From 157502d45086dc831b4a6f84711f06fac52fa7b2 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 15 Jan 2016 10:35:56 +0800 Subject: [PATCH 01/52] =?UTF-8?q?=E7=B2=BE=E5=93=81=E8=AF=BE=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/base_courses.html.erb | 40 +++++++++++++++++++ ...160115021923_add_is_excellent_to_course.rb | 5 +++ .../20160115022341_add_excellent_course.rb | 7 ++++ public/stylesheets/courses.css | 2 + public/stylesheets/public.css | 1 + 5 files changed, 55 insertions(+) create mode 100644 db/migrate/20160115021923_add_is_excellent_to_course.rb create mode 100644 db/migrate/20160115022341_add_excellent_course.rb diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb index cb5c2502f..862424786 100644 --- a/app/views/layouts/base_courses.html.erb +++ b/app/views/layouts/base_courses.html.erb @@ -204,6 +204,46 @@
+ +
diff --git a/db/migrate/20160115021923_add_is_excellent_to_course.rb b/db/migrate/20160115021923_add_is_excellent_to_course.rb new file mode 100644 index 000000000..39bbf2dd5 --- /dev/null +++ b/db/migrate/20160115021923_add_is_excellent_to_course.rb @@ -0,0 +1,5 @@ +class AddIsExcellentToCourse < ActiveRecord::Migration + def change + add_column :courses, :is_excellent, :integer, :default => false + end +end diff --git a/db/migrate/20160115022341_add_excellent_course.rb b/db/migrate/20160115022341_add_excellent_course.rb new file mode 100644 index 000000000..6d743d0c3 --- /dev/null +++ b/db/migrate/20160115022341_add_excellent_course.rb @@ -0,0 +1,7 @@ +class AddExcellentCourse < ActiveRecord::Migration + def up + end + + def down + end +end diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index 16ef3c5df..985fd5c97 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -1257,3 +1257,5 @@ div.disable_link {background-color: #c1c1c1 !important;} .fn {font-weight:normal} .boutiqueP {position:absolute; left:0px; top:0px;} +/*160114课程推荐*/ +.courseR {width:220px; padding:10px; background-color:#ffffff; margin-top:10px;} diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index 87097a052..08625c6ef 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -216,6 +216,7 @@ a.c_green{ color:#28be6c;} .fontGrey {color:#cecece;} .fontGrey2 {color:#888888;} .fontGrey3 {color:#484848;} +.fontGrey4{color:#999999;} .fontBlue {color:#3498db;} a.underline {text-decoration:underline;} a.fontBlue {color:#297fb8;} From f52b0c1cc69c30820d90567f73cae64f6651db21 Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 18 Jan 2016 10:16:29 +0800 Subject: [PATCH 02/52] =?UTF-8?q?=E6=A0=87=E8=AE=B0=E7=B2=BE=E5=93=81?= =?UTF-8?q?=E8=AF=BE=E7=A8=8B=EF=BC=8C=E7=B2=BE=E5=93=81=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E6=8E=A8=E8=8D=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/application_helper.rb | 5 +++ app/views/courses/_recommendation.html.erb | 41 ++++++++++++++++++++++ app/views/layouts/_project_info.html.erb | 4 +-- app/views/layouts/base_courses.html.erb | 40 +-------------------- config/locales/zh.yml | 4 ++- db/schema.rb | 3 +- 6 files changed, 54 insertions(+), 43 deletions(-) create mode 100644 app/views/courses/_recommendation.html.erb diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 07f7a0ed8..336c6937b 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -49,6 +49,11 @@ module ApplicationHelper end end + # 判断课程是否为精品课程 + def is_excellent_course course + course.is_excellent? ? true : false + end + # 获取项目/课程总分 # 发布缺陷 4分 回复缺陷 1分 提交一次 4分 讨论帖子 2分 回复帖子 1分 发布新闻 1分 def static_project_score obj diff --git a/app/views/courses/_recommendation.html.erb b/app/views/courses/_recommendation.html.erb new file mode 100644 index 000000000..8e14e1130 --- /dev/null +++ b/app/views/courses/_recommendation.html.erb @@ -0,0 +1,41 @@ + \ No newline at end of file diff --git a/app/views/layouts/_project_info.html.erb b/app/views/layouts/_project_info.html.erb index 60fc6f96d..9a9d34e54 100644 --- a/app/views/layouts/_project_info.html.erb +++ b/app/views/layouts/_project_info.html.erb @@ -3,14 +3,14 @@ <% student_num = studentCount(@course) %> <% course_file_num = visable_attachemnts_incourse(@course).count%>
<%= @course.is_public == 0 ? "私有课程" : "公开课程" %> - <% if @course.id == 370 %> + <% if is_excellent_course(@course) %> 精品课程 <% end %>
diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb index b57e9ac54..9d61a6fbb 100644 --- a/app/views/layouts/base_courses.html.erb +++ b/app/views/layouts/base_courses.html.erb @@ -205,45 +205,7 @@
- + <%= render :partial => 'courses/recommendation', :locals => {:course => @course} %>
diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 34a526734..d5b249e8d 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -2106,4 +2106,6 @@ zh: label_org_name: 组织名称: label_blank_user_lists_for_org: 用户不能为空 - + # 课程推荐 + label_homework_commont: 作业 + label_homework_recommendation: 课程推荐 \ No newline at end of file diff --git a/db/schema.rb b/db/schema.rb index bac1882c5..601b09561 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 => 20160115125217) do +ActiveRecord::Schema.define(:version => 20160118014219) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -499,6 +499,7 @@ ActiveRecord::Schema.define(:version => 20160115125217) do t.integer "is_delete", :default => 0 t.integer "end_time" t.string "end_term" + t.integer "is_excellent", :default => 0 end create_table "custom_fields", :force => true do |t| From ef0a2a54c5ccf85249fea2a08d46017e69f691bd Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 18 Jan 2016 15:48:26 +0800 Subject: [PATCH 03/52] =?UTF-8?q?=E7=B2=BE=E5=93=81=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E6=8E=A8=E8=8D=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/application_helper.rb | 5 ++ app/helpers/courses_helper.rb | 26 ++++++++ app/models/course.rb | 25 +++++--- app/views/courses/_recommendation.html.erb | 59 ++++++------------- .../20160118014219_define_excellent_course.rb | 17 ++++++ 5 files changed, 84 insertions(+), 48 deletions(-) create mode 100644 db/migrate/20160118014219_define_excellent_course.rb diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 336c6937b..66f60d020 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -54,6 +54,11 @@ module ApplicationHelper course.is_excellent? ? true : false end + # 判断课程对成员是否可见 + def visible_course?(course) + (course.is_delete? or (!course.is_public? && !User.current.member_of_course?(course))) ? false : true + end + # 获取项目/课程总分 # 发布缺陷 4分 回复缺陷 1分 提交一次 4分 讨论帖子 2分 回复帖子 1分 发布新闻 1分 def static_project_score obj diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index 097a3c1a4..780d73de2 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -11,6 +11,32 @@ module CoursesHelper #StudentRoles = [5, 10] #AllPeople = StudentRoles+TeacherRoles ## return people count + + # 推荐的精品课程 + def excellent_course_recommend course + q = "%#{course.name.strip}%" + result = find_excelletn_course(q, course) + end + + # 查询符合条件的精品课程 + def find_excelletn_course keywords, course + # 用新课程名去匹配精品课程中按课程名和Tag名 + if !course.is_public? && !User.current.member_of_course?(course) + sql = "SELECT distinct c.* FROM `courses` c, tags t, taggings ts where t.id = ts.tag_id and ts.taggable_id = c.id and c.is_excellent = 1 and is_delete = 0 and + ts.taggable_type = 'Course' and (t.name like '%#{keywords}%'or c.name like '%#{keywords}%')" + resultSetTag = Course.find_by_sql(sql) + else + sql = "SELECT distinct c.* FROM `courses` c, tags t, taggings ts where t.id = ts.tag_id and ts.taggable_id = c.id and c.is_excellent = 1 and is_delete = 0 and + ts.taggable_type = 'Course' and (t.name like '%#{keywords}%'or c.name like '%#{keywords}%') ORDER BY c.updated_at desc limit 0,5;" + resultSetTag = Course.visible.find_by_sql(sql) + end + + end + + # 判断精品课程是否可见,非课程成员无法查看私有课程 + def visible_excellent_course obj + # if course.is_pu + end # 返回x项目成员数量,即roles表中定义的所有成员 def projectCount project diff --git a/app/models/course.rb b/app/models/course.rb index 24e955d15..13e6be0ae 100644 --- a/app/models/course.rb +++ b/app/models/course.rb @@ -72,7 +72,7 @@ class Course < ActiveRecord::Base before_save :self_validate # 公开课程变成私有课程,所有资源都变成私有 after_update :update_files_public,:update_course_ealasticsearch_index,:update_activity - after_create :create_board_sync, :act_as_course_activity, :act_as_course_message,:create_course_ealasticsearch_index + after_create :create_board_sync, :act_as_course_activity, :act_as_course_message,:create_course_ealasticsearch_index, :add_course_ead before_destroy :delete_all_members,:delete_course_ealasticsearch_index safe_attributes 'extra', @@ -384,6 +384,12 @@ class Course < ActiveRecord::Base def act_as_course_message self.course_messages << CourseMessage.new(:user_id => self.tea_id, :course_id => self.id, :viewed => false) end + + # 发布新课导语 + def add_course_ead + + end + #项目与课程分离后,很多课程的名称等信息为空,这些数据信息存储在项目表中!!就是数据兼容的问题 #def name # read_attribute('name') || Project.find_by_identifier(self.extra).try(:name) @@ -405,6 +411,7 @@ class Course < ActiveRecord::Base self.__elasticsearch__.index_document end end + def update_course_ealasticsearch_index if self.is_public == 1 and self.is_delete == 0 #如果是初次更新成为公开或者恢复被删除的情况,会报错,那么这条记录尚未被索引过。没有报错就是更新的其他属性 begin @@ -428,13 +435,17 @@ class Course < ActiveRecord::Base end end + + #动态的更新 + def update_activity + update_course_activity(self.class, self.id) + update_user_activity(self.class, self.id) + update_org_activity(self.class, self.id) + end + end -#动态的更新 -def update_activity - update_course_activity(self.class, self.id) - update_user_activity(self.class, self.id) - update_org_activity(self.class, self.id) -end + + # Delete the previous articles index in Elasticsearch # Course.__elasticsearch__.client.indices.delete index: Course.index_name rescue nil diff --git a/app/views/courses/_recommendation.html.erb b/app/views/courses/_recommendation.html.erb index 8e14e1130..c7e459c95 100644 --- a/app/views/courses/_recommendation.html.erb +++ b/app/views/courses/_recommendation.html.erb @@ -1,41 +1,18 @@ - \ No newline at end of file +<% unless excellent_course_recommend(course).count == 0 %> +
    +

    <%= l(:label_homework_recommendation) %>

    + <% excellent_course_recommend(course).each do |c_course| %> +
  • <%= image_tag(url_to_avatar(c_course), :width => "40", :height => "40", :class => "fl mr10 rankPortrait", :alt => "logo") %> +
    +

    +

    + <%= l(:project_module_attachments) %>(<%= link_to c_course.attachments.count, course_files_path(c_course), :class => "linkBlue2" %>) + <%= l(:label_homework_commont) %>(<%= link_to c_course.homework_commons.count, homework_common_index_path(c_course), :class => "linkBlue2" %>)

    +
    +
    +
  • + <% end %> +
    +
+<% end %> + diff --git a/db/migrate/20160118014219_define_excellent_course.rb b/db/migrate/20160118014219_define_excellent_course.rb new file mode 100644 index 000000000..911c14a3e --- /dev/null +++ b/db/migrate/20160118014219_define_excellent_course.rb @@ -0,0 +1,17 @@ +class DefineExcellentCourse < ActiveRecord::Migration + def up + arr = [302,192,370,394,183,361,117,218,379,178,418,203,342,403,225] + for i in 0..arr.length-1 + begin + puts arr[i] + course = Course.find(arr[i]) + course.update_attribute(:is_excellent, true) + rescue + logger.error("Course is not found!") + end + end + end + + def down + end +end \ No newline at end of file From b93b86b9a0c926c4d617de688cfe9b486ee26765 Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 18 Jan 2016 17:16:33 +0800 Subject: [PATCH 04/52] =?UTF-8?q?=E5=88=9B=E5=BB=BA=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E5=8F=91=E9=80=81board?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 2 +- app/models/course.rb | 5 ++++- app/views/users/_course_message.html.erb | 8 ++++++++ db/migrate/20160118083751_add_status_to_message.rb | 5 +++++ db/schema.rb | 3 ++- 5 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 db/migrate/20160118083751_add_status_to_message.rb diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 279975c77..43a49c7d9 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -509,7 +509,7 @@ class CoursesController < ApplicationController if @course respond_to do |format| flash[:notice] = l(:notice_successful_create) - format.html {redirect_to settings_course_url(@course, :course_type => 1)} + format.html {redirect_to course_url(@course)} format.api { render :action => 'show', :status => :created, :location => url_for(:controller => 'courses', :action => 'show', :id => @course.id) } end else diff --git a/app/models/course.rb b/app/models/course.rb index 13e6be0ae..433a5801e 100644 --- a/app/models/course.rb +++ b/app/models/course.rb @@ -387,7 +387,10 @@ class Course < ActiveRecord::Base # 发布新课导语 def add_course_ead - + name = Redmine::Configuration['course_message_lead_subject'] + content = Redmine::Configuration['course_message_lead_content'] + # message的status状态为0为正常,为1表示创建课程时发送的message + Message.create(:subject => name, :content => content, :board_id => self.boards.first.id, :author_id => self.tea_id , :sticky => true, :status => true ) end #项目与课程分离后,很多课程的名称等信息为空,这些数据信息存储在项目表中!!就是数据兼容的问题 diff --git a/app/views/users/_course_message.html.erb b/app/views/users/_course_message.html.erb index d8268d698..7d732bc8e 100644 --- a/app/views/users/_course_message.html.erb +++ b/app/views/users/_course_message.html.erb @@ -43,6 +43,14 @@ <%= activity.parent.content.to_s.html_safe%> <% end %>
+ <% if activity.status == 1 %> + <%= activity.created_on.year %> + + <%= activity.created_on.month %> + + <%= activity.created_on.day %> + + <% end %>
diff --git a/db/migrate/20160118083751_add_status_to_message.rb b/db/migrate/20160118083751_add_status_to_message.rb new file mode 100644 index 000000000..46d63de3a --- /dev/null +++ b/db/migrate/20160118083751_add_status_to_message.rb @@ -0,0 +1,5 @@ +class AddStatusToMessage < ActiveRecord::Migration + def change + add_column :messages, :status, :integer, :default => false + end +end diff --git a/db/schema.rb b/db/schema.rb index 601b09561..1cad3bd21 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 => 20160118014219) do +ActiveRecord::Schema.define(:version => 20160118083751) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -1073,6 +1073,7 @@ ActiveRecord::Schema.define(:version => 20160118014219) do t.integer "sticky", :default => 0 t.integer "reply_id" t.integer "quotes" + t.integer "status", :default => 0 end add_index "messages", ["author_id"], :name => "index_messages_on_author_id" From 5862c16c680d503e41d6e04d431d3f70a1e95f84 Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 18 Jan 2016 17:36:18 +0800 Subject: [PATCH 05/52] =?UTF-8?q?=E5=AE=8C=E6=88=90=E7=B2=BE=E5=93=81?= =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E6=8E=A8=E8=8D=90=20=E8=BF=87=E6=BB=A4?= =?UTF-8?q?=E6=8E=89=E7=A7=81=E6=9C=89=E8=AF=BE=E7=A8=8B=20=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E6=8E=89=E5=B7=B2=E5=88=A0=E9=99=A4=E7=9A=84=E8=AF=BE?= =?UTF-8?q?=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/courses_helper.rb | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index 780d73de2..712f2d075 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -21,16 +21,10 @@ module CoursesHelper # 查询符合条件的精品课程 def find_excelletn_course keywords, course # 用新课程名去匹配精品课程中按课程名和Tag名 - if !course.is_public? && !User.current.member_of_course?(course) - sql = "SELECT distinct c.* FROM `courses` c, tags t, taggings ts where t.id = ts.tag_id and ts.taggable_id = c.id and c.is_excellent = 1 and is_delete = 0 and + sql = "SELECT distinct c.* FROM `courses` c, tags t, taggings ts where t.id = ts.tag_id and ts.taggable_id = c.id and c.is_excellent = 1 and is_delete = 0 and ts.taggable_type = 'Course' and (t.name like '%#{keywords}%'or c.name like '%#{keywords}%')" - resultSetTag = Course.find_by_sql(sql) - else - sql = "SELECT distinct c.* FROM `courses` c, tags t, taggings ts where t.id = ts.tag_id and ts.taggable_id = c.id and c.is_excellent = 1 and is_delete = 0 and - ts.taggable_type = 'Course' and (t.name like '%#{keywords}%'or c.name like '%#{keywords}%') ORDER BY c.updated_at desc limit 0,5;" - resultSetTag = Course.visible.find_by_sql(sql) - end - + resultSetTag = Course.find_by_sql(sql).select{|e_course| e_course.is_public ==1 unless User.current.member_of_course?(e_course)}.first(3) + resultSetTag end # 判断精品课程是否可见,非课程成员无法查看私有课程 From 610b54b27c632627d7f50a1f54069ad72aaf5ae4 Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 19 Jan 2016 10:29:57 +0800 Subject: [PATCH 06/52] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=AF=BC=E8=AF=AD?= =?UTF-8?q?=E6=94=BE=E7=BD=AE=E8=AF=BE=E7=A8=8B=E5=8A=A8=E6=80=81=E4=B9=8B?= =?UTF-8?q?=E5=90=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/course.rb | 10 +--------- app/models/course_activity.rb | 13 +++++++++++++ 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/app/models/course.rb b/app/models/course.rb index 433a5801e..480c00480 100644 --- a/app/models/course.rb +++ b/app/models/course.rb @@ -72,7 +72,7 @@ class Course < ActiveRecord::Base before_save :self_validate # 公开课程变成私有课程,所有资源都变成私有 after_update :update_files_public,:update_course_ealasticsearch_index,:update_activity - after_create :create_board_sync, :act_as_course_activity, :act_as_course_message,:create_course_ealasticsearch_index, :add_course_ead + after_create :create_board_sync, :act_as_course_activity, :act_as_course_message,:create_course_ealasticsearch_index before_destroy :delete_all_members,:delete_course_ealasticsearch_index safe_attributes 'extra', @@ -385,14 +385,6 @@ class Course < ActiveRecord::Base self.course_messages << CourseMessage.new(:user_id => self.tea_id, :course_id => self.id, :viewed => false) end - # 发布新课导语 - def add_course_ead - name = Redmine::Configuration['course_message_lead_subject'] - content = Redmine::Configuration['course_message_lead_content'] - # message的status状态为0为正常,为1表示创建课程时发送的message - Message.create(:subject => name, :content => content, :board_id => self.boards.first.id, :author_id => self.tea_id , :sticky => true, :status => true ) - end - #项目与课程分离后,很多课程的名称等信息为空,这些数据信息存储在项目表中!!就是数据兼容的问题 #def name # read_attribute('name') || Project.find_by_identifier(self.extra).try(:name) diff --git a/app/models/course_activity.rb b/app/models/course_activity.rb index e1f9ab9f5..88351acfd 100644 --- a/app/models/course_activity.rb +++ b/app/models/course_activity.rb @@ -6,6 +6,7 @@ class CourseActivity < ActiveRecord::Base belongs_to :user has_many :user_acts, :class_name => 'UserAcivity',:as =>:act after_save :add_user_activity, :add_course_activity + after_create :add_course_lead before_destroy :destroy_user_activity, :destroy_org_activity #在个人动态里面增加当前动态 @@ -60,4 +61,16 @@ class CourseActivity < ActiveRecord::Base org_activity = OrgActivity.where("org_act_type = '#{self.course_act_type.to_s}' and org_act_id = '#{self.course_act_id}'") org_activity.destroy_all end + + # 发布新课导语 + # 导语要放置在课程创建信息之后 + # 导语 + def add_course_lead + if self.course_act_type == "Course" + name = Redmine::Configuration['course_message_lead_subject'] + content = Redmine::Configuration['course_message_lead_content'] + # message的status状态为0为正常,为1表示创建课程时发送的message + Message.create(:subject => name, :content => content, :board_id => self.course.boards.first.id, :author_id => self.course.tea_id , :sticky => true, :status => true ) + end + end end From 18c3c23d2c3d8ca3e94022db1147dbb0057ed675 Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 20 Jan 2016 15:43:33 +0800 Subject: [PATCH 07/52] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E6=8E=A8=E8=8D=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/courses_helper.rb | 37 ++++++++++++++++------ app/models/course.rb | 30 +++++++++++++++++- app/views/courses/_recommendation.html.erb | 10 +++--- public/stylesheets/public.css | 1 + 4 files changed, 63 insertions(+), 15 deletions(-) diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index 712f2d075..6d16dbb4a 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -12,19 +12,38 @@ module CoursesHelper #AllPeople = StudentRoles+TeacherRoles ## return people count + # 推荐的精品课程 - def excellent_course_recommend course - q = "%#{course.name.strip}%" - result = find_excelletn_course(q, course) + def excellent_course_recommend new_course + q = "%#{new_course.name.strip}%" + result = find_excelletn_course(q, new_course) end # 查询符合条件的精品课程 - def find_excelletn_course keywords, course - # 用新课程名去匹配精品课程中按课程名和Tag名 - sql = "SELECT distinct c.* FROM `courses` c, tags t, taggings ts where t.id = ts.tag_id and ts.taggable_id = c.id and c.is_excellent = 1 and is_delete = 0 and - ts.taggable_type = 'Course' and (t.name like '%#{keywords}%'or c.name like '%#{keywords}%')" - resultSetTag = Course.find_by_sql(sql).select{|e_course| e_course.is_public ==1 unless User.current.member_of_course?(e_course)}.first(3) - resultSetTag + # 用新课程名去匹配精品课程中按课程名和Tag名 + def find_excelletn_course keywords, current_course + # 获取tag匹配结果ID + a_tags = [] + # kc = keywords.to_a + Course.visible.where("is_excellent =?", 2).each do |ec| + if ec.tags.any?{|value| current_course.name.include?(value.to_s)} + #if ec.tags.find_all{|ect| kc.include? ect}.length != 0 + a_tags << ec.id + end + end + # sql = "SELECT distinct c.* FROM `courses` c, tags t, taggings ts where t.id = ts.tag_id and ts.taggable_id = c.id and c.is_excellent = 1 and is_delete = 0 and + # ts.taggable_type = 'Course' and t.name like '%#{keywords}%'" + # a_tags = Course.find_by_sql(sql).select{|course| course.is_public ==1 unless User.current.member_of_course?(course)} + # 通过elastic结果获取精品课程 + a_courses = [] + courses = Course.search(keywords) + courses.each do |c| + a_courses << c.id unless current_course.id != c.id + end + a_courses << a_tags unless a_tags.length == 0 + # 过滤条件:精品课程、本身不在搜索范围 + e_courses = Course.where("is_excellent =? and id in (?)",1,a_courses.uniq).where("id !=?",current_course.id) + e_courses end # 判断精品课程是否可见,非课程成员无法查看私有课程 diff --git a/app/models/course.rb b/app/models/course.rb index 480c00480..e715e9198 100644 --- a/app/models/course.rb +++ b/app/models/course.rb @@ -72,7 +72,7 @@ class Course < ActiveRecord::Base before_save :self_validate # 公开课程变成私有课程,所有资源都变成私有 after_update :update_files_public,:update_course_ealasticsearch_index,:update_activity - after_create :create_board_sync, :act_as_course_activity, :act_as_course_message,:create_course_ealasticsearch_index + after_create :create_board_sync, :act_as_course_activity, :act_as_course_message,:create_course_ealasticsearch_index, :add_course_ead before_destroy :delete_all_members,:delete_course_ealasticsearch_index safe_attributes 'extra', @@ -145,6 +145,26 @@ class Course < ActiveRecord::Base ) end + def self.e_search(query) + __elasticsearch__.search( + { + query: { + multi_match: { + query: query, + type:"most_fields", + operator: "or", + fields: ['name', 'description^0.5'] + } + }, + sort: { + _score:{order: "desc" }, + updated_at:{order:"desc"} + + } + } + ) + end + def visible?(user=User.current) user.allowed_to?(:view_course, self) end @@ -385,6 +405,14 @@ class Course < ActiveRecord::Base self.course_messages << CourseMessage.new(:user_id => self.tea_id, :course_id => self.id, :viewed => false) end + # 发布新课导语 + def add_course_ead + name = Redmine::Configuration['course_message_lead_subject'] + content = Redmine::Configuration['course_message_lead_content'] + # message的status状态为0为正常,为1表示创建课程时发送的message + Message.create(:subject => name, :content => content, :board_id => self.boards.first.id, :author_id => self.tea_id , :sticky => true, :status => true ) + end + #项目与课程分离后,很多课程的名称等信息为空,这些数据信息存储在项目表中!!就是数据兼容的问题 #def name # read_attribute('name') || Project.find_by_identifier(self.extra).try(:name) diff --git a/app/views/courses/_recommendation.html.erb b/app/views/courses/_recommendation.html.erb index c7e459c95..bd44afad2 100644 --- a/app/views/courses/_recommendation.html.erb +++ b/app/views/courses/_recommendation.html.erb @@ -1,13 +1,13 @@ <% unless excellent_course_recommend(course).count == 0 %>

    <%= l(:label_homework_recommendation) %>

    - <% excellent_course_recommend(course).each do |c_course| %> -
  • <%= image_tag(url_to_avatar(c_course), :width => "40", :height => "40", :class => "fl mr10 rankPortrait", :alt => "logo") %> + <% excellent_course_recommend(course).each do |e_course| %> +
  • <%= image_tag(url_to_avatar(e_course), :width => "40", :height => "40", :class => "fl mr10 rankPortrait", :alt => "logo") %>
    -

    +

    <%=link_to e_course.name, course_path(e_course.id), :class => "hidden fl w170" %>

    - <%= l(:project_module_attachments) %>(<%= link_to c_course.attachments.count, course_files_path(c_course), :class => "linkBlue2" %>) - <%= l(:label_homework_commont) %>(<%= link_to c_course.homework_commons.count, homework_common_index_path(c_course), :class => "linkBlue2" %>)

    + <%= l(:project_module_attachments) %>(<%= link_to e_course.attachments.count, course_files_path(e_course), :class => "linkBlue2" %>) + <%= l(:label_homework_commont) %>(<%= link_to e_course.homework_commons.count, homework_common_index_path(e_course), :class => "linkBlue2" %>)

  • diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index 08625c6ef..42e18a7cf 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -141,6 +141,7 @@ h4{ font-size:14px; color:#3b3b3b;} .w100{width: 100px;} .w210{ width:210px;} .w150{ width:150px;} +.w170{width:170px;} .w230{width:230px !important;} .w235{ width:235px !important;} .w280{ width:280px;} From c5d935108e7280959d82ff0ebb98df661821d278 Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 20 Jan 2016 15:59:30 +0800 Subject: [PATCH 08/52] =?UTF-8?q?=E5=AE=8C=E6=88=90=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E6=8C=89tag=E6=90=9C=E7=B4=A2=E6=8E=A8=E8=8D=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/courses_helper.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index 6d16dbb4a..13d8e99b6 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -25,9 +25,8 @@ module CoursesHelper # 获取tag匹配结果ID a_tags = [] # kc = keywords.to_a - Course.visible.where("is_excellent =?", 2).each do |ec| + Course.visible.where("is_excellent =?", 1).each do |ec| if ec.tags.any?{|value| current_course.name.include?(value.to_s)} - #if ec.tags.find_all{|ect| kc.include? ect}.length != 0 a_tags << ec.id end end @@ -42,7 +41,7 @@ module CoursesHelper end a_courses << a_tags unless a_tags.length == 0 # 过滤条件:精品课程、本身不在搜索范围 - e_courses = Course.where("is_excellent =? and id in (?)",1,a_courses.uniq).where("id !=?",current_course.id) + e_courses = Course.where("is_excellent =? and id in (?)",1,a_courses.flatten.uniq).where("id !=?",current_course.id) e_courses end From 0db69e1ebfc991a88f3785bf2b19f1a885660d17 Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 20 Jan 2016 16:32:47 +0800 Subject: [PATCH 09/52] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E5=AF=BC=E8=AF=AD=E6=97=B6=E9=97=B4=E5=92=8C=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E5=8A=A8=E6=80=81=E6=97=B6=E9=97=B4=E4=B8=80?= =?UTF-8?q?=E8=87=B4=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/courses_helper.rb | 2 +- app/models/course.rb | 10 +--------- app/models/course_activity.rb | 4 +++- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index 13d8e99b6..7b7bcbcf4 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -37,7 +37,7 @@ module CoursesHelper a_courses = [] courses = Course.search(keywords) courses.each do |c| - a_courses << c.id unless current_course.id != c.id + a_courses << c.id end a_courses << a_tags unless a_tags.length == 0 # 过滤条件:精品课程、本身不在搜索范围 diff --git a/app/models/course.rb b/app/models/course.rb index e715e9198..0d663b19a 100644 --- a/app/models/course.rb +++ b/app/models/course.rb @@ -72,7 +72,7 @@ class Course < ActiveRecord::Base before_save :self_validate # 公开课程变成私有课程,所有资源都变成私有 after_update :update_files_public,:update_course_ealasticsearch_index,:update_activity - after_create :create_board_sync, :act_as_course_activity, :act_as_course_message,:create_course_ealasticsearch_index, :add_course_ead + after_create :create_board_sync, :act_as_course_activity, :act_as_course_message,:create_course_ealasticsearch_index before_destroy :delete_all_members,:delete_course_ealasticsearch_index safe_attributes 'extra', @@ -405,14 +405,6 @@ class Course < ActiveRecord::Base self.course_messages << CourseMessage.new(:user_id => self.tea_id, :course_id => self.id, :viewed => false) end - # 发布新课导语 - def add_course_ead - name = Redmine::Configuration['course_message_lead_subject'] - content = Redmine::Configuration['course_message_lead_content'] - # message的status状态为0为正常,为1表示创建课程时发送的message - Message.create(:subject => name, :content => content, :board_id => self.boards.first.id, :author_id => self.tea_id , :sticky => true, :status => true ) - end - #项目与课程分离后,很多课程的名称等信息为空,这些数据信息存储在项目表中!!就是数据兼容的问题 #def name # read_attribute('name') || Project.find_by_identifier(self.extra).try(:name) diff --git a/app/models/course_activity.rb b/app/models/course_activity.rb index 88351acfd..194e1183a 100644 --- a/app/models/course_activity.rb +++ b/app/models/course_activity.rb @@ -70,7 +70,9 @@ class CourseActivity < ActiveRecord::Base name = Redmine::Configuration['course_message_lead_subject'] content = Redmine::Configuration['course_message_lead_content'] # message的status状态为0为正常,为1表示创建课程时发送的message - Message.create(:subject => name, :content => content, :board_id => self.course.boards.first.id, :author_id => self.course.tea_id , :sticky => true, :status => true ) + message = Message.create(:subject => name, :content => content, :board_id => self.course.boards.first.id, :author_id => self.course.tea_id , :sticky => true, :status => true ) + # 更新的目的是为了排序,因为该条动态的时间可能与课程创建的动态创建时间一直 + message.course_acts.first.update_attribute(:updated_at, message.course_acts.first.updated_at + 1) end end end From f3b5f4e5f762b6c52bf698c2b12b33cbd546f0a6 Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 20 Jan 2016 16:58:41 +0800 Subject: [PATCH 10/52] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B5=8F=E8=A7=88?= =?UTF-8?q?=E5=99=A8tab=E9=A1=B5=E9=80=9A=E8=BF=87=E4=B8=8D=E5=90=8C?= =?UTF-8?q?=E7=9A=84=E6=A8=A1=E5=9D=97=E5=B1=95=E7=A4=BA=E4=B8=8D=E5=90=8C?= =?UTF-8?q?=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/application_helper.rb | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 66f60d020..ebc60c312 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -969,7 +969,17 @@ module ApplicationHelper first_page = FirstPage.find_by_page_type('project') if args.empty? title = @html_title || [] - title << @project.name if @project + if @project + title << @project.name + elsif @course + title << @course.name + elsif @organization + title << @organization.name + elsif @user + title << @user.login + else + title << User.current.login + end if first_page.nil? || first_page.web_title.nil? title << Setting.app_title unless Setting.app_title == title.last else From 01016c67a92b06abf6d635507b9b73f2b56a50cd Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 20 Jan 2016 18:28:27 +0800 Subject: [PATCH 11/52] =?UTF-8?q?issue=E5=B1=9E=E6=80=A7=E5=B1=80=E9=83=A8?= =?UTF-8?q?=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_project_issue.html.erb | 2 + .../users/_project_issue_detail.html.erb | 134 ++++++++++++++++++ public/stylesheets/project.css | 6 +- public/stylesheets/public.css | 4 + 4 files changed, 145 insertions(+), 1 deletion(-) create mode 100644 app/views/users/_project_issue_detail.html.erb diff --git a/app/views/users/_project_issue.html.erb b/app/views/users/_project_issue.html.erb index 6f1fc8b7a..4c89110ad 100644 --- a/app/views/users/_project_issue.html.erb +++ b/app/views/users/_project_issue.html.erb @@ -57,6 +57,8 @@ <% end %> + <%# 局部刷新:修改xissue属性 %> + <%= render :partial => 'users/project_issue_detail', :locals => {:activity => activity} %>
    diff --git a/app/views/users/_project_issue_detail.html.erb b/app/views/users/_project_issue_detail.html.erb new file mode 100644 index 000000000..0c0ac2f1d --- /dev/null +++ b/app/views/users/_project_issue_detail.html.erb @@ -0,0 +1,134 @@ + +
    +
    +
      +
    • +

       状态  : 

      +

      新增

      + +
    • +
      +
    • +

       指派  : 

      + + +
    • +
      +
    +
      +
    • +

       优先级  : 

      + 立刻 + +
    • +
      +
    • +

       完成度  : 

      + 0% + +
    • +
      +
    +
      +
    • +

       开始  : 

      +

      2015-12-11

      +
    • +
      +
    • +

       周期  : 

      + 0.00 小时
    • +
      +
    + + +
    \ No newline at end of file diff --git a/public/stylesheets/project.css b/public/stylesheets/project.css index 46364eee0..cf23eb963 100644 --- a/public/stylesheets/project.css +++ b/public/stylesheets/project.css @@ -1163,4 +1163,8 @@ a.uploadIcon {background:url(images/resource_icon_list.png) 8px -60px no-repeat; .mb10 {margin-bottom: 10px} .mb15 {margin-bottom: 15px} div.disable_link {background-color: #c1c1c1 !important;} -.reUploadDetail{border:1px solid #dddddd; float:left; resize:none; width:400px; height:80px; overflow-y:auto;outline: none;} \ No newline at end of file +.reUploadDetail{border:1px solid #dddddd; float:left; resize:none; width:400px; height:80px; overflow-y:auto;outline: none;} + +/*问题跟踪局部修改属性*/ +.proInfoBox2{ border:1px solid #dddddd; height:45px; padding:10px 0; background-color:#f1f1f1;} +.proInfoBox2 ul li{ height:24px; position:relative;} \ No newline at end of file diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index 2126e36d8..baa3f6fcf 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -140,6 +140,7 @@ h4{ font-size:14px; color:#3b3b3b;} .w50 {width:50px;} .w60{ width:60px;} .w70{ width:70px;} +.w80{ width:80px;} .w90{ width:90px;} .w100{width: 100px;} .w210{ width:210px;} @@ -323,6 +324,9 @@ a:hover.bgreen_n_btn{background:#08a384;} .pic_text02{display:block; background:url(../images/new_project/public_icon.png) 0px -642px no-repeat; width:20px; height:19px;} .pic_edit{display:block; background:url(../images/new_project/public_icon.png) 0px -32px no-repeat; width:20px; height:15px;} .pic_edit:hover{display:block; background:url(../images/new_project/public_icon.png) -32px -32px no-repeat; width:20px; height:15px;} +.pic_edit2{display:inline-block; background:url(../images/public_icon.png) 0px -32px no-repeat; width:20px; height:15px; vertical-align:middle; display:none;} +.pic_edit2:hover{display:inline-block; background:url(../images/public_icon.png) -32px -32px no-repeat; width:20px; height:15px;} + From c7522067e6e1f5b4d5779d19d0c9f47d57f9576f Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 20 Jan 2016 18:37:39 +0800 Subject: [PATCH 12/52] =?UTF-8?q?=E4=BF=AE=E6=94=B9base=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/_recommendation.html.erb | 2 +- app/views/layouts/base_courses.html.erb | 2 +- app/views/layouts/base_projects.html.erb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/courses/_recommendation.html.erb b/app/views/courses/_recommendation.html.erb index bd44afad2..455ced056 100644 --- a/app/views/courses/_recommendation.html.erb +++ b/app/views/courses/_recommendation.html.erb @@ -1,6 +1,6 @@ <% unless excellent_course_recommend(course).count == 0 %>
      -

      <%= l(:label_homework_recommendation) %>

      +

      <%= l(:label_homework_recommendation) %>:

      <% excellent_course_recommend(course).each do |e_course| %>
    • <%= image_tag(url_to_avatar(e_course), :width => "40", :height => "40", :class => "fl mr10 rankPortrait", :alt => "logo") %>
      diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb index 12331b088..5f53e5203 100644 --- a/app/views/layouts/base_courses.html.erb +++ b/app/views/layouts/base_courses.html.erb @@ -199,7 +199,7 @@
      -

      <%= l(:label_tag)%>:

      +

      <%= l(:label_tag)%>:

      <%= render :partial => 'tags/new_tag', :locals => {:obj => @course, :object_flag => "9"} %>
      diff --git a/app/views/layouts/base_projects.html.erb b/app/views/layouts/base_projects.html.erb index 880c6cc1c..657873f8b 100644 --- a/app/views/layouts/base_projects.html.erb +++ b/app/views/layouts/base_projects.html.erb @@ -150,7 +150,7 @@
      -

      <%= l(:label_tag)%>:

      +

      <%= l(:label_tag)%>:

      <%= render :partial => 'tags/project_tag', :locals => {:obj => @project,:object_flag => "2"}%> From 7de48f143e71abb49ea3f9d077b9ee3d83e92649 Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 21 Jan 2016 10:38:07 +0800 Subject: [PATCH 13/52] =?UTF-8?q?issue=E7=8A=B6=E6=80=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 5 +++++ config/routes.rb | 1 + 2 files changed, 6 insertions(+) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 449d8b9de..4f404eb93 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -93,6 +93,11 @@ class UsersController < ApplicationController end end + # 更新issue状态 + def user_act_issue_assign_to + + end + # 用户消息 # 说明: homework 发布作业;message:讨论区; news:新闻; poll:问卷;works_reviewers:作品评阅;works_reply:作品回复,exercise:课程测验 # issue:问题;journal:缺陷状态更新; forum:公共贴吧: user_feedback: 用户留言; new_reply:新闻回复(comment) diff --git a/config/routes.rb b/config/routes.rb index ccbe67004..f55c69403 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -523,6 +523,7 @@ RedmineApp::Application.routes.draw do match 'file_score_index', :to => 'projects#file_score_index', :via => [:get, :post] match 'code_submit_score_index', :to => 'projects#code_submit_score_index', :via => [:get, :post] match 'projects_topic_score_index', :to => 'projects#projects_topic_score_index', :via => [:get, :post] + match 'user_act_issue_assign_to', :to => 'users#user_act_issue_assign_to', :via => [:get, :post] get 'edit_brief_introduction' get "user_resource" get "resource_search" From e2fc88e3d1d4d0b93fbc9a3d837ee67e647bdd2e Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 21 Jan 2016 16:14:39 +0800 Subject: [PATCH 14/52] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E8=AE=A8=E8=AE=BA?= =?UTF-8?q?=E5=8C=BA=E6=A0=B7=E5=BC=8F=E6=B7=B7=E4=B9=B1=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_course_message.html.erb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/views/users/_course_message.html.erb b/app/views/users/_course_message.html.erb index abfbba993..dbc9c3041 100644 --- a/app/views/users/_course_message.html.erb +++ b/app/views/users/_course_message.html.erb @@ -35,11 +35,11 @@ 更新时间:<%= format_time(CourseActivity.where("course_act_type='#{activity.class}' and course_act_id =#{activity.id}").first.updated_at) %>
      - <% if activity.parent_id.nil? %> + <% if activity.parent_id.nil? %> <% content = activity.content%> - <% else %> + <% else %> <% content = activity.parent.content%> - <% end %> + <% end %> <%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>content} %> <% if activity.status == 1 %> <%= activity.created_on.year %> @@ -49,7 +49,6 @@ <%= activity.created_on.day %> <% end %> -
      From 448a412abf0c03bd14a205030c847e54ea36467c Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 21 Jan 2016 17:29:46 +0800 Subject: [PATCH 15/52] =?UTF-8?q?issue=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E5=9C=A8=20user=E5=8A=A8=E6=80=81=E3=80=81project=E5=8A=A8?= =?UTF-8?q?=E6=80=81=E4=B8=AD=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../users/_project_issue_detail.html.erb | 98 +++++++------------ public/stylesheets/new_user.css | 11 +++ 2 files changed, 49 insertions(+), 60 deletions(-) diff --git a/app/views/users/_project_issue_detail.html.erb b/app/views/users/_project_issue_detail.html.erb index 0c0ac2f1d..f6d66a371 100644 --- a/app/views/users/_project_issue_detail.html.erb +++ b/app/views/users/_project_issue_detail.html.erb @@ -36,98 +36,76 @@
      •  状态  : 

        -

        新增

        - +

        <%= activity.status.name %>

        + <%= select( :issue,:status, [["新增",1],["正在解决",2],["已解决",3],["反馈",4],["关闭",5],["拒绝",6]].unshift(["状态",0]), + { :include_blank => false,:selected=>@status_id ? @status_id : 0 + }, + {:onchange=>"remote_function();",:id=>"status_id",:name=>"status_id",:class=>"w70 undis issueEdit"} + ) + %>
      •  指派  : 

        - - + + <%= link_to activity.try(:assigned_to), user_path(activity.assigned_to_id), :class => "linkBlue hidden", :style => "max-width:50px; display:inline-block;" %> + + <%= select( :issue, :user_id, principals_options_for_isuue_list(activity.project), + { :include_blank => false,:selected=>@assign_to_id ? @assign_to_id : 0 + }, + {:onchange=>"remote_function();",:id=>"assigned_to_id",:name=>"assigned_to_id",:class=>"w70 undis issueEdit"} + ) + %>
      •  优先级  : 

        - 立刻 - + <%= activity.priority.name %> + <%= select( :issue,:prior, [["低",1],["正常",2],["高",3],["紧急",4],["立刻",5]].unshift(["优先级",0]), + { :include_blank => false,:selected=>@priority_id ? @priority_id : 0 + }, + {:onchange=>"remote_function();",:id=>"priority_id",:name=>"priority_id",:class=>"w70 undis issueEdit"} + ) + %>
      •  完成度  : 

        - 0% - + <%= activity.done_ratio %>% + <%= select( :issue,:done_ratio, ((0..10).to_a.collect { |r| ["#{r*10} %", r*10] }), + { :include_blank => false,:selected=>@priority_id ? @priority_id : 0 + }, + {:onchange=>"remote_function();",:id=>"priority_id",:name=>"priority_id",:class=>"w70 undis issueEdit"} + ) + %> + <%#= select :done_ratio, ((0..10).to_a.collect { |r| ["#{r*10} %", r*10] }), + {:required => @issue.required_attribute?('done_ratio'), :no_label => true}, + :onchange => "PrecentChange(this.value)", + :class => "w150" %>
      •  开始  : 

        -

        2015-12-11

        +

        <%= format_date(activity.start_date) %>

      •  周期  : 

        - 0.00 小时
      • + <%= l_hours(activity.estimated_hours) %>
      •  计划完成  : 

        - --
      • + <%= format_date(activity.due_date)? format_date(activity.due_date) : "--" %>
      •  目标版本  : 

        -
      • + <%= (activity.fixed_version ? link_to_version(activity.fixed_version) : "--") %>
      diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index b1f950960..26bf53c62 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -1422,3 +1422,14 @@ span.at a{color:#269ac9;text-decoration: none;} .orgSendSearch {border:1px solid #dddddd; outline:none; width:262px; height:22px; padding-left:10px; float:left;} .relatePWrap{max-height: 210px;overflow:hidden;} + +/*20160115问题跟踪*/ +.proInfoBox2{ border:1px solid #dddddd; height:45px; padding:10px 0; background-color:#f1f1f1;} +.proInfoBox2 ul li{ height:24px; position:relative;} +.pic_edit2{display:inline-block; background:url(../images/public_icon.png) 0px -32px no-repeat; width:20px; height:15px; vertical-align:middle; display:none;} +.pic_edit2:hover{display:inline-block; background:url(../images/public_icon.png) -32px -32px no-repeat; width:20px; height:15px;} +.w70{ width:70px;} +.w80{ width:80px;} +.label03{ width:70px; text-align:right; display:block; float:left;} +.pro_info_p{color:#0781b4 !important; float:left; width:80px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; } +.proInfoP{color:#000000 !important; float:left; width:80px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; } \ No newline at end of file From 42cc8bc69e3d3013d61b5acd2654a6fb2a75d81a Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 22 Jan 2016 09:30:52 +0800 Subject: [PATCH 16/52] =?UTF-8?q?issue=E5=B1=9E=E6=80=A7=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_project_issue_detail.html.erb | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/app/views/users/_project_issue_detail.html.erb b/app/views/users/_project_issue_detail.html.erb index f6d66a371..34405e5db 100644 --- a/app/views/users/_project_issue_detail.html.erb +++ b/app/views/users/_project_issue_detail.html.erb @@ -30,17 +30,20 @@ stopPropagation(e); }); }); + function remote_function(id) { + $(id).submit(); + }
        + <%= form_tag({:controller => 'issues', :action => 'update', :project_id => activity.project},:remote=>'true', :method => :post, :id=>"issue_query_form_#{activity.id}", :class => 'query_form') do %>
      •  状态  : 

        <%= activity.status.name %>

        <%= select( :issue,:status, [["新增",1],["正在解决",2],["已解决",3],["反馈",4],["关闭",5],["拒绝",6]].unshift(["状态",0]), - { :include_blank => false,:selected=>@status_id ? @status_id : 0 - }, - {:onchange=>"remote_function();",:id=>"status_id",:name=>"status_id",:class=>"w70 undis issueEdit"} + {:include_blank => false, :selected => @status_id ? @status_id : 0 }, + {:onchange=>"remote_function('#issue_query_form_#{activity.id}');",:id=>"status_id",:name=>"status_id",:class=>"w70 undis issueEdit"} ) %>
      • @@ -53,7 +56,7 @@ <%= select( :issue, :user_id, principals_options_for_isuue_list(activity.project), { :include_blank => false,:selected=>@assign_to_id ? @assign_to_id : 0 }, - {:onchange=>"remote_function();",:id=>"assigned_to_id",:name=>"assigned_to_id",:class=>"w70 undis issueEdit"} + {:onchange=>"remote_function();",:id=>"assigned_to_id", :name => "assigned_to_id",:class=>"w70 undis issueEdit"} ) %> @@ -75,7 +78,7 @@

         完成度  : 

        <%= activity.done_ratio %>% <%= select( :issue,:done_ratio, ((0..10).to_a.collect { |r| ["#{r*10} %", r*10] }), - { :include_blank => false,:selected=>@priority_id ? @priority_id : 0 + { :include_blank => false, :selected => @priority_id ? @priority_id : 0 }, {:onchange=>"remote_function();",:id=>"priority_id",:name=>"priority_id",:class=>"w70 undis issueEdit"} ) @@ -85,6 +88,7 @@ :onchange => "PrecentChange(this.value)", :class => "w150" %> + <% end %>
        From 8ef3018adc3566a7a89937d38b93b6c31a214944 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Fri, 22 Jan 2016 09:41:05 +0800 Subject: [PATCH 17/52] =?UTF-8?q?issue=E5=B1=80=E9=83=A8=E5=88=B7=E6=96=B0?= =?UTF-8?q?=E4=BD=BF=E7=94=A8update,=E6=96=B9=E5=BC=8F=E6=98=AFput?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_project_issue_detail.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/users/_project_issue_detail.html.erb b/app/views/users/_project_issue_detail.html.erb index 34405e5db..b984c54fb 100644 --- a/app/views/users/_project_issue_detail.html.erb +++ b/app/views/users/_project_issue_detail.html.erb @@ -37,7 +37,7 @@
          - <%= form_tag({:controller => 'issues', :action => 'update', :project_id => activity.project},:remote=>'true', :method => :post, :id=>"issue_query_form_#{activity.id}", :class => 'query_form') do %> + <%= form_tag({:controller => 'issues', :action => 'update', :project_id => activity.project},:remote=>'true', :method => :put, :id=>"issue_query_form_#{activity.id}", :class => 'query_form') do %>
        •  状态  : 

          <%= activity.status.name %>

          From fea4f79dc852649ef0ef4f58cad2d80881db9c04 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 22 Jan 2016 09:47:18 +0800 Subject: [PATCH 18/52] =?UTF-8?q?=E7=BB=84=E7=BB=87=E5=B8=96=E5=AD=90?= =?UTF-8?q?=E6=A0=8F=E7=9B=AE=E7=9A=84=E9=80=9A=E7=9F=A5=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E7=82=B9=E8=B5=9Etip?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/organizations/_org_subfield_news.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/organizations/_org_subfield_news.html.erb b/app/views/organizations/_org_subfield_news.html.erb index 074d15a42..fb18c0f7f 100644 --- a/app/views/organizations/_org_subfield_news.html.erb +++ b/app/views/organizations/_org_subfield_news.html.erb @@ -51,7 +51,7 @@ <%= count>0 ? "(#{count})" : "" %> <% if activity.author == User.current %> - + <% else %> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%> <% end %> @@ -92,7 +92,7 @@ <%= format_time(comment.created_on) %> <% if comment.author == User.current %> - + <% else %> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> <% end %> From 6789693fc761f0db4d9509924e8d38b8cc9cf5a1 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 22 Jan 2016 10:17:00 +0800 Subject: [PATCH 19/52] =?UTF-8?q?=E5=B7=B2=E8=AF=84=E5=88=86=E4=BD=9C?= =?UTF-8?q?=E5=93=81=E8=B6=85=E8=BF=875=E4=B8=AA=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E4=BC=98=E7=A7=80=E4=BD=9C=E5=93=81=E6=8E=92?= =?UTF-8?q?=E8=A1=8C=E6=98=BE=E7=A4=BA=E2=80=9C=E6=9B=B4=E5=A4=9A=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/organizations/_org_course_homework.html.erb | 4 +++- app/views/users/_course_homework.html.erb | 5 +++-- app/views/users/_user_homework_detail.html.erb | 4 +++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/app/views/organizations/_org_course_homework.html.erb b/app/views/organizations/_org_course_homework.html.erb index ffee90ede..88170dc2d 100644 --- a/app/views/organizations/_org_course_homework.html.erb +++ b/app/views/organizations/_org_course_homework.html.erb @@ -155,7 +155,9 @@ <% break %> <% end %> <% end %> - <%= link_to "更多>>", student_work_index_path(:homework => activity.id),:class=>'linkGrey2 fl ml50',:style=>'margin-top:60px;'%> + <% if student_works.count > 5 %> + <%= link_to "更多>>", student_work_index_path(:homework => activity.id),:class=>'linkGrey2 fl ml50',:style=>'margin-top:60px;'%> + <% end %>
        <% end %> diff --git a/app/views/users/_course_homework.html.erb b/app/views/users/_course_homework.html.erb index 651a284e4..e6ed73036 100644 --- a/app/views/users/_course_homework.html.erb +++ b/app/views/users/_course_homework.html.erb @@ -134,7 +134,6 @@ <% if activity.student_works.count != 0 %> <% sw_id = "("+activity.student_works.map{|sw| sw.id}.join(",")+")" %> <% student_work_scores = StudentWorksScore.find_by_sql("select max(created_at) as created_at, student_work_id, user_id from student_works_scores where student_work_id in #{sw_id} group by student_work_id order by max(created_at) desc") %> - <%# student_work_scores = StudentWorksScore.where("student_work_id in #{sw_id}").reorder("created_at desc") %> <% unless student_work_scores.empty? %> <% last_score = student_work_scores.first %>
        @@ -155,7 +154,9 @@ <% break %> <% end %> <% end %> - <%= link_to "更多>>", student_work_index_path(:homework => activity.id),:class=>'linkGrey2 fl ml50',:style=>'margin-top:60px;'%> + <% if student_works.count > 5 %> + <%= link_to "更多>>", student_work_index_path(:homework => activity.id),:class=>'linkGrey2 fl ml50',:style=>'margin-top:60px;'%> + <% end %>
        <% end %> diff --git a/app/views/users/_user_homework_detail.html.erb b/app/views/users/_user_homework_detail.html.erb index b3e14d174..bf24ea3b2 100644 --- a/app/views/users/_user_homework_detail.html.erb +++ b/app/views/users/_user_homework_detail.html.erb @@ -156,7 +156,9 @@ <% break %> <% end %> <% end %> - <%= link_to "更多>>", student_work_index_path(:homework => homework_common.id),:class=>'linkGrey2 fl ml50',:style=>'margin-top:60px;'%> + <% if student_works > 5%> + <%= link_to "更多>>", student_work_index_path(:homework => homework_common.id),:class=>'linkGrey2 fl ml50',:style=>'margin-top:60px;'%> + <% end %>
      <% end %> From f7be78efc7a2ab14725404507a5668380fdc8522 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 22 Jan 2016 11:10:35 +0800 Subject: [PATCH 20/52] =?UTF-8?q?=E5=85=B3=E8=81=94=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E7=9A=84=E6=9B=B4=E6=96=B0=E6=97=B6=E9=97=B4=E5=8C=85=E5=90=AB?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=9A=84=E6=8F=90=E4=BA=A4=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../_org_course_homework.html.erb | 3 ++- app/views/users/_course_homework.html.erb | 3 ++- .../users/_user_homework_detail.html.erb | 5 ++-- db/migrate/20160122023014_add_commit_time.rb | 27 +++++++++++++++++++ 4 files changed, 34 insertions(+), 4 deletions(-) create mode 100644 db/migrate/20160122023014_add_commit_time.rb diff --git a/app/views/organizations/_org_course_homework.html.erb b/app/views/organizations/_org_course_homework.html.erb index 88170dc2d..3446a86d4 100644 --- a/app/views/organizations/_org_course_homework.html.erb +++ b/app/views/organizations/_org_course_homework.html.erb @@ -190,10 +190,11 @@ <% else %> <%= image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius",:id=>"project_img_"+project.id.to_s+"_"+activity.id.to_s,:alt =>"项目头像") %> <% end %> + <% com_time = project.project_score.commit_time %> <% time=project.updated_on %> <% time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last %>

      <%=(User.find project.user_id).show_name %>(组长)

      -

      <%=time_from_now time %>  <%= project.project_score.changeset_num %>提交

      +

      <%=time_from_now !com_time.nil? && format_time(com_time) > format_timetime ? com_time : time %>  <%= project.project_score.changeset_num %>提交

      项目名称:<%=project.name %>
      创建者:<%=(User.find project.user_id).show_name %>(组长)
      diff --git a/app/views/users/_course_homework.html.erb b/app/views/users/_course_homework.html.erb index e6ed73036..5be1334c3 100644 --- a/app/views/users/_course_homework.html.erb +++ b/app/views/users/_course_homework.html.erb @@ -189,10 +189,11 @@ <% else %> <%= image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius",:id=>"project_img_"+project.id.to_s+"_"+activity.id.to_s,:alt =>"项目头像") %> <% end %> + <% com_time = project.project_score.commit_time %> <% time=project.updated_on %> <% time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last %>

      <%=(User.find project.user_id).show_name %>(组长)

      -

      <%=time_from_now time %>  <%= project.project_score.changeset_num %>提交

      +

      <%=time_from_now !com_time.nil? && format_time(com_time) > format_timetime ? com_time : time %>  <%= project.project_score.changeset_num %>提交

      项目名称:<%=project.name %>
      创建者:<%=(User.find project.user_id).show_name %>(组长)
      diff --git a/app/views/users/_user_homework_detail.html.erb b/app/views/users/_user_homework_detail.html.erb index bf24ea3b2..04c8b8f0a 100644 --- a/app/views/users/_user_homework_detail.html.erb +++ b/app/views/users/_user_homework_detail.html.erb @@ -156,7 +156,7 @@ <% break %> <% end %> <% end %> - <% if student_works > 5%> + <% if student_works.count > 5%> <%= link_to "更多>>", student_work_index_path(:homework => homework_common.id),:class=>'linkGrey2 fl ml50',:style=>'margin-top:60px;'%> <% end %>
      @@ -191,10 +191,11 @@ <% else %> <%= image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius",:id=>"project_img_"+project.id.to_s+"_"+homework_common.id.to_s,:alt =>"项目头像") %> <% end %> + <% com_time = project.project_score.commit_time %> <% time=project.updated_on %> <% time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last %>

      <%=(User.find project.user_id).show_name %>(组长)

      -

      <%=time_from_now time %>  <%= project.project_score.changeset_num %>提交

      +

      <%=time_from_now !com_time.nil? && format_time(com_time) > format_timetime ? com_time : time %>  <%= project.project_score.changeset_num %>提交

      项目名称:<%=project.name %>
      创建者:<%=(User.find project.user_id).show_name %>(组长)
      diff --git a/db/migrate/20160122023014_add_commit_time.rb b/db/migrate/20160122023014_add_commit_time.rb new file mode 100644 index 000000000..d9b860073 --- /dev/null +++ b/db/migrate/20160122023014_add_commit_time.rb @@ -0,0 +1,27 @@ +class AddCommitTime < ActiveRecord::Migration + def up + add_column :project_scores, :commit_time, :datetime, :default => nil + count = ProjectScore.all.count / 30 + 2 + transaction do + for i in 1 ... count do i + ProjectScore.page(i).per(30).each do |ps| + unless ps.project.nil? + unless ps.project.gpid.nil? + g = Gitlab.client + begin + changesets = g.commits(ps.project.gpid) + ps.commit_time = changesets[0].created_at + ps.save + rescue + logger.error("The project's rep is not exit!") + end + end + end + end + end + end + end + + def down + end +end From edd198e91f4babc0e4ab004a71c8f63240adbf22 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 22 Jan 2016 14:21:17 +0800 Subject: [PATCH 21/52] =?UTF-8?q?issue=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/issues_controller.rb | 42 +++++++++++++----- app/helpers/users_helper.rb | 5 +++ app/views/issues/add_journal.js.erb | 2 + app/views/users/_project_issue.html.erb | 8 ++-- .../users/_project_issue_detail.html.erb | 43 +++++++++---------- 5 files changed, 65 insertions(+), 35 deletions(-) diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index af8990f37..72dd0a741 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -81,6 +81,7 @@ class IssuesController < ApplicationController @priority_id = params[:priority_id] @status_id = params[:status_id] @subject = params[:subject] + @done_ratio = parmas[:done_ratio] @issue_count = @query.issue_count @issue_pages = Paginator.new @issue_count, @limit, params['page'] params[:page] = (params[:page] || 1).to_i + 1 #页码需要加1 @@ -220,19 +221,27 @@ class IssuesController < ApplicationController end def update - return unless update_issue_from_params - @issue.save_attachments(params[:attachments] || (params[:issue] && params[:issue][:uploads])) - saved = false - begin - @saved = @issue.save_issue_with_child_records(params, @time_entry) - rescue ActiveRecord::StaleObjectError - @conflict = true - if params[:last_journal_id] - @conflict_journals = @issue.journals_after(params[:last_journal_id]).all - @conflict_journals.reject!(&:private_notes?) unless User.current.allowed_to?(:view_private_notes, @issue.project) + if params[:issue_detail] + issue = Issue.find(params[:issue_id]) + issue = update_user_issue_detail(issue, params) + @saved = update_user_issue_detail(issue, params) + return + else + return unless update_issue_from_params + @issue.save_attachments(params[:attachments] || (params[:issue] && params[:issue][:uploads])) + saved = false + begin + @saved = @issue.save_issue_with_child_records(params, @time_entry) + rescue ActiveRecord::StaleObjectError + @conflict = true + if params[:last_journal_id] + @conflict_journals = @issue.journals_after(params[:last_journal_id]).all + @conflict_journals.reject!(&:private_notes?) unless User.current.allowed_to?(:view_private_notes, @issue.project) + end end end + if @saved #修改界面增加跟踪者 watcherlist = @issue.watcher_users @@ -278,6 +287,19 @@ class IssuesController < ApplicationController end end + def update_user_issue_detail(issue, params) + case params[:type] + when "status" + issue.update_attribute(:status_id, params[:status_id]) + when "assigned" + issue.update_attribute(:assigned_to_id, params[:assigned_to_id]) + when "ratio" + issue.update_attribute(:done_ratio, params[:done_ratio]) + when "prior" + issue.update_attribute(:priority_id, params[:priority_id]) + end + end + # Updates the issue form when changing the project, status or tracker # on issue creation/update def update_form diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index bfc01a102..43ef7cefc 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -85,6 +85,11 @@ module UsersHelper end end + def link_to_user_version(version, options = {}) + return '' unless version && version.is_a?(Version) + link_to_if version.visible?, format_version_name(version), { :controller => 'versions', :action => 'show', :id => version }, :class => " f16 fb c_dblue " + end + # 统计未读消息数 def unviewed_message(user) course_count = CourseMessage.where("user_id =? and viewed =?", user, 0).count diff --git a/app/views/issues/add_journal.js.erb b/app/views/issues/add_journal.js.erb index eca7685cb..e6a84da50 100644 --- a/app/views/issues/add_journal.js.erb +++ b/app/views/issues/add_journal.js.erb @@ -1,6 +1,7 @@ <% if @issue_id %> //issue详情中回复 $("#reply_div_<%= @issue_id %>").html("<%= escape_javascript(render :partial => 'issues/issue_replies', :locals => {:issue => Issue.find( @issue_id),:replies_all_i=>0}) %>"); $("#div_issue_attachment_<%=@issue.id %>").html("<%= escape_javascript(render :partial => 'issues/issue_attachments', :locals => {:issue => Issue.find( @issue_id)}) %>"); +// $("#div_user_issue_detail_<%#=@issue.id %>").html("<%#= escape_javascript(render :partial => 'users/project_issue_detail', :locals => {:issue => Issue.find( @issue_id), :activity => Issue.find( @issue_id)}) %>"); $("#issue_edit").replaceWith('<%= escape_javascript(render :partial => 'issues/edit') %>') sd_create_editor_from_data(<%= @issue.id%>, null, "100%"); issue_desc_editor = KindEditor.create('#issue_description', @@ -17,6 +18,7 @@ "uploadJson":"/kindeditor/upload", "fileManagerJson":"/kindeditor/filemanager"}); // $("#issue_test_<%#= @issue.id %>").html("<%#= escape_javascript(render :partial => 'issues/edit', :locals => {:issue => Issue.find( @issue_id)}) %>"); + $(".homepagePostReplyBannerCount").html('回复(<%= Issue.find( @issue_id).journals.count %>)') sd_create_editor_from_data(<%= @issue.id %>, null, "100%"); <%else%> diff --git a/app/views/users/_project_issue.html.erb b/app/views/users/_project_issue.html.erb index 9f4e396de..f0dc4f19e 100644 --- a/app/views/users/_project_issue.html.erb +++ b/app/views/users/_project_issue.html.erb @@ -52,7 +52,9 @@
      <%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>activity.description} %> <%# 局部刷新:修改xissue属性 %> - <%= render :partial => 'users/project_issue_detail', :locals => {:activity => activity} %> +
      + <%= render :partial => 'users/project_issue_detail', :locals => {:activity => activity} %> +
      @@ -136,8 +138,8 @@
      <%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %>
      -
      - <%= form_for('new_form',:url => add_journal_issue_path(activity.id),:method => "post", :remote => true) do |f|%> +
      + <%= form_for('new_form',:url => add_journal_issue_path(activity.id),:method => "post", :remote => true) do |f| %>
      diff --git a/app/views/users/_project_issue_detail.html.erb b/app/views/users/_project_issue_detail.html.erb index b984c54fb..e46761bd1 100644 --- a/app/views/users/_project_issue_detail.html.erb +++ b/app/views/users/_project_issue_detail.html.erb @@ -37,7 +37,12 @@
        - <%= form_tag({:controller => 'issues', :action => 'update', :project_id => activity.project},:remote=>'true', :method => :put, :id=>"issue_query_form_#{activity.id}", :class => 'query_form') do %> + <%#= labelled_fields_for :issue, @issue do |f| %> + <%#= f.select :status_id, ([["新增",1],["正在解决",2],["已解决",3],["反馈",4],["关闭",5],["拒绝",6]].unshift(["状态",0])), + {:include_blank => false, :selected => @status_id ? @status_id : 0 }, + {:onchange=>"remote_function('#issue_query_form_#{activity.id}');",:id=>"status_id",:name=>"status_id",:class=>"w70 undis issueEdit"} %> + <%# end %> + <%= form_tag({:controller => 'issues', :action => 'update', :issue_id => activity.id, :issue_detail => true, :type => "status"},:remote=>'true', :method => :put, :id=>"issue_query_form_#{activity.id}", :class => 'query_form') do %>
      •  状态  : 

        <%= activity.status.name %>

        @@ -47,48 +52,42 @@ ) %>
      • + <% end %>
        + <%= form_tag({:controller => 'issues', :action => 'update', :issue_id => activity.id, :issue_detail => true, :type => "assigned"},:remote=>'true', :method => :put, :id=>"issue_query_assign_form_#{activity.id}", :class => 'query_form') do %>
      •  指派  : 

        <%= link_to activity.try(:assigned_to), user_path(activity.assigned_to_id), :class => "linkBlue hidden", :style => "max-width:50px; display:inline-block;" %> <%= select( :issue, :user_id, principals_options_for_isuue_list(activity.project), - { :include_blank => false,:selected=>@assign_to_id ? @assign_to_id : 0 - }, - {:onchange=>"remote_function();",:id=>"assigned_to_id", :name => "assigned_to_id",:class=>"w70 undis issueEdit"} - ) - %> + { :include_blank => false,:selected => @assign_to_id ? @assign_to_id : 0}, + {:onchange=>"remote_function('#issue_query_assign_form_#{activity.id}');", :id =>"assigned_to_id", :name => "assigned_to_id",:class=>"w70 undis issueEdit"}) %>
      • + <% end %>
        + <%= form_tag({:controller => 'issues', :action => 'update', :issue_id => activity.id, :issue_detail => true, :type => "prior"},:remote=>'true', :method => :put, :id=>"issue_query_prior_form_#{activity.id}", :class => 'query_form') do %>
      •  优先级  : 

        <%= activity.priority.name %> <%= select( :issue,:prior, [["低",1],["正常",2],["高",3],["紧急",4],["立刻",5]].unshift(["优先级",0]), - { :include_blank => false,:selected=>@priority_id ? @priority_id : 0 - }, - {:onchange=>"remote_function();",:id=>"priority_id",:name=>"priority_id",:class=>"w70 undis issueEdit"} - ) - %> + {:include_blank => false,:selected=>@priority_id ? @priority_id : 0}, + {:onchange=>"remote_function('#issue_query_prior_form_#{activity.id}');",:id=>"priority_id",:name=>"priority_id",:class=>"w70 undis issueEdit"}) %>
      • + <% end %>
        + <%= form_tag({:controller => 'issues', :action => 'update', :issue_id => activity.id, :issue_detail => true, :type => "ratio"},:remote=>'true', :method => :put, :id=>"issue_query_done_form_#{activity.id}", :class => 'query_form') do %>
      •  完成度  : 

        <%= activity.done_ratio %>% <%= select( :issue,:done_ratio, ((0..10).to_a.collect { |r| ["#{r*10} %", r*10] }), - { :include_blank => false, :selected => @priority_id ? @priority_id : 0 - }, - {:onchange=>"remote_function();",:id=>"priority_id",:name=>"priority_id",:class=>"w70 undis issueEdit"} - ) - %> - <%#= select :done_ratio, ((0..10).to_a.collect { |r| ["#{r*10} %", r*10] }), - {:required => @issue.required_attribute?('done_ratio'), :no_label => true}, - :onchange => "PrecentChange(this.value)", - :class => "w150" %> -
      • + {:include_blank => false, :selected => @done_ratio ? @done_ratio : 0}, + {:onchange=>"remote_function('#issue_query_done_form_#{activity.id}');",:id=>"done_ratio",:name=>"done_ratio",:class=>"w70 undis issueEdit"}) %> <% end %> + +
        @@ -109,7 +108,7 @@
      •  目标版本  : 

        - <%= (activity.fixed_version ? link_to_version(activity.fixed_version) : "--") %>
      • + <%= (activity.fixed_version ? link_to_user_version(activity.fixed_version) : "--") %>
      From 338c22484622b7c61ee406ba68babd6b19877ead Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 22 Jan 2016 15:17:11 +0800 Subject: [PATCH 22/52] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E7=9A=84=E7=BB=93=E6=9D=9F=E5=AD=A6=E6=9C=9F?= =?UTF-8?q?=E5=8F=AF=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/courses_helper.rb | 2 +- app/services/courses_service.rb | 2 ++ app/views/courses/settings.html.erb | 15 +++++++-------- public/javascripts/course.js | 2 +- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index 097a3c1a4..b062351c1 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -509,7 +509,7 @@ module CoursesHelper type = [] month = Time.now.month now_year = year.nil? ? Time.now.year : (Time.now.year <= year ? Time.now.year : year) - year = month < 3 ? now_year - 1 : now_year + year = month < 3 && now_year >=Time.now.year ? now_year - 1 : now_year for i in (year..year + 10) option = [] option << i diff --git a/app/services/courses_service.rb b/app/services/courses_service.rb index 6f2819f53..ef0c2eb16 100644 --- a/app/services/courses_service.rb +++ b/app/services/courses_service.rb @@ -254,6 +254,8 @@ class CoursesService #course.safe_attributes = params[:course] course.time = params[:time] course.term = params[:term] + course.end_time = params[:end_time] + course.end_term = params[:end_term] course.class_period = params[:class_period].to_i params[:course][:is_public] ? course.is_public = 1 : course.is_public = 0 params[:course][:open_student] ? course.open_student = 1 : course.open_student = 0 diff --git a/app/views/courses/settings.html.erb b/app/views/courses/settings.html.erb index f62951236..984fb4212 100644 --- a/app/views/courses/settings.html.erb +++ b/app/views/courses/settings.html.erb @@ -46,14 +46,15 @@
    • - <%= select_tag :time,options_for_select(course_time_option(@course.time),@course.time), {:id=>"time_selected"} %> - <%= select_tag :term,options_for_select(course_term_option,@course.term || cur_course_term),{:id=>"term_selected"} %> + <%= select_tag :time,options_for_select(course_time_option(@course.time),@course.time), {:id=>"time"} %> + <%= select_tag :term,options_for_select(course_term_option,@course.term || cur_course_term),{:id=>"term"} %>
    • - <%= select_tag :end_time,options_for_select(course_time_option(@course.end_time),@course.end_time), {:id=>"end_time_selected"} %> - <%= select_tag :end_term,options_for_select(course_term_option,@course.end_term || cur_course_term),{:id=>"end_term_selected"} %> + <%= select_tag :end_time,options_for_select(course_time_option(@course.end_time),@course.end_time), {:id=>"end_time"} %> + <%= select_tag :end_term,options_for_select(course_term_option,@course.end_term || cur_course_term),{:id=>"end_term"} %> +
    • @@ -138,8 +139,6 @@ $('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9"); $('#ajax-modal').parent().addClass("anonymos"); } - $("#time_selected").click(select); - $("#term_selected").click(select); - $("#end_time_selected").click(select); - $("#end_term_selected").click(select); + $("#time").click(select); + $("#term").click(select); diff --git a/public/javascripts/course.js b/public/javascripts/course.js index 6c2f0af71..fff30dec5 100644 --- a/public/javascripts/course.js +++ b/public/javascripts/course.js @@ -193,7 +193,7 @@ function submit_new_course() function submit_edit_course(id) { - if(regex_course_name()&®ex_course_class_period()&®ex_course_password()) + if(regex_course_name()&®ex_course_class_period()&®ex_time_term()&®ex_course_password()) { $("#edit_course_"+id).submit(); } From 2947ff89979ebd0b84d020d42815216639920060 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 22 Jan 2016 16:46:23 +0800 Subject: [PATCH 23/52] =?UTF-8?q?=E7=B2=BE=E5=93=81=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=BF=81=E7=A7=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/application_helper.rb | 2 +- ...22083400_add_excellent_option_to_course.rb | 6 +++++ ...22083507_define_excellent_option_course.rb | 19 ++++++++++++++++ db/schema.rb | 22 ++++++++----------- 4 files changed, 35 insertions(+), 14 deletions(-) create mode 100644 db/migrate/20160122083400_add_excellent_option_to_course.rb create mode 100644 db/migrate/20160122083507_define_excellent_option_course.rb diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 22c7df263..51138f2ef 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -51,7 +51,7 @@ module ApplicationHelper # 判断课程是否为精品课程 def is_excellent_course course - course.is_excellent? ? true : false + (course.is_excellent? or course.excellent_option?) ? true : false end # 判断课程对成员是否可见 diff --git a/db/migrate/20160122083400_add_excellent_option_to_course.rb b/db/migrate/20160122083400_add_excellent_option_to_course.rb new file mode 100644 index 000000000..560153781 --- /dev/null +++ b/db/migrate/20160122083400_add_excellent_option_to_course.rb @@ -0,0 +1,6 @@ +class AddExcellentOptionToCourse < ActiveRecord::Migration + def change + add_column :courses, :excellent_option, :integer, :default => false + end +end + diff --git a/db/migrate/20160122083507_define_excellent_option_course.rb b/db/migrate/20160122083507_define_excellent_option_course.rb new file mode 100644 index 000000000..7b4a4ae4a --- /dev/null +++ b/db/migrate/20160122083507_define_excellent_option_course.rb @@ -0,0 +1,19 @@ +class DefineExcellentOptionCourse < ActiveRecord::Migration + def up + arr = [151,122,15,227,139,410,291,224,55,137,414,43,417,52,205,44,216,132,204,258,411,50, + 419,390,420,133,91,112,202,95,194,34,172,403,177,252,138,352,225,46,279,382,397,286,344,27,175, + 124,265,88,59,110,72,92,392,413,26,201,94,57,156,393,154,12,262] + for i in 0..arr.length-1 + begin + puts arr[i] + course = Course.find(arr[i]) + course.update_attribute(:excellent_option, true) + rescue + logger.error("Course is not found!") + end + end + end + + def down + end +end diff --git a/db/schema.rb b/db/schema.rb index be1fdb1a4..7e6291806 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 => 20160121070232) do +ActiveRecord::Schema.define(:version => 20160122083507) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -500,6 +500,7 @@ ActiveRecord::Schema.define(:version => 20160121070232) do t.integer "end_time" t.string "end_term" t.integer "is_excellent", :default => 0 + t.integer "excellent_option", :default => 0 end create_table "custom_fields", :force => true do |t| @@ -1084,14 +1085,14 @@ ActiveRecord::Schema.define(:version => 20160121070232) do create_table "news", :force => true do |t| t.integer "project_id" - t.string "title", :limit => 60, :default => "", :null => false - t.string "summary", :default => "" + t.string "title", :limit => 60, :default => "", :null => false + t.string "summary", :default => "" t.text "description" - t.integer "author_id", :default => 0, :null => false + t.integer "author_id", :default => 0, :null => false t.datetime "created_on" - t.integer "comments_count", :default => 0, :null => false + t.integer "comments_count", :default => 0, :null => false t.integer "course_id" - t.integer "sticky", :default => 0 + t.integer "sticky", :default => 0 t.integer "org_subfield_id" end @@ -1216,7 +1217,6 @@ ActiveRecord::Schema.define(:version => 20160121070232) do create_table "org_members", :force => true do |t| t.integer "user_id" t.integer "organization_id" - t.string "role" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false end @@ -1265,8 +1265,8 @@ ActiveRecord::Schema.define(:version => 20160121070232) do t.integer "home_id" t.string "domain" t.boolean "is_public" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false t.boolean "allow_guest_download", :default => true end @@ -1714,10 +1714,6 @@ ActiveRecord::Schema.define(:version => 20160121070232) do t.string "extra" end - create_table "temp", :id => false, :force => true do |t| - t.integer "id", :default => 0, :null => false - end - create_table "time_entries", :force => true do |t| t.integer "project_id", :null => false t.integer "user_id", :null => false From e09f795171ec41469befaf2cb6df56fc448a265d Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 22 Jan 2016 17:05:58 +0800 Subject: [PATCH 24/52] =?UTF-8?q?=E9=99=84=E4=BB=B6=E7=9A=84=E6=98=BE?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/attachments/_project_file_links.html.erb | 2 +- app/views/messages/_course_show.html.erb | 4 ++-- app/views/messages/_org_subfield_show.html.erb | 4 ++-- app/views/messages/_project_show.html.erb | 4 ++-- app/views/news/_course_show.html.erb | 4 ++-- app/views/news/_project_show.html.erb | 4 ++-- app/views/org_document_comments/show.html.erb | 5 +++-- app/views/organizations/_show_org_document.html.erb | 4 ++-- .../student_work/_work_attachments_status.html.erb | 12 ++++++++++-- app/views/student_work/index.html.erb | 2 +- public/stylesheets/courses.css | 1 + public/stylesheets/public.css | 1 + 12 files changed, 29 insertions(+), 18 deletions(-) diff --git a/app/views/attachments/_project_file_links.html.erb b/app/views/attachments/_project_file_links.html.erb index 3b76689f5..0f7e8a012 100644 --- a/app/views/attachments/_project_file_links.html.erb +++ b/app/views/attachments/_project_file_links.html.erb @@ -37,7 +37,7 @@ <% if options[:length] %> <%= link_to_short_attachment attachment, :class => ' link_file_board', :download => true,:length => options[:length] -%> <% else %> - <%= link_to_short_attachment attachment, :class => ' link_file_board', :download => true -%> + <%= link_to_short_attachment attachment, :length=> 58,:class => 'hidden link_file_a fl newsBlue mw400', :download => true -%> <% end %> <%if is_float%> diff --git a/app/views/messages/_course_show.html.erb b/app/views/messages/_course_show.html.erb index c3278a209..c760e686d 100644 --- a/app/views/messages/_course_show.html.erb +++ b/app/views/messages/_course_show.html.erb @@ -84,8 +84,8 @@ <%= @topic.content.html_safe%>
      -
      - <%= link_to_attachments_course @topic, :author => false %> +
      + <%= render :partial=>"attachments/activity_attach", :locals=>{:activity => @topic} %>
      diff --git a/app/views/messages/_org_subfield_show.html.erb b/app/views/messages/_org_subfield_show.html.erb index 304694b39..6d12fe960 100644 --- a/app/views/messages/_org_subfield_show.html.erb +++ b/app/views/messages/_org_subfield_show.html.erb @@ -113,8 +113,8 @@ <%= @topic.content.html_safe%>
      -
      - <%= link_to_attachments_course @topic, :author => false %> +
      + <%= render :partial=>"attachments/activity_attach", :locals=>{:activity => @topic} %>
      diff --git a/app/views/messages/_project_show.html.erb b/app/views/messages/_project_show.html.erb index e5aba7c02..c98f2983e 100644 --- a/app/views/messages/_project_show.html.erb +++ b/app/views/messages/_project_show.html.erb @@ -139,8 +139,8 @@ <%= @topic.content.html_safe%>
      -
      - <%= link_to_attachments_course @topic, :author => false %> +
      + <%= render :partial=>"attachments/activity_attach", :locals=>{:activity => @topic} %>
      diff --git a/app/views/news/_course_show.html.erb b/app/views/news/_course_show.html.erb index 07aaef26d..767c11553 100644 --- a/app/views/news/_course_show.html.erb +++ b/app/views/news/_course_show.html.erb @@ -89,8 +89,8 @@ <%= @news.description.html_safe%>
      -
      - <%= link_to_attachments_course @news, :author => false %> +
      + <%= render :partial=>"attachments/activity_attach", :locals=>{:activity => @news} %>
      diff --git a/app/views/news/_project_show.html.erb b/app/views/news/_project_show.html.erb index 26ff807db..880bd0885 100644 --- a/app/views/news/_project_show.html.erb +++ b/app/views/news/_project_show.html.erb @@ -89,8 +89,8 @@ <%= @news.description.html_safe%>
      -
      - <%= link_to_attachments_course @news, :author => false %> +
      + <%= render :partial=>"attachments/activity_attach", :locals=>{:activity => @news} %>
      diff --git a/app/views/org_document_comments/show.html.erb b/app/views/org_document_comments/show.html.erb index 26d04924a..405631369 100644 --- a/app/views/org_document_comments/show.html.erb +++ b/app/views/org_document_comments/show.html.erb @@ -29,8 +29,9 @@ <%= @document.content.html_safe %> <% end %> -
      - <%= link_to_attachments_course @document, :author => false %> +
      + <%= render :partial=>"attachments/activity_attach", :locals=>{:activity => @document} %> + <%#= link_to_attachments_course @document, :author => false %>
      <% if Setting.openid? %> @@ -283,8 +283,8 @@
      - <%= f.text_field :login, :size => 25,:placeholder=>"请输入用户昵称",:class=>'loginSignBox'%> - + <%= f.text_field :login, :size => 25,:placeholder=>"请输入用户登录名",:class=>'loginSignBox'%> +
      diff --git a/app/views/admin/latest_login_users.html.erb b/app/views/admin/latest_login_users.html.erb index 28ef8091e..a32bdd33a 100644 --- a/app/views/admin/latest_login_users.html.erb +++ b/app/views/admin/latest_login_users.html.erb @@ -38,7 +38,7 @@ 用户姓名 - 用户昵称 + 用户登录名 用户身份 diff --git a/app/views/attachments/_form.html.erb b/app/views/attachments/_form.html.erb index aac365a15..6786a06a7 100644 --- a/app/views/attachments/_form.html.erb +++ b/app/views/attachments/_form.html.erb @@ -31,7 +31,7 @@ <%#= button_tag "浏览", :type=>"button", :onclick=>"CompatibleSend();" %> - <%= button_tag "文件浏览", :type=>"button", :onclick=>"$('#_file').click();",:onmouseover => 'this.focus()',:class => 'sub_btn' %> + <%= button_tag "上传附件", :type=>"button", :onclick=>"$('#_file').click();",:onmouseover => 'this.focus()',:class => 'sub_btn' %> <%= file_field_tag 'attachments[dummy][file]', :id => '_file', :class => 'file_selector', diff --git a/app/views/attachments/_form_project.html.erb b/app/views/attachments/_form_project.html.erb index a9cb068ad..f97bd8bea 100644 --- a/app/views/attachments/_form_project.html.erb +++ b/app/views/attachments/_form_project.html.erb @@ -109,7 +109,7 @@ <%#= button_tag "浏览", :type=>"button", :onclick=>"CompatibleSend();" %> - <%= button_tag "文件浏览", :type=>"button", :onclick=>"_file.click()", :class =>"sub_btn",:style => ie8? ? 'display:none' : '' %> + <%= button_tag "上传附件", :type=>"button", :onclick=>"_file.click()", :class =>"sub_btn",:style => ie8? ? 'display:none' : '' %> <%= file_field_tag 'attachments[dummy][file]', :id => '_file', :class => 'file_selector', diff --git a/app/views/courses/_searchmembers.html.erb b/app/views/courses/_searchmembers.html.erb index 1956f34c4..b864bfd8f 100644 --- a/app/views/courses/_searchmembers.html.erb +++ b/app/views/courses/_searchmembers.html.erb @@ -1,5 +1,5 @@ <%= form_tag( searchmembers_course_path(@course), method: 'get',:class => "f_l",:remote=>true,:id => "search_student") do %> - <%= text_field_tag 'name', params[:name], name: "name", :class => 'st_search_input', :placeholder => '输入学生昵称、姓名、学号进行搜索'%> + <%= text_field_tag 'name', params[:name], name: "name", :class => 'st_search_input', :placeholder => '输入学生登录名、姓名、学号进行搜索'%> <% if @group %> <%= hidden_field "search_group_id", params[:search_group_id],:value => "#{@group.id}", name: 'search_group_id' %> diff --git a/app/views/courses/settings.html.erb b/app/views/courses/settings.html.erb index f62951236..32db48def 100644 --- a/app/views/courses/settings.html.erb +++ b/app/views/courses/settings.html.erb @@ -109,7 +109,7 @@
      <%= form_tag(search_member_course_path,:id => "course_member_search_form", :method => :get, :class => "search_form_course",:remote => true) do %> - <%= text_field_tag 'name', params[:name], :placeholder => "昵称、学号、姓名搜索", :class => "search_text fl" %> + <%= text_field_tag 'name', params[:name], :placeholder => "登录名、学号、姓名搜索", :class => "search_text fl" %> <%= l(:label_search)%> diff --git a/app/views/homework_attach/_homeworks_list.html.erb b/app/views/homework_attach/_homeworks_list.html.erb index c82a729de..2696bf9ec 100644 --- a/app/views/homework_attach/_homeworks_list.html.erb +++ b/app/views/homework_attach/_homeworks_list.html.erb @@ -20,7 +20,7 @@ <%= link_to l(:label_export_excel), get_batch_homeworks_homework_attach_index_path(:bid_id => @bid.id,:format => 'xls'),:class=>'xls' if is_batch_homeworks%> <%= link_to l(:label_export_excel), get_not_batch_homework_homework_attach_index_path(:bid_id => @bid.id,:format => 'xls'),:class=>'xls' if not_batch_homework%> <%= link_to l(:label_export_excel), get_homeworks_homework_attach_index_path(:bid_id => @bid.id,:format => 'xls'),:class=>'xls' if is_all_homeworks%> - + 搜索 diff --git a/app/views/issues/add_journal.js.erb b/app/views/issues/add_journal.js.erb index e6a84da50..5708f6b3d 100644 --- a/app/views/issues/add_journal.js.erb +++ b/app/views/issues/add_journal.js.erb @@ -1,7 +1,6 @@ <% if @issue_id %> //issue详情中回复 $("#reply_div_<%= @issue_id %>").html("<%= escape_javascript(render :partial => 'issues/issue_replies', :locals => {:issue => Issue.find( @issue_id),:replies_all_i=>0}) %>"); $("#div_issue_attachment_<%=@issue.id %>").html("<%= escape_javascript(render :partial => 'issues/issue_attachments', :locals => {:issue => Issue.find( @issue_id)}) %>"); -// $("#div_user_issue_detail_<%#=@issue.id %>").html("<%#= escape_javascript(render :partial => 'users/project_issue_detail', :locals => {:issue => Issue.find( @issue_id), :activity => Issue.find( @issue_id)}) %>"); $("#issue_edit").replaceWith('<%= escape_javascript(render :partial => 'issues/edit') %>') sd_create_editor_from_data(<%= @issue.id%>, null, "100%"); issue_desc_editor = KindEditor.create('#issue_description', @@ -18,11 +17,10 @@ "uploadJson":"/kindeditor/upload", "fileManagerJson":"/kindeditor/filemanager"}); // $("#issue_test_<%#= @issue.id %>").html("<%#= escape_javascript(render :partial => 'issues/edit', :locals => {:issue => Issue.find( @issue_id)}) %>"); - $(".homepagePostReplyBannerCount").html('回复(<%= Issue.find( @issue_id).journals.count %>)') sd_create_editor_from_data(<%= @issue.id %>, null, "100%"); <%else%> - $("#user_activity_<%= @user_activity_id %>").replaceWith("<%= escape_javascript(render :partial => 'users/project_issue', :locals => {:activity => @issue,:user_activity_id =>@user_activity_id}) %>"); + $("#div_user_issue_reply_<%=@user_activity_id %>").replaceWith("<%= escape_javascript(render :partial => 'users/project_issue_reply', :locals => {:activity => @issue, :user_activity_id => @user_activity_id}) %>"); init_activity_KindEditor_data(<%= @user_activity_id %>,"","87%", 'UserActivity'); // sd_create_editor_from_data(<%#= @issue.id%>, null, "100%"); <%end %> diff --git a/app/views/organizations/setting.html.erb b/app/views/organizations/setting.html.erb index 436d571f5..21e611929 100644 --- a/app/views/organizations/setting.html.erb +++ b/app/views/organizations/setting.html.erb @@ -86,7 +86,7 @@

      添加成员

      <%= form_tag url_for(:controller => 'org_member',:action => 'create',:org=>@organization),:id=>'org_member_add_form',:remote=>true do |f|%> - + <%= javascript_tag "observeSearchfield('not_org_member_search', null, '#{ escape_javascript org_member_autocomplete_org_member_index_path(:org=>@organization, :format => 'js') }')" %>
      <%= find_user_not_in_current_org_by_name(@project) %> diff --git a/app/views/student_work/_student_work_attachment_form.html.erb b/app/views/student_work/_student_work_attachment_form.html.erb index d82aea7f9..21928492e 100644 --- a/app/views/student_work/_student_work_attachment_form.html.erb +++ b/app/views/student_work/_student_work_attachment_form.html.erb @@ -3,7 +3,7 @@
      - <%= button_tag "文件浏览", :type=>"button", :onclick=>"$('#_file#{work.id}').click();",:onmouseover => 'this.focus()',:class => 'sub_btn mb0' %> + <%= button_tag "上传附件", :type=>"button", :onclick=>"$('#_file#{work.id}').click();",:onmouseover => 'this.focus()',:class => 'sub_btn mb0' %> <%= file_field_tag 'attachments[dummy][file]', :id => "_file#{work.id}", :class => 'file_selector', diff --git a/app/views/users/_project_issue.html.erb b/app/views/users/_project_issue.html.erb index f0dc4f19e..618dc3185 100644 --- a/app/views/users/_project_issue.html.erb +++ b/app/views/users/_project_issue.html.erb @@ -65,93 +65,7 @@
      - <% count = activity.journals.count %> -
      -
      -
      回复 - <%= count>0 ? "(#{count})" : "" %> - - <% if activity.author == User.current %> - - <% else %> - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%> - <% end %> - -
      -
      <%#= format_date(activity.updated_on) %>
      - <% if count > 3 %> - - <% end %> -
      - - <% replies_all_i = 0 %> - <% if count > 0 %> -
      -
        - <% activity.journals.reorder("created_on desc").each do |reply| %> - - <% replies_all_i=replies_all_i + 1 %> -
      • -
        - <%= link_to image_tag(url_to_avatar(reply.user), :width => "33", :height => "33"), user_path(reply.user_id), :alt => "用户头像" %> -
        -
        -
        - <% if reply.try(:user).try(:realname) == ' ' %> - <%= link_to reply.try(:user), user_path(reply.user_id), :class => "newsBlue mr10 f14" %> - <% else %> - <%= link_to reply.try(:user).try(:realname), user_path(reply.user_id), :class => "newsBlue mr10 f14" %> - <% end %> - <%= format_time(reply.created_on) %> - - <% if reply.user == User.current %> - - <% else %> - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%> - <% end %> - -
        -
        - <% if reply.details.any? %> - <% details_to_strings(reply.details).each do |string| %> -

        <%= string %>

        - <% end %> - <% end %> -

        <%= reply.notes.html_safe %>

        -
        -
        -
        -
      • - <% end %> -
      -
      - <% end %> - -
      -
      <%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %>
      -
      -
      - <%= form_for('new_form',:url => add_journal_issue_path(activity.id),:method => "post", :remote => true) do |f| %> - - -
      - -
      -

      - <% end%> -
      -
      -
      -
      -
      - +
      + <%= render :partial => 'users/project_issue_reply', :locals => {:activity => activity, :user_activity_id => user_activity_id} %>
      diff --git a/app/views/users/_project_issue_reply.html.erb b/app/views/users/_project_issue_reply.html.erb new file mode 100644 index 000000000..0a84ba9c4 --- /dev/null +++ b/app/views/users/_project_issue_reply.html.erb @@ -0,0 +1,89 @@ +<% count = activity.journals.count %> +
      +
      +
      回复 + <%= count>0 ? "(#{count})" : "" %> + + <% if activity.author == User.current %> + + <% else %> + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%> + <% end %> + +
      +
      <%#= format_date(activity.updated_on) %>
      + <% if count > 3 %> + + <% end %> +
      + + <% replies_all_i = 0 %> + <% if count > 0 %> +
      +
        + <% activity.journals.reorder("created_on desc").each do |reply| %> + + <% replies_all_i=replies_all_i + 1 %> +
      • +
        + <%= link_to image_tag(url_to_avatar(reply.user), :width => "33", :height => "33"), user_path(reply.user_id), :alt => "用户头像" %> +
        +
        +
        + <% if reply.try(:user).try(:realname) == ' ' %> + <%= link_to reply.try(:user), user_path(reply.user_id), :class => "newsBlue mr10 f14" %> + <% else %> + <%= link_to reply.try(:user).try(:realname), user_path(reply.user_id), :class => "newsBlue mr10 f14" %> + <% end %> + <%= format_time(reply.created_on) %> + + <% if reply.user == User.current %> + + <% else %> + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%> + <% end %> + +
        +
        + <% if reply.details.any? %> + <% details_to_strings(reply.details).each do |string| %> +

        <%= string %>

        + <% end %> + <% end %> +

        <%= reply.notes.html_safe %>

        +
        +
        +
        +
      • + <% end %> +
      +
      + <% end %> + +
      +
      <%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %>
      +
      +
      + <%= form_for('new_form',:url => add_journal_issue_path(activity.id, :user_activity_id => user_activity_id),:method => "post", :remote => true) do |f| %> + + +
      + +
      +

      + <% end%> +
      +
      +
      +
      +
      + +
      \ No newline at end of file diff --git a/app/views/welcome/_search_project.html.erb b/app/views/welcome/_search_project.html.erb index 6679f559d..fba855bde 100644 --- a/app/views/welcome/_search_project.html.erb +++ b/app/views/welcome/_search_project.html.erb @@ -91,7 +91,7 @@ form #search_by { if($("#search_type").val() == "users") { - $("#q").attr('placeholder','昵称/姓名/邮箱'); + $("#q").attr('placeholder','登录名/姓名/邮箱'); // $("#search_by").show(); } else diff --git a/config/locales/navigatiors/zh.yml b/config/locales/navigatiors/zh.yml index 97c6da61a..c0df616f3 100644 --- a/config/locales/navigatiors/zh.yml +++ b/config/locales/navigatiors/zh.yml @@ -63,7 +63,7 @@ zh: course: 课程 user: 用户 userinfo: - nickname: 昵称 + nickname: 登录名 showname: 姓名 email: 邮箱 diff --git a/config/locales/projects/zh.yml b/config/locales/projects/zh.yml index 765060675..8bf3f03be 100644 --- a/config/locales/projects/zh.yml +++ b/config/locales/projects/zh.yml @@ -369,7 +369,7 @@ zh: label_input_email: 请输入邮箱地址 label_invite_trustie_user: "邀请Trustie注册用户" - label_invite_trustie_user_tips: "支持姓名、邮箱、昵称搜索!" + label_invite_trustie_user_tips: "支持姓名、邮箱、登录名搜索!" label_user_role_null: 用户和角色不能留空! label_invite_project: 邀请您加入项目 label_mail_invite_success: 您已成功加入项目! diff --git a/config/locales/zh.yml b/config/locales/zh.yml index d5b249e8d..daa0c3a31 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -1855,7 +1855,7 @@ zh: excel_user_id: 学生id excel_user_name: 用户名 - excel_nickname: 昵称 + excel_nickname: 登录名 excel_student_id: 学号 excel_mail: 电子邮箱 excel_homework_name: 作品名 From bb67a8f77de97371d5384d1d4afacf3e6c910e98 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 22 Jan 2016 17:34:35 +0800 Subject: [PATCH 27/52] =?UTF-8?q?=E8=8B=A5=E6=B5=8B=E8=AF=95=E9=9B=86?= =?UTF-8?q?=E5=A4=9F=E9=95=BF=EF=BC=8C=E7=82=B9=E5=87=BB=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E9=9B=86=EF=BC=8C=E6=AD=A4=E6=97=B6=E5=BA=94?= =?UTF-8?q?=E8=AF=A5=E8=87=AA=E5=8A=A8=E5=AE=9A=E4=BD=8D=E5=88=B0=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E9=9B=86=E8=BE=93=E5=85=A5=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/javascripts/homework.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/javascripts/homework.js b/public/javascripts/homework.js index 45721fd1b..0762a6db3 100644 --- a/public/javascripts/homework.js +++ b/public/javascripts/homework.js @@ -194,7 +194,7 @@ $(function(){ autoTextarea2(outputs[i], inputs[i]); } } - + $(inputs[inputs.length - 1]).focus(); }); $("#BluePopupBox").on('click', 'a.icon_remove', function(){ $(this).parent('.mt10').remove(); From 58b5dbdf9aa10eff7d281ff9d83377eda960c2e7 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 22 Jan 2016 18:00:01 +0800 Subject: [PATCH 28/52] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=BA=93=E6=9C=80?= =?UTF-8?q?=E8=BF=91=E4=B8=80=E6=AC=A1=E6=8F=90=E4=BA=A4=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E5=AD=98=E5=85=A5=E6=95=B0=E6=8D=AE=E5=BA=93=20=E7=B2=BE?= =?UTF-8?q?=E5=93=81=E8=AF=BE=E7=A8=8B=E6=95=B0=E6=8D=AE=E8=BF=81=E7=A7=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/repositories_controller.rb | 8 ++++++++ app/helpers/application_helper.rb | 5 +++++ app/helpers/users_helper.rb | 5 ----- db/migrate/20160122094805_excellent_course.rb | 17 +++++++++++++++++ .../20160122094829_excellent_option_course.rb | 19 +++++++++++++++++++ db/schema.rb | 3 ++- 6 files changed, 51 insertions(+), 6 deletions(-) create mode 100644 db/migrate/20160122094805_excellent_course.rb create mode 100644 db/migrate/20160122094829_excellent_option_course.rb diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index cafec1c62..707e87fd1 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -360,6 +360,9 @@ update end # end @changesets_latest_coimmit = @changesets[0] + unless @changesets[0].blank? + update_commits_date(@project, @changesets_latest_coimmit) + end @properties = @repository.properties(@path, @rev) @repositories = @project.repositories @course_tag = params[:course] @@ -589,6 +592,11 @@ update project.project_score.update_attribute(:changeset_num, count) end + # 更新项目提交次数时间 + def update_commits_date project, date + project.project_score.update_attribute(:commit_time, date.created_at) + end + def find_repository @repository = Repository.find(params[:id]) @project = @repository.project diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 51138f2ef..3a0808bdd 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -49,6 +49,11 @@ module ApplicationHelper end end + def link_to_user_version(version, options = {}) + return '' unless version && version.is_a?(Version) + link_to_if version.visible?, format_version_name(version), { :controller => 'versions', :action => 'show', :id => version }, :class => " f16 fb c_dblue " + end + # 判断课程是否为精品课程 def is_excellent_course course (course.is_excellent? or course.excellent_option?) ? true : false diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index 43ef7cefc..bfc01a102 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -85,11 +85,6 @@ module UsersHelper end end - def link_to_user_version(version, options = {}) - return '' unless version && version.is_a?(Version) - link_to_if version.visible?, format_version_name(version), { :controller => 'versions', :action => 'show', :id => version }, :class => " f16 fb c_dblue " - end - # 统计未读消息数 def unviewed_message(user) course_count = CourseMessage.where("user_id =? and viewed =?", user, 0).count diff --git a/db/migrate/20160122094805_excellent_course.rb b/db/migrate/20160122094805_excellent_course.rb new file mode 100644 index 000000000..465b81464 --- /dev/null +++ b/db/migrate/20160122094805_excellent_course.rb @@ -0,0 +1,17 @@ +class ExcellentCourse < ActiveRecord::Migration + def up + arr = [302,192,370,394,183,361,117,218,379,178,418,203,342,403,225] + for i in 0..arr.length-1 + begin + puts arr[i] + course = Course.find(arr[i]) + course.update_attribute(:is_excellent, true) + rescue + logger.error("Course is not found!") + end + end + end + + def down + end +end diff --git a/db/migrate/20160122094829_excellent_option_course.rb b/db/migrate/20160122094829_excellent_option_course.rb new file mode 100644 index 000000000..30ee53ba3 --- /dev/null +++ b/db/migrate/20160122094829_excellent_option_course.rb @@ -0,0 +1,19 @@ +class ExcellentOptionCourse < ActiveRecord::Migration + def up + arr = [151,122,15,227,139,410,291,224,55,137,414,43,417,52,205,44,216,132,204,258,411,50, + 419,390,420,133,91,112,202,95,194,34,172,403,177,252,138,352,225,46,279,382,397,286,344,27,175, + 124,265,88,59,110,72,92,392,413,26,201,94,57,156,393,154,12,262] + for i in 0..arr.length-1 + begin + puts arr[i] + course = Course.find(arr[i]) + course.update_attribute(:excellent_option, true) + rescue + logger.error("Course is not found!") + end + end + end + + def down + end +end diff --git a/db/schema.rb b/db/schema.rb index 7e6291806..fb021e9ae 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 => 20160122083507) do +ActiveRecord::Schema.define(:version => 20160122094829) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -1372,6 +1372,7 @@ ActiveRecord::Schema.define(:version => 20160122083507) do t.integer "board_message_num", :default => 0 t.integer "board_num", :default => 0 t.integer "attach_num", :default => 0 + t.datetime "commit_time" end create_table "project_statuses", :force => true do |t| From dbed8379d3ab44a4fee491c6e2bde1c0be644966 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Fri, 22 Jan 2016 18:10:32 +0800 Subject: [PATCH 29/52] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E5=85=81=E8=AE=B8=E6=B8=B8=E5=AE=A2=E4=B8=8B=E8=BD=BD=E9=80=89?= =?UTF-8?q?=E9=A1=B9=E5=8A=9F=E8=83=BD=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/organizations_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index 4e3286700..85fc42f66 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -55,7 +55,7 @@ class OrganizationsController < ApplicationController @organization.name = params[:organization][:name] @organization.description = params[:organization][:description] @organization.is_public = params[:organization][:is_public] - @organization.allow_guest_download = params[:organization][:allow_guest_download] == 'on' ? 1 : 0 + @organization.allow_guest_download = params[:organization][:allow_guest_download] == '1' ? 1 : 0 @organization.creator_id = User.current.id member = OrgMember.new(:user_id => User.current.id) From 6ae7da99be343bac8ad87c2823b9bb359a8f7ebb Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 22 Jan 2016 18:33:43 +0800 Subject: [PATCH 30/52] =?UTF-8?q?=E5=B8=96=E5=AD=90=E3=80=81=E5=8D=9A?= =?UTF-8?q?=E5=AE=A2=E3=80=81=E9=80=9A=E7=9F=A5=E3=80=81=E6=96=87=E7=AB=A0?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2=E7=9A=84=E5=8D=95=E8=AF=8D?= =?UTF-8?q?=E6=8A=98=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/blog_comments/show.html.erb | 11 +++++++++-- app/views/courses/syllabus.html.erb | 11 +++++++++-- app/views/memos/show.html.erb | 11 +++++++++-- app/views/messages/_course_show.html.erb | 11 +++++++++-- app/views/messages/_org_subfield_show.html.erb | 11 +++++++++-- app/views/messages/_project_show.html.erb | 9 ++++++++- app/views/news/_course_show.html.erb | 9 ++++++++- app/views/news/_organization_show.html.erb | 9 ++++++++- app/views/news/_project_show.html.erb | 9 ++++++++- app/views/organizations/_show_org_document.html.erb | 11 +++++------ app/views/users/_project_news.html.erb | 3 --- 11 files changed, 82 insertions(+), 23 deletions(-) diff --git a/app/views/blog_comments/show.html.erb b/app/views/blog_comments/show.html.erb index 6f4397569..93041e1be 100644 --- a/app/views/blog_comments/show.html.erb +++ b/app/views/blog_comments/show.html.erb @@ -94,7 +94,7 @@
      <%= format_time( @article.created_on)%>
      -
      +
      <%= @article.content.html_safe%>
      @@ -208,4 +208,11 @@
      <% end %>
      -
      \ No newline at end of file + + \ No newline at end of file diff --git a/app/views/courses/syllabus.html.erb b/app/views/courses/syllabus.html.erb index 9d20b5adb..c9d333e6d 100644 --- a/app/views/courses/syllabus.html.erb +++ b/app/views/courses/syllabus.html.erb @@ -94,7 +94,7 @@
      <%= format_time( @article.created_on)%>
      -
      +
      <%= @article.content.html_safe%>
      @@ -214,4 +214,11 @@
      <% end %> - \ No newline at end of file + + \ No newline at end of file diff --git a/app/views/memos/show.html.erb b/app/views/memos/show.html.erb index b7cc1a0c2..3028f3369 100644 --- a/app/views/memos/show.html.erb +++ b/app/views/memos/show.html.erb @@ -74,7 +74,7 @@ <%= link_to @memo.author.name, user_path(@memo.author), :class => "linkBlue2", :target=> "_blank"%>
      <%= format_date( @memo.created_at)%>
      -
      +
      <%= @memo.content.html_safe%>
      @@ -136,4 +136,11 @@
      - \ No newline at end of file + + \ No newline at end of file diff --git a/app/views/messages/_course_show.html.erb b/app/views/messages/_course_show.html.erb index c760e686d..66d4bd0d0 100644 --- a/app/views/messages/_course_show.html.erb +++ b/app/views/messages/_course_show.html.erb @@ -80,7 +80,7 @@
      <%= format_time( @topic.created_on)%>
      -
      +
      <%= @topic.content.html_safe%>
      @@ -168,4 +168,11 @@
      <% end %> - \ No newline at end of file + + \ No newline at end of file diff --git a/app/views/messages/_org_subfield_show.html.erb b/app/views/messages/_org_subfield_show.html.erb index 6d12fe960..f46e7d5ab 100644 --- a/app/views/messages/_org_subfield_show.html.erb +++ b/app/views/messages/_org_subfield_show.html.erb @@ -109,7 +109,7 @@
      <%= format_time( @topic.created_on)%>
      -
      +
      <%= @topic.content.html_safe%>
      @@ -197,4 +197,11 @@
      <% end %> - \ No newline at end of file + + \ No newline at end of file diff --git a/app/views/messages/_project_show.html.erb b/app/views/messages/_project_show.html.erb index c98f2983e..187e1670e 100644 --- a/app/views/messages/_project_show.html.erb +++ b/app/views/messages/_project_show.html.erb @@ -135,7 +135,7 @@
      <%= format_time( @topic.created_on)%>
      -
      +
      <%= @topic.content.html_safe%>
      @@ -225,3 +225,10 @@
      + diff --git a/app/views/news/_course_show.html.erb b/app/views/news/_course_show.html.erb index 767c11553..05a430d57 100644 --- a/app/views/news/_course_show.html.erb +++ b/app/views/news/_course_show.html.erb @@ -85,7 +85,7 @@
      <%= format_time( @news.created_on)%>
      -
      +
      <%= @news.description.html_safe%>
      @@ -182,3 +182,10 @@ <% end %>
      + diff --git a/app/views/news/_organization_show.html.erb b/app/views/news/_organization_show.html.erb index 3e608c177..3189b03bf 100644 --- a/app/views/news/_organization_show.html.erb +++ b/app/views/news/_organization_show.html.erb @@ -75,7 +75,7 @@
      <%= format_time( @news.created_on)%>
      -
      +
      <%= @news.description.html_safe%>
      @@ -172,3 +172,10 @@ <% end %>
      + diff --git a/app/views/news/_project_show.html.erb b/app/views/news/_project_show.html.erb index 880bd0885..93fd1f10c 100644 --- a/app/views/news/_project_show.html.erb +++ b/app/views/news/_project_show.html.erb @@ -85,7 +85,7 @@
      <%= format_time( @news.created_on)%>
      -
      +
      <%= @news.description.html_safe%>
      @@ -182,3 +182,10 @@ <% end %>
      + diff --git a/app/views/organizations/_show_org_document.html.erb b/app/views/organizations/_show_org_document.html.erb index d4b44a3d2..b29bac7d1 100644 --- a/app/views/organizations/_show_org_document.html.erb +++ b/app/views/organizations/_show_org_document.html.erb @@ -20,10 +20,12 @@
      <% unless document.content.blank? %> -
      - <%= document.content.html_safe %> -
      + <%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>document.id, :content=>document.content} %> <% end %> +
      + + +
      <%= render :partial=>"attachments/activity_attach", :locals=>{:activity => document} %>
      @@ -133,9 +135,6 @@ From 26f850067125f4302c0c2cdf5a1bd794129bc61e Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Fri, 22 Jan 2016 18:42:50 +0800 Subject: [PATCH 31/52] =?UTF-8?q?=E5=8D=9A=E5=AE=A2=E5=9B=9E=E5=A4=8D?= =?UTF-8?q?=E5=90=8E=EF=BC=8C=E8=AF=A5=E5=8D=9A=E5=AE=A2=E7=9A=84=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E6=97=B6=E9=97=B4=E4=B8=BA=E5=BD=93=E5=89=8D=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/blog_comments_controller.rb | 1 + app/models/blog_comment.rb | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/app/controllers/blog_comments_controller.rb b/app/controllers/blog_comments_controller.rb index df6ba10d2..87bbcb2f3 100644 --- a/app/controllers/blog_comments_controller.rb +++ b/app/controllers/blog_comments_controller.rb @@ -127,6 +127,7 @@ class BlogCommentsController < ApplicationController @blogComment.title = "RE: #{@article.title}" unless params[:blog_comment][:title] @article.children << @blogComment @article.save + # @article.update_attribute(:updated_on, @blogComment.updated_on) @user_activity_id = params[:user_activity_id] user_activity = UserActivity.where("act_type='BlogComment' and act_id =#{@article.id}").first if user_activity diff --git a/app/models/blog_comment.rb b/app/models/blog_comment.rb index db28e55d6..2b31af604 100644 --- a/app/models/blog_comment.rb +++ b/app/models/blog_comment.rb @@ -18,6 +18,7 @@ class BlogComment < ActiveRecord::Base after_save :add_user_activity after_update :update_activity + after_create :update_parent_time before_destroy :destroy_user_activity scope :like, lambda {|arg| @@ -64,6 +65,11 @@ class BlogComment < ActiveRecord::Base (user && user.logged? && (self.author == user) ) || user.admin? end + def update_parent_time + if !self.parent.nil? + self.root.update_attribute(:updated_on, self.updated_on) + end + end def project end end From 16cb4add09365267eb0eefebd59fd9b5ae287e4e Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 22 Jan 2016 18:48:40 +0800 Subject: [PATCH 32/52] =?UTF-8?q?issue=E5=B1=80=E9=83=A8=E5=88=B7=E6=96=B0?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/issues_controller.rb | 4 ++-- app/views/users/_project_issue.html.erb | 2 ++ app/views/users/_project_issue_detail.html.erb | 8 ++++---- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 72dd0a741..eb78c4c5b 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -81,7 +81,7 @@ class IssuesController < ApplicationController @priority_id = params[:priority_id] @status_id = params[:status_id] @subject = params[:subject] - @done_ratio = parmas[:done_ratio] + @done_ratio = params[:done_ratio] @issue_count = @query.issue_count @issue_pages = Paginator.new @issue_count, @limit, params['page'] params[:page] = (params[:page] || 1).to_i + 1 #页码需要加1 @@ -222,7 +222,7 @@ class IssuesController < ApplicationController def update if params[:issue_detail] - issue = Issue.find(params[:issue_id]) + issue = Issue.find(params[:id]) issue = update_user_issue_detail(issue, params) @saved = update_user_issue_detail(issue, params) return diff --git a/app/views/users/_project_issue.html.erb b/app/views/users/_project_issue.html.erb index 618dc3185..725a064cc 100644 --- a/app/views/users/_project_issue.html.erb +++ b/app/views/users/_project_issue.html.erb @@ -52,9 +52,11 @@ <%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>activity.description} %> <%# 局部刷新:修改xissue属性 %> + <% unless params[:action] == "index" %>
      <%= render :partial => 'users/project_issue_detail', :locals => {:activity => activity} %>
      + <% end %>
      diff --git a/app/views/users/_project_issue_detail.html.erb b/app/views/users/_project_issue_detail.html.erb index e46761bd1..b682a74ea 100644 --- a/app/views/users/_project_issue_detail.html.erb +++ b/app/views/users/_project_issue_detail.html.erb @@ -42,7 +42,7 @@ {:include_blank => false, :selected => @status_id ? @status_id : 0 }, {:onchange=>"remote_function('#issue_query_form_#{activity.id}');",:id=>"status_id",:name=>"status_id",:class=>"w70 undis issueEdit"} %> <%# end %> - <%= form_tag({:controller => 'issues', :action => 'update', :issue_id => activity.id, :issue_detail => true, :type => "status"},:remote=>'true', :method => :put, :id=>"issue_query_form_#{activity.id}", :class => 'query_form') do %> + <%= form_tag({:controller => 'issues', :action => 'update', :id => activity.id, :issue_detail => true, :type => "status"},:remote=>'true', :method => :put, :id=>"issue_query_form_#{activity.id}", :class => 'query_form') do %>
    •  状态  : 

      <%= activity.status.name %>

      @@ -54,7 +54,7 @@
    • <% end %>
      - <%= form_tag({:controller => 'issues', :action => 'update', :issue_id => activity.id, :issue_detail => true, :type => "assigned"},:remote=>'true', :method => :put, :id=>"issue_query_assign_form_#{activity.id}", :class => 'query_form') do %> + <%= form_tag({:controller => 'issues', :action => 'update', :id => activity.id, :issue_detail => true, :type => "assigned"},:remote=>'true', :method => :put, :id=>"issue_query_assign_form_#{activity.id}", :class => 'query_form') do %>
    •  指派  : 

      @@ -68,7 +68,7 @@
      - <%= form_tag({:controller => 'issues', :action => 'update', :issue_id => activity.id, :issue_detail => true, :type => "prior"},:remote=>'true', :method => :put, :id=>"issue_query_prior_form_#{activity.id}", :class => 'query_form') do %> + <%= form_tag({:controller => 'issues', :action => 'update', :id => activity.id, :issue_detail => true, :type => "prior"},:remote=>'true', :method => :put, :id=>"issue_query_prior_form_#{activity.id}", :class => 'query_form') do %>
    •  优先级  : 

      <%= activity.priority.name %> @@ -78,7 +78,7 @@
    • <% end %>
      - <%= form_tag({:controller => 'issues', :action => 'update', :issue_id => activity.id, :issue_detail => true, :type => "ratio"},:remote=>'true', :method => :put, :id=>"issue_query_done_form_#{activity.id}", :class => 'query_form') do %> + <%= form_tag({:controller => 'issues', :action => 'update', :id => activity.id, :issue_detail => true, :type => "ratio"},:remote=>'true', :method => :put, :id=>"issue_query_done_form_#{activity.id}", :class => 'query_form') do %>
    •  完成度  : 

      <%= activity.done_ratio %>% From c4a264f8a6864f5487d7d63945b3fa11dd7ddd98 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 22 Jan 2016 18:48:50 +0800 Subject: [PATCH 33/52] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BD=9C=E5=93=81?= =?UTF-8?q?=E6=97=B6=E7=9A=84=E9=99=84=E4=BB=B6=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/student_work/_work_edit_information.html.erb | 10 +++++++++- app/views/student_work/_work_information.html.erb | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/app/views/student_work/_work_edit_information.html.erb b/app/views/student_work/_work_edit_information.html.erb index 38670d9e4..1934d15eb 100644 --- a/app/views/student_work/_work_edit_information.html.erb +++ b/app/views/student_work/_work_edit_information.html.erb @@ -13,7 +13,15 @@ <%= "无附件"%> <% else %>
      - <%= render :partial => 'work_attachments_status', :locals => {:attachments => @student_work.attachments, :status => 2} %> + <% @student_work.attachments.each_with_index do |attachment,i| %> +
      + <%= link_to_short_attachment attachment, :class => 'link_file_a fl', :download => true -%> + <%= link_to(' '.html_safe, attachment_path(attachment, :format => 'js'), :method => 'delete', :remote => true, :title => '删除', :class => 'remove-upload fl', :confirm => l(:text_are_you_sure)) %> + (<%= number_to_human_size attachment.filesize %>) +
      +
      + <% end -%> + <%#= render :partial => 'work_attachments_status', :locals => {:attachments => @student_work.attachments, :status => 2} %>
      <% end %>

      diff --git a/app/views/student_work/_work_information.html.erb b/app/views/student_work/_work_information.html.erb index bc728ca71..d23f21c4d 100644 --- a/app/views/student_work/_work_information.html.erb +++ b/app/views/student_work/_work_information.html.erb @@ -13,7 +13,15 @@ <%= "无附件"%> <% else %>
      - <%= render :partial => 'work_attachments_status', :locals => {:attachments => @student_work.attachments, :status => 2} %> + <% @student_work.attachments.each_with_index do |attachment,i| %> +
      + <%= link_to_short_attachment attachment, :class => 'link_file_a fl', :download => true -%> + <%= link_to(' '.html_safe, attachment_path(attachment, :format => 'js'), :method => 'delete', :remote => true, :title => '删除', :class => 'remove-upload fl', :confirm => l(:text_are_you_sure)) %> + (<%= number_to_human_size attachment.filesize %>) +
      +
      + <% end -%> + <%#= render :partial => 'work_attachments_status', :locals => {:attachments => @student_work.attachments, :status => 2} %>
      <% end %>

      From 007afa8c4f991471d7f6bd84f80bb78fc4c54f29 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 22 Jan 2016 19:34:02 +0800 Subject: [PATCH 34/52] =?UTF-8?q?issue=E5=9C=A8=E5=8A=A8=E6=80=81=E4=B8=AD?= =?UTF-8?q?=E5=9B=9E=E5=A4=8D=E8=87=AA=E5=8A=A8=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/issues/add_journal.js.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/issues/add_journal.js.erb b/app/views/issues/add_journal.js.erb index 5708f6b3d..9099c31b6 100644 --- a/app/views/issues/add_journal.js.erb +++ b/app/views/issues/add_journal.js.erb @@ -20,7 +20,7 @@ $(".homepagePostReplyBannerCount").html('回复(<%= Issue.find( @issue_id).journals.count %>)') sd_create_editor_from_data(<%= @issue.id %>, null, "100%"); <%else%> - $("#div_user_issue_reply_<%=@user_activity_id %>").replaceWith("<%= escape_javascript(render :partial => 'users/project_issue_reply', :locals => {:activity => @issue, :user_activity_id => @user_activity_id}) %>"); + $("#div_user_issue_reply_<%=@user_activity_id %>").html("<%= escape_javascript(render :partial => 'users/project_issue_reply', :locals => {:activity => @issue, :user_activity_id => @user_activity_id}) %>"); init_activity_KindEditor_data(<%= @user_activity_id %>,"","87%", 'UserActivity'); // sd_create_editor_from_data(<%#= @issue.id%>, null, "100%"); <%end %> From afad062b809ee80c7592973a0274e508b854a715 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Fri, 22 Jan 2016 19:49:05 +0800 Subject: [PATCH 35/52] =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E6=A0=8F=E7=9B=AE=E3=80=81=E9=A1=B9=E7=9B=AE=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E3=80=81=E8=AF=BE=E7=A8=8B=E8=B5=84=E6=BA=90=E7=9A=84title,?= =?UTF-8?q?=E4=B8=8D=E6=98=BE=E7=A4=BAFiles?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/files/_course_file.html.erb | 2 +- app/views/files/_project_file.html.erb | 2 +- app/views/files/_subfield_files.html.erb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/files/_course_file.html.erb b/app/views/files/_course_file.html.erb index 85b230be3..cf91b7814 100644 --- a/app/views/files/_course_file.html.erb +++ b/app/views/files/_course_file.html.erb @@ -126,4 +126,4 @@ <%= render :partial => 'course_list',:locals => {course: @course,all_attachments: @all_attachments,sort:@sort,order:@order,curse_attachments:@obj_attachments} %> -<% html_title(l(:label_attachment_plural)) -%> \ No newline at end of file +<%# html_title(l(:label_attachment_plural)) -%> \ No newline at end of file diff --git a/app/views/files/_project_file.html.erb b/app/views/files/_project_file.html.erb index 88c30e1b7..e8f4f023b 100644 --- a/app/views/files/_project_file.html.erb +++ b/app/views/files/_project_file.html.erb @@ -95,4 +95,4 @@ <%= render :partial => 'project_list',:locals => {project: @project, all_attachments: @all_attachments, sort:@sort, order:@order, project_attachments:@obj_attachments} %> -<% html_title(l(:label_attachment_plural)) -%> \ No newline at end of file +<%# html_title(l(:label_attachment_plural)) -%> \ No newline at end of file diff --git a/app/views/files/_subfield_files.html.erb b/app/views/files/_subfield_files.html.erb index eed9266d5..1de0e8dc2 100644 --- a/app/views/files/_subfield_files.html.erb +++ b/app/views/files/_subfield_files.html.erb @@ -74,7 +74,7 @@ -<% html_title(l(:label_attachment_plural)) -%> +<%# html_title(l(:label_attachment_plural)) -%> - <%= render :partial => 'user_journalsformessage', :locals => {:activity => jour,:user_activity_id =>jour.id} %> + <%= render :partial => 'user_journalsformessage', :locals => {:activity => jour,:user_activity_id =>jour.id,:is_activity=>false} %> <%#= render :partial => 'user_jours_new', :locals => {:jour => jour} %> <% end %> <%end%> diff --git a/app/views/words/create_reply.js.erb b/app/views/words/create_reply.js.erb index ac56b69fc..8d6674845 100644 --- a/app/views/words/create_reply.js.erb +++ b/app/views/words/create_reply.js.erb @@ -1,9 +1,9 @@ <% if @save_succ %> <% if @user_activity_id %> <% if @reply_type == 'user' %> - $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/user_journalsformessage', :locals => {:activity => @activity,:user_activity_id =>@user_activity_id}) %>"); + $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/user_journalsformessage', :locals => {:activity => @activity,:user_activity_id =>@user_activity_id,:is_activity=>@is_activity}) %>"); <% else %> - $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_journalsformessage', :locals => {:activity => @activity,:user_activity_id =>@user_activity_id}) %>"); + $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_journalsformessage', :locals => {:activity => @activity,:user_activity_id =>@user_activity_id,:is_activity=>@is_activity}) %>"); <% end %> init_activity_KindEditor_data('<%= @user_activity_id%>', "", "87%", "UserActivity"); <% else %> From 655cc0d2dbcaadaf95ed4dbe56d2a2bdf07a90bb Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 22 Jan 2016 20:26:44 +0800 Subject: [PATCH 38/52] =?UTF-8?q?issue=E6=88=AA=E6=AD=A2=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E9=82=AE=E4=BB=B6=E9=80=9A=E7=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/mailer.rb | 10 +++++++++- app/views/mailer/issue_due_date.text.erb | 0 lib/tasks/issue_due_date.rake | 4 ++-- 3 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 app/views/mailer/issue_due_date.text.erb diff --git a/app/models/mailer.rb b/app/models/mailer.rb index ee37927d3..05b0349ec 100644 --- a/app/models/mailer.rb +++ b/app/models/mailer.rb @@ -380,7 +380,15 @@ class Mailer < ActionMailer::Base end # issue截止时间提醒 - def issue_due_date(issue, recipients) + def issue_due_date(issue) + recipients ||= [] + if issue.author.id != issue.assigned_to_id + recipients << issue.author.mail + end + + # 被指派人邮箱地址加入数组 + recipients << issue.assigned_to.mail + # cc = wiki_content.page.wiki.watcher_recipients - recipients @author = issue.author @issue_name = issue.subject @issue_url = url_for(:controller => 'issues', :action => 'show', :id => issue.id) diff --git a/app/views/mailer/issue_due_date.text.erb b/app/views/mailer/issue_due_date.text.erb new file mode 100644 index 000000000..e69de29bb diff --git a/lib/tasks/issue_due_date.rake b/lib/tasks/issue_due_date.rake index 74ee242f5..8ea6d9ed0 100644 --- a/lib/tasks/issue_due_date.rake +++ b/lib/tasks/issue_due_date.rake @@ -14,10 +14,10 @@ namespace :issue_due_date do recipients << assigner recipients.each do |r| issue.forge_messages << ForgeMessage.new(:user_id => r.id, :project_id => issue.project_id, :viewed => false, :status => 1) - # issue截止时间邮件提醒 - Mailer.issue_due_date(issue, recipients).deliver end end + # issue截止时间邮件提醒 + Mailer.issue_due_date(issue).deliver end end end From b3caa0154057d053d24924a84de988a1f55c689a Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 22 Jan 2016 20:45:25 +0800 Subject: [PATCH 39/52] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/_recommendation.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/courses/_recommendation.html.erb b/app/views/courses/_recommendation.html.erb index 455ced056..d0afc6ebd 100644 --- a/app/views/courses/_recommendation.html.erb +++ b/app/views/courses/_recommendation.html.erb @@ -7,7 +7,7 @@

      <%=link_to e_course.name, course_path(e_course.id), :class => "hidden fl w170" %>

      <%= l(:project_module_attachments) %>(<%= link_to e_course.attachments.count, course_files_path(e_course), :class => "linkBlue2" %>) - <%= l(:label_homework_commont) %>(<%= link_to e_course.homework_commons.count, homework_common_index_path(e_course), :class => "linkBlue2" %>)

      + <%= l(:label_homework_commont) %>(<%= link_to e_course.homework_commons.count, homework_common_index_path(:course=>e_course.id), :class => "linkBlue2" %>)

    • From bbdced9bc11b04ef06143675c3a400a4429fb9ea Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 22 Jan 2016 21:41:17 +0800 Subject: [PATCH 40/52] =?UTF-8?q?=E7=95=99=E8=A8=80=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E7=9A=84=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/views/users/_jour_form.html.erb | 4 ++-- app/views/users/_user_activities.html.erb | 2 +- app/views/users/_user_journalsformessage.html.erb | 2 +- app/views/users/_user_jours_list.html.erb | 2 +- app/views/words/create_reply.js.erb | 2 +- db/schema.rb | 1 + 6 files changed, 7 insertions(+), 6 deletions(-) diff --git a/app/views/users/_jour_form.html.erb b/app/views/users/_jour_form.html.erb index 13bf6d79a..4ad9fef54 100644 --- a/app/views/users/_jour_form.html.erb +++ b/app/views/users/_jour_form.html.erb @@ -8,8 +8,8 @@ <%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %> <%= f.kindeditor :content, :editor_id => 'jour_content_editor', :width => '99.7%', - :height => 40, - :minHeight=>40, + :height => 100, + :minHeight=>100, :input_html => { :id => 'jour_content', :class => 'talk_text fl', :maxlength => 5000 }%> diff --git a/app/views/users/_user_activities.html.erb b/app/views/users/_user_activities.html.erb index d4169bc47..c8d599af4 100644 --- a/app/views/users/_user_activities.html.erb +++ b/app/views/users/_user_activities.html.erb @@ -111,7 +111,7 @@ <% case user_activity.act_type.to_s %> <% when 'JournalsForMessage' %> <% unless act.private == 1 && (!User.current || (User.current && act.jour_id != User.current.id && act.user_id != User.current.id)) %> - <%= render :partial => 'user_journalsformessage', :locals => {:activity => act,:user_activity_id =>user_activity.id,:is_activity=>true} %> + <%= render :partial => 'user_journalsformessage', :locals => {:activity => act,:user_activity_id =>user_activity.id,:is_activity=>1} %> <% end %> <% end %> <% end %> diff --git a/app/views/users/_user_journalsformessage.html.erb b/app/views/users/_user_journalsformessage.html.erb index 70cce2374..e30fd1824 100644 --- a/app/views/users/_user_journalsformessage.html.erb +++ b/app/views/users/_user_journalsformessage.html.erb @@ -16,7 +16,7 @@ <% end %> <% end %> - <% if is_activity %> + <% if is_activity.to_i == 1 %>
      <% if activity.parent %> <%= link_to activity.parent.notes.html_safe, feedback_path(activity.jour, :host=> Setting.host_user), :class => "postGrey" %> diff --git a/app/views/users/_user_jours_list.html.erb b/app/views/users/_user_jours_list.html.erb index 6993a7e91..c73344a7a 100644 --- a/app/views/users/_user_jours_list.html.erb +++ b/app/views/users/_user_jours_list.html.erb @@ -22,7 +22,7 @@ init_activity_KindEditor_data(<%= jour.id%>, null, "87%", "<%=jour.class.to_s%>"); }); - <%= render :partial => 'user_journalsformessage', :locals => {:activity => jour,:user_activity_id =>jour.id,:is_activity=>false} %> + <%= render :partial => 'user_journalsformessage', :locals => {:activity => jour,:user_activity_id =>jour.id,:is_activity=>0} %> <%#= render :partial => 'user_jours_new', :locals => {:jour => jour} %> <% end %> <%end%> diff --git a/app/views/words/create_reply.js.erb b/app/views/words/create_reply.js.erb index 8d6674845..d4d9a2cd7 100644 --- a/app/views/words/create_reply.js.erb +++ b/app/views/words/create_reply.js.erb @@ -3,7 +3,7 @@ <% if @reply_type == 'user' %> $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/user_journalsformessage', :locals => {:activity => @activity,:user_activity_id =>@user_activity_id,:is_activity=>@is_activity}) %>"); <% else %> - $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_journalsformessage', :locals => {:activity => @activity,:user_activity_id =>@user_activity_id,:is_activity=>@is_activity}) %>"); + $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_journalsformessage', :locals => {:activity => @activity,:user_activity_id =>@user_activity_id}) %>"); <% end %> init_activity_KindEditor_data('<%= @user_activity_id%>', "", "87%", "UserActivity"); <% else %> diff --git a/db/schema.rb b/db/schema.rb index fb021e9ae..b31ebc5c2 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1371,6 +1371,7 @@ ActiveRecord::Schema.define(:version => 20160122094829) do t.integer "changeset_num", :default => 0 t.integer "board_message_num", :default => 0 t.integer "board_num", :default => 0 + t.integer "act_num", :default => 0 t.integer "attach_num", :default => 0 t.datetime "commit_time" end From 4b253835313fd02367d4394d373bf24153beb03b Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 22 Jan 2016 21:42:05 +0800 Subject: [PATCH 41/52] =?UTF-8?q?=E5=AD=A6=E7=94=9F=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E7=9A=84tip=E8=A2=AB=E9=81=AE=E7=9B=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/courses.css | 2 +- public/stylesheets/project.css | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index 1e3c68c83..a0052b97a 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -513,7 +513,7 @@ a.exit { height:24px; display:block; width:80px; color:#000000; background:#c3c3 .st_list{ width:670px;} .st_search{ } .st_search span{ font-size:14px; font-weight:bold; color:#606060; margin-right:35px;} -.st_search_input{ border:1px solid #1c9ec7; background:#fff; height:20px; color:#c4c4c4; width:200px; padding-left:5px; margin-bottom:5px;} +.st_search_input{ border:1px solid #1c9ec7; background:#fff; height:20px; color:#c4c4c4; width:220px; padding-left:5px; margin-bottom:5px;} .st_search a{ background:#1c9ec7; color:#fff;border:1px solid #1c9ec7; text-align:center; display:block; width:60px; height:20px; float:left; font-size:12px; } .st_search a:hover{ background:#048fbb; text-decoration:none;} .classbox{ border:1px solid #f8df8c; background:#fffce6; color:#0d90c3; padding:0 3px; float:left; margin-left:15px;} diff --git a/public/stylesheets/project.css b/public/stylesheets/project.css index f1b0c5846..29c099d3d 100644 --- a/public/stylesheets/project.css +++ b/public/stylesheets/project.css @@ -414,7 +414,7 @@ a.link_file_board{ background:url(../images/pic_file.png) 0 3px no-repeat !impor .st_list{ width:670px;} .st_search{ } .st_search span{ font-size:14px; font-weight:bold; color:#606060; margin-right:35px;} -.st_search_input{ border:1px solid #1c9ec7; background:#fff; height:20px; color:#c4c4c4; width:200px; padding-left:5px; margin-bottom:5px;} +.st_search_input{ border:1px solid #1c9ec7; background:#fff; height:20px; color:#c4c4c4; width:220px; padding-left:5px; margin-bottom:5px;} .st_search a{ background:#1c9ec7; color:#fff;border:1px solid #1c9ec7; text-align:center; display:block; width:60px; height:20px; float:left; font-size:12px; } .st_search a:hover{ background:#048fbb; text-decoration:none;} .classbox{ border:1px solid #f8df8c; background:#fffce6; color:#0d90c3; padding:0 3px; float:left; margin-left:15px;} @@ -1167,4 +1167,4 @@ div.disable_link {background-color: #c1c1c1 !important;} /*问题跟踪局部修改属性*/ .proInfoBox2{ border:1px solid #dddddd; height:45px; padding:10px 0; background-color:#f1f1f1;} -.proInfoBox2 ul li{ height:24px; position:relative;} +.proInfoBox2 ul li{ height:24px; position:relative;} From 435f81a42203969edf90807e9d0bb6cb148457e3 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 22 Jan 2016 21:47:59 +0800 Subject: [PATCH 42/52] =?UTF-8?q?=E5=85=B3=E8=81=94=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E7=9A=84=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/organizations/_org_course_homework.html.erb | 2 +- app/views/users/_course_homework.html.erb | 2 +- app/views/users/_user_homework_detail.html.erb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/organizations/_org_course_homework.html.erb b/app/views/organizations/_org_course_homework.html.erb index 3446a86d4..3dccdcc2b 100644 --- a/app/views/organizations/_org_course_homework.html.erb +++ b/app/views/organizations/_org_course_homework.html.erb @@ -194,7 +194,7 @@ <% time=project.updated_on %> <% time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last %>

      <%=(User.find project.user_id).show_name %>(组长)

      -

      <%=time_from_now !com_time.nil? && format_time(com_time) > format_timetime ? com_time : time %>  <%= project.project_score.changeset_num %>提交

      +

      <%=time_from_now !com_time.nil? && format_time(com_time) > format_time(time) ? com_time : time %>  <%= project.project_score.changeset_num %>提交

      项目名称:<%=project.name %>
      创建者:<%=(User.find project.user_id).show_name %>(组长)
      diff --git a/app/views/users/_course_homework.html.erb b/app/views/users/_course_homework.html.erb index 5be1334c3..23a469188 100644 --- a/app/views/users/_course_homework.html.erb +++ b/app/views/users/_course_homework.html.erb @@ -193,7 +193,7 @@ <% time=project.updated_on %> <% time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last %>

      <%=(User.find project.user_id).show_name %>(组长)

      -

      <%=time_from_now !com_time.nil? && format_time(com_time) > format_timetime ? com_time : time %>  <%= project.project_score.changeset_num %>提交

      +

      <%=time_from_now !com_time.nil? && format_time(com_time) > format_time(time) ? com_time : time %>  <%= project.project_score.changeset_num %>提交

      项目名称:<%=project.name %>
      创建者:<%=(User.find project.user_id).show_name %>(组长)
      diff --git a/app/views/users/_user_homework_detail.html.erb b/app/views/users/_user_homework_detail.html.erb index 04c8b8f0a..36b2be34f 100644 --- a/app/views/users/_user_homework_detail.html.erb +++ b/app/views/users/_user_homework_detail.html.erb @@ -195,7 +195,7 @@ <% time=project.updated_on %> <% time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last %>

      <%=(User.find project.user_id).show_name %>(组长)

      -

      <%=time_from_now !com_time.nil? && format_time(com_time) > format_timetime ? com_time : time %>  <%= project.project_score.changeset_num %>提交

      +

      <%=time_from_now !com_time.nil? && format_time(com_time) > format_time(time) ? com_time : time %>  <%= project.project_score.changeset_num %>提交

      项目名称:<%=project.name %>
      创建者:<%=(User.find project.user_id).show_name %>(组长)
      From 83ff449946ed50209a466b2430cd3579dfe40287 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 22 Jan 2016 21:51:31 +0800 Subject: [PATCH 43/52] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E3=80=81=E8=AF=BE?= =?UTF-8?q?=E7=A8=8B=E8=B5=84=E6=BA=90=20=E6=B5=8F=E8=A7=88=20=E6=94=B9?= =?UTF-8?q?=E6=88=90=20=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/locales/zh.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/zh.yml b/config/locales/zh.yml index daa0c3a31..e9d3ed813 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -674,7 +674,7 @@ zh: label_day_plural: 天 label_repository: 版本库 label_course_repository: 代码库 - label_browse: 浏览 + label_browse: 上传文件 label_branch: 分支 label_tag: 标签 label_revision: 修订 From 8f1bffd28b6dc9e02fbc57521e3bedfcff778849 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 22 Jan 2016 21:53:32 +0800 Subject: [PATCH 44/52] =?UTF-8?q?=E7=95=99=E8=A8=80=E4=B8=8D=E8=83=BD?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/javascripts/new_user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/javascripts/new_user.js b/public/javascripts/new_user.js index f273f0b77..b6301afad 100644 --- a/public/javascripts/new_user.js +++ b/public/javascripts/new_user.js @@ -75,7 +75,7 @@ function private_jour_submit(){ function jourReplyVerify() { var content = jour_content_editor.html();//$.trim($("#message_content").val()); if (jour_content_editor.isEmpty()) { - $("#jour_content_span").text("回复不能为空"); + $("#jour_content_span").text("留言不能为空"); $("#jour_content_span").css('color', '#ff0000'); $("#submit_feedback_user").one('click',function() { jour_submit(); From f632a3d4fb7b69883a9272848c3481b158bb7c08 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 22 Jan 2016 22:17:52 +0800 Subject: [PATCH 45/52] =?UTF-8?q?=E7=BC=96=E7=A8=8B=E5=BC=B9=E6=A1=86?= =?UTF-8?q?=E5=9B=BA=E5=AE=9A=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/javascripts/homework.js | 1 + 1 file changed, 1 insertion(+) diff --git a/public/javascripts/homework.js b/public/javascripts/homework.js index 0762a6db3..bd2b967e4 100644 --- a/public/javascripts/homework.js +++ b/public/javascripts/homework.js @@ -117,6 +117,7 @@ $(function(){ $('#BluePopupBox').parent().resizable("disable"); $('#BluePopupBox').parent().removeClass("ui-state-disabled"); $('#BluePopupBox').parent().css("border","3px solid #269ac9").css("padding","10px"); + $('#BluePopupBox').parent().css("position","fixed"); $('a.ProBtn').live('click', function(){ $("#BluePopupBox").dialog("open"); From dfb8a3afbf1eeca98b38b0d91746a417015120ac Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 22 Jan 2016 22:35:47 +0800 Subject: [PATCH 46/52] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=BF=81=E7=A7=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20160122142844_excellent_course_se.rb | 17 +++++++++++++++++ .../20160122143138_excellent_option_se.rb | 19 +++++++++++++++++++ db/schema.rb | 3 +-- 3 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 db/migrate/20160122142844_excellent_course_se.rb create mode 100644 db/migrate/20160122143138_excellent_option_se.rb diff --git a/db/migrate/20160122142844_excellent_course_se.rb b/db/migrate/20160122142844_excellent_course_se.rb new file mode 100644 index 000000000..c6f5dbb88 --- /dev/null +++ b/db/migrate/20160122142844_excellent_course_se.rb @@ -0,0 +1,17 @@ +class ExcellentCourseSe < ActiveRecord::Migration + def up + arr = [302,192,370,394,183,361,117,218,379,178,418,203,342,403,225] + for i in 0..arr.length-1 + begin + puts arr[i] + course = Course.find(arr[i]) + course.update_attribute(:is_excellent, true) + rescue + logger.error("Course is not found!") + end + end + end + + def down + end +end diff --git a/db/migrate/20160122143138_excellent_option_se.rb b/db/migrate/20160122143138_excellent_option_se.rb new file mode 100644 index 000000000..cee739b7f --- /dev/null +++ b/db/migrate/20160122143138_excellent_option_se.rb @@ -0,0 +1,19 @@ +class ExcellentOptionSe < ActiveRecord::Migration + def up + arr = [151,122,15,227,139,410,291,224,55,137,414,43,417,52,205,44,216,132,204,258,411,50, + 419,390,420,133,91,112,202,95,194,34,172,403,177,252,138,352,225,46,279,382,397,286,344,27,175, + 124,265,88,59,110,72,92,392,413,26,201,94,57,156,393,154,12,262] + for i in 0..arr.length-1 + begin + puts arr[i] + course = Course.find(arr[i]) + course.update_attribute(:excellent_option, true) + rescue + logger.error("Course is not found!") + end + end + end + + def down + end +end diff --git a/db/schema.rb b/db/schema.rb index b31ebc5c2..b2c74a96c 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 => 20160122094829) do +ActiveRecord::Schema.define(:version => 20160122143138) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -1371,7 +1371,6 @@ ActiveRecord::Schema.define(:version => 20160122094829) do t.integer "changeset_num", :default => 0 t.integer "board_message_num", :default => 0 t.integer "board_num", :default => 0 - t.integer "act_num", :default => 0 t.integer "attach_num", :default => 0 t.datetime "commit_time" end From d386b2ff84194f4f5a22bc03a3d5ad5ad38e390b Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 22 Jan 2016 22:37:47 +0800 Subject: [PATCH 47/52] =?UTF-8?q?=E7=95=99=E8=A8=80=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E7=9A=84=E2=80=9C=E5=B1=95=E5=BC=80=E6=9B=B4=E5=A4=9A=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_user_jours_list.html.erb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/app/views/users/_user_jours_list.html.erb b/app/views/users/_user_jours_list.html.erb index c73344a7a..d982d8984 100644 --- a/app/views/users/_user_jours_list.html.erb +++ b/app/views/users/_user_jours_list.html.erb @@ -18,6 +18,22 @@ <% jours.each do |jour|%> <% unless jour.private == 1 && (!User.current || (User.current && jour.jour_id != User.current.id && jour.user_id != User.current.id)) %> -
      -
      -
        - <%#= labelled_fields_for :issue, @issue do |f| %> - <%#= f.select :status_id, ([["新增",1],["正在解决",2],["已解决",3],["反馈",4],["关闭",5],["拒绝",6]].unshift(["状态",0])), - {:include_blank => false, :selected => @status_id ? @status_id : 0 }, - {:onchange=>"remote_function('#issue_query_form_#{activity.id}');",:id=>"status_id",:name=>"status_id",:class=>"w70 undis issueEdit"} %> - <%# end %> - <%= form_tag({:controller => 'issues', :action => 'update', :id => activity.id, :issue_detail => true, :type => "status"},:remote=>'true', :method => :put, :id=>"issue_query_form_#{activity.id}", :class => 'query_form') do %> -
      • -

         状态  : 

        -

        <%= activity.status.name %>

        - <%= select( :issue,:status, [["新增",1],["正在解决",2],["已解决",3],["反馈",4],["关闭",5],["拒绝",6]].unshift(["状态",0]), - {:include_blank => false, :selected => @status_id ? @status_id : 0 }, - {:onchange=>"remote_function('#issue_query_form_#{activity.id}');",:id=>"status_id",:name=>"status_id",:class=>"w70 undis issueEdit"} - ) - %> -
      • - <% end %> -
        - <%= form_tag({:controller => 'issues', :action => 'update', :id => activity.id, :issue_detail => true, :type => "assigned"},:remote=>'true', :method => :put, :id=>"issue_query_assign_form_#{activity.id}", :class => 'query_form') do %> -
      • -

         指派  : 

        - - <%= link_to activity.try(:assigned_to), user_path(activity.assigned_to_id), :class => "linkBlue hidden", :style => "max-width:50px; display:inline-block;" %> - - <%= select( :issue, :user_id, principals_options_for_isuue_list(activity.project), - { :include_blank => false,:selected => @assign_to_id ? @assign_to_id : 0}, - {:onchange=>"remote_function('#issue_query_assign_form_#{activity.id}');", :id =>"assigned_to_id", :name => "assigned_to_id",:class=>"w70 undis issueEdit"}) %> -
      • - <% end %> -
        -
      -
        - <%= form_tag({:controller => 'issues', :action => 'update', :id => activity.id, :issue_detail => true, :type => "prior"},:remote=>'true', :method => :put, :id=>"issue_query_prior_form_#{activity.id}", :class => 'query_form') do %> -
      • -

         优先级  : 

        - <%= activity.priority.name %> - <%= select( :issue,:prior, [["低",1],["正常",2],["高",3],["紧急",4],["立刻",5]].unshift(["优先级",0]), - {:include_blank => false,:selected=>@priority_id ? @priority_id : 0}, - {:onchange=>"remote_function('#issue_query_prior_form_#{activity.id}');",:id=>"priority_id",:name=>"priority_id",:class=>"w70 undis issueEdit"}) %> -
      • - <% end %> -
        - <%= form_tag({:controller => 'issues', :action => 'update', :id => activity.id, :issue_detail => true, :type => "ratio"},:remote=>'true', :method => :put, :id=>"issue_query_done_form_#{activity.id}", :class => 'query_form') do %> -
      • -

         完成度  : 

        - <%= activity.done_ratio %>% - <%= select( :issue,:done_ratio, ((0..10).to_a.collect { |r| ["#{r*10} %", r*10] }), - {:include_blank => false, :selected => @done_ratio ? @done_ratio : 0}, - {:onchange=>"remote_function('#issue_query_done_form_#{activity.id}');",:id=>"done_ratio",:name=>"done_ratio",:class=>"w70 undis issueEdit"}) %> - <% end %> -
      • - -
        -
      -
        -
      • -

         开始  : 

        -

        <%= format_date(activity.start_date) %>

        -
      • -
        -
      • -

         周期  : 

        - <%= l_hours(activity.estimated_hours) %>
      • -
        -
      -
        -
      • -

         计划完成  : 

        - <%= format_date(activity.due_date)? format_date(activity.due_date) : "--" %>
      • -
        -
      • -

         目标版本  : 

        - <%= (activity.fixed_version ? link_to_user_version(activity.fixed_version) : "--") %>
      • -
        -
      - + +
      +
      +
        + <%#= labelled_fields_for :issue, @issue do |f| %> + <%#= f.select :status_id, ([["新增",1],["正在解决",2],["已解决",3],["反馈",4],["关闭",5],["拒绝",6]].unshift(["状态",0])), + {:include_blank => false, :selected => @status_id ? @status_id : 0 }, + {:onchange=>"remote_function('#issue_query_form_#{activity.id}');",:id=>"status_id",:name=>"status_id",:class=>"w70 undis issueEdit"} %> + <%# end %> + <%= form_tag({:controller => 'issues', :action => 'update', :id => activity.id, :issue_detail => true, :type => "status"},:remote=>'true', :method => :put, :id=>"issue_query_form_#{activity.id}", :class => 'query_form') do %> +
      • +

         状态  : 

        +

        <%= activity.status.name %>

        + <%= select( :issue,:status, [["新增",1],["正在解决",2],["已解决",3],["反馈",4],["关闭",5],["拒绝",6]].unshift(["状态",0]), + {:include_blank => false, :selected => @status_id ? @status_id : 0 }, + {:onchange=>"remote_function('#issue_query_form_#{activity.id}');",:id=>"status_id",:name=>"status_id",:class=>"w70 undis issueEdit",:style=>"white-space:nowrap; overflow:hidden;"} + ) + %> +
      • + <% end %> +
        + <%= form_tag({:controller => 'issues', :action => 'update', :id => activity.id, :issue_detail => true, :type => "assigned"},:remote=>'true', :method => :put, :id=>"issue_query_assign_form_#{activity.id}", :class => 'query_form') do %> +
      • +

         指派  : 

        + + <%= link_to activity.try(:assigned_to), user_path(activity.assigned_to_id), :class => "linkBlue hidden", :style => "max-width:50px; display:inline-block;" %> + + <%= select( :issue, :user_id, principals_options_for_isuue_list(activity.project), + { :include_blank => false,:selected => @assign_to_id ? @assign_to_id : 0}, + {:onchange=>"remote_function('#issue_query_assign_form_#{activity.id}');", :id =>"assigned_to_id", :name => "assigned_to_id",:class=>"w70 undis issueEdit"}) %> +
      • + <% end %> +
        +
      +
        + <%= form_tag({:controller => 'issues', :action => 'update', :id => activity.id, :issue_detail => true, :type => "prior"},:remote=>'true', :method => :put, :id=>"issue_query_prior_form_#{activity.id}", :class => 'query_form') do %> +
      • +

         优先级  : 

        + <%= activity.priority.name %> + <%= select( :issue,:prior, [["低",1],["正常",2],["高",3],["紧急",4],["立刻",5]].unshift(["优先级",0]), + {:include_blank => false,:selected=>@priority_id ? @priority_id : 0}, + {:onchange=>"remote_function('#issue_query_prior_form_#{activity.id}');",:id=>"priority_id",:name=>"priority_id",:class=>"w70 undis issueEdit"}) %> +
      • + <% end %> +
        + <%= form_tag({:controller => 'issues', :action => 'update', :id => activity.id, :issue_detail => true, :type => "ratio"},:remote=>'true', :method => :put, :id=>"issue_query_done_form_#{activity.id}", :class => 'query_form') do %> +
      • +

         完成度  : 

        + <%= activity.done_ratio %>% + <%= select( :issue,:done_ratio, ((0..10).to_a.collect { |r| ["#{r*10} %", r*10] }), + {:include_blank => false, :selected => @done_ratio ? @done_ratio : 0}, + {:onchange=>"remote_function('#issue_query_done_form_#{activity.id}');",:id=>"done_ratio",:name=>"done_ratio",:class=>"w70 undis issueEdit"}) %> + <% end %> +
      • + +
        +
      +
        +
      • +

         开始  : 

        +

        <%= format_date(activity.start_date) %>

        +
      • +
        +
      • +

         周期  : 

        + <%= l_hours(activity.estimated_hours) %>
      • +
        +
      +
        +
      • +

         计划完成  : 

        + <%= format_date(activity.due_date)? format_date(activity.due_date) : "--" %>
      • +
        +
      • +

         目标版本  : 

        + <%= (activity.fixed_version ? link_to_user_version(activity.fixed_version) : "--") %>
      • +
        +
      +
      \ No newline at end of file From 63d1d3a8e7c1ff91f59cb9a592a07e18b82f187f Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Tue, 26 Jan 2016 10:59:28 +0800 Subject: [PATCH 52/52] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E4=B8=AD=EF=BC=8C=E5=8F=AA=E8=A6=81=E6=98=AF=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E6=88=90=E5=91=98=E5=B0=B1=E6=98=BE=E7=A4=BA=E7=BC=96=E8=BE=91?= =?UTF-8?q?issue=E5=A4=9A=E5=B1=9E=E6=80=A7=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_project_issue.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/users/_project_issue.html.erb b/app/views/users/_project_issue.html.erb index 1e9f1bb68..c5d93e0a5 100644 --- a/app/views/users/_project_issue.html.erb +++ b/app/views/users/_project_issue.html.erb @@ -52,7 +52,7 @@
      <%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>activity.description} %> <%# 局部刷新:修改xissue属性 %> - <% if is_project_manager?(User.current, activity.project) %> + <% if User.current.member_of?(activity.project) %> <% unless params[:action] == "index" %>
      <%= render :partial => 'users/project_issue_detail', :locals => {:activity => activity} %>