From 3476731b83a418fa31153866e64245a6ecb16554 Mon Sep 17 00:00:00 2001
From: guange <8863824@gmail.com>
Date: Wed, 9 Dec 2015 09:59:13 +0800
Subject: [PATCH 001/120] =?UTF-8?q?=E5=B0=86at=20js=20data=E6=95=B4?=
=?UTF-8?q?=E5=90=88=E5=88=B0=E6=96=87=E4=BB=B6=E4=B8=AD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/at_controller.rb | 25 +++++++++++++++++++++++
app/controllers/issues_controller.rb | 29 ++++++++++-----------------
app/helpers/application_helper.rb | 10 +--------
app/views/at/show.js.erb | 8 ++++++++
app/views/issues/show.html.erb | 2 +-
config/routes.rb | 3 ++-
public/assets/kindeditor/at/config.js | 5 ++---
7 files changed, 50 insertions(+), 32 deletions(-)
create mode 100644 app/controllers/at_controller.rb
create mode 100644 app/views/at/show.js.erb
diff --git a/app/controllers/at_controller.rb b/app/controllers/at_controller.rb
new file mode 100644
index 000000000..92506d4e8
--- /dev/null
+++ b/app/controllers/at_controller.rb
@@ -0,0 +1,25 @@
+#coding=utf-8
+
+class AtController < ApplicationController
+ respond_to :js
+
+ def show
+ type = params[:type]
+ case type
+ when "Issue"
+ @users = find_issue(params)
+ else
+ end
+ end
+
+ private
+ def find_issue(params)
+ #1. issues list persons
+ #2. project persons
+ issue = Issue.find(params[:id])
+ journals = issue.journals
+ at_persons = journals.map(&:user) + issue.project.users
+ at_persons.uniq{|u| u.id}.delete_if{|u| u.id == User.current.id}
+ end
+
+end
\ No newline at end of file
diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb
index 7cdc838e2..6f441c29a 100644
--- a/app/controllers/issues_controller.rb
+++ b/app/controllers/issues_controller.rb
@@ -142,24 +142,17 @@ class IssuesController < ApplicationController
@project_base_tag = (params[:project_id] || @issue.project) ? 'base_projects':'base'#by young
@available_watchers = (@issue.project.users.sort + @issue.watcher_users).uniq
- #id name email
- #1. issues list persons
- #2. project persons
- @at_persons = @journals.map(&:user) + @issue.project.users
- @at_persons = @at_persons.uniq{|u| u.id}.delete_if{|u| u.id == User.current.id}
- @at_persons = nil
-
- respond_to do |format|``
- format.html {
- retrieve_previous_and_next_issue_ids
- render :template => 'issues/show', :layout => @project_base_tag#by young
- }
- format.api
- format.atom { render :template => 'journals/index', :layout => false, :content_type => 'application/atom+xml' }
- format.pdf {
- pdf = issue_to_pdf(@issue, :journals => @journals)
- send_data(pdf, :type => 'application/pdf', :filename => filename_for_content_disposition("#{@project.identifier}-#{@issue.id}.pdf") )
- }
+ respond_to do |format|
+ format.html {
+ retrieve_previous_and_next_issue_ids
+ render :template => 'issues/show', :layout => @project_base_tag#by young
+ }
+ format.api
+ format.atom { render :template => 'journals/index', :layout => false, :content_type => 'application/atom+xml' }
+ format.pdf {
+ pdf = issue_to_pdf(@issue, :journals => @journals)
+ send_data(pdf, :type => 'application/pdf', :filename => filename_for_content_disposition("#{@project.identifier}-#{@issue.id}.pdf") )
+ }
end
end
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index ba8fe4f53..227de930f 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -2624,15 +2624,7 @@ int main(int argc, char** argv){
opt = {enable_at: true, prettify: false, init_activity: false}.merge default_opt
ss = ''
if opt[:enable_at]
- ss = '"
+ ss += %Q||
end
ss += javascript_include_tag("/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg')
diff --git a/app/views/at/show.js.erb b/app/views/at/show.js.erb
new file mode 100644
index 000000000..df253f237
--- /dev/null
+++ b/app/views/at/show.js.erb
@@ -0,0 +1,8 @@
+(function(){
+ window.atPersonLists = [];
+ <% @users && @users.each_with_index do |person,index| %>
+ var o = {id: <%=index%>, name: '<%=person.show_name%>', login: '<%=person.login%>', searchKey: '<%=person.get_at_show_name%>'};
+ atPersonLists.push(o);
+ <% end %>
+
+})();
diff --git a/app/views/issues/show.html.erb b/app/views/issues/show.html.erb
index 80d3aaac1..67d1186c4 100644
--- a/app/views/issues/show.html.erb
+++ b/app/views/issues/show.html.erb
@@ -1,5 +1,5 @@
<%= content_for(:header_tags) do %>
-<%= import_ke(enable_at: true) %>
+<%= import_ke(enable_at: {id: @issue.id, type: 'Issue'}) %>
<% end %>
diff --git a/config/routes.rb b/config/routes.rb
index 59eb29d70..656f55720 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1035,13 +1035,14 @@ RedmineApp::Application.routes.draw do
match 'system_log/clear'
##ended by lizanle
-
resources :git_callback do
collection do
post 'post_update'
end
end
+ resources :at
+
Dir.glob File.expand_path("plugins/*", Rails.root) do |plugin_dir|
file = File.join(plugin_dir, "config/routes.rb")
if File.exists?(file)
diff --git a/public/assets/kindeditor/at/config.js b/public/assets/kindeditor/at/config.js
index b9769c42e..0a1bbf11a 100644
--- a/public/assets/kindeditor/at/config.js
+++ b/public/assets/kindeditor/at/config.js
@@ -1,4 +1,4 @@
-function enableAt(_editor) {
+var enableAt = function(_editor) {
var editor = _editor;
if(editor.edit == undefined || editor.edit.iframe == undefined){
return;
@@ -11,7 +11,7 @@ function enableAt(_editor) {
console.log("enable at");
$.fn.atwho.debug = true;
- if(!atPersonLists){
+ if("undefined" === (typeof atPersonLists) || !atPersonLists){
return;
}
var names = atPersonLists;
@@ -32,7 +32,6 @@ function enableAt(_editor) {
}
$inputor = $(ifrBody).atwho(at_config);
- window.aaa= $inputor;
$inputor.caret('pos', 47);
$inputor.focus().atwho('run');
};
From 91b245ad2cb694726996c31811276b5129a0be7e Mon Sep 17 00:00:00 2001
From: guange <8863824@gmail.com>
Date: Sat, 12 Dec 2015 18:06:59 +0800
Subject: [PATCH 002/120] =?UTF-8?q?lastname=E4=B8=BA=E7=A9=BA=E6=97=B6?=
=?UTF-8?q?=E4=B9=9F=E5=8F=AF=E4=BB=A5=E5=8A=A0,=E5=8F=AF=E4=BB=A5?=
=?UTF-8?q?=E7=9C=81=E6=8E=89=E6=9F=A5=E8=AF=A2extensions=E7=9A=84?=
=?UTF-8?q?=E8=AF=AD=E5=8F=A5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/models/user.rb | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/app/models/user.rb b/app/models/user.rb
index 65c0bf858..0d3d465e2 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -399,16 +399,7 @@ class User < Principal
end
def show_name
- name = ""
- unless self.user_extensions.nil?
- if self.user_extensions.identity == 2
- name = firstname
- else
- name = lastname+firstname
- end
- else
- name = lastname+firstname
- end
+ name = lastname + firstname
name.empty? || name.nil? ? login : name
end
## end
From 9b86ec30445a0ad2682ee91361ecbbf2a0019543 Mon Sep 17 00:00:00 2001
From: lizanle <491823689@qq.com>
Date: Mon, 14 Dec 2015 10:07:55 +0800
Subject: [PATCH 003/120] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=97=B6=E9=97=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/welcome/_search_all_results.html.erb | 4 ++--
app/views/welcome/_search_memo_results.html.erb | 2 +-
app/views/welcome/_search_project_results.html.erb | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/app/views/welcome/_search_all_results.html.erb b/app/views/welcome/_search_all_results.html.erb
index 34ef9a8eb..7256534e5 100644
--- a/app/views/welcome/_search_all_results.html.erb
+++ b/app/views/welcome/_search_all_results.html.erb
@@ -67,7 +67,7 @@
<%= item.try(:highlight).try(:description) ? item.highlight.description[0].html_safe : item.description%>
-
管理人员:<%= item.user_id ? User.find(item.user_id).login : '无' %> 创建时间:<%= date_format_local( Project.find(item.id).created_on) %>
+
管理人员:<%= item.user_id ? User.find(item.user_id).login : '无' %> 更新时间:<%= date_format_local( Project.find(item.id).updated_on) %>
@@ -83,7 +83,7 @@
<%= item.try(:highlight).try(:content) ? item.highlight.content[0].html_safe : item.content.html_safe%>
-
发帖人:<%= item.author_id ? User.find(item.author_id).login : '无' %> 创建时间:<%= format_date( item.created_at) %>
+
发帖人:<%= item.author_id ? User.find(item.author_id).login : '无' %> 更新时间:<%= format_date( item.updated_at) %>
diff --git a/app/views/welcome/_search_memo_results.html.erb b/app/views/welcome/_search_memo_results.html.erb
index c5fe9cc72..98f9ae7f0 100644
--- a/app/views/welcome/_search_memo_results.html.erb
+++ b/app/views/welcome/_search_memo_results.html.erb
@@ -12,7 +12,7 @@
<%= memo.try(:highlight).try(:content) ? memo.highlight.content[0].html_safe : memo.content.html_safe%>
-
发帖人:<%= memo.author_id ? User.find(memo.author_id).login : '无' %> 创建时间:<%= format_date( memo.created_at) %>
+
发帖人:<%= memo.author_id ? User.find(memo.author_id).login : '无' %> 更新时间:<%= format_date( memo.updated_at) %>
diff --git a/app/views/welcome/_search_project_results.html.erb b/app/views/welcome/_search_project_results.html.erb
index b3ed44654..5775a939d 100644
--- a/app/views/welcome/_search_project_results.html.erb
+++ b/app/views/welcome/_search_project_results.html.erb
@@ -12,7 +12,7 @@
<%= project.try(:highlight).try(:description) ? project.highlight.description[0].html_safe : project.description%>
-
管理人员:<%= project.user_id ? User.find(project.user_id).login : '无' %> 创建时间:<%= date_format_local( Project.find(project.id).created_on) %>
+
管理人员:<%= project.user_id ? User.find(project.user_id).login : '无' %> 更新时间:<%= date_format_local( Project.find(project.id).updated_on) %>
From 0602a03e12000d2b4081b33215c0e7d97969f6e1 Mon Sep 17 00:00:00 2001
From: ouyangxuhua
Date: Mon, 14 Dec 2015 10:26:34 +0800
Subject: [PATCH 004/120] =?UTF-8?q?=E7=BB=84=E7=BB=87=E8=B5=84=E6=BA=90?=
=?UTF-8?q?=E7=B1=BB=E5=9E=8B=E7=9A=84=E6=A0=8F=E7=9B=AE=EF=BC=8C=E5=A2=9E?=
=?UTF-8?q?=E5=8A=A0=E6=90=9C=E7=B4=A2=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/files_controller.rb | 93 +++++++++++++++++++
app/helpers/files_helper.rb | 6 ++
app/views/files/_subfield_files.html.erb | 2 +-
.../files/search_files_in_subfield.js.erb | 2 +
.../_org_left_subfield_list.html.erb | 4 +-
config/routes.rb | 2 +-
db/schema.rb | 4 +
7 files changed, 109 insertions(+), 4 deletions(-)
create mode 100644 app/views/files/search_files_in_subfield.js.erb
diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb
index 328446fbb..6ed42bd6e 100644
--- a/app/controllers/files_controller.rb
+++ b/app/controllers/files_controller.rb
@@ -131,6 +131,45 @@ class FilesController < ApplicationController
end
end
+ def search_files_in_subfield
+ sort = ""
+ @sort = ""
+ @order = ""
+ @is_remote = true
+ @q = params[:name].strip
+ if params[:sort]
+ order_by = params[:sort].split(":")
+ @sort = order_by[0]
+ if order_by.count > 1
+ @order = order_by[1]
+ end
+ sort = "#{@sort} #{@order}"
+ end
+ # show_attachments [@course]
+ begin
+ q = "%#{params[:name].strip}%"
+ #(redirect_to stores_url, :notice => l(:label_sumbit_empty);return) if params[:name].blank?
+ if params[:insite]
+ if q == "%%"
+ @result = []
+ @searched_attach = paginateHelper @result,10
+ else
+ @result = find_public_attache q,sort
+ @result = visable_attachemnts_insite @result,@org_subfield
+ @searched_attach = paginateHelper @result,10
+ end
+ else
+ @result = find_org_subfield_attache q,@org_subfield,sort
+ @result = visable_attachemnts @result
+ @searched_attach = paginateHelper @result,10
+ #@tag_list = get_course_tag_list @course
+ end
+ #rescue Exception => e
+ # #render 'stores'
+ # redirect_to search_course_files_url
+ end
+ end
+
def find_course_attache keywords,course,sort = ""
if sort == ""
sort = "created_on DESC"
@@ -144,6 +183,19 @@ class FilesController < ApplicationController
#resultSet = Attachment.find_by_sql("SELECT `attachments`.* FROM `attachments` LEFT OUTER JOIN `homework_attaches` ON `attachments`.container_type = 'HomeworkAttach' AND `attachments`.container_id = `homework_attaches`.id LEFT OUTER JOIN `homework_for_courses` ON `homework_attaches`.bid_id = `homework_for_courses`.bid_id LEFT OUTER JOIN `homework_for_courses` AS H_C ON `attachments`.container_type = 'Bid' AND `attachments`.container_id = H_C.bid_id WHERE (`homework_for_courses`.course_id = 117 OR H_C.course_id = 117 OR (`attachments`.container_type = 'Course' AND `attachments`.container_id = 117)) AND `attachments`.filename LIKE '%#{keywords}%'").reorder("created_on DESC")
end
+ def find_org_subfield_attache keywords,org_subfield,sort = ""
+ if sort == ""
+ sort = "created_on DESC"
+ end
+ if keywords != "%%"
+ resultSet = Attachment.where("attachments.container_type = 'OrgSubfield' And attachments.container_id = '#{org_subfield.id}' AND filename LIKE :like ", like: "%#{keywords}%").
+ reorder(sort)
+ else
+ resultSet = Attachment.where("attachments.container_type = 'OrgSubfield' And attachments.container_id = '#{org_subfield.id}' "). reorder(sort)
+ end
+ #resultSet = Attachment.find_by_sql("SELECT `attachments`.* FROM `attachments` LEFT OUTER JOIN `homework_attaches` ON `attachments`.container_type = 'HomeworkAttach' AND `attachments`.container_id = `homework_attaches`.id LEFT OUTER JOIN `homework_for_courses` ON `homework_attaches`.bid_id = `homework_for_courses`.bid_id LEFT OUTER JOIN `homework_for_courses` AS H_C ON `attachments`.container_type = 'Bid' AND `attachments`.container_id = H_C.bid_id WHERE (`homework_for_courses`.course_id = 117 OR H_C.course_id = 117 OR (`attachments`.container_type = 'Course' AND `attachments`.container_id = 117)) AND `attachments`.filename LIKE '%#{keywords}%'").reorder("created_on DESC")
+ end
+
def find_project_attache keywords,project,sort = ""
if sort == ""
sort = "created_on DESC"
@@ -298,6 +350,47 @@ class FilesController < ApplicationController
render :layout => 'base_courses'
elsif params[:org_subfield_id]
+ if params[:sort]
+ params[:sort].split(",").each do |sort_type|
+ order_by = sort_type.split(":")
+
+ case order_by[0]
+ when "filename"
+ attribute = "filename"
+ when "size"
+ attribute = "filesize"
+ when "attach_type"
+ attribute = "attachtype"
+ when "content_type"
+ attribute = "created_on"
+ when "field_file_dense"
+ attribute = "is_public"
+ when "downloads"
+ attribute = "downloads"
+ when "created_on"
+ attribute = "created_on"
+ when "quotes"
+ attribute = "quotes"
+ else
+ attribute = "created_on"
+ end
+ @sort = order_by[0]
+ @order = order_by[1]
+ if order_by.count == 1 && attribute
+ sort += "#{Attachment.table_name}.#{attribute} asc "
+ if sort_type != params[:sort].split(",").last
+ sort += ","
+ end
+ elsif order_by.count == 2 && order_by[1]
+ sort += "#{Attachment.table_name}.#{attribute} #{order_by[1]} "
+ if sort_type != params[:sort].split(",").last
+ sort += ","
+ end
+ end
+ end
+ else
+ sort = "#{Attachment.table_name}.created_on desc"
+ end
@container_type = 2
@organization = Organization.find(params[:organization_id])
@containers = [ OrgSubfield.includes(:attachments).reorder(sort).find(@org_subfield.id)]
diff --git a/app/helpers/files_helper.rb b/app/helpers/files_helper.rb
index cf9cbcc32..276786fb7 100644
--- a/app/helpers/files_helper.rb
+++ b/app/helpers/files_helper.rb
@@ -141,6 +141,12 @@ module FilesHelper
result << attachment
end
end
+ elsif obj.is_a?(OrgSubfield)
+ attachments.each do |attachment|
+ if attachment.is_public? || (attachment.container_type == "OrgSubfield" && attachment.container_id == obj.id )|| attachment.author_id == User.current.id
+ result << attachment
+ end
+ end
end
end
result
diff --git a/app/views/files/_subfield_files.html.erb b/app/views/files/_subfield_files.html.erb
index ea408c7a6..b0bc9ea09 100644
--- a/app/views/files/_subfield_files.html.erb
+++ b/app/views/files/_subfield_files.html.erb
@@ -68,7 +68,7 @@
- <%= form_tag( search_org_subfield_files_path(@org_subfield), method: 'get',:class => "re_search f_l",:remote=>true) do %>
+ <%= form_tag( search_files_in_subfield_org_subfield_files_path(@org_subfield), method: 'get',:class => "re_search f_l",:remote=>true) do %>
<%= text_field_tag 'name', params[:name], name: "name", :class => 're_schbox',:style=>"padding: 0px"%>
<%= submit_tag "栏目内搜索", :class => "re_schbtn b_lblue",:name => "inorg_subfield",:id => "inorg_subfield", :onmouseover => "presscss('inorg_subfield')",:onmouseout =>"buttoncss()" %>
<%= submit_tag "全站搜索", :class => "re_schbtn b_lblue",:name => "insite",:id => "insite",:onmouseover => "presscss('insite')",:onmouseout =>"buttoncss()" %>
diff --git a/app/views/files/search_files_in_subfield.js.erb b/app/views/files/search_files_in_subfield.js.erb
new file mode 100644
index 000000000..deed2d5d3
--- /dev/null
+++ b/app/views/files/search_files_in_subfield.js.erb
@@ -0,0 +1,2 @@
+$("#org_subfield_list").html("<%= escape_javascript(render :partial => 'org_subfield_list',
+ :locals => {org_subfield: @org_subfield,all_attachments: @result,sort:@sort,order:@order,org_subfield_attachments:@searched_attach})%>");
\ No newline at end of file
diff --git a/app/views/organizations/_org_left_subfield_list.html.erb b/app/views/organizations/_org_left_subfield_list.html.erb
index 367c23843..152310bba 100644
--- a/app/views/organizations/_org_left_subfield_list.html.erb
+++ b/app/views/organizations/_org_left_subfield_list.html.erb
@@ -29,8 +29,8 @@
<%= link_to "#{field.name}", organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText" %>
<%=link_to "", new_organization_org_document_comment_path(organization, :field_id => field.id), :method => "get", :class => "homepageMenuSetting fr", :title => "发布帖子"%>
<% else %>
- <%#= link_to "#{field.name}", org_subfield_files_path(field, :organization_id => organization.id), :class => "homepageMenuText" %>
-
+ <%= link_to "#{field.name}", org_subfield_files_path(field, :organization_id => organization.id), :class => "homepageMenuText" %>
+
<% end %>
-
@@ -40,11 +39,10 @@
<%= time_tag(file.created_on).html_safe %><%= l(:label_bids_published_ago) %> | 下载<%= file.downloads %> | 引用<%= file.quotes.nil? ? 0:file.quotes %>
-
-
-
-
-
+
+ <%= render :partial => 'tags/tag_new', :locals => {:obj => file, :object_flag => "6"} %>
+ <%= render :partial => 'tags/tag_add', :locals => {:obj => file, :object_flag => "6"} %>
+
<% end %>
diff --git a/app/views/files/_subfield_files.html.erb b/app/views/files/_subfield_files.html.erb
index b0bc9ea09..2a552dc43 100644
--- a/app/views/files/_subfield_files.html.erb
+++ b/app/views/files/_subfield_files.html.erb
@@ -70,7 +70,7 @@
<%= form_tag( search_files_in_subfield_org_subfield_files_path(@org_subfield), method: 'get',:class => "re_search f_l",:remote=>true) do %>
<%= text_field_tag 'name', params[:name], name: "name", :class => 're_schbox',:style=>"padding: 0px"%>
- <%= submit_tag "栏目内搜索", :class => "re_schbtn b_lblue",:name => "inorg_subfield",:id => "inorg_subfield", :onmouseover => "presscss('inorg_subfield')",:onmouseout =>"buttoncss()" %>
+ <%= submit_tag "栏目内搜索", :class => "re_schbtn b_lblue",:style => 'width:72px;',:name => "inorg_subfield",:id => "inorg_subfield", :onmouseover => "presscss('inorg_subfield')",:onmouseout =>"buttoncss()" %>
<%= submit_tag "全站搜索", :class => "re_schbtn b_lblue",:name => "insite",:id => "insite",:onmouseover => "presscss('insite')",:onmouseout =>"buttoncss()" %>
<% end %>
<%# if is_org_subfield_teacher(User.current,@org_subfield) || (@org_subfield.publish_resource==1 && User.current.member_of_org_subfield?(@org_subfield) ) %>
@@ -88,7 +88,7 @@
-
+
<%= render :partial => 'org_subfield_list',:locals => {org_subfield: @org_subfield,all_attachments: @all_attachments,sort:@sort,order:@order,org_subfield_attachments:@obj_attachments} %>
From 14912078ee3067a922e7a61886f763a3ed14c195 Mon Sep 17 00:00:00 2001
From: lizanle <491823689@qq.com>
Date: Mon, 14 Dec 2015 11:03:04 +0800
Subject: [PATCH 009/120] =?UTF-8?q?=E5=8D=9A=E5=AE=A2=E8=B5=84=E6=BA=90?=
=?UTF-8?q?=E5=85=81=E8=AE=B8=E4=B8=8B=E8=BD=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/helpers/application_helper.rb | 2 ++
1 file changed, 2 insertions(+)
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index cbc646eac..ad4da60a7 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -1934,6 +1934,8 @@ module ApplicationHelper
candown = true
elsif attachment.container.class.to_s=="StudentWork"
candown = true
+ elsif attachment.container.class.to_s=="BlogComment" #博客资源允许下载
+ candown = true
elsif attachment.container.class.to_s == "User"
candown = (attachment.is_public == 1 || attachment.is_public == true || attachment.author_id == User.current.id)
elsif attachment.container_type == "Bid" && attachment.container && attachment.container.courses
From 9aebafee09990cdd25fb4bafa0d9977e3b6c381b Mon Sep 17 00:00:00 2001
From: lizanle <491823689@qq.com>
Date: Mon, 14 Dec 2015 11:11:09 +0800
Subject: [PATCH 010/120] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E6=B7=BB=E5=8A=A0?=
=?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=97=B6=E9=97=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/welcome/_search_all_results.html.erb | 6 +++++-
app/views/welcome/_search_course_results.html.erb | 6 +++++-
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/app/views/welcome/_search_all_results.html.erb b/app/views/welcome/_search_all_results.html.erb
index 537da336a..4ed9fba33 100644
--- a/app/views/welcome/_search_all_results.html.erb
+++ b/app/views/welcome/_search_all_results.html.erb
@@ -37,7 +37,11 @@
<%= item.try(:highlight).try(:description) ? item.highlight.description[0].html_safe : item.description %>
-
教师:<%= User.find(item.tea_id).realname %> 授课时间:<%= item.time.to_s + item.term%> <%= User.find(item.tea_id).user_extensions.occupation.present? ? '单位:'+User.find(item.tea_id).user_extensions.occupation : ''%>
+
+ 教师:<%= User.find(item.tea_id).realname %>
+ 授课时间:<%= item.time.to_s + item.term%>
+ 更新时间:<%= format_date(item.updated_at)%>
+ <%= User.find(item.tea_id).user_extensions.occupation.present? ? '单位:'+User.find(item.tea_id).user_extensions.occupation : ''%>
diff --git a/app/views/welcome/_search_course_results.html.erb b/app/views/welcome/_search_course_results.html.erb
index 89567063d..e51452ada 100644
--- a/app/views/welcome/_search_course_results.html.erb
+++ b/app/views/welcome/_search_course_results.html.erb
@@ -12,7 +12,11 @@
<%= course.try(:highlight).try(:description) ? course.highlight.description[0].html_safe : (course.description.present? ? course.description : '暂时没有该课程描述') %>
-
教师:<%= User.find(course.tea_id).realname %> 授课时间:<%= course.time.to_s + course.term%> <%= User.find(course.tea_id).user_extensions.occupation.present? ? '单位:'+User.find(course.tea_id).user_extensions.occupation : ''%>
+
+ 教师:<%= User.find(course.tea_id).realname %>
+ 授课时间:<%= course.time.to_s + course.term%>
+ 更新时间:<%= format_date(course.updated_at)%>
+ <%= User.find(course.tea_id).user_extensions.occupation.present? ? '单位:'+User.find(course.tea_id).user_extensions.occupation : ''%>
From f3013ca3e71dc61effbedb4a733ad41c2fbe7919 Mon Sep 17 00:00:00 2001
From: lizanle <491823689@qq.com>
Date: Mon, 14 Dec 2015 11:22:36 +0800
Subject: [PATCH 011/120] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E6=90=9C?=
=?UTF-8?q?=E7=B4=A2=E7=9A=84=E6=8F=90=E7=A4=BA=E6=8F=8F=E8=BF=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/layouts/_logined_header.html.erb | 2 +-
app/views/layouts/_unlogin_header.html.erb | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/views/layouts/_logined_header.html.erb b/app/views/layouts/_logined_header.html.erb
index d100e79a5..a0cbe4eed 100644
--- a/app/views/layouts/_logined_header.html.erb
+++ b/app/views/layouts/_logined_header.html.erb
@@ -54,7 +54,7 @@
<% name = name%>
<%= form_tag({controller: :welcome, action: :search },:class=>'navHomepageSearchBox', method: :get) do %>
-
" id="navHomepageSearchInput" class="navHomepageSearchInput" placeholder="请输入关键词搜索公开的课程、项目、用户以及资源"/>
+
" id="navHomepageSearchInput" class="navHomepageSearchInput" placeholder="请输入关键词搜索公开的课程、项目、用户、资源以及帖子"/>
diff --git a/app/views/layouts/_unlogin_header.html.erb b/app/views/layouts/_unlogin_header.html.erb
index 162f59ed4..7a2196d01 100644
--- a/app/views/layouts/_unlogin_header.html.erb
+++ b/app/views/layouts/_unlogin_header.html.erb
@@ -52,7 +52,7 @@
<% name = name%>
<%= form_tag({controller: :welcome, action: :search },:class=>'navHomepageSearchBox', method: :get) do %>
-
" id="navHomepageSearchInput" class="navHomepageSearchInput" placeholder="请输入关键词搜索公开的课程、项目、用户以及资源" onkeypress="search_in_header_I(event,$(this));"/>
+
" id="navHomepageSearchInput" class="navHomepageSearchInput" placeholder="请输入关键词搜索公开的课程、项目、用户、资源以及帖子" onkeypress="search_in_header_I(event,$(this));"/>
From a5fa68c9289c7220a25e7901accc11e029999052 Mon Sep 17 00:00:00 2001
From: ouyangxuhua
Date: Mon, 14 Dec 2015 16:41:18 +0800
Subject: [PATCH 012/120] =?UTF-8?q?=E8=B5=84=E6=BA=90=E6=A0=8F=E7=9B=AE?=
=?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=B5=84=E6=BA=90?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/files_controller.rb | 6 +++++-
app/views/files/_upload_subfield_file.html.erb | 6 ++----
app/views/files/subfield_upload_file.js.erb | 6 ++++++
app/views/layouts/base_org.html.erb | 4 ++--
app/views/organizations/_org_left_subfield_list.html.erb | 6 +++++-
config/routes.rb | 1 +
public/stylesheets/org.css | 4 +++-
7 files changed, 24 insertions(+), 9 deletions(-)
create mode 100644 app/views/files/subfield_upload_file.js.erb
diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb
index 6ed42bd6e..7b375377c 100644
--- a/app/controllers/files_controller.rb
+++ b/app/controllers/files_controller.rb
@@ -392,8 +392,8 @@ class FilesController < ApplicationController
sort = "#{Attachment.table_name}.created_on desc"
end
@container_type = 2
- @organization = Organization.find(params[:organization_id])
@containers = [ OrgSubfield.includes(:attachments).reorder(sort).find(@org_subfield.id)]
+ @organization = Organization.find(@containers.first.organization_id)
show_attachments @containers
render :layout => 'base_org'
# @subfield = params[:org_subfield_id]
@@ -733,4 +733,8 @@ class FilesController < ApplicationController
# format.html
end
end
+
+ def subfield_upload_file
+ @org_subfield = OrgSubfield.find(params[:org_subfield_id])
+ end
end
diff --git a/app/views/files/_upload_subfield_file.html.erb b/app/views/files/_upload_subfield_file.html.erb
index c3ca72ecd..5d8723d03 100644
--- a/app/views/files/_upload_subfield_file.html.erb
+++ b/app/views/files/_upload_subfield_file.html.erb
@@ -10,7 +10,7 @@
- <%= render :partial => 'files/attachement_list',:locals => {:org_subfield => org_subfield} %>
+ <%= render :partial => 'files/attachement_list'%>
<%= l(:button_cancel)%>
<%= l(:button_confirm)%>
@@ -18,9 +18,7 @@
- <% content_for :header_tags do %>
- <%= javascript_include_tag 'attachments' %>
- <% end %>
+
|
- end
ss += javascript_include_tag("/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg')
if opt[:enable_at]
diff --git a/app/views/at/show.js.erb b/app/views/at/show.js.erb
deleted file mode 100644
index df253f237..000000000
--- a/app/views/at/show.js.erb
+++ /dev/null
@@ -1,8 +0,0 @@
-(function(){
- window.atPersonLists = [];
- <% @users && @users.each_with_index do |person,index| %>
- var o = {id: <%=index%>, name: '<%=person.show_name%>', login: '<%=person.login%>', searchKey: '<%=person.get_at_show_name%>'};
- atPersonLists.push(o);
- <% end %>
-
-})();
diff --git a/app/views/at/show.json.erb b/app/views/at/show.json.erb
new file mode 100644
index 000000000..7af729ff7
--- /dev/null
+++ b/app/views/at/show.json.erb
@@ -0,0 +1,6 @@
+[
+ <% @users && @users.each_with_index do |person,index| %>
+ {"id": <%=index%>, "name": "<%=person.show_name%>", "login": "<%=person.login%>", "searchKey": "<%=person.get_at_show_name%>"}
+ <%= index != @users.size-1 ? ',' : '' %>
+ <% end %>
+]
diff --git a/app/views/bids/_new_homework_form.html.erb b/app/views/bids/_new_homework_form.html.erb
index 5958fccff..815ff27e4 100644
--- a/app/views/bids/_new_homework_form.html.erb
+++ b/app/views/bids/_new_homework_form.html.erb
@@ -15,10 +15,10 @@
diff --git a/app/views/memos/show.html.erb b/app/views/memos/show.html.erb
index 44f3e5a64..b7cc1a0c2 100644
--- a/app/views/memos/show.html.erb
+++ b/app/views/memos/show.html.erb
@@ -34,7 +34,7 @@
}
}
$(function() {
- init_activity_KindEditor_data(<%= @memo.id%>,null,"87%");
+ init_activity_KindEditor_data(<%= @memo.id%>,null,"87%", "<%=@memo.class.to_s%>");
});
function del_confirm(){
diff --git a/app/views/messages/_course_show.html.erb b/app/views/messages/_course_show.html.erb
index 0f39b73d2..e06c04775 100644
--- a/app/views/messages/_course_show.html.erb
+++ b/app/views/messages/_course_show.html.erb
@@ -27,7 +27,7 @@
}
}
$(function() {
- init_activity_KindEditor_data(<%= @topic.id%>,null,"85%");
+ init_activity_KindEditor_data(<%= @topic.id%>,null,"85%", "<%=@topic.class.to_s%>");
showNormalImage('message_description_<%= @topic.id %>');
});
diff --git a/app/views/messages/quote.js.erb b/app/views/messages/quote.js.erb
index eee820c61..b0e8ecb85 100644
--- a/app/views/messages/quote.js.erb
+++ b/app/views/messages/quote.js.erb
@@ -11,7 +11,7 @@ if($("#reply_message_<%= @message.id%>").length > 0) {
$(function(){
$('#reply_subject').val("<%= raw escape_javascript(@subject) %>");
$('#quote_quote').val("<%= raw escape_javascript(@temp.content.html_safe) %>");
- init_activity_KindEditor_data(<%= @message.id%>,null,"85%");
+ init_activity_KindEditor_data(<%= @message.id%>,null,"85%", "<%=@message.class.to_s%>");
});
}else if($("#reply_to_message_<%= @message.id%>").length >0) {
$("#reply_to_message_<%= @message.id%>").replaceWith("
");
diff --git a/app/views/messages/reply.js.erb b/app/views/messages/reply.js.erb
index ac80de3b4..518479344 100644
--- a/app/views/messages/reply.js.erb
+++ b/app/views/messages/reply.js.erb
@@ -3,4 +3,4 @@
<%elsif @course%>
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_message', :locals => {:activity => @topic,:user_activity_id =>@user_activity_id}) %>");
<%end%>
-init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%");
\ No newline at end of file
+init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", "UserActivity");
\ No newline at end of file
diff --git a/app/views/org_document_comments/_reply_form.html.erb b/app/views/org_document_comments/_reply_form.html.erb
index 7871b910d..8808ff8b7 100644
--- a/app/views/org_document_comments/_reply_form.html.erb
+++ b/app/views/org_document_comments/_reply_form.html.erb
@@ -1,2 +1,2 @@
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/user_blog', :locals => {:activity => @article,:user_activity_id =>@user_activity_id}) %>");
-init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%");
+init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", "UserActivity");
diff --git a/app/views/org_document_comments/add_reply.js.erb b/app/views/org_document_comments/add_reply.js.erb
index 40ed2eeb2..84f8c1f83 100644
--- a/app/views/org_document_comments/add_reply.js.erb
+++ b/app/views/org_document_comments/add_reply.js.erb
@@ -1,3 +1,3 @@
$("#organization_document_<%= @act.id %>").replaceWith("<%= escape_javascript(render :partial => 'organizations/show_org_document', :locals => {:document => @document, :act => @act}) %>");
-init_activity_KindEditor_data(<%= @act.id %>,"","87%");
\ No newline at end of file
+init_activity_KindEditor_data(<%= @act.id %>,"","87%", "<%=@act.class.to_s%>");
\ No newline at end of file
diff --git a/app/views/org_document_comments/index.html.erb b/app/views/org_document_comments/index.html.erb
index 331e61bfd..ddbb6bf9c 100644
--- a/app/views/org_document_comments/index.html.erb
+++ b/app/views/org_document_comments/index.html.erb
@@ -19,7 +19,7 @@
<% @documents.each do |document| %>
<%= render :partial => 'organizations/show_org_document', :locals => {:document => document, :act => OrgActivity.where("org_act_type='OrgDocumentComment'and org_act_id=?", document.id).first} %>
diff --git a/app/views/org_document_comments/quote.js.erb b/app/views/org_document_comments/quote.js.erb
index a71b23f0e..7ea5daf7b 100644
--- a/app/views/org_document_comments/quote.js.erb
+++ b/app/views/org_document_comments/quote.js.erb
@@ -3,7 +3,7 @@ if($("#reply_message_<%= @org_comment.id%>").length > 0) {
$(function(){
$('#reply_subject').val("<%= raw escape_javascript(@subject) %>");
$('#quote_quote').val("<%= raw escape_javascript(@temp.content.html_safe) %>");
- init_activity_KindEditor_data(<%= @org_comment.id%>,null,"85%");
+ init_activity_KindEditor_data(<%= @org_comment.id%>,null,"85%", "<%=@org_comment.class.to_s%>");
});
}else if($("#reply_to_message_<%= @org_comment.id %>").length >0) {
$("#reply_to_message_<%= @org_comment.id%>").replaceWith("");
diff --git a/app/views/org_document_comments/show.html.erb b/app/views/org_document_comments/show.html.erb
index 1b1eca418..3a50e5faa 100644
--- a/app/views/org_document_comments/show.html.erb
+++ b/app/views/org_document_comments/show.html.erb
@@ -5,7 +5,7 @@
diff --git a/app/views/organizations/_org_activities.html.erb b/app/views/organizations/_org_activities.html.erb
index 33ac13e76..8f9acbc7b 100644
--- a/app/views/organizations/_org_activities.html.erb
+++ b/app/views/organizations/_org_activities.html.erb
@@ -2,7 +2,7 @@
<% org_activities.each do |act| %>
<% if act.container_type == 'Organization' %>
diff --git a/app/views/organizations/show.html.erb b/app/views/organizations/show.html.erb
index 7200761a3..9d62dd1f9 100644
--- a/app/views/organizations/show.html.erb
+++ b/app/views/organizations/show.html.erb
@@ -59,7 +59,7 @@
<% if !@organization.home_id.nil? and OrgDocumentComment.where("id = ?", @organization.home_id).count > 0 %>
<% act = OrgActivity.where("org_act_type = 'OrgDocumentComment' and org_act_id =?", @organization.home_id).first %>
diff --git a/app/views/student_work/forbidden_anonymous_comment.js.erb b/app/views/student_work/forbidden_anonymous_comment.js.erb
index a72c29509..47dfb4b51 100644
--- a/app/views/student_work/forbidden_anonymous_comment.js.erb
+++ b/app/views/student_work/forbidden_anonymous_comment.js.erb
@@ -1,7 +1,7 @@
<% if @user_activity_id == -1 %>
$("#homework_common_<%= @homework.id %>").replaceWith("<%= escape_javascript(render :partial => "users/user_homework_detail",:locals => {:homework_common => @homework, :is_in_course => @is_in_course})%>");
-init_activity_KindEditor_data(<%= @homework.id%>,"","87%");
+init_activity_KindEditor_data(<%= @homework.id%>,"","87%", "<%=@homework.class.to_s%>");
<% else %>
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework,:user_activity_id =>@user_activity_id,:course_activity=>@course_activity}) %>");
-init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%");
+init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", "UserActivity");
<% end %>
\ No newline at end of file
diff --git a/app/views/student_work/set_score_rule.js.erb b/app/views/student_work/set_score_rule.js.erb
index ff3a0e7ed..180f04faa 100644
--- a/app/views/student_work/set_score_rule.js.erb
+++ b/app/views/student_work/set_score_rule.js.erb
@@ -1,8 +1,8 @@
clickCanel();
<% if @user_activity_id %>
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework,:user_activity_id =>@user_activity_id}) %>");
- init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%");
+ init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", "UserActivity");
<% else %>
$("#homework_common_<%= @homework.id %>").replaceWith("<%= escape_javascript(render :partial => 'users/user_homework_detail', :locals => {:homework_common => @homework,:is_in_course => @is_in_course}) %>");
- init_activity_KindEditor_data(<%= @homework.id%>,"","87%");
+ init_activity_KindEditor_data(<%= @homework.id%>,"","87%", "<%=@homework.class.to_s%>");
<% end %>
\ No newline at end of file
diff --git a/app/views/users/_user_activities.html.erb b/app/views/users/_user_activities.html.erb
index 4f1d3a5d8..557b9e9ee 100644
--- a/app/views/users/_user_activities.html.erb
+++ b/app/views/users/_user_activities.html.erb
@@ -1,12 +1,12 @@
<%= content_for(:header_tags) do %>
- <%= import_ke(enable_at: false, prettify: false, init_activity: true) %>
+ <%= import_ke(enable_at: true, prettify: false, init_activity: true) %>
<% end %>
-
-
<%= l(:label_issue_tracking) %>
-
-
- <% unless @project.enabled_modules.where("name = 'issue_tracking'").empty? %>
- <%= form_tag({:controller => 'issues', :action => 'index', :project_id => @project},:remote=>'true', :method => :get,:id=>"issue_query_form", :class => 'query_form') do %>
- <%= hidden_field_tag 'set_filter', '1' %>
-
- <%= link_to '新建问题', new_project_issue_path(@project) , :class => "green_u_btn fr ml10" %>
-
<%= l(:label_issues_sum) %>:<%= @project.issues.visible.all.count %>
- <%= l(:lable_issues_undo) %>:<%= @project.issues.where('status_id in (1,2,4,6)').visible.all.count %>
-
+
-
- <% if !@query.new_record? && @query.editable_by?(User.current) %>
- <%= link_to l(:button_edit), edit_query_path(@query), :class => 'icon icon-edit' %>
- <%= delete_link query_path(@query) %>
- <% end %>
-
-
-<% html_title(@query.new_record? ? l(:label_issue_plural) : @query.name) %>
-
-
-
-<%= error_messages_for 'query' %>
-
-<% if @query.valid? %>
- <% if @issues.empty? %>
-
- <%= l(:label_no_data) %>
-
- <% else %>
-
- <%= render :partial => 'issues/list', :locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count} %>
-
-
-
- <% end %>
-
-
- <% other_formats_links do |f| %>
- <%= f.link_to 'Atom', :url => params.merge(:key => User.current.rss_key) %>
- <%= f.link_to 'CSV', :url => params, :onclick => "showModal('csv-export-options', '330px'); return false;" %>
- <%= f.link_to 'PDF', :url => params %>
+
+ <% if !@query.new_record? && @query.editable_by?(User.current) %>
+ <%= link_to l(:button_edit), edit_query_path(@query), :class => 'icon icon-edit' %>
+ <%= delete_link query_path(@query) %>
<% end %>
-
-
<%= l(:label_export_options, :export_format => 'CSV') %>
- <%= form_tag(params.merge({:format => 'csv', :page => nil}), :method => :get, :id => 'csv-export-form') do %>
-
-
- <%= radio_button_tag 'columns', 'all' %>
- <%= l(:description_all_columns) %>
-
-
-
-
-
- <%= check_box_tag 'description', '1', @query.has_column?(:description) %>
- <%= l(:field_description) %>
-
-
-
-
- <%= submit_tag l(:button_export), :name => nil, :onclick => "hideModal(this);" %>
- <%= submit_tag l(:button_cancel), :name => nil, :onclick => "hideModal(this);", :type => 'button' %>
-
- <% end %>
+ <% html_title(@query.new_record? ? l(:label_issue_plural) : @query.name) %>
+
-<% end %>
-<%= call_hook(:view_issues_index_bottom, {:issues => @issues, :project => @project, :query => @query}) %>
-<% content_for :sidebar do %>
- <%= render :partial => 'issues/sidebar' %>
-<% end %>
-<% content_for :header_tags do %>
- <%= auto_discovery_link_tag(:atom,
- {:query_id => @query, :format => 'atom',
- :page => nil, :key => User.current.rss_key},
- :title => l(:label_issue_plural)) %>
- <%= auto_discovery_link_tag(:atom,
- {:controller => 'journals', :action => 'index',
- :query_id => @query, :format => 'atom',
- :page => nil, :key => User.current.rss_key},
- :title => l(:label_changes_details)) %>
-<% end %>
+ <%= error_messages_for 'query' %>
+
+ <% if @query.valid? %>
+ <% if @issues.empty? %>
+
+ <%= l(:label_no_data) %>
+
+ <% else %>
+
+ <%= render :partial => 'issues/list', :locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count} %>
+
+
+
+ <% end %>
+
+
+ <% other_formats_links do |f| %>
+ <%= f.link_to 'Atom', :url => params.merge(:key => User.current.rss_key) %>
+ <%= f.link_to 'CSV', :url => params, :onclick => "showModal('csv-export-options', '330px'); return false;" %>
+ <%= f.link_to 'PDF', :url => params %>
+ <% end %>
+
+
+
+
<%= l(:label_export_options, :export_format => 'CSV') %>
+ <%= form_tag(params.merge({:format => 'csv', :page => nil}), :method => :get, :id => 'csv-export-form') do %>
+
+
+ <%= radio_button_tag 'columns', 'all' %>
+ <%= l(:description_all_columns) %>
+
+
+
+
+
+ <%= check_box_tag 'description', '1', @query.has_column?(:description) %>
+ <%= l(:field_description) %>
+
+
+
+
+ <%= submit_tag l(:button_export), :name => nil, :onclick => "hideModal(this);" %>
+ <%= submit_tag l(:button_cancel), :name => nil, :onclick => "hideModal(this);", :type => 'button' %>
+
+ <% end %>
+
+ <% end %>
+ <%= call_hook(:view_issues_index_bottom, {:issues => @issues, :project => @project, :query => @query}) %>
+ <% content_for :sidebar do %>
+ <%= render :partial => 'issues/sidebar' %>
+ <% end %>
+
+ <% content_for :header_tags do %>
+ <%= auto_discovery_link_tag(:atom,
+ {:query_id => @query, :format => 'atom',
+ :page => nil, :key => User.current.rss_key},
+ :title => l(:label_issue_plural)) %>
+ <%= auto_discovery_link_tag(:atom,
+ {:controller => 'journals', :action => 'index',
+ :query_id => @query, :format => 'atom',
+ :page => nil, :key => User.current.rss_key},
+ :title => l(:label_changes_details)) %>
+ <% end %>
-<%= context_menu issues_context_menu_path %>
+ <%= context_menu issues_context_menu_path %>
+
\ No newline at end of file
diff --git a/public/stylesheets/project.css b/public/stylesheets/project.css
index aa3297128..c0afe45d5 100644
--- a/public/stylesheets/project.css
+++ b/public/stylesheets/project.css
@@ -161,9 +161,9 @@ a:hover.invi_search_btn{ background:#0da1b2; border:1px solid #0da1b2;}
/*问题跟踪*/
.problem_top{ margin:10px 0 ;}
-.problem_search_input{ border:1px solid #64bdd9; width:180px; height:24px; color:#9b9b9b; padding-left:5px; margin-bottom:5px;}
-a.problem_search_btn{ background:#64bdd9; color:#fff; text-align: center; width:40px; height:22px;border:1px solid #64bdd9; padding-top:2px; cursor:pointer;}
-a:hover.problem_search_btn{ background:#3da1c1; border:1px solid #3da1c1;}
+.problem_search_input{ border:1px solid #dddddd; width:180px; height:24px; color:#9b9b9b; padding-left:5px; margin-bottom:5px;}
+a.problem_search_btn{ background:#269ac9; color:#fff; text-align: center; width:40px; height:22px;border:1px solid #64bdd9; padding-top:2px; cursor:pointer;}
+a:hover.problem_search_btn{ background:#269ac9; border:1px solid #3da1c1;}
a.problem_new_btn{ margin-left:10px; border:1px solid #ff7143; color:#ff7143; width:60px; height:21px; font-size:12px; text-align:center; padding-top:3px;}
a:hover.problem_new_btn{ background:#ff7143; color:#fff;}
.problem_p{ color:#535252; margin-top:5px;}
diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css
index 003cf90df..13362dd19 100644
--- a/public/stylesheets/public.css
+++ b/public/stylesheets/public.css
@@ -87,6 +87,7 @@ h4{ font-size:14px; color:#3b3b3b;}
.mr55{ margin-right:55px;}
.mr10{ margin-right:10px;}
.mr15 {margin-right:15px;}
+.mr18 {margin-right:15px;}
.mr20{ margin-right:20px;}
.mr25 {margin-right:25px;}
.mr30{ margin-right:30px;}
From 0fef18312dc0f19246fcc38936219826283c9fc8 Mon Sep 17 00:00:00 2001
From: ouyangxuhua
Date: Wed, 16 Dec 2015 15:36:01 +0800
Subject: [PATCH 033/120] =?UTF-8?q?=E9=BC=A0=E6=A0=87=E7=BB=8F=E8=BF=87?=
=?UTF-8?q?=E8=B5=84=E6=BA=90=E6=A0=8F=E7=9B=AETAG=E6=97=B6=EF=BC=8C?=
=?UTF-8?q?=E5=8F=98=E6=88=90=E6=89=8B=E5=9E=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/tags/_tag_list.html.erb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/views/tags/_tag_list.html.erb b/app/views/tags/_tag_list.html.erb
index 14b6a0597..de8c0a4d2 100644
--- a/app/views/tags/_tag_list.html.erb
+++ b/app/views/tags/_tag_list.html.erb
@@ -2,7 +2,7 @@
<% if @tags.size > 0 %>
<% @tags.each do |tag| %>
- <%#= link_to tag, :controller => "tags", :action => "index", :q => tag, :object_flag => object_flag, :obj_id => obj.id %>
+ <%#= link_to tag, :controller => "tags", :action => "index", :q => tag, :object_flag => object_flag, :obj_id => obj.id %>
<%= tag %>
<% case object_flag %>
From dc0f004021426fafd8b5c8864f8fe4289269abaf Mon Sep 17 00:00:00 2001
From: cxt
Date: Wed, 16 Dec 2015 15:47:30 +0800
Subject: [PATCH 034/120] =?UTF-8?q?=E5=85=B3=E8=81=94=E9=A1=B9=E7=9B=AE?=
=?UTF-8?q?=E7=9A=84=E6=8F=90=E7=A4=BA=E4=BF=A1=E6=81=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/users/_course_homework.html.erb | 27 ++++++++++++++-----
.../users/_user_homework_detail.html.erb | 26 +++++++++++++-----
public/stylesheets/courses.css | 1 +
public/stylesheets/new_user.css | 2 ++
4 files changed, 44 insertions(+), 12 deletions(-)
diff --git a/app/views/users/_course_homework.html.erb b/app/views/users/_course_homework.html.erb
index a3aa5d5b1..fe02d9882 100644
--- a/app/views/users/_course_homework.html.erb
+++ b/app/views/users/_course_homework.html.erb
@@ -104,14 +104,29 @@
已关联项目:
<% activity.student_work_projects.where("is_leader = 1").each do |pro| %>
-
- <% project = Project.find pro.project_id %>
- <% if project.is_public || User.current.member_of?(project) || User.current.admin?%>
- <%= link_to image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius"),project_path(project.id,:host=>Setting.host_name),:alt =>"项目头像" %>
+ <% project = Project.find pro.project_id %>
+
+
+ <% if project.is_public || User.current.member_of?(project) || User.current.admin? %>
+ <%= link_to image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius"),project_path(project.id,:host=>Setting.host_name),:id=>"project_img_"+project.id.to_s,:alt =>"项目头像" %>
<% else %>
- <%= image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius") %>
+ <%= image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius",:id=>"project_img_"+project.id.to_s,:alt =>"项目头像") %>
<% end %>
-
<%=project.project_score.score.to_i %>
+
+ 项目名称:<%=project.name %>
+ 创建者:<%=(User.find project.user_id).show_name %>
+ <% time=project.updated_on %>
+ <% time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last %>
+ 更新时间:<%=time_from_now time %>
+
<% end %>
diff --git a/app/views/users/_user_homework_detail.html.erb b/app/views/users/_user_homework_detail.html.erb
index 4217cf1a9..536a9deb6 100644
--- a/app/views/users/_user_homework_detail.html.erb
+++ b/app/views/users/_user_homework_detail.html.erb
@@ -102,18 +102,32 @@
<% if homework_common.homework_type == 3 && !homework_common.student_work_projects.empty? && homework_common.homework_detail_group.base_on_project == 1 %>
-
已关联项目:
<% homework_common.student_work_projects.where("is_leader = 1").each do |pro| %>
-
- <% project = Project.find pro.project_id %>
+ <% project = Project.find pro.project_id %>
+
+
<% if project.is_public || User.current.member_of?(project) || User.current.admin? %>
- <%= link_to image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius"),project_path(project.id,:host=>Setting.host_name),:alt =>"项目头像" %>
+ <%= link_to image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius"),project_path(project.id,:host=>Setting.host_name),:id=>"project_img_"+project.id.to_s,:alt =>"项目头像" %>
<% else %>
- <%= image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius") %>
+ <%= image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius",:id=>"project_img_"+project.id.to_s,:alt =>"项目头像") %>
<% end %>
-
<%=project.project_score.score.to_i %>
+
+ 项目名称:<%=project.name %>
+ 创建者:<%=(User.find project.user_id).show_name %>
+ <% time=project.updated_on %>
+ <% time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last %>
+ 更新时间:<%=time_from_now time %>
+
<% end %>
diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css
index 77c839f8d..6a6c3a7e7 100644
--- a/public/stylesheets/courses.css
+++ b/public/stylesheets/courses.css
@@ -1209,6 +1209,7 @@ a:hover.blueCir{ background:#3598db; color:#fff;}
.proHelp {background:url(/images/course/hwork_icon.png) -5px -124px no-repeat; display:inline-block; width:15px; height:15px; display:inline-block;}
.hworkPrName {width:110px; max-width:110px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; float:left; height:18px; line-height:18px; font-size:12px; color:#888888; text-align:center;}
.mr150 {margin-right:150px;}
+.relatePInfo {position:absolute; background-color:#ffffff; padding:3px 8px; white-space:nowrap; box-shadow:0px 2px 8px rgba(146, 153, 169, 0.5); z-index:999; color:#585858; cursor:pointer; display:none;}
/*上传资源弹窗*/
.resourceUploadPopup {width:400px; height:auto; border:3px solid #269ac9 !important; padding-left:16px; padding-bottom:16px; background-color:#ffffff; position:absolute; top:50%; left:50%; margin-left:-200px; z-index:1000;}
diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css
index 0ed4df627..5a98211ab 100644
--- a/public/stylesheets/new_user.css
+++ b/public/stylesheets/new_user.css
@@ -1381,3 +1381,5 @@ a:hover.blueCir{ background:#3598db; color:#fff;}
.proHelp {background:url(/images/course/hwork_icon.png) -5px -124px no-repeat; display:inline-block; width:15px; height:15px; display:inline-block;}
.hworkPrName {width:110px; max-width:110px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; float:left; height:18px; line-height:18px; font-size:12px; color:#888888; text-align:center;}
.mr150 {margin-right:150px;}
+.relatePInfo {position:absolute; background-color:#ffffff; padding:3px 8px; white-space:nowrap; box-shadow:0px 2px 8px rgba(146, 153, 169, 0.5); z-index:999; color:#585858; cursor:pointer; display:none;}
+
From b13ae8f599378215f66a71273fa2f7f4cb23a6d9 Mon Sep 17 00:00:00 2001
From: lizanle <491823689@qq.com>
Date: Wed, 16 Dec 2015 15:55:40 +0800
Subject: [PATCH 035/120] issue
---
app/controllers/issues_controller.rb | 2 +-
app/views/issues/_list.html.erb | 15 ++++++++++++---
app/views/issues/index.html.erb | 16 ++++++++--------
app/views/issues/index.js.erb | 5 ++---
public/javascripts/application.js | 4 ++++
5 files changed, 27 insertions(+), 15 deletions(-)
diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb
index 1eb39fb32..48bf3b568 100644
--- a/app/controllers/issues_controller.rb
+++ b/app/controllers/issues_controller.rb
@@ -81,7 +81,7 @@ class IssuesController < ApplicationController
@status_id = params[:status_id]
@subject = params[:subject]
@issue_count = @query.issue_count
- @issue_pages = Paginator.new @issue_count, @limit, params['page']
+ @issue_pages = Paginator.new @issue_count, @limit, params['page'].to_i + 1
@offset ||= @issue_pages.offset
@issues = @query.issues(:include => [:assigned_to, :tracker, :priority, :category, :fixed_version],
:order => sort_clause,
diff --git a/app/views/issues/_list.html.erb b/app/views/issues/_list.html.erb
index 327cc2c75..c071d57d8 100644
--- a/app/views/issues/_list.html.erb
+++ b/app/views/issues/_list.html.erb
@@ -39,6 +39,15 @@
<%= render :partial => 'users/project_issue', :locals => {:activity => issue, :user_activity_id => issue.id} %>
<% end %>
-
- <%= pagination_links_full issue_pages, issue_count, :per_page_links => false, :remote => true, :flag => true %>
-
\ No newline at end of file
+ <% if issues.count == 10%>
+
展开更多<%=link_to "", project_issues_path(:project_id => project.id,:page => issue_pages.page),:id => "more_issues_link",:remote => "true",:class => "none" %>
+ <%#= link_to "点击展开更多",user_activities_path(@user.id,:type => type,:page => page),:id => "show_more_activities",:remote => "true",:class => "loadMore mt10 f_grey"%>
+ <% end%>
+
+
+
+
\ No newline at end of file
diff --git a/app/views/issues/index.html.erb b/app/views/issues/index.html.erb
index df7f9dddc..7c358aaed 100644
--- a/app/views/issues/index.html.erb
+++ b/app/views/issues/index.html.erb
@@ -144,19 +144,19 @@
<% else %>
- <%= render :partial => 'issues/list', :locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count} %>
+ <%= render :partial => 'issues/list', :locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count,:project=>@project} %>
<% end %>
-
- <% other_formats_links do |f| %>
- <%= f.link_to 'Atom', :url => params.merge(:key => User.current.rss_key) %>
- <%= f.link_to 'CSV', :url => params, :onclick => "showModal('csv-export-options', '330px'); return false;" %>
- <%= f.link_to 'PDF', :url => params %>
- <% end %>
-
+
+
+
+
+
+
+
<%= l(:label_export_options, :export_format => 'CSV') %>
diff --git a/app/views/issues/index.js.erb b/app/views/issues/index.js.erb
index 012d01c20..9e68f9bc8 100644
--- a/app/views/issues/index.js.erb
+++ b/app/views/issues/index.js.erb
@@ -1,3 +1,2 @@
-$("#issue_list").html("<%= escape_javascript(render :partial => 'issues/list',:locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count})%>");
-$("#v_subject").focus();
-$("#v_subject").blur();
\ No newline at end of file
+//$("#issue_list").html("<%#= escape_javascript(render :partial => 'issues/list',:locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count})%>");
+$("#show_more_issues").replaceWith("<%= escape_javascript( render :partial => 'issues/list', :locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count,:project=>@project} )%>");
diff --git a/public/javascripts/application.js b/public/javascripts/application.js
index 50f271a8a..dcf153a80 100644
--- a/public/javascripts/application.js
+++ b/public/javascripts/application.js
@@ -590,7 +590,11 @@ function setupAjaxIndicator() {
$('#ajax-indicator').hide();
if(MathJax && MathJax.Hub)
MathJax.Hub.Queue(['Typeset', MathJax.Hub]); //如果是ajax刷新页面的话,手动执行MathJax的公式显示
+ try{
+ prettyPrint(); //如果刷新出来的页面如果存在代码行的话,也需要美化
+ }catch (e){
+ }
});
}
From ab96bf8e5e2d06b756fd1f42589ffeda10b57f95 Mon Sep 17 00:00:00 2001
From: cxt
Date: Wed, 16 Dec 2015 16:00:25 +0800
Subject: [PATCH 036/120] =?UTF-8?q?=E4=BD=9C=E5=93=81=E5=88=97=E8=A1=A8?=
=?UTF-8?q?=E4=B8=AD=E6=9C=AA=E5=8F=82=E4=B8=8E=E5=8C=BF=E8=AF=84=E7=9A=84?=
=?UTF-8?q?=E4=BD=9C=E5=93=81=E6=98=BE=E7=A4=BA=E2=80=9C=E6=9C=AA=E5=8F=82?=
=?UTF-8?q?=E4=B8=8E=E2=80=9D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/student_work/_evaluation_un_work.html.erb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/views/student_work/_evaluation_un_work.html.erb b/app/views/student_work/_evaluation_un_work.html.erb
index 641405fe4..0a4ab044a 100644
--- a/app/views/student_work/_evaluation_un_work.html.erb
+++ b/app/views/student_work/_evaluation_un_work.html.erb
@@ -57,7 +57,7 @@
<% if @homework.anonymous_comment == 0%>
- <%= student_work.student_score.nil? ? "--" : format("%.1f",student_work.student_score)%>
+ <%= student_work.student_score.nil? ? "未参与" : format("%.1f",student_work.student_score)%>
<% unless student_work.student_score.nil?%>
(<%= student_work.student_works_scores.where(:reviewer_role => 3).count%>)
@@ -84,7 +84,7 @@
缺评扣分
<%= student_work.absence_penalty%> 分,
最终成绩为
- <%= format("%.1f",score)%> 分。
+ <%= format("%.1f",score<0 ? 0 : score)%> 分。
<% end%>
From c0de5d55de11e13e89386595733639dd08df3eac Mon Sep 17 00:00:00 2001
From: guange <8863824@gmail.com>
Date: Wed, 16 Dec 2015 16:37:00 +0800
Subject: [PATCH 037/120] =?UTF-8?q?=E5=8A=A0=E5=85=A5=E4=BA=86issue?=
=?UTF-8?q?=E7=9A=84at=E6=B6=88=E6=81=AF=E6=8F=90=E9=86=92?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/models/issue.rb | 8 +++++---
app/views/users/_user_at_message.html.erb | 21 +++++++++++++++++++++
app/views/users/user_messages.html.erb | 2 ++
db/schema.rb | 16 +++++++++++++++-
4 files changed, 43 insertions(+), 4 deletions(-)
create mode 100644 app/views/users/_user_at_message.html.erb
diff --git a/app/models/issue.rb b/app/models/issue.rb
index 11daf670f..5ecb3e36f 100644
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -52,6 +52,7 @@ class Issue < ActiveRecord::Base
# ForgeMessage虚拟关联(多态)
has_many :forge_messages, :class_name => 'ForgeMessage',:as =>:forge_message ,:dependent => :destroy
+ has_many :at_messages, class_name: 'AtMessage', as: :at_message ,:dependent => :destroy
acts_as_nested_set :scope => 'root_id', :dependent => :destroy
acts_as_attachable :before_add => :attachment_added, :after_remove => :attachment_removed
@@ -82,7 +83,7 @@ class Issue < ActiveRecord::Base
attr_reader :current_journal
# fq
- after_create :act_as_activity,:be_user_score_new_issue,:act_as_forge_activity, :act_as_forge_message
+ after_create :act_as_activity,:be_user_score_new_issue,:act_as_forge_activity, :act_as_forge_message, :act_as_at_message
after_update :be_user_score
after_destroy :down_user_score
# after_create :be_user_score
@@ -159,8 +160,9 @@ class Issue < ActiveRecord::Base
# at 功能添加消息提醒
def act_as_at_message
users = self.description.scan /
/m
- ### xxx 在 xxx 中at了你
-
+ users && users.flatten.uniq.each do |uid|
+ self.at_messages << AtMessage.new(user_id: uid, sender_id: self.author_id)
+ end
end
# 更新缺陷
diff --git a/app/views/users/_user_at_message.html.erb b/app/views/users/_user_at_message.html.erb
new file mode 100644
index 000000000..0b706c4ce
--- /dev/null
+++ b/app/views/users/_user_at_message.html.erb
@@ -0,0 +1,21 @@
+<% if AtMessage === ma %>
+
+ <%=link_to image_tag(url_to_avatar(ma.at_message.author), :width => "30", :height => "30"),user_path(ma.at_message.author) %>
+
+ <%= ma.at_message.author.login %> 提到了你:
+
+
+ <%= link_to ma.at_message.subject, {:controller => :issues, :action => 'show', :id => ma.at_message.id },
+ :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
+ :onmouseover =>"message_titile_show($(this),event)",
+ :onmouseout => "message_titile_hide($(this))" %>
+
+
标题: <%= ma.at_message.subject %>
+ <% unless ma.at_message.description.nil? %>
+
内容:
+
<%= ma.at_message.description.html_safe %>
+ <% end %>
+
+ <%= time_tag(ma.created_at).html_safe %>
+
+<% end %>
\ No newline at end of file
diff --git a/app/views/users/user_messages.html.erb b/app/views/users/user_messages.html.erb
index f83e5617c..d690f7e43 100644
--- a/app/views/users/user_messages.html.erb
+++ b/app/views/users/user_messages.html.erb
@@ -17,6 +17,8 @@
<%# 系统消息 %>
<%= render :partial => 'users/user_message_system', :locals => {:ma => ma} %>
+ <%= render :partial => 'users/user_at_message', :locals => {:ma => ma} %>
+
<%# 课程消息 %>
<%= render :partial => 'users/user_message_course', :locals => {:ma => ma} %>
diff --git a/db/schema.rb b/db/schema.rb
index 17e613acb..2bf172198 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20151209085942) do
+ActiveRecord::Schema.define(:version => 20151216030610) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
@@ -66,6 +66,20 @@ ActiveRecord::Schema.define(:version => 20151209085942) do
t.datetime "updated_at", :null => false
end
+ create_table "at_messages", :force => true do |t|
+ t.integer "user_id"
+ t.integer "at_message_id"
+ t.string "at_message_type"
+ t.boolean "viewed"
+ t.string "container_type"
+ t.integer "container_id"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ t.integer "sender_id"
+ end
+
+ add_index "at_messages", ["user_id"], :name => "index_at_messages_on_user_id"
+
create_table "attachments", :force => true do |t|
t.integer "container_id"
t.string "container_type", :limit => 30
From a0035a4c1ed46e94ab34255b743323e6ea73341f Mon Sep 17 00:00:00 2001
From: lizanle <491823689@qq.com>
Date: Wed, 16 Dec 2015 16:49:33 +0800
Subject: [PATCH 038/120] =?UTF-8?q?issue=20=E6=9F=A5=E8=AF=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/issues_controller.rb | 3 +++
app/views/issues/_list.html.erb | 2 +-
app/views/issues/index.html.erb | 2 +-
app/views/issues/index.js.erb | 6 +++++-
4 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb
index 48bf3b568..3263ebc07 100644
--- a/app/controllers/issues_controller.rb
+++ b/app/controllers/issues_controller.rb
@@ -87,6 +87,9 @@ class IssuesController < ApplicationController
:order => sort_clause,
:offset => @offset,
:limit => @limit)
+ if params[:set_filter]
+ @set_filter = params[:set_filter]
+ end
@issue_count_by_group = @query.issue_count_by_group
respond_to do |format|
format.js
diff --git a/app/views/issues/_list.html.erb b/app/views/issues/_list.html.erb
index c071d57d8..115a70e7a 100644
--- a/app/views/issues/_list.html.erb
+++ b/app/views/issues/_list.html.erb
@@ -40,7 +40,7 @@
<%= render :partial => 'users/project_issue', :locals => {:activity => issue, :user_activity_id => issue.id} %>
<% end %>
<% if issues.count == 10%>
- 展开更多<%=link_to "", project_issues_path(:project_id => project.id,:page => issue_pages.page),:id => "more_issues_link",:remote => "true",:class => "none" %>
+ 展开更多<%=link_to "", project_issues_path({:project_id => project.id,:page => issue_pages.page}.merge(params)),:id => "more_issues_link",:remote => "true",:class => "none" %>
<%#= link_to "点击展开更多",user_activities_path(@user.id,:type => type,:page => page),:id => "show_more_activities",:remote => "true",:class => "loadMore mt10 f_grey"%>
<% end%>
diff --git a/app/views/issues/index.html.erb b/app/views/issues/index.html.erb
index 7c358aaed..cf0428c27 100644
--- a/app/views/issues/index.html.erb
+++ b/app/views/issues/index.html.erb
@@ -144,7 +144,7 @@
<% else %>
- <%= render :partial => 'issues/list', :locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count,:project=>@project} %>
+ <%= render :partial => 'issues/list', :locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count,:project=>@project,:subject=>@subject} %>
diff --git a/app/views/issues/index.js.erb b/app/views/issues/index.js.erb
index 9e68f9bc8..9ddc50445 100644
--- a/app/views/issues/index.js.erb
+++ b/app/views/issues/index.js.erb
@@ -1,2 +1,6 @@
//$("#issue_list").html("<%#= escape_javascript(render :partial => 'issues/list',:locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count})%>");
-$("#show_more_issues").replaceWith("<%= escape_javascript( render :partial => 'issues/list', :locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count,:project=>@project} )%>");
+<% if @set_filter && @issue_pages.page == 1%>
+ $("#issue_list").html("<%= escape_javascript(render :partial => 'issues/list',:locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count,:project=>@project})%>");
+<%else%>
+ $("#show_more_issues").replaceWith("<%= escape_javascript( render :partial => 'issues/list', :locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count,:project=>@project} )%>");
+<%end%>
From 66f88cdf5ad02a6c21493eabd086b48238e0bedb Mon Sep 17 00:00:00 2001
From: lizanle <491823689@qq.com>
Date: Wed, 16 Dec 2015 16:55:07 +0800
Subject: [PATCH 039/120] =?UTF-8?q?issue=20=E6=96=87=E4=BB=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/issues/index.js.erb | 2 +-
public/stylesheets/project.css | 5 ++++-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/app/views/issues/index.js.erb b/app/views/issues/index.js.erb
index 9ddc50445..399c6a977 100644
--- a/app/views/issues/index.js.erb
+++ b/app/views/issues/index.js.erb
@@ -1,5 +1,5 @@
//$("#issue_list").html("<%#= escape_javascript(render :partial => 'issues/list',:locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count})%>");
-<% if @set_filter && @issue_pages.page == 1%>
+<% if @set_filter && @issue_pages.page == 1%> //只有搜索的第一页才需要替换整个issue_list,其余的都是替换show_more_issues
$("#issue_list").html("<%= escape_javascript(render :partial => 'issues/list',:locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count,:project=>@project})%>");
<%else%>
$("#show_more_issues").replaceWith("<%= escape_javascript( render :partial => 'issues/list', :locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count,:project=>@project} )%>");
diff --git a/public/stylesheets/project.css b/public/stylesheets/project.css
index c0afe45d5..db41a1c5c 100644
--- a/public/stylesheets/project.css
+++ b/public/stylesheets/project.css
@@ -1078,4 +1078,7 @@ img.date-trigger {
}
.proInfoBox{ margin-left:60px; border:1px solid #dddddd; height:45px; padding:10px 0; background-color:#f1f1f1;}
.proInfoBox ul li{ height:24px;}
-.proInfoP{color:#000000 !important; float:left; width:80px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; }
\ No newline at end of file
+.proInfoP{color:#000000 !important; float:left; width:80px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; }
+
+a.link_file_a{ background:url(../images/pic_file.png) 0 2px no-repeat; padding-left:20px; }
+a:hover.link_file_a{ background:url(../images/pic_file.png) 0 -25px no-repeat; color:#3ca5c6;}
\ No newline at end of file
From bb23049f5555dcc5455aacf9e664c30c83aaae9a Mon Sep 17 00:00:00 2001
From: huang
Date: Wed, 16 Dec 2015 17:04:17 +0800
Subject: [PATCH 040/120] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=BA=93=E6=8F=90?=
=?UTF-8?q?=E4=BA=A4=E6=AC=A1=E6=95=B0=E5=B0=81=E8=A3=85=20=E6=8F=90?=
=?UTF-8?q?=E4=BA=A4=E9=A1=B5=E9=9D=A2=E6=A0=B7=E5=BC=8F=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/repositories_controller.rb | 37 ++-----------------
app/helpers/application_helper.rb | 36 +++++++++++++++++++
app/helpers/project_score_helper.rb | 1 +
app/views/repositories/_revisions.html.erb | 42 ++++++++--------------
4 files changed, 54 insertions(+), 62 deletions(-)
diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb
index f0b15e8f8..8eb6a6860 100644
--- a/app/controllers/repositories_controller.rb
+++ b/app/controllers/repositories_controller.rb
@@ -348,10 +348,6 @@ update
# end
# end
-
-
-
-
@changesets = g.commits(@project.gpid, :ref_name => @rev)
# @changesets = @repository.latest_changesets(@path, @rev)
# @changesets_count = @repository.latest_changesets(@path, @rev).count
@@ -378,19 +374,6 @@ update
alias_method :browse, :show
- #add by hx
- def count_commits(project_id , left , right)
- count = 0
- (left..right).each do |page|
- if $g.commits(project_id,:page => page).count == 0
- break
- else
- count = count + $g.commits(project_id,:page => page).count
- end
- end
- return count
- end
-
def changes
@entry = @repository.entry(@path, @rev)
(show_error_not_found; return) unless @entry
@@ -400,26 +383,10 @@ update
@commits = g.commits(@project.gpid, page:(params[:page].to_i - 1).to_s)
#add by hx
- if g.commits(@project.gpid , :page=>200).count > 0
- count = 4020
- elsif g.commits(@project.gpid , :page=>25).count==0
- count = count_commits(@project.gpid , 0 , 25)
- elsif g.commits(@project.gpid , :page=>50).count ==0
- count = count_commits(@project.gpid , 25 , 50)+ 25 * 20
- elsif g.commits(@project.gpid , :page=>75).count ==0
- count = count_commits(@project.gpid , 50 , 75)+ 50 * 20
- elsif g.commits(@project.gpid , :page=>100).count== 0
- count = count_commits(@project.gpid , 75 , 100) + 75 * 20
- elsif g.commits(@project.gpid , :page=>125).count==0
- count = count_commits(@project.gpid , 100 , 125) + 100 * 20
- elsif g.commits(@project.gpid , :page=>150).count==0
- count = count_commits(@project.gpid , 125 , 150) + 125 * 20
- else
- count = count_commits(@project.gpid , 150 ,200) + 150 * 20
- end
+ rep_count = commit_count(@project)
#页面传递必须要str类型,但是Paginator的初始化必须要num类型,需要类型转化
- @commits_count = count
+ @commits_count = rep_count
@commits_pages = Redmine::Pagination::Paginator.new @commits_count,limit,params[:page]
@commit = g.commit(@project.gpid,@rev)
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 5a9563b73..667314531 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -668,6 +668,42 @@ module ApplicationHelper
return rep.blank? ? true :false
end
+ # 获取Gitlab版本库提交总数
+ def commit_count(project)
+ g = Gitlab.client
+ #add by hx
+ if g.commits(project.gpid , :page=>200).count > 0
+ count = 4020
+ elsif g.commits(project.gpid , :page=>25).count==0
+ count = count_commits(project.gpid , 0 , 25)
+ elsif g.commits(project.gpid , :page=>50).count ==0
+ count = count_commits(project.gpid , 25 , 50)+ 25 * 20
+ elsif g.commits(project.gpid , :page=>75).count ==0
+ count = count_commits(project.gpid , 50 , 75)+ 50 * 20
+ elsif g.commits(project.gpid , :page=>100).count== 0
+ count = count_commits(project.gpid , 75 , 100) + 75 * 20
+ elsif g.commits(project.gpid , :page=>125).count==0
+ count = count_commits(project.gpid , 100 , 125) + 100 * 20
+ elsif g.commits(project.gpid , :page=>150).count==0
+ count = count_commits(project.gpid , 125 , 150) + 125 * 20
+ else
+ count = count_commits(project.gpid , 150 ,200) + 150 * 20
+ end
+ end
+
+ #add by hx
+ def count_commits(project_id , left , right)
+ count = 0
+ (left..right).each do |page|
+ if $g.commits(project_id,:page => page).count == 0
+ break
+ else
+ count = count + $g.commits(project_id,:page => page).count
+ end
+ end
+ return count
+ end
+
# 获取单一gitlab项目
def gitlab_repository(project)
rep = Repository.where("project_id =? and type =?", project.id,"Repository::Gitlab" ).first
diff --git a/app/helpers/project_score_helper.rb b/app/helpers/project_score_helper.rb
index 104cd16cb..256e35a7a 100644
--- a/app/helpers/project_score_helper.rb
+++ b/app/helpers/project_score_helper.rb
@@ -22,6 +22,7 @@ module ProjectScoreHelper
#代码提交数量
def changesets_num project
+ # commit_count(project)
project.changesets.count
end
diff --git a/app/views/repositories/_revisions.html.erb b/app/views/repositories/_revisions.html.erb
index b72a05876..4d6e39f88 100644
--- a/app/views/repositories/_revisions.html.erb
+++ b/app/views/repositories/_revisions.html.erb
@@ -20,42 +20,31 @@
-
<% if !user_commit_rep(changeset.author_email).nil? %>
- <%= image_tag(url_to_avatar(user_commit_rep(changeset.author_email)), :width => "20", :height => "20", :class => "fl portraitRadius mt2 ml4 mr5") %>
- <%= link_to user_commit_rep(changeset.author_email), user_path(user_commit_rep(changeset.author_email)), :length => 30 %>
- 提交于
+ <%= image_tag(url_to_avatar(user_commit_rep(changeset.author_email)), :width => "20", :height => "20", :class => "fl portraitRadius mt2 ml4 mr5") %>
+ <%= link_to user_commit_rep(changeset.author_email), user_path(user_commit_rep(changeset.author_email)), :length => 30 %>提交于
- <%= time_tag(changeset.created_at) %>
- 前
-
-
+ <%= time_tag(changeset.created_at) %>前
<% else %>
-
<%= changeset.author_email %>
- 提交于
+
<%= changeset.author_email %> 提交于
- <%= time_tag(changeset.created_at) %>
- 前
-
-
+ <%= time_tag(changeset.created_at) %> 前
<% end %>
-
-
+
@@ -65,7 +54,6 @@
<%#= submit_tag(l(:label_view_diff), :name => nil, :class=>"c_blue") if show_diff %>
-
<%= pagination_links_full commits_pages, commits_count, :per_page_links => false, :remote => false, :flag => true %>
From ffd8d55aa6ef3e5702f7b7da75ec535987d849a6 Mon Sep 17 00:00:00 2001
From: lizanle <491823689@qq.com>
Date: Wed, 16 Dec 2015 17:08:59 +0800
Subject: [PATCH 041/120] =?UTF-8?q?memo=E6=9B=B4=E6=96=B0=E6=97=B6?=
=?UTF-8?q?=E9=97=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/memos_controller.rb | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/app/controllers/memos_controller.rb b/app/controllers/memos_controller.rb
index 2d2c058d4..a47ddf787 100644
--- a/app/controllers/memos_controller.rb
+++ b/app/controllers/memos_controller.rb
@@ -159,7 +159,8 @@ class MemosController < ApplicationController
@memo.update_column(:content, params[:memo][:content]) &&
@memo.update_column(:sticky, params[:memo][:sticky]) &&
@memo.update_column(:lock, params[:memo][:lock]) &&
- @memo.update_column(:subject,params[:memo][:subject]))
+ @memo.update_column(:subject,params[:memo][:subject]) &&
+ @memo.update_column(:updated_at,Time.now))
@memo.save_attachments(params[:attachments] || (params[:memo] && params[:memo][:uploads]))
@flag = @memo.save
# @memo.root.update_attribute(:updated_at, @memo.updated_at)
From 71f6a637e06c103e228a0d1d95ee57f4a273bad4 Mon Sep 17 00:00:00 2001
From: lizanle <491823689@qq.com>
Date: Wed, 16 Dec 2015 17:26:19 +0800
Subject: [PATCH 042/120] =?UTF-8?q?=E5=B8=96=E5=AD=90=E6=8C=89=E6=97=B6?=
=?UTF-8?q?=E9=97=B4=E5=80=92=E6=8E=92?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/forums_controller.rb | 4 +--
app/views/forums/show.html.erb | 6 ++--
db/schema.rb | 43 ++++++++++++++++------------
3 files changed, 31 insertions(+), 22 deletions(-)
diff --git a/app/controllers/forums_controller.rb b/app/controllers/forums_controller.rb
index efbb4ffab..3332f1207 100644
--- a/app/controllers/forums_controller.rb
+++ b/app/controllers/forums_controller.rb
@@ -147,8 +147,8 @@ class ForumsController < ApplicationController
order = "#{Memo.table_name}.updated_at #{params[:reorder_time]}"
@order_str = "reorder_time="+params[:reorder_time]
else
- order = "last_replies_memos.created_at desc, #{Memo.table_name}.created_at desc"
- @order_str = "reorder_complex=desc"
+ order = "#{Memo.table_name}.updated_at desc"
+ @order_str = "reorder_time=desc"
end
@memo = Memo.new(:forum => @forum)
@topic_count = @forum.topics.count
diff --git a/app/views/forums/show.html.erb b/app/views/forums/show.html.erb
index 2a7a02e57..b0ed5a60c 100644
--- a/app/views/forums/show.html.erb
+++ b/app/views/forums/show.html.erb
@@ -30,9 +30,11 @@
<% end %>
diff --git a/db/schema.rb b/db/schema.rb
index 17e613acb..bcc6b2c80 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -544,26 +544,23 @@ ActiveRecord::Schema.define(:version => 20151209085942) do
add_index "documents", ["created_on"], :name => "index_documents_on_created_on"
add_index "documents", ["project_id"], :name => "documents_project_id"
- create_table "dts", :primary_key => "Num", :force => true do |t|
- t.string "Defect", :limit => 50
- t.string "Category", :limit => 50
- t.string "File"
- t.string "Method"
- t.string "Module", :limit => 20
- t.string "Variable", :limit => 50
- t.integer "StartLine"
- t.integer "IPLine"
- t.string "IPLineCode", :limit => 200
- t.string "Judge", :limit => 15
- t.integer "Review", :limit => 1
+ create_table "dts", :force => true do |t|
+ t.string "IPLineCode"
t.string "Description"
- t.text "PreConditions", :limit => 2147483647
- t.text "TraceInfo", :limit => 2147483647
- t.text "Code", :limit => 2147483647
+ t.string "Num"
+ t.string "Variable"
+ t.string "TraceInfo"
+ t.string "Method"
+ t.string "File"
+ t.string "IPLine"
+ t.string "Review"
+ t.string "Category"
+ t.string "Defect"
+ t.string "PreConditions"
+ t.string "StartLine"
t.integer "project_id"
- t.datetime "created_at"
- t.datetime "updated_at"
- t.integer "id", :null => false
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
end
create_table "editor_of_documents", :force => true do |t|
@@ -912,6 +909,16 @@ ActiveRecord::Schema.define(:version => 20151209085942) do
add_index "journal_details", ["journal_id"], :name => "journal_details_journal_id"
+ create_table "journal_details_copy", :force => true do |t|
+ t.integer "journal_id", :default => 0, :null => false
+ t.string "property", :limit => 30, :default => "", :null => false
+ t.string "prop_key", :limit => 30, :default => "", :null => false
+ t.text "old_value"
+ t.text "value"
+ end
+
+ add_index "journal_details_copy", ["journal_id"], :name => "journal_details_journal_id"
+
create_table "journal_replies", :id => false, :force => true do |t|
t.integer "journal_id"
t.integer "user_id"
From a8c8dc3cc6a913967f0b2dc29997afc08430b89a Mon Sep 17 00:00:00 2001
From: cxt
Date: Wed, 16 Dec 2015 17:38:28 +0800
Subject: [PATCH 043/120] =?UTF-8?q?=E5=85=B3=E8=81=94=E9=A1=B9=E7=9B=AE?=
=?UTF-8?q?=E7=9A=84=E6=8F=90=E7=A4=BA=E4=BF=A1=E6=81=AF=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../student_work/_relate_project.html.erb | 2 +-
app/views/users/_course_homework.html.erb | 24 +++++++++++------
.../users/_user_homework_detail.html.erb | 26 ++++++++++++++-----
3 files changed, 36 insertions(+), 16 deletions(-)
diff --git a/app/views/student_work/_relate_project.html.erb b/app/views/student_work/_relate_project.html.erb
index 43f59c9c9..9a1fcead5 100644
--- a/app/views/student_work/_relate_project.html.erb
+++ b/app/views/student_work/_relate_project.html.erb
@@ -4,7 +4,7 @@
<%=form_tag url_for(:controller=>'student_work',:action=>'student_work_project',:homework=>@homework.id,:user_activity_id=>@user_activity_id,:is_in_course=>@is_in_course,:course_activity =>@course_activity),:id =>'student_work_relate_project',:class=>'resourcesSearchBox',:remote => true do %>
- 您当前尚未参与任何项目,请先加入项目再关联。
+ 您当前尚未创建任何项目,请先创建项目再关联。
diff --git a/app/views/users/_course_homework.html.erb b/app/views/users/_course_homework.html.erb
index fe02d9882..8112bc521 100644
--- a/app/views/users/_course_homework.html.erb
+++ b/app/views/users/_course_homework.html.erb
@@ -13,7 +13,7 @@
<% end %> TO
<%= link_to activity.course.name.to_s+" | 课程作业", homework_common_index_path(:course => activity.course.id, :host=> Setting.host_course), :class => "newsBlue ml15"%>
-
+
<%= link_to activity.name.to_s, student_work_index_path(:homework => activity.id,:host=> Setting.host_course), :class => "postGrey"%>
<% if activity.homework_detail_manual%>
@@ -56,7 +56,7 @@
<% works = cur_user_works_for_homework activity %>
<% if works.nil? && projects.nil? %>
- <%=link_to "关联项目",new_student_work_project_student_work_index_path(:homework => activity.id,:is_in_course=>-1,:user_activity_id=>user_activity_id,:course_activity=>course_activity),remote: true,:class=> 'c_blue', :title=> '请选择分组作业关联的项目' %>
+ <%=link_to "关联项目",new_student_work_project_student_work_index_path(:homework => activity.id,:is_in_course=>-1,:user_activity_id=>user_activity_id,:course_activity=>course_activity),remote: true,:class=> 'c_blue', :title=> '请各组长关联作业项目' %>
<%#= relate_project(activity,is_teacher,-1,user_activity_id,course_activity) %>
<% elsif works.nil? %>
@@ -81,7 +81,6 @@
<%= activity.language_name%>
<% end %>
-
截止时间:<%= activity.end_time.to_s %> 23:59
@@ -93,17 +92,26 @@
+
+
+ 匿评开启时间:<%= activity.homework_detail_manual.evaluation_start%> 00:00
+
+
+ 匿评关闭时间:<%= activity.homework_detail_manual.evaluation_end%> 23:59
+
+
+
<%= render :partial => 'student_work/work_attachments', :locals => {:attachments => activity.attachments} %>
- <% if activity.homework_type == 3 && !activity.student_work_projects.empty? && activity.homework_detail_group.base_on_project == 1 %>
+ <% if activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 1 %>
+ <% projects = activity.student_work_projects.where("is_leader = 1") %>
-
- 已关联项目:
+ 已关联项目:<%='各小组尚未将小组项目关联到本次作业。' if projects.empty? %>
- <% activity.student_work_projects.where("is_leader = 1").each do |pro| %>
+ <% projects.each do |pro| %>
<% project = Project.find pro.project_id %>