-
-
+ <% if User.current == course.teacher || User.current.admin? %>
+
+
归档
+
+
+
+
此班级的信息将不再显示
+ 您和您的学生将不能在此班级中继续互动
+ 但您可以点击上方的“归档管理”
+
+
+
+ <% end %>
diff --git a/app/views/users/_syllabus_course_list.html.erb b/app/views/users/_syllabus_course_list.html.erb
index 0759cb5b6..6c8e2140e 100644
--- a/app/views/users/_syllabus_course_list.html.erb
+++ b/app/views/users/_syllabus_course_list.html.erb
@@ -1,16 +1,12 @@
<% if @type.to_i == 2 %>
<%= link_to "", {:controller => 'users', :action => 'sort_syllabus_list', :id =>@user,:list_type => list_type, :type => @type, :sort => @c_sort, :order => 2 }, :class => "#{@c_sort.to_i == 1 ? 'sortupbtn' : 'sortdownbtn'} fr", :style => "margin-right: 5px;", :remote => true %>
- <% else %>
- <%= link_to "", {:controller => 'users', :action => 'sort_syllabus_list', :id =>@user,:list_type => list_type, :type => @type, :sort => @c_sort, :order => 2 }, :class => "sortdownbtn sort_no fr", :style => "margin-right: 5px;", :remote => true %>
<% end %>
<%= link_to "人气", {:controller => 'users', :action => 'sort_syllabus_list', :id =>@user,:list_type => list_type, :type => @type, :sort => @c_sort, :order => 2 }, :class => "sortTxt fr", :remote => true %>
<% if @type.to_i == 1 %>
<%= link_to "", {:controller => 'users', :action => 'sort_syllabus_list', :id =>@user,:list_type => list_type, :type => @type, :sort => @c_sort, :order => 1 }, :class => "#{@c_sort.to_i == 1 ? 'sortupbtn' : 'sortdownbtn'} fr", :remote => true %>
- <% else %>
- <%= link_to "", {:controller => 'users', :action => 'sort_syllabus_list', :id =>@user,:list_type => list_type, :type => @type, :sort => @c_sort, :order => 1 }, :class => "sortdownbtn sort_no fr", :remote => true %>
<% end %>
- <%= link_to "时间", {:controller => 'users', :action => 'sort_syllabus_list', :id =>@user,:list_type => list_type, :type => @type, :sort => @c_sort, :order => 1 }, :class => "sortTxt fr", :remote => true %>
+ <%= link_to "时间", {:controller => 'users', :action => 'sort_syllabus_list', :id =>@user,:list_type => list_type, :type => @type, :sort => @c_sort, :order => 1 }, :class => "sortTxt mr5 fr", :remote => true %>
<%=@user == User.current ? "我" : "他" %><%= list_type == 1 ? "创建" : "加入"%>的课程
diff --git a/app/views/users/user_archive_courses.html.erb b/app/views/users/user_archive_courses.html.erb
new file mode 100644
index 000000000..e69de29bb
diff --git a/app/views/users/user_courselist.html.erb b/app/views/users/user_courselist.html.erb
index 8f41b051e..b247ed230 100644
--- a/app/views/users/user_courselist.html.erb
+++ b/app/views/users/user_courselist.html.erb
@@ -1,5 +1,11 @@
-
课程列表
+
+
课程列表
+ <% if @user == User.current && !@archive_syllabuses.blank? %>
+ <%= link_to "归档管理", user_archive_courses_users_path(), :class => "linkBlue2 mt15 fr mr20 f14"%>
+ <% end %>
+
+
<%= render :partial => 'users/user_syllabus_list'%>
diff --git a/config/routes.rb b/config/routes.rb
index 3848c4b46..f3cc8c159 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -579,6 +579,7 @@ RedmineApp::Application.routes.draw do
post 'user_select_homework'
post 'check_homework'
get 'all_journals'
+ get 'user_archive_courses'
end
member do
diff --git a/public/javascripts/application.js b/public/javascripts/application.js
index 3f5a739f9..6c0f615dd 100644
--- a/public/javascripts/application.js
+++ b/public/javascripts/application.js
@@ -2240,3 +2240,19 @@ function getIssueStatistics(url){
}
+function archive_course(id, type, source){
+ if(type == 0){
+ var htmlvalue = '';
+ pop_box_new(htmlvalue, 400, 132);
+ } else{
+ var htmlvalue = '';
+ pop_box_new(htmlvalue, 400, 200);
+ }
+}
+
diff --git a/public/stylesheets/css/courses.css b/public/stylesheets/css/courses.css
index 1f7301772..91a22a177 100644
--- a/public/stylesheets/css/courses.css
+++ b/public/stylesheets/css/courses.css
@@ -597,4 +597,10 @@ a:hover.blueCir{ background:#3598db; color:#fff;}
a.ex_icon_de{ background:url(/images/course/icons.png) 0px -342px no-repeat; width:16px; height:27px; display:block;float:right;}
a:hover.ex_icon_de{ background:url(/images/course/icons.png) -20px -342px no-repeat;}
.ex_icon_edit{ background:url(/images/course/icons.png) 0px -276px no-repeat; width:16px; height:27px; display:block;float:right; margin-right:10px;}
-a:hover.ex_icon_edit{ background:url(/images/course/icons.png) -21px -276px no-repeat;}
\ No newline at end of file
+a:hover.ex_icon_edit{ background:url(/images/course/icons.png) -21px -276px no-repeat;}
+
+/*首页课程列表归档按钮提示*/
+/*分组作业评分提示框*/
+.archive_course_notice {width:220px; position:absolute; padding:5px 10px; white-space:nowrap; background-color:#fff; right:-265px; top:-15px; box-shadow:0px 2px 8px rgba(146, 153, 169, 0.5);}
+.archive_course_notice em {display:block; border-width:10px; position:absolute;top:26px; left:-20px; border-style:dashed solid dashed dashed; border-color:transparent #eaeaea transparent transparent; font-size:0; line-height:0;}
+.archive_course_notice span {display:block; border-width:10px; position:absolute;top:26px; left:-18px; border-style:dashed solid dashed dashed; border-color:transparent #fff transparent transparent; font-size:0; line-height:0;}
diff --git a/public/stylesheets/syllabus.css b/public/stylesheets/syllabus.css
index 64640f96f..499e4a336 100644
--- a/public/stylesheets/syllabus.css
+++ b/public/stylesheets/syllabus.css
@@ -65,7 +65,7 @@ input.syllabus_input_min{
.syllabus_class_list_more{padding:8px; text-align:center;border-left:1px solid #e7e7e7;border-bottom:1px solid #e7e7e7;}
.syllabus_class_list_more:hover{ background:#ececec;}
.syllabus_class_list_more a{ color:#ff7e00;}
-a.syllabus_class_title{ font-size:14px; color:#333; max-width:480px; margin-bottom:3px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
+a.syllabus_class_title{ font-size:14px; color:#333; max-width:520px; margin-bottom:3px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.syllabus_class_w{ width:650px;}
.syllabus_class_property {font-size:12px; padding:0 5px; border-radius:3px; line-height:14px;}
.syllabus_class_private {color:#ff4a1b; border:1px solid #ff4a1b;}
From 428cb8e928d9a30b2362b0651fc5262db49a19f1 Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Mon, 21 Nov 2016 17:21:15 +0800
Subject: [PATCH 11/43] =?UTF-8?q?=E9=A1=B9=E7=9B=AEissue=E3=80=82=E9=87=8C?=
=?UTF-8?q?=E7=A8=8B=E7=A2=91=E4=B8=BA=E7=A9=BA=EF=BC=8C=E5=AE=8C=E6=88=90?=
=?UTF-8?q?=E4=B8=BA100%=E7=9A=84issue=E7=AD=9B=E9=80=89=E4=B8=8D=E4=BA=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/issues_controller.rb | 5 +++--
db/migrate/20161121091826_modify_fixed_version_id.rb | 8 ++++++++
2 files changed, 11 insertions(+), 2 deletions(-)
create mode 100644 db/migrate/20161121091826_modify_fixed_version_id.rb
diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb
index a137b7cd1..b5e92546f 100644
--- a/app/controllers/issues_controller.rb
+++ b/app/controllers/issues_controller.rb
@@ -284,11 +284,11 @@ class IssuesController < ApplicationController
# 用户编辑更改issue
def update
- # params[:assigned_to_id] = nil if params[:assigned_to_id].to_i == 0
+ # params[:assigned_to_id] = nil if params[:assigned_to_id].to_i == 0
+ # params[:fixed_version_id] = nil if params[:fixed_version_id].to_i == 0
if params[:issue_detail]
issue = Issue.find(params[:id])
issue = update_user_issue_detail(issue, params)
- @issue.assigned_to_id = nil if @issue.assigned_to_id == 0
@saved = update_user_issue_detail(issue, params)
return
else
@@ -296,6 +296,7 @@ class IssuesController < ApplicationController
return unless update_issue_from_params
@issue.save_attachments(params[:attachments] || (params[:issue] && params[:issue][:uploads]))
@issue.assigned_to_id = nil if @issue.assigned_to_id == 0
+ @issue.fixed_version_id = nil if @issue.fixed_version_id == 0
saved = false
begin
@saved = @issue.save_issue_with_child_records(params, @time_entry)
diff --git a/db/migrate/20161121091826_modify_fixed_version_id.rb b/db/migrate/20161121091826_modify_fixed_version_id.rb
new file mode 100644
index 000000000..3456aec28
--- /dev/null
+++ b/db/migrate/20161121091826_modify_fixed_version_id.rb
@@ -0,0 +1,8 @@
+class ModifyFixedVersionId < ActiveRecord::Migration
+ def up
+ Issue.where(:fixed_version_id => 0).update_all(:fixed_version_id => nil)
+ end
+
+ def down
+ end
+end
From f1ad70bb335fbf4e21695a9fe8d48fc62726b1ea Mon Sep 17 00:00:00 2001
From: yuanke <249218296@qq.com>
Date: Tue, 22 Nov 2016 08:52:19 +0800
Subject: [PATCH 12/43] =?UTF-8?q?=E5=85=B3=E6=B3=A8BUG=E4=BF=AE=E6=94=B9?=
=?UTF-8?q?=EF=BC=8C=E4=BF=AE=E6=94=B9=E5=AF=86=E7=A0=81BUG=E4=BF=AE?=
=?UTF-8?q?=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/my/account.html.erb | 3 +-
app/views/users/_user_fans_item.html.erb | 114 +++++++++++------------
app/views/users/user_fanslist.html.erb | 43 +++++----
3 files changed, 80 insertions(+), 80 deletions(-)
diff --git a/app/views/my/account.html.erb b/app/views/my/account.html.erb
index 2a4b3b480..fd7425aab 100644
--- a/app/views/my/account.html.erb
+++ b/app/views/my/account.html.erb
@@ -214,7 +214,8 @@
确认密码 :
-
+
+
请输入8-12个字符
diff --git a/app/views/users/_user_fans_item.html.erb b/app/views/users/_user_fans_item.html.erb
index 8614e0b61..36d1b1b73 100644
--- a/app/views/users/_user_fans_item.html.erb
+++ b/app/views/users/_user_fans_item.html.erb
@@ -1,65 +1,55 @@
<% unless list.nil?%>
-<% for item in list %>
-
-
-
-
<%= item.show_name %>
-
-
- <% if item.user_extensions && !item.user_extensions.brief_introduction.nil? && !item.user_extensions.brief_introduction.empty? %>
-
个性签名:<%= item.user_extensions.brief_introduction %>
+ <% for item in list %>
+
+
+
+
<%= item.show_name %>
+
+
+ <% if item.user_extensions && !item.user_extensions.brief_introduction.nil? && !item.user_extensions.brief_introduction.empty? %>
+
个性签名:<%= item.user_extensions.brief_introduction %>
+ <% end %>
+
+ 加入时间:
+ <%= format_date(item.created_on) %>
+ <% if (item.user_extensions.identity == 0 || item.user_extensions.identity == 1) && !item.user_extensions.school.nil? %>
+ 工作单位:
+
+
+ <%= item.user_extensions.school.name %>
+
+
+ <% elsif item.user_extensions.identity == 3 && !item.user_extensions.occupation.nil? && !item.user_extensions.occupation.empty? %>
+ 工作单位:
+
+
+ <%= item.user_extensions.occupation %>
+
+
+ <% elsif item.user_extensions.identity == 2 %>
+ 工作单位:
+
+
+ <%= item.show_name %>
+
+
+ <% end %>
+
+
+
+
+ <% if(User.current.logged? && User.current != item )%>
+ <%if(item.watched_by?(User.current))%>
+
取消关注
+ <% else %>
+
添加关注
+ <% end %>
<% end %>
-
- 加入时间:
- <%= format_date(item.created_on) %>
- <% if (item.user_extensions.identity == 0 || item.user_extensions.identity == 1) && !item.user_extensions.school.nil? %>
- 工作单位:
-
-
- <%= item.user_extensions.school.name %>
-
-
- <% elsif item.user_extensions.identity == 3 && !item.user_extensions.occupation.nil? && !item.user_extensions.occupation.empty? %>
- 工作单位:
-
-
- <%= item.user_extensions.occupation %>
-
-
- <% elsif item.user_extensions.identity == 2 %>
- 工作单位:
-
-
- <%= item.show_name %>
-
-
- <% end %>
-
+
-
-
- <% if(User.current.logged? && User.current != item )%>
- <%if(item.watched_by?(User.current))%>
-
取消关注
- <% else %>
-
添加关注
- <% end %>
- <% end %>
-
-
-<% end %>
-
-
-
- <%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => true, :flag => true, :is_new => true%>
-
-
-
-
-<% else %>
-
<%= l(:label_no_data) %>
-<% end %>
+ <% end %>
+<% end %>
\ No newline at end of file
diff --git a/app/views/users/user_fanslist.html.erb b/app/views/users/user_fanslist.html.erb
index 77d85565e..041dabd03 100644
--- a/app/views/users/user_fanslist.html.erb
+++ b/app/views/users/user_fanslist.html.erb
@@ -7,30 +7,39 @@
}
-
-
- <% if @action == 'fans' %>
+
+
+ <% if @action == 'fans' %>
粉丝
共有<%=@obj_count%> 名粉丝
- <% elsif @action == 'visitor' %>
+ <% elsif @action == 'visitor' %>
访客
共有<%=@obj_count%> 访客
- <% else %>
+ <% else %>
关注
一共关注<%=@obj_count%> 人
- <% end %>
+ <% end %>
+
+
+
+ <%# for item in @list %>
+ <%= render :partial => 'users/user_fans_item', :locals => {:list => @list,:target=>@user,:action_name=>@action,:page=>params[:page]} %>
+ <%# end %>
+
+
<%= l(:label_no_data) %>
+
+
+
+
+ <%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true, :is_new => true%>
+
-
- <%# for item in @list %>
- <%= render :partial => 'users/user_fans_item', :locals => {:list => @list,:target=>@user,:action_name=>@action,:page=>params[:page]} %>
- <%# end %>
-
-
-
-
-
-
-
+
+
+
+
+
+
From 0eb6a607b20ae241f1ce1f5c497057b6063d4fc9 Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Tue, 22 Nov 2016 09:23:16 +0800
Subject: [PATCH 13/43] =?UTF-8?q?=E9=A1=B9=E7=9B=AEissue=E4=B8=AD=EF=BC=8C?=
=?UTF-8?q?=E9=99=84=E4=BB=B6=E5=90=8D=E7=A7=B0=E5=90=8E=E7=BC=80=E6=98=BE?=
=?UTF-8?q?=E7=A4=BA=E4=B8=8D=E5=85=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/models/organization.rb | 1 +
app/views/attachments/_project_file_links.html.erb | 14 +++++++-------
public/stylesheets/css/common.css | 1 +
3 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/app/models/organization.rb b/app/models/organization.rb
index 50f62ea11..284754c03 100644
--- a/app/models/organization.rb
+++ b/app/models/organization.rb
@@ -9,6 +9,7 @@ class Organization < ActiveRecord::Base
has_many :org_subfields, :dependent => :destroy
has_many :users, :through => :org_members
has_many :files
+ has_many :org_messages, :class_name => 'OrgMessage', :dependent => :destroy
acts_as_attachable
validates_uniqueness_of :name
after_create :save_as_org_activity, :add_default_subfields
diff --git a/app/views/attachments/_project_file_links.html.erb b/app/views/attachments/_project_file_links.html.erb
index cccc8382c..a1a978a48 100644
--- a/app/views/attachments/_project_file_links.html.erb
+++ b/app/views/attachments/_project_file_links.html.erb
@@ -30,9 +30,9 @@
<% for attachment in attachments %>
- <%if is_float%>
-
- <% end%>
+ <% if is_float %>
+
+ <% end %>
<% if options[:length] %>
<% if User.current.logged? %>
@@ -42,15 +42,15 @@
<% end %>
<% else %>
<% if User.current.logged? %>
- <%= link_to_short_attachment attachment, :length=> 58,:class => 'hidden link_file_a fl newsBlue mw400', :download => true -%>
+ <%= link_to_short_attachment attachment, :length => 58,:class => 'hidden link_file_a fl newsBlue mw400 h15', :download => true -%>
<% else %>
- <%= link_to(attachment.filename, signin_url_without_domain,:length=> 58, :class => "hidden link_file_a fl newsBlue mw400") %>
+ <%= link_to(attachment.filename, signin_url_without_domain,:length => 58, :class => "hidden link_file_a fl newsBlue mw400 h15") %>
<% end %>
<% end %>
- <%if is_float%>
+ <% if is_float %>
- <% end%>
+ <% end %>
<% if attachment.is_text? %>
<%= link_to image_tag('magnifier.png'),
diff --git a/public/stylesheets/css/common.css b/public/stylesheets/css/common.css
index bbc85f3ce..89664a633 100644
--- a/public/stylesheets/css/common.css
+++ b/public/stylesheets/css/common.css
@@ -300,6 +300,7 @@ h4{ font-size:14px;}/*color:#3b3b3b;*/
.w720{width:721px;}
.w730{width:730px;}
.w770{ width:770px;}
+.h15{ height: 15px; }
.h28{height: 28px;}
.h20{height: 20px;}
.h22{ height:22px;}
From 8d980b16dba84b107f6007f2714e7af814a967fb Mon Sep 17 00:00:00 2001
From: yuanke <249218296@qq.com>
Date: Tue, 22 Nov 2016 10:10:53 +0800
Subject: [PATCH 14/43] =?UTF-8?q?=E6=8D=A2=E8=A1=8C=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/projects/show.html.erb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/views/projects/show.html.erb b/app/views/projects/show.html.erb
index f9a88baf8..3467214c9 100644
--- a/app/views/projects/show.html.erb
+++ b/app/views/projects/show.html.erb
@@ -1,5 +1,5 @@
-
+
<%= render :partial => 'projects/invite_code' %>
<% if @project.description.blank? %>
From c571d195483065c15af0aaf02d3571d12c1357b4 Mon Sep 17 00:00:00 2001
From: yuanke <249218296@qq.com>
Date: Tue, 22 Nov 2016 10:16:09 +0800
Subject: [PATCH 15/43] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=AE=80=E4=BB=8B?=
=?UTF-8?q?=E5=8D=95=E8=AF=8D=E4=B8=8D=E6=8D=A2=E8=A1=8C?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/projects/show.html.erb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/views/projects/show.html.erb b/app/views/projects/show.html.erb
index 09ed2216a..5a38e3b38 100644
--- a/app/views/projects/show.html.erb
+++ b/app/views/projects/show.html.erb
@@ -1,5 +1,5 @@
-
+
<%= render :partial => 'projects/invite_code' %>
<% if @project.description.blank? %>
From eeacd76aa9ff0d49a728cc87ba19c3533da96c7e Mon Sep 17 00:00:00 2001
From: cxt
Date: Tue, 22 Nov 2016 10:27:56 +0800
Subject: [PATCH 16/43] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E7=8F=AD=E7=BA=A7?=
=?UTF-8?q?=E5=88=97=E8=A1=A8=E7=9A=84=E5=BD=92=E6=A1=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/syllabuses_controller.rb | 2 +-
app/controllers/users_controller.rb | 14 +++--
app/views/courses/archive_course.js.erb | 8 ++-
app/views/layouts/base_users_new.html.erb | 12 ++--
app/views/layouts/new_base_user.html.erb | 10 ++--
app/views/users/_courses_list.html.erb | 23 ++++---
.../users/_syllabus_course_list.html.erb | 3 +
.../users/_user_archive_course_list.html.erb | 60 +++++++++++++++++++
app/views/users/user_archive_courses.html.erb | 40 +++++++++++++
app/views/users/user_archive_courses.js.erb | 1 +
app/views/users/user_courselist.html.erb | 2 +-
11 files changed, 149 insertions(+), 26 deletions(-)
create mode 100644 app/views/users/_user_archive_course_list.html.erb
create mode 100644 app/views/users/user_archive_courses.js.erb
diff --git a/app/controllers/syllabuses_controller.rb b/app/controllers/syllabuses_controller.rb
index cad65f88d..13bacbd4b 100644
--- a/app/controllers/syllabuses_controller.rb
+++ b/app/controllers/syllabuses_controller.rb
@@ -92,7 +92,7 @@ class SyllabusesController < ApplicationController
def destroy
if @syllabus && @syllabus.courses.not_deleted.empty?
@syllabus.destroy
- redirect_to user_courselist_user_path(User.current.id)
+ redirect_to user_courselist_user_path(User.current)
end
end
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 1a8c7f7f0..04a3df24a 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -3476,7 +3476,7 @@ class UsersController < ApplicationController
#归档班级列表
def user_archive_courses
if User.current.logged?
- @order, @c_sort, @type, @list_type = params[:order] || 1, params[:sort] || 1, params[:type] || 1, params[:list_type] || 1
+ @order, @c_sort, @type = params[:order] || 1, params[:sort] || 1, params[:type] || 1
#确定 sort_type
if @order.to_i == @type.to_i
@@ -3485,6 +3485,7 @@ class UsersController < ApplicationController
@c_sort = 2
end
+ @user = User.current
sort_name = "updated_at"
archive_ids = Course.where("tea_id = #{@user.id} and is_delete = 1").blank? ? "(-1)" : "(" + Course.where("tea_id = #{@user.id} and is_delete = 1").map{|course| course.syllabus_id}.join(",") + ")"
@archive_syllabuses = Syllabus.where("id in #{archive_ids}")
@@ -3503,13 +3504,14 @@ class UsersController < ApplicationController
end
syllabus[:infocount] = count
end
- @c_sort == 1 ? (@archive_syllabuses = @syllabuses.sort{|x,y| x[:infocount] <=> y[:infocount] }) : (@archive_syllabuses = @archive_syllabuses.sort{|x,y| y[:infocount] <=> x[:infocount]})
+ @c_sort == 1 ? (@archive_syllabuses = @archive_syllabuses.sort{|x,y| x[:infocount] <=> y[:infocount] }) : (@archive_syllabuses = @archive_syllabuses.sort{|x,y| y[:infocount] <=> x[:infocount]})
@archive_syllabuses = sortby_time_countcommon_nosticky @archive_syllabuses,sort_name
else
@type = 1
end
respond_to do |format|
- format.html
+ format.js
+ format.html {render :layout => 'new_base_user'}
end
end
end
@@ -3518,7 +3520,11 @@ class UsersController < ApplicationController
def expand_courses
@syllabus = Syllabus.where("id = #{params[:syllabus_id]}").first
unless @syllabus.nil?
- @courses = @syllabus.courses.not_deleted.select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS updatetime").order("updatetime desc")
+ if params[:is_delete] && params[:is_delete] == '1'
+ @courses = @syllabus.courses.where("is_delete = 1").select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS updatetime").order("updatetime desc")
+ else
+ @courses = @syllabus.courses.not_deleted.select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS updatetime").order("updatetime desc")
+ end
respond_to do |format|
format.js
end
diff --git a/app/views/courses/archive_course.js.erb b/app/views/courses/archive_course.js.erb
index c7cd0f729..a5ef39035 100644
--- a/app/views/courses/archive_course.js.erb
+++ b/app/views/courses/archive_course.js.erb
@@ -13,7 +13,11 @@ function click_OK(){
hideModal();
<% if params[:source] == "1" %>
window.location.href = "<%=syllabus_courselist_syllabus_path(@syllabus, :list_type => params[:type].to_i) %>";
- <% else params[:source] == "0" %>
- window.location.href = "<%=user_courselist_path(User.current) %>";
+ <% elsif params[:source] == "0" %>
+ <% if params[:type] == "0" %>
+ window.location.href = "<%=user_courselist_user_path(User.current) %>";
+ <% else %>
+ window.location.href = "<%=user_archive_courses_users_path() %>";
+ <% end %>
<% end %>
}
\ No newline at end of file
diff --git a/app/views/layouts/base_users_new.html.erb b/app/views/layouts/base_users_new.html.erb
index 2f3ef2928..316d10c4c 100644
--- a/app/views/layouts/base_users_new.html.erb
+++ b/app/views/layouts/base_users_new.html.erb
@@ -140,25 +140,25 @@
<% if @center_flag %>
-
+
我的资源库
(<%=Attachment.where("(author_id = #{@user.id} and container_type in('Project','Principal','Course','Issue','Document','Message','News','StudentWorkScore','HomewCommon')) or (container_type = 'Course' and container_id in (#{@user.courses.map{|c| c.id}.empty? ? '0' : @user.courses.map{|c| c.id}.join(',')}))").count%>)
@@ -166,13 +166,13 @@
<% else%>
-
+
TA的项目
(<%=@user.projects.visible.count%>)
diff --git a/app/views/layouts/new_base_user.html.erb b/app/views/layouts/new_base_user.html.erb
index 07be357dc..fd86d9dff 100644
--- a/app/views/layouts/new_base_user.html.erb
+++ b/app/views/layouts/new_base_user.html.erb
@@ -162,8 +162,8 @@
<% if hidden_unproject_infos %>
- <%= link_to '班级',{:controller => "users", :action => "user_courselist", :id => @user.id}, :id => "user_course_list" %>
- <%= link_to '全部',{:controller => "users", :action => "user_courselist", :id => @user.id}, :style => "color:#aaa;" %>
+ <%= link_to '班级',{:controller => "users", :action => "user_courselist", :id => @user}, :id => "user_course_list" %>
+ <%= link_to '全部',{:controller => "users", :action => "user_courselist", :id => @user}, :style => "color:#aaa;" %>
<% courses = @user.favorite_courses.visible.where("is_delete =?", 0).select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc").limit(10) %>
<%=render :partial => 'layouts/homepage_left_course_list', :locals => {:courses => courses} %>
@@ -181,7 +181,7 @@
<% if @user == User.current %>
- <%=link_to '我的作业', my_homeworks_user_path(@user.id), :target => "_blank", :style => "font-size:14px;" %>
+ <%=link_to '我的作业', my_homeworks_user_path(@user), :target => "_blank", :style => "font-size:14px;" %>
<% end %>
<% end %>
@@ -190,8 +190,8 @@
- <%= link_to '项目',{:controller => "users", :action => "user_projectlist", :id => @user.id}, :id => 'user_project_list'%>
- <%= link_to '全部',{:controller => "users", :action => "user_projectlist", :id => @user.id}, :style => "color:#aaa;" %>
+ <%= link_to '项目',{:controller => "users", :action => "user_projectlist", :id => @user}, :id => 'user_project_list'%>
+ <%= link_to '全部',{:controller => "users", :action => "user_projectlist", :id => @user}, :style => "color:#aaa;" %>
<% projects = @user.favorite_projects.visible.select("projects.*, (SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS a").order("a desc").limit(10)%>
<%=render :partial => 'layouts/homepage_left_project_list', :locals => {:projects => projects} %>
diff --git a/app/views/users/_courses_list.html.erb b/app/views/users/_courses_list.html.erb
index 439a24d10..bee64a059 100644
--- a/app/views/users/_courses_list.html.erb
+++ b/app/views/users/_courses_list.html.erb
@@ -1,14 +1,16 @@
<% unless courses.nil? %>
<% courses.each_with_index do |course, i| %>
- <% allow_visit = User.current.member_of_course?(course) || User.current.admin? || course.is_public == 1 %>
+ <% allow_visit = course.is_delete == 0 && (User.current.member_of_course?(course) || User.current.admin? || course.is_public == 1) %>
+ <% if course.is_delete == 0 %>
<%=render :partial => 'collect_course', :locals => {:course => course} %>
+ <% end %>
- <% if User.current == course.teacher || User.current.admin? %>
+ <% if User.current == @user && (User.current == course.teacher || User.current.admin?) %>
-
归档
+
<%= course.is_delete == 0 ? '归档' : '恢复' %>
-
此班级的信息将不再显示
- 您和您的学生将不能在此班级中继续互动
- 但您可以点击上方的“归档管理”
+
+ <% if course.is_delete == 0 %>
+ 此班级的信息将不再显示
+ 您和您的学生将不能在此班级中继续互动
+ 但您可以点击上方的“归档管理”
+ <% else %>
+ 此班级的信息将恢复显示
+ 您和您的学生将可以重新在此班级中互动
+ <% end %>
diff --git a/app/views/users/_syllabus_course_list.html.erb b/app/views/users/_syllabus_course_list.html.erb
index 6c8e2140e..eba104f14 100644
--- a/app/views/users/_syllabus_course_list.html.erb
+++ b/app/views/users/_syllabus_course_list.html.erb
@@ -40,6 +40,9 @@
+
+ <%= link_to "新建班级", new_course_path(:syllabus_id => syllabus.id), :class => "postOptionLink", :target => '_blank', :title => "新建班级"%>
+
<%=link_to '查看课程', syllabus_path(syllabus.id), :class => 'postOptionLink',:target =>'_blank', :title => '查看课程' %>
diff --git a/app/views/users/_user_archive_course_list.html.erb b/app/views/users/_user_archive_course_list.html.erb
new file mode 100644
index 000000000..122e70264
--- /dev/null
+++ b/app/views/users/_user_archive_course_list.html.erb
@@ -0,0 +1,60 @@
+
+ <% if @type.to_i == 2 %>
+ <%= link_to "", {:controller => 'users', :action => 'user_archive_courses', :type => @type, :sort => @c_sort, :order => 2 }, :class => "#{@c_sort.to_i == 1 ? 'sortupbtn' : 'sortdownbtn'} fr", :style => "margin-right: 5px;", :remote => true %>
+ <% end %>
+ <%= link_to "人气", {:controller => 'users', :action => 'user_archive_courses', :type => @type, :sort => @c_sort, :order => 2 }, :class => "sortTxt fr", :remote => true %>
+ <% if @type.to_i == 1 %>
+ <%= link_to "", {:controller => 'users', :action => 'user_archive_courses', :type => @type, :sort => @c_sort, :order => 1 }, :class => "#{@c_sort.to_i == 1 ? 'sortupbtn' : 'sortdownbtn'} fr", :remote => true %>
+ <% end %>
+ <%= link_to "时间", {:controller => 'users', :action => 'user_archive_courses', :type => @type, :sort => @c_sort, :order => 1 }, :class => "sortTxt mr5 fr", :remote => true %>
+
归档的班级
+
+
+
+<% if syllabuses.any? %>
+ <% syllabuses.each_with_index do |syllabus, index|%>
+
+ <% course_count = syllabus.courses.where("is_delete = 1").count %>
+
+
+
+ <%=link_to syllabus.title, syllabus_path(syllabus.id), :class => 'syllabus_courses_title fl', :target => '_blank' %>
+
+
更新时间:<%=format_date syllabus.updated_at %>
+ 创建老师:<%=syllabus.user.show_name %>
+ 班级:<%=course_count %>
+
+
+
+
+
+
+ <% if index == 0 %>
+ <% courses = syllabus.courses.where("is_delete = 1").select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS updatetime").order("updatetime desc") %>
+ <%= render :partial => 'users/courses_list', :locals => {:courses => courses, :syllabus => syllabus}%>
+ <% end %>
+
+
+
+
+
+
+
+
+ <%= link_to "新建班级", new_course_path(:syllabus_id => syllabus.id), :class => "postOptionLink", :target => '_blank', :title => "新建班级"%>
+
+
+ <%=link_to '查看课程', syllabus_path(syllabus.id), :class => 'postOptionLink',:target =>'_blank', :title => '查看课程' %>
+
+ <% if User.current == syllabus.user %>
+ <%=link_to '删除课程', delete_syllabus_syllabus_path(syllabus), :class => 'postOptionLink', :remote => 'true'%>
+ <% end %>
+
+
+
+
+
+ <% end %>
+<% else %>
+ <%= l(:label_no_data) %>
+<% end %>
\ No newline at end of file
diff --git a/app/views/users/user_archive_courses.html.erb b/app/views/users/user_archive_courses.html.erb
index e69de29bb..61b1e47a8 100644
--- a/app/views/users/user_archive_courses.html.erb
+++ b/app/views/users/user_archive_courses.html.erb
@@ -0,0 +1,40 @@
+
+
+
课程列表
+ <%= link_to "返回", user_courselist_user_path(@user), :class => "linkBlue2 mt15 fr mr15 f14"%>
+
+
+
+
+ <%= render :partial => 'users/user_archive_course_list', :locals => {:syllabuses => @archive_syllabuses}%>
+
+
+
+
+
\ No newline at end of file
diff --git a/app/views/users/user_archive_courses.js.erb b/app/views/users/user_archive_courses.js.erb
new file mode 100644
index 000000000..833786fbf
--- /dev/null
+++ b/app/views/users/user_archive_courses.js.erb
@@ -0,0 +1 @@
+$("#user_archive_course_list").html('<%= escape_javascript(render :partial => 'users/user_archive_course_list', :locals => {:syllabuses => @archive_syllabuses}) %>');
diff --git a/app/views/users/user_courselist.html.erb b/app/views/users/user_courselist.html.erb
index b247ed230..7a7b68fa6 100644
--- a/app/views/users/user_courselist.html.erb
+++ b/app/views/users/user_courselist.html.erb
@@ -2,7 +2,7 @@
课程列表
<% if @user == User.current && !@archive_syllabuses.blank? %>
- <%= link_to "归档管理", user_archive_courses_users_path(), :class => "linkBlue2 mt15 fr mr20 f14"%>
+ <%= link_to "归档管理", user_archive_courses_users_path(), :class => "linkBlue2 mt15 fr mr15 f14"%>
<% end %>
From f9d12758d45c4342f46d3ae25a2c2b70605207bb Mon Sep 17 00:00:00 2001
From: cxt
Date: Tue, 22 Nov 2016 11:29:45 +0800
Subject: [PATCH 17/43] =?UTF-8?q?=E7=8F=AD=E7=BA=A7=E5=88=86=E7=8F=AD?=
=?UTF-8?q?=EF=BC=9A=E5=A6=82=E5=9B=BE=E5=9C=A8=E6=9F=90=E5=85=B7=E4=BD=93?=
=?UTF-8?q?=E5=88=86=E7=8F=AD=E4=B8=AD=EF=BC=8C=E7=BC=96=E8=BE=91=E6=9F=90?=
=?UTF-8?q?=E6=88=90=E5=91=98=E5=88=86=E7=8F=AD=E4=B8=BA=E2=80=9C=E6=9A=82?=
=?UTF-8?q?=E6=97=A0=E2=80=9D=E6=88=96=E5=85=B6=E4=BB=96=E5=88=86=E7=8F=AD?=
=?UTF-8?q?=EF=BC=8C=E5=8E=9F=E5=A7=8B=E5=88=86=E7=8F=AD=E5=88=97=E8=A1=A8?=
=?UTF-8?q?=E6=9C=AA=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/courses/teacher_assign_group.js.erb | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/app/views/courses/teacher_assign_group.js.erb b/app/views/courses/teacher_assign_group.js.erb
index 4df0924ea..503c530cd 100644
--- a/app/views/courses/teacher_assign_group.js.erb
+++ b/app/views/courses/teacher_assign_group.js.erb
@@ -1,5 +1,9 @@
<% if params[:group_id] != "0" %>
-$("#member_li_<%=@member.id %>").html("");
+var all_indexes = $("#member_li_<%=@member.id %>").nextAll().find("td:first-child");
+for(var i = 0; i < all_indexes.length; i++){
+ $(all_indexes[i]).html(parseInt($(all_indexes[i]).html()) - 1);
+}
+$("#member_li_<%=@member.id %>").remove();
<% end %>
<% if @group && @group != "-1" %>
//$("#member_content").html("<%#= escape_javascript( render :partial => 'new_member_list', :locals => {:members => @results})%>");
From 196d3b31a161b0b8c8c81202a2b95b5ac666c432 Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Tue, 22 Nov 2016 14:29:03 +0800
Subject: [PATCH 18/43] =?UTF-8?q?=E4=B8=BA=E5=AE=8C=20=E5=88=87=E6=8D=A2?=
=?UTF-8?q?=E5=88=86=E6=94=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/helpers/projects_helper.rb | 9 +++++++++
app/views/issues/_form.html.erb | 6 +-----
2 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb
index 3dff9c414..b2eb6fd0e 100644
--- a/app/helpers/projects_helper.rb
+++ b/app/helpers/projects_helper.rb
@@ -267,6 +267,15 @@ module ProjectsHelper
project_name = versions.blank? ? "" : versions.first.project.name
grouped = Hash.new {|h,k| h[k] = []}
grouped[project_name] << ["请选择里程碑", 0]
+
+ unless selected.nil?
+ if (params[:action] == "show" ) && Version.find(selected.id).status == "closed"
+ version_name = Version.find(selected.id).name
+ grouped[project_name] << [version_name, selected.id]
+ end
+ end
+
+
versions.each do |version|
grouped[version.project.name] << [version.name, version.id]
end
diff --git a/app/views/issues/_form.html.erb b/app/views/issues/_form.html.erb
index 02ae7f677..13bde48a5 100644
--- a/app/views/issues/_form.html.erb
+++ b/app/views/issues/_form.html.erb
@@ -160,9 +160,5 @@
}
// 里程碑添加默认选项
$("#issue_fixed_version_id option[value='']").remove();
- <%# if params[:action] == "new" %>
-// $('#issue_fixed_version_id').prepend("选择里程碑 ");
- <%# else %>
-// $('#issue_fixed_version_id').prepend("选择里程碑 ");
- <%# end %>
+
From 85f9f636a2456f283b63db5c09471c8ba82e0783 Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Tue, 22 Nov 2016 16:51:16 +0800
Subject: [PATCH 19/43] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E9=87=8C?=
=?UTF-8?q?=E7=A8=8B=E7=A2=91=E5=85=B3=E9=97=AD=EF=BC=8C=E7=BC=96=E8=BE=91?=
=?UTF-8?q?issue=EF=BC=8C=E9=87=8C=E7=A8=8B=E7=A2=91=E8=A2=AB=E6=B8=85?=
=?UTF-8?q?=E7=A9=BA=E7=9A=84=E6=83=85=E5=86=B5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/helpers/projects_helper.rb | 3 ++-
app/models/issue.rb | 3 ++-
app/views/issues/_form.html.erb | 10 +++++-----
3 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb
index b2eb6fd0e..188481cb2 100644
--- a/app/helpers/projects_helper.rb
+++ b/app/helpers/projects_helper.rb
@@ -268,13 +268,14 @@ module ProjectsHelper
grouped = Hash.new {|h,k| h[k] = []}
grouped[project_name] << ["请选择里程碑", 0]
+=begin
unless selected.nil?
if (params[:action] == "show" ) && Version.find(selected.id).status == "closed"
version_name = Version.find(selected.id).name
grouped[project_name] << [version_name, selected.id]
end
end
-
+=end
versions.each do |version|
grouped[version.project.name] << [version.name, version.id]
diff --git a/app/models/issue.rb b/app/models/issue.rb
index 1b47d80cc..46a42cb34 100644
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -854,7 +854,8 @@ class Issue < ActiveRecord::Base
return @assignable_versions if @assignable_versions
# versions = project.shared_versions.open.all
- versions = Version.where(:project_id => project.id, :status => "open").order("created_on desc")
+ # versions = Version.where(:project_id => project.id, :status => "open").order("created_on desc")
+ versions = Version.where(:project_id => project.id).order("created_on desc")
if fixed_version
if fixed_version_id_changed?
# nothing to do
diff --git a/app/views/issues/_form.html.erb b/app/views/issues/_form.html.erb
index 13bde48a5..94b55f3e2 100644
--- a/app/views/issues/_form.html.erb
+++ b/app/views/issues/_form.html.erb
@@ -98,8 +98,8 @@
<% if @issue.safe_attribute? 'start_date' %>
<%= f.text_field :start_date, :size => 22, :disabled => !@issue.leaf?, :no_label => true,
- :required => @issue.required_attribute?('start_date'), :onchange=>"issue_start_date_change();",
- :class=>"fl calendar_input", :style=>"width:170px;" %>
+ :required => @issue.required_attribute?('start_date'), :onchange => "issue_start_date_change();",
+ :class => "fl calendar_input", :style => "width:170px;" %>
<%= calendar_for('issue_start_date', 'start_date') if @issue.leaf? %>
<% end %>
@@ -110,8 +110,8 @@
<% if @issue.safe_attribute? 'due_date' %>
<%= f.text_field :due_date, :size => 22, :disabled => !@issue.leaf?, :no_label => true,
- :required => @issue.required_attribute?('due_date'), :onchange=>"issue_end_date_change();",
- :class=>"fl calendar_input",:style=>"width: 170px;", :placeholder=> "请选择结束日期" %>
+ :required => @issue.required_attribute?('due_date'), :onchange => "issue_end_date_change();",
+ :class => "fl calendar_input",:style => "width: 170px;", :placeholder => "请选择结束日期" %>
<%= calendar_for('issue_due_date', 'start_date') if @issue.leaf? %>
<% end %>
@@ -121,7 +121,7 @@
<% if @issue.safe_attribute? 'estimated_hours' %>
<%= f.text_field :estimated_hours, :size => 22, :disabled => !@issue.leaf?, :no_label => true,
- :required => @issue.required_attribute?('estimated_hours'), :placeholder=> "请填写预计工时" %>
+ :required => @issue.required_attribute?('estimated_hours'), :placeholder => "请填写预计工时" %>
<% end %>
<%= l(:field_estimated_hours) %>
From 9720f84fce12e57da1373718c1c6f0792e2b8313 Mon Sep 17 00:00:00 2001
From: yuanke <249218296@qq.com>
Date: Wed, 23 Nov 2016 13:29:02 +0800
Subject: [PATCH 20/43] =?UTF-8?q?js=E7=9A=84=E8=87=AA=E5=8A=A8=E8=BD=AC?=
=?UTF-8?q?=E6=8D=A2URL=E5=87=BD=E6=95=B0autoUrl=E5=8A=A0=E4=B8=8A?=
=?UTF-8?q?=E4=B8=AA=E5=BC=82=E5=B8=B8=E5=A4=84=E7=90=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/javascripts/application.js | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/public/javascripts/application.js b/public/javascripts/application.js
index 3f5a739f9..ac8dfcc44 100644
--- a/public/javascripts/application.js
+++ b/public/javascripts/application.js
@@ -1706,7 +1706,14 @@ function autoUrl(id){
}
return reStr ;
});
- $(this).html(html);
+ try{
+ $(this).html(html);
+ }
+ catch (e)
+ {
+ console.log(e.name + ": " + e.message);
+ }
+
}
});
}
@@ -1725,7 +1732,13 @@ function autoUrl(id){
}
return reStr ;
});
- $("#"+id).html(html);
+ try{
+ $("#"+id).html(html);
+ }
+ catch (e)
+ {
+ console.log(e.name + ": " + e.message);
+ }
}
if(!(!!window.ActiveXObject || "ActiveXObject" in window)){
autoMedia(id);
From 2dc6171b480d55edef70cf73a11e51312c242476 Mon Sep 17 00:00:00 2001
From: yuanke <249218296@qq.com>
Date: Wed, 23 Nov 2016 16:40:31 +0800
Subject: [PATCH 21/43] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E5=8F=8D=E9=A6=88?=
=?UTF-8?q?=E6=97=B6=E7=9A=84=E6=8F=90=E7=A4=BA=E8=AF=AD=E5=8A=A0=E5=85=A5?=
=?UTF-8?q?www.trustie.net?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/wechats_controller.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/controllers/wechats_controller.rb b/app/controllers/wechats_controller.rb
index a082d72ff..654f83855 100644
--- a/app/controllers/wechats_controller.rb
+++ b/app/controllers/wechats_controller.rb
@@ -137,7 +137,7 @@ class WechatsController < ActionController::Base
on :fallback, respond: 'fallback message'
on :click, with: 'FEEDBACK' do |request, key|
- request.reply.text "如有问题反馈,请您:\n1、直接切换至输入框,发微信给我们。\n2、加入QQ群:373967360,直接互动。\n\n如您有合作事宜洽谈,请联系:\n王林春 老师\n手机:13467631747\nQQ:494496321"
+ request.reply.text "如有问题反馈,请您:\n1、直接切换至输入框,发微信给我们。\n2、加入QQ群:373967360,直接互动。\n3、登录网站:www.trustie.net,给我们留言。\n\n如您有合作事宜洽谈,请联系:\n王林春 老师\n手机:13467631747\nQQ:494496321"
end
on :click, with: 'MY_NEWS' do |request, key|
From 61a3ffcbd0c6bc696e80268a0edb0dcff099c7c2 Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Wed, 23 Nov 2016 17:18:12 +0800
Subject: [PATCH 22/43] =?UTF-8?q?=E9=A1=B9=E7=9B=AEissue=E7=BB=9F=E8=AE=A1?=
=?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=A1=BA=E5=BA=8F=E6=8C=89=E4=BB=BB=E5=8A=A1?=
=?UTF-8?q?=E9=87=8F=E6=8E=92=E5=BA=8F=EF=BC=8C=E8=B0=83=E6=95=B4total?=
=?UTF-8?q?=E4=BD=8D=E7=BD=AE=E5=92=8C=E6=A0=B7=E5=BC=8F=E5=B9=B6=E5=A2=9E?=
=?UTF-8?q?=E5=8A=A0=E6=9C=AA=E6=8C=87=E6=B4=BE=E4=B8=80=E6=A0=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/issues_controller.rb | 9 ++++++---
app/views/issues/_statistics_all.html.erb | 20 ++++++++++----------
app/views/issues/_statistics_lock.html.erb | 20 ++++++++++----------
app/views/issues/_statistics_open.html.erb | 20 ++++++++++----------
4 files changed, 36 insertions(+), 33 deletions(-)
diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb
index b5e92546f..c6cb018a5 100644
--- a/app/controllers/issues_controller.rb
+++ b/app/controllers/issues_controller.rb
@@ -102,6 +102,7 @@ class IssuesController < ApplicationController
@issue_count = @query.issue_count
@test = params[:test]
@project_sort = 'issues.updated_on desc'
+
if params[:test] != "0"
case @test
when "1"
@@ -631,7 +632,9 @@ class IssuesController < ApplicationController
end
end
# 搜索结果
- @issues_filter = @query.issues(:order => @project_sort)
+ # SELECT assigned_to_id, count(*) as ac FROM `issues` where project_id = @project.id group by assigned_to_id order by ac desc;
+ @issues_filter = @query.issues.sort_by{ |i| Issue.where(:project_id => @project.id , :assigned_to_id => i.assigned_to_id).count }.reverse
+ # @issues_filter = @query.issues(:order => @project_sort)
# if params[:type] == 1 || params[:type].nil?
# @results = @issues_filter
@@ -669,7 +672,7 @@ class IssuesController < ApplicationController
@alltotal[issue.tracker_id.to_i] = @alltotal[issue.tracker_id.to_i] + 1
user_id = issue.assigned_to_id
if issue.assigned_to_id.nil?
- user_id = issue.author_id
+ user_id = 0
end
if !@results[user_id].nil?
@@ -697,7 +700,7 @@ class IssuesController < ApplicationController
tmpuser = User.find(user_id)
- @results[user_id][:name] = tmpuser.nil? ? " " : tmpuser.show_name
+ @results[user_id][:name] = tmpuser.nil? ? "" : tmpuser.show_name
#所有的
@results[user_id][0] = 1
for i in 1..17 do
diff --git a/app/views/issues/_statistics_all.html.erb b/app/views/issues/_statistics_all.html.erb
index 0ef85057a..b9b593b91 100644
--- a/app/views/issues/_statistics_all.html.erb
+++ b/app/views/issues/_statistics_all.html.erb
@@ -11,9 +11,18 @@
+
+ 合计
+ <%= @alltotal[0] %>
+ <%= @alltotal[2] %>
+ <%= @alltotal[4] %>
+ <%= @alltotal[1] %>
+ <%= @alltotal[3] %>
+ <%= @alltotal[5] %>
+
<% @results.each do |k,v|%>
- <%= v[:name] %>
+ <%= v[:name] =="Anonymous" ? "未指派" : v[:name] %>
<%= v[0] %>
<%= v[2] %>
<%= v[4] %>
@@ -22,14 +31,5 @@
<%= v[5] %>
<% end %>
-
- Total
- <%= @alltotal[0] %>
- <%= @alltotal[2] %>
- <%= @alltotal[4] %>
- <%= @alltotal[1] %>
- <%= @alltotal[3] %>
- <%= @alltotal[5] %>
-
\ No newline at end of file
diff --git a/app/views/issues/_statistics_lock.html.erb b/app/views/issues/_statistics_lock.html.erb
index f8628144e..edcd9b090 100644
--- a/app/views/issues/_statistics_lock.html.erb
+++ b/app/views/issues/_statistics_lock.html.erb
@@ -11,10 +11,19 @@
+
+ 合计
+ <%= @closetotal[0] %>
+ <%= @closetotal[2] %>
+ <%= @closetotal[4] %>
+ <%= @closetotal[1] %>
+ <%= @closetotal[3] %>
+ <%= @closetotal[5] %>
+
<% @results.each do |k,v|%>
<% if v[12] > 0 %>
- <%= v[:name] %>
+ <%= v[:name] == "Anonymous" ? "未指派" : v[:name] %>
<%= v[12] %>
<%= v[14] %>
<%= v[16] %>
@@ -24,14 +33,5 @@
<% end %>
<% end %>
-
- Total
- <%= @closetotal[0] %>
- <%= @closetotal[2] %>
- <%= @closetotal[4] %>
- <%= @closetotal[1] %>
- <%= @closetotal[3] %>
- <%= @closetotal[5] %>
-
\ No newline at end of file
diff --git a/app/views/issues/_statistics_open.html.erb b/app/views/issues/_statistics_open.html.erb
index d5eb843f7..e5d07a138 100644
--- a/app/views/issues/_statistics_open.html.erb
+++ b/app/views/issues/_statistics_open.html.erb
@@ -11,10 +11,19 @@
+
+ 合计
+ <%= @opentotal[0] %>
+ <%= @opentotal[2] %>
+ <%= @opentotal[4] %>
+ <%= @opentotal[1] %>
+ <%= @opentotal[3] %>
+ <%= @opentotal[5] %>
+
<% @results.each do |k,v|%>
<% if v[6] > 0 %>
- <%= v[:name] %>
+ <%= v[:name] =="Anonymous" ? "未指派" : v[:name] %>
<%= v[6] %>
<%= v[8] %>
<%= v[10] %>
@@ -24,14 +33,5 @@
<% end %>
<% end %>
-
- Total
- <%= @opentotal[0] %>
- <%= @opentotal[2] %>
- <%= @opentotal[4] %>
- <%= @opentotal[1] %>
- <%= @opentotal[3] %>
- <%= @opentotal[5] %>
-
\ No newline at end of file
From 1c0b4e99a846f5a295f5dd634937b74fac2c0a48 Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Thu, 24 Nov 2016 09:47:10 +0800
Subject: [PATCH 23/43] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E9=85=8D=E7=BD=AE?=
=?UTF-8?q?=EF=BC=8C=E5=88=9B=E5=BB=BA=E7=89=88=E6=9C=AC=E5=BA=93=E6=8F=90?=
=?UTF-8?q?=E7=A4=BA=E5=AD=97=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4=EF=BC=8C?=
=?UTF-8?q?=E5=92=8CPull=20Requests=E9=A1=B5=E9=9D=A2=E7=9A=84tab=E7=82=B9?=
=?UTF-8?q?=E5=87=BB=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../settings/_new_repositories.html.erb | 2 +-
app/views/pull_requests/index.html.erb | 35 +++++++++++++++----
2 files changed, 29 insertions(+), 8 deletions(-)
diff --git a/app/views/projects/settings/_new_repositories.html.erb b/app/views/projects/settings/_new_repositories.html.erb
index a531e904a..b5a6ffe57 100644
--- a/app/views/projects/settings/_new_repositories.html.erb
+++ b/app/views/projects/settings/_new_repositories.html.erb
@@ -18,7 +18,7 @@
版本库名是无效的
-
+
1.长度必须在1到254个字符之间
2.仅限使用小写字母(a-z)、数字、破折号(-)和下划线(_)
3.一旦保存,标识无法修改
diff --git a/app/views/pull_requests/index.html.erb b/app/views/pull_requests/index.html.erb
index 2e10d6598..f2591b6ea 100644
--- a/app/views/pull_requests/index.html.erb
+++ b/app/views/pull_requests/index.html.erb
@@ -3,9 +3,18 @@
- <%= link_to "待处理#{@requests_opened_count} ".html_safe, project_pull_requests_path(:type => "1"), :remote => true, :class => "new_roadmap_type_nomal" %>
- <%= link_to "已处理#{@requests_merged_count} ".html_safe, project_pull_requests_path(:type => "2"), :remote => true, :class => "new_roadmap_type_nomal" %>
- <%= link_to "已关闭#{@requests_closed_count} ".html_safe, project_pull_requests_path(:type => "3"), :remote => true, :class => "new_roadmap_type_nomal" %>
+
+ <%= link_to "待处理#{@requests_opened_count} ".html_safe,
+ project_pull_requests_path(:type => "1"), :remote => true, :class => "new_roadmap_type_nomal", :id => "new_roadmap_type_1", :id => "new_roadmap_type_1" %>
+
+
+ <%= link_to "已处理#{@requests_merged_count} ".html_safe,
+ project_pull_requests_path(:type => "2"), :remote => true, :class => "new_roadmap_type_nomal", :id => "new_roadmap_type_1", :id => "new_roadmap_type_2" %>
+
+
+ <%= link_to "已关闭#{@requests_closed_count} ".html_safe,
+ project_pull_requests_path(:type => "3"), :remote => true, :class => "new_roadmap_type_nomal", :id => "new_roadmap_type_1", :id => "new_roadmap_type_3" %>
+
<% if allow_pull_request(@project) && User.current.member_of?(@project) %>
<%= link_to "创建Pull Request", new_project_pull_request_path, :class => "btn btn-green fr mr15 mt10" %>
@@ -34,11 +43,23 @@
<% else %>
<%= render :partial => "projects/no_data" %>
From f6034b56f0e6f1eaf3a97f79a7c421be608f1b81 Mon Sep 17 00:00:00 2001
From: cxt
Date: Thu, 24 Nov 2016 09:53:36 +0800
Subject: [PATCH 24/43] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E7=9A=84=E6=8F=90?=
=?UTF-8?q?=E4=BA=A4=E6=88=AA=E6=AD=A2=E6=97=B6=E9=97=B4=E4=B8=80=E7=9B=B4?=
=?UTF-8?q?=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/_homework_post_brief.html.erb | 4 +---
app/views/users/_course_homework.html.erb | 6 ++----
2 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/app/views/student_work/_homework_post_brief.html.erb b/app/views/student_work/_homework_post_brief.html.erb
index 868caae96..d2041bfbb 100644
--- a/app/views/student_work/_homework_post_brief.html.erb
+++ b/app/views/student_work/_homework_post_brief.html.erb
@@ -31,10 +31,8 @@
<%= l(:label_publish_time)%>:<%= homework.publish_time%> 00:00
<% end %>
- <% if homework.homework_detail_manual && homework.homework_detail_manual.comment_status < 2 %>
+ <% if !homework.end_time.nil? %>
提交截止时间:<%= homework.end_time.to_s %> 23:59
- <% elsif homework.homework_detail_manual && homework.homework_detail_manual.comment_status >= 2 && homework.anonymous_comment == 0%>
-
匿评截止时间:<%= homework.homework_detail_manual.evaluation_end.to_s %> 23:59
<% end %>
diff --git a/app/views/users/_course_homework.html.erb b/app/views/users/_course_homework.html.erb
index b120c8afc..9ec5af7e2 100644
--- a/app/views/users/_course_homework.html.erb
+++ b/app/views/users/_course_homework.html.erb
@@ -33,10 +33,8 @@
<% end %>
<%= render :partial => 'users/homework_opr', :locals => {:activity => activity, :is_teacher => is_teacher, :hw_status => hw_status, :user_activity_id => user_activity_id} %>
- <% if activity.homework_detail_manual && activity.homework_detail_manual.comment_status < 2 %>
-
提交截止时间:<%= activity.end_time.to_s %> 23:59
- <% elsif activity.homework_detail_manual && activity.homework_detail_manual.comment_status >= 2 && activity.anonymous_comment == 0%>
-
匿评截止时间:<%= activity.homework_detail_manual.evaluation_end.to_s %> 23:59
+ <% if !activity.end_time.nil? %>
+
提交截止时间:<%= activity.end_time.to_s %> 23:59
<% end %>
<% if activity.homework_detail_manual.comment_status == 0 && !activity.publish_time.nil? %>
From 980ae7818518b36c5516f80ce0b53910f6bb47a0 Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Thu, 24 Nov 2016 10:11:59 +0800
Subject: [PATCH 25/43] =?UTF-8?q?=E4=BF=AE=E6=94=B9pull=20request=E5=8F=91?=
=?UTF-8?q?=E9=80=81=E6=BA=90=E9=A1=B9=E7=9B=AE=E6=8F=90=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/pull_requests_controller.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/controllers/pull_requests_controller.rb b/app/controllers/pull_requests_controller.rb
index e481b09a6..ec9f98ccf 100644
--- a/app/controllers/pull_requests_controller.rb
+++ b/app/controllers/pull_requests_controller.rb
@@ -95,7 +95,7 @@ class PullRequestsController < ApplicationController
if params[:target_project_id]
target_project_id = params[:forked_project_id].to_i
request = @g.create_merge_request(@project.gpid, title, User.current.gid, :description => description, :source_branch => source_branch, :target_branch => target_branch, :target_project_id => target_project_id)
- @fork_project_name = Project.find(target_project_id).try(:name)
+ @fork_project_name = Project.find(params[:target_project_id]).try(:name)
@fork_pr_message = true if @fork_project_name
else
request = @g.create_merge_request(@project.gpid, title, User.current.gid, :description => description, :source_branch => source_branch, :target_branch => target_branch)
From 7713fba2f8627edb00d1f5e09a55c0936fb4347b Mon Sep 17 00:00:00 2001
From: yuanke <249218296@qq.com>
Date: Thu, 24 Nov 2016 14:30:24 +0800
Subject: [PATCH 26/43] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E7=95=99=E8=A8=80?=
=?UTF-8?q?=E5=88=97=E8=A1=A8=E4=BC=98=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/users_controller.rb | 7 ++++---
app/models/journals_for_message.rb | 5 +++++
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 56b536d30..049789115 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -1369,9 +1369,10 @@ class UsersController < ApplicationController
@jour = jours.limit(10).offset(@page * 10)
@type = params[:type]
if User.current == @user
- jours.update_all(:is_readed => true, :status => false)
- jours.each do |journal|
- fetch_user_leaveWord_reply(journal).update_all(:is_readed => true, :status => false)
+ @jour.update_all(:is_readed => true, :status => false)
+ @jour.each do |journal|
+ # fetch_user_leaveWord_reply(journal).update_all(:is_readed => true, :status => false)
+ journal.delay.set_children_readed_delay
end
end
@state = false
diff --git a/app/models/journals_for_message.rb b/app/models/journals_for_message.rb
index 4a9601d07..aa83c2210 100644
--- a/app/models/journals_for_message.rb
+++ b/app/models/journals_for_message.rb
@@ -344,4 +344,9 @@ class JournalsForMessage < ActiveRecord::Base
def content_detail
self.notes
end
+
+ def set_children_readed_delay
+ # fetch_user_leaveWord_reply(self).update_all(:is_readed => true, :status => false)
+ end
+
end
From 45bbd7b293eb59601e41798f68dd1de06657bfd5 Mon Sep 17 00:00:00 2001
From: huang
Date: Thu, 24 Nov 2016 14:47:02 +0800
Subject: [PATCH 27/43] =?UTF-8?q?pull=20request=20=E9=80=89=E6=8B=A9?=
=?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=9A=84=E6=97=B6=E5=80=99JS=E6=8E=A7?=
=?UTF-8?q?=E5=88=B6=E5=88=86=E6=94=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/pull_requests_controller.rb | 2 +-
app/views/pull_requests/_form.html.erb | 6 ++--
public/javascripts/project.js | 34 ++++++++++++++-------
3 files changed, 27 insertions(+), 15 deletions(-)
diff --git a/app/controllers/pull_requests_controller.rb b/app/controllers/pull_requests_controller.rb
index ec9f98ccf..6bfe72c21 100644
--- a/app/controllers/pull_requests_controller.rb
+++ b/app/controllers/pull_requests_controller.rb
@@ -92,7 +92,7 @@ class PullRequestsController < ApplicationController
if compare_pull_request(source_branch, target_project_id, target_branch)
# 如果传送了目标项目ID即向fork源项目发送请求
# if params[:forked_project_id] && params[:source_project] == "forked_project_name"
- if params[:target_project_id]
+ if params[:target_project_id].to_i != @project.id
target_project_id = params[:forked_project_id].to_i
request = @g.create_merge_request(@project.gpid, title, User.current.gid, :description => description, :source_branch => source_branch, :target_branch => target_branch, :target_project_id => target_project_id)
@fork_project_name = Project.find(params[:target_project_id]).try(:name)
diff --git a/app/views/pull_requests/_form.html.erb b/app/views/pull_requests/_form.html.erb
index 43b3bf4d9..d76c3e8a8 100644
--- a/app/views/pull_requests/_form.html.erb
+++ b/app/views/pull_requests/_form.html.erb
@@ -12,9 +12,9 @@
<% if @forked_project.nil? %>
<%= select_tag :branch, options_for_select(@source_rev), :id => "pull_request_branch", :name => "target_branch", :value => "target_branch",:class => "fl PullReques_minselect ml5" %>
<% else %>
-
- <%= @source_project_name %>
- <%= @forked_project_name %>
+
+ <%= @source_project_name %>
+ <%= @forked_project_name %>
<% @source_rev.each do |rev| %>
diff --git a/public/javascripts/project.js b/public/javascripts/project.js
index be3327985..10dfbd9bb 100644
--- a/public/javascripts/project.js
+++ b/public/javascripts/project.js
@@ -665,18 +665,30 @@ function search_tag_attachment(url,tag_name,q,course_id,sort)
}
-function choice_branch(name, branch, source_rev, forked_rev) {
- switch (name) {
- case "source_project_name" :
- var branchOptions = source_rev;
- break;
- case "forked_project_name" :
- var branchOptions = forked_rev;
- break;
- default:
- var branchOptions = source_rev;
- break;
+function choice_branch(name, branch, source_rev, forked_rev, project_id, project_forked_from_id) {
+ if (name==project_id){
+ var branchOptions = source_rev;
}
+ else if (name == project_forked_from_id){
+ var branchOptions = forked_rev;
+ }
+ else{
+ var branchOptions = source_rev;
+ }
+
+// switch (name) {
+// case project_id :
+// alert("project_id" + project_id);
+// var branchOptions = source_rev;
+// break;
+// case project_forked_from_id :
+// alert("project_forked_from_id"+project_forked_from_id);
+// var branchOptions = forked_rev;
+// break;
+// default:
+// var branchOptions = source_rev;
+// break;
+// }
branch.options.length = 0;
for (var i = 0; i < branchOptions.length; i++) {
From 4fcddf743d3817a283439f0c1a236c420ebfe0e6 Mon Sep 17 00:00:00 2001
From: yuanke <249218296@qq.com>
Date: Thu, 24 Nov 2016 15:15:52 +0800
Subject: [PATCH 28/43] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=AE=80=E4=BB=8B?=
=?UTF-8?q?=E5=8D=95=E8=AF=8D=E4=B8=8D=E6=8D=A2=E8=A1=8C=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/projects/show.html.erb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/views/projects/show.html.erb b/app/views/projects/show.html.erb
index 5a38e3b38..74a4878b8 100644
--- a/app/views/projects/show.html.erb
+++ b/app/views/projects/show.html.erb
@@ -3,9 +3,9 @@
<%= render :partial => 'projects/invite_code' %>
<% if @project.description.blank? %>
-
<%= @project.name %>
+
<%= @project.name %>
<% else %>
-
<%=h @project.description.html_safe %>
+
<%=h @project.description.html_safe %>
<% end %>
From abc6eafdb4ce526ed81ad64468e03833bd4fe3e7 Mon Sep 17 00:00:00 2001
From: huang
Date: Thu, 24 Nov 2016 16:04:29 +0800
Subject: [PATCH 29/43] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=A0=E9=99=A4?=
=?UTF-8?q?=E7=89=88=E6=9C=AC=E5=BA=93=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/projects_controller.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index 304ab8e02..5ad31c771 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -810,12 +810,12 @@ class ProjectsController < ApplicationController
g = Gitlab.client
@gitlab_repository.destroy
@gitlab_repository = nil
- @project.update_attribute(:gpid, nil)
scm = params[:repository_scm] || (Redmine::Scm::Base.all & Setting.enabled_scm).first
@repository = Repository.factory(scm)
@repository.is_default = @project.repository.nil?
g.delete_project(@project.gpid)
rescue Exception => e
+ @project.update_attribute(:gpid, nil)
puts e
end
end
From 8743460134aa2065aaa5cc48f42c1b48edcc4ffe Mon Sep 17 00:00:00 2001
From: cxt
Date: Fri, 25 Nov 2016 09:59:03 +0800
Subject: [PATCH 30/43] =?UTF-8?q?=E5=8A=A8=E6=80=81=E4=B8=8E=E8=AF=A6?=
=?UTF-8?q?=E6=83=85=E7=9A=84=E5=9B=9E=E5=A4=8D=E5=8F=A0=E5=B1=82=E8=B0=83?=
=?UTF-8?q?=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/blog_comments_controller.rb | 5 +-
app/controllers/messages_controller.rb | 13 +--
app/controllers/news_controller.rb | 2 +
.../org_document_comments_controller.rb | 4 +-
app/controllers/users_controller.rb | 108 +++++++++++++++---
app/controllers/words_controller.rb | 46 +-------
app/helpers/application_helper.rb | 95 +++++++++++++++
.../_blog_comment_show_replies.html.erb | 4 +-
app/views/blog_comments/destroy.js.erb | 13 ++-
app/views/blog_comments/reply.js.erb | 17 +--
app/views/blog_comments/show.html.erb | 5 +-
app/views/blogs/_homepage.html.erb | 7 +-
app/views/comments/destroy.js.erb | 2 +-
app/views/comments/reply.js.erb | 2 +-
app/views/issues/_issue_replies.html.erb | 2 +-
.../messages/_course_show_replies.html.erb | 4 +-
app/views/messages/_org_show_replies.html.erb | 4 +-
.../messages/_project_show_replies.html.erb | 4 +-
app/views/messages/destroy.js.erb | 8 +-
app/views/messages/reply.js.erb | 8 +-
app/views/news/_news_replies_detail.html.erb | 4 +-
.../_document_show_replies.html.erb | 4 +-
.../org_document_comments/destroy.js.erb | 2 +-
app/views/org_document_comments/reply.js.erb | 2 +-
app/views/org_document_comments/show.html.erb | 4 -
.../_org_document_post_reply.html.erb | 33 ++++++
.../_org_message_post_reply.html.erb | 35 ++++++
.../_org_subfield_message.html.erb | 37 +-----
.../organizations/_org_subfield_news.html.erb | 33 +-----
.../organizations/_show_org_document.html.erb | 35 +-----
app/views/projects/_act_messages.html.erb | 42 +------
.../projects/_comment_reply_detail.html.erb | 20 ++++
.../projects/_journal_comment_reply.html.erb | 4 +-
.../_project_issue_comments_reply.html.erb | 4 +-
...oject_issue_comments_reply_detail.html.erb | 20 ++++
.../projects/_project_issue_contents.html.erb | 6 +-
.../_project_issue_expand_show.html.erb | 2 +-
.../projects/_project_issue_reply.html.erb | 7 +-
.../_project_message_contents.html.erb | 6 +-
.../_project_message_post_reply.html.erb | 36 ++++++
.../_project_message_replies.html.erb | 6 +-
.../projects/_project_reply_banner.html.erb | 4 +-
.../syllabuses/_syllabus_post_reply.html.erb | 31 +++++
app/views/syllabuses/show.html.erb | 31 +----
app/views/users/_comment_reply.html.erb | 4 +-
.../users/_comment_reply_detail.html.erb | 37 +++++-
app/views/users/_course_homework.html.erb | 2 +-
.../users/_course_journalsformessage.html.erb | 39 +------
app/views/users/_course_message.html.erb | 41 +------
.../users/_course_message_post_reply.html.erb | 35 ++++++
app/views/users/_course_news.html.erb | 35 +-----
.../users/_course_news_post_reply.html.erb | 33 ++++++
app/views/users/_homework_post_reply.html.erb | 8 +-
.../users/_journal_comment_reply.html.erb | 4 +-
app/views/users/_message_contents.html.erb | 6 +-
app/views/users/_message_replies.html.erb | 10 +-
app/views/users/_news_contents.html.erb | 6 +-
app/views/users/_news_replies.html.erb | 6 +-
app/views/users/_project_issue_reply.html.erb | 7 +-
app/views/users/_project_message.html.erb | 41 +------
app/views/users/_reply_banner.html.erb | 8 +-
app/views/users/_reply_to.html.erb | 6 +-
app/views/users/_reply_to_comment.html.erb | 20 ++++
app/views/users/_user_blog.html.erb | 42 +------
.../users/_user_blog_post_reply.html.erb | 39 +++++++
.../users/_user_homework_detail.html.erb | 7 +-
.../users/_user_journal_post_reply.html.erb | 36 ++++++
.../users/_user_journalsformessage.html.erb | 39 +------
app/views/users/all_journals.js.erb | 8 +-
app/views/users/reply_detail.js.erb | 48 ++++++++
app/views/users/reply_to_comment.js.erb | 10 ++
app/views/users/show_all_replies.js.erb | 6 +-
app/views/words/create_reply.js.erb | 4 +-
app/views/words/destroy.js.erb | 10 +-
app/views/words/leave_homework_message.js.erb | 2 +-
app/views/words/reply_to_homework.js.erb | 2 +-
app/views/words/reply_to_syllabus.js.erb | 4 +-
config/routes.rb | 2 +
public/javascripts/application.js | 72 +-----------
public/stylesheets/css/public.css | 5 +-
80 files changed, 793 insertions(+), 652 deletions(-)
create mode 100644 app/views/organizations/_org_document_post_reply.html.erb
create mode 100644 app/views/organizations/_org_message_post_reply.html.erb
create mode 100644 app/views/projects/_project_message_post_reply.html.erb
create mode 100644 app/views/syllabuses/_syllabus_post_reply.html.erb
create mode 100644 app/views/users/_course_message_post_reply.html.erb
create mode 100644 app/views/users/_course_news_post_reply.html.erb
create mode 100644 app/views/users/_reply_to_comment.html.erb
create mode 100644 app/views/users/_user_blog_post_reply.html.erb
create mode 100644 app/views/users/_user_journal_post_reply.html.erb
create mode 100644 app/views/users/reply_detail.js.erb
create mode 100644 app/views/users/reply_to_comment.js.erb
diff --git a/app/controllers/blog_comments_controller.rb b/app/controllers/blog_comments_controller.rb
index 148f45d2c..b0475097d 100644
--- a/app/controllers/blog_comments_controller.rb
+++ b/app/controllers/blog_comments_controller.rb
@@ -40,9 +40,10 @@ class BlogCommentsController < ApplicationController
end
def show
@article = BlogComment.find(params[:id])
- all_comments = []
- @replies = get_all_children(all_comments, @article)
+ @replies = BlogComment.where("root_id = #{@article.id}").reorder("created_on desc")
@reply_count = @replies.count
+ @replies = get_no_children_comments_all @replies
+ @limit_count = @replies.count
@page = params[:page] ? params[:page].to_i + 1 : 0
@limit = 10
@replies = @replies[@page * @limit..@page * @limit + 9]
diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb
index 0c7eb570f..51fcdcc2d 100644
--- a/app/controllers/messages_controller.rb
+++ b/app/controllers/messages_controller.rb
@@ -50,6 +50,8 @@ class MessagesController < ApplicationController
all_comments = []
@replies = Message.where("root_id = #{@topic.id}").reorder("created_on desc")
@reply_count = @replies.count
+ @replies = get_no_children_comments_all @replies
+ @limit_count = @replies.count
@page = params[:page] ? params[:page].to_i + 1 : 0
@limit = 10
@replies = @replies[@page * @limit..@page * @limit + 9]
@@ -171,9 +173,6 @@ class MessagesController < ApplicationController
@reply.root_id = parent.root_id.nil? ? parent.id : parent.root_id
# @reply.reply_id = params[:id]
parent.children << @reply
- @user_activity_id = params[:user_activity_id] if params[:user_activity_id]
- @is_course = params[:is_course] if params[:is_course]
- @is_board = params[:is_board] if params[:is_board]
else
@quote = params[:quote][:quote]
@reply = Message.new
@@ -207,8 +206,8 @@ class MessagesController < ApplicationController
end
if params[:user_activity_id]
@user_activity_id = params[:user_activity_id]
- @is_course = params[:is_course]
- @is_board = params[:is_board]
+ @is_course = params[:is_course] if params[:is_course]
+ @is_board = params[:is_board] if params[:is_board]
respond_to do |format|
format.js
end
@@ -282,8 +281,8 @@ class MessagesController < ApplicationController
@message.destroy
@topic = Message.find(params[:activity_id].to_i)
@user_activity_id = params[:user_activity_id]
- @is_course = params[:is_course]
- @is_board = params[:is_board]
+ @is_course = params[:is_course] if params[:is_course]
+ @is_board = params[:is_board] if params[:is_board]
respond_to do |format|
format.js
end
diff --git a/app/controllers/news_controller.rb b/app/controllers/news_controller.rb
index 53afa50aa..aa037b8d5 100644
--- a/app/controllers/news_controller.rb
+++ b/app/controllers/news_controller.rb
@@ -172,6 +172,8 @@ class NewsController < ApplicationController
@news = result[:news]
@comments = result[:comments]
@comments_count = @comments.count
+ @comments = get_no_children_comments_all @comments
+ @limit_count = @comments.count
@page = params[:page] ? params[:page].to_i + 1 : 0
@limit = 10
@comments = @comments[@page * @limit..@page * @limit + 9]
diff --git a/app/controllers/org_document_comments_controller.rb b/app/controllers/org_document_comments_controller.rb
index 49e970af7..6b8d11479 100644
--- a/app/controllers/org_document_comments_controller.rb
+++ b/app/controllers/org_document_comments_controller.rb
@@ -41,8 +41,10 @@ class OrgDocumentCommentsController < ApplicationController
@org_subfield = OrgSubfield.where(:id => @document.org_subfield_id).first
@subfield_content = @organization.org_subfields.order("priority")
all_comments = []
- @replies = get_all_children(all_comments, @document)
+ @replies = OrgDocumentComment.where("root_id = #{@document.id}").reorder("created_at desc")
@reply_count = @replies.count
+ @replies = get_no_children_comments_all @replies
+ @limit_count = @replies.count
@page = params[:page] ? params[:page].to_i + 1 : 0
@limit = 10
@replies = @replies[@page * @limit..@page * @limit + 9]
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 04a3df24a..76a47b00d 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -171,7 +171,6 @@ class UsersController < ApplicationController
else
@user_activity_id = -1
end
- @hw_status = params[:hw_status].to_i
when 'JournalsForMessage'
@reply = JournalsForMessage.find params[:reply_id]
@user_activity_id = params[:user_activity_id]
@@ -181,15 +180,11 @@ class UsersController < ApplicationController
@reply = Message.find params[:reply_id]
@user_activity_id = params[:user_activity_id]
@activity_id = params[:activity_id]
- @is_course = params[:is_course]
- @is_board = params[:is_board]
@type = 'Message'
when 'BlogComment'
@reply = BlogComment.find params[:reply_id]
@user_activity_id = params[:user_activity_id]
@activity_id = params[:activity_id]
- @homepage = params[:homepage]
- @user_id = params[:user_id]
@type = 'BlogComment'
when 'OrgDocumentComment'
@reply = OrgDocumentComment.find params[:reply_id]
@@ -215,6 +210,96 @@ class UsersController < ApplicationController
end
end
+ #叠层回复框中的回复
+ def reply_to_comment
+ @type = params[:type]
+ @reply = get_reply_by_type @type, params[:reply_id]
+ @user_activity_id = params[:user_activity_id]
+ @is_project = params[:is_project] if params[:is_project]
+ respond_to do |format|
+ format.js
+ end
+ end
+
+ #多级回复
+ def reply_detail
+ @type = params[:type]
+ reply = get_reply_by_type @type, params[:reply_id]
+ @user_activity_id = params[:user_activity_id]
+ case params[:type]
+ when 'HomeworkCommon'
+ @root = HomeworkCommon.find reply.jour_id
+ options = {:notes => params[:reply_message], :reply_id => reply.user_id,:user_id => User.current.id,:m_parent_id => params[:reply_id].to_i,:m_reply_id => params[:reply_id].to_i, :root_id => reply.root_id}
+ comment = HomeworkCommon.add_homework_jour(User.current, params[:reply_message], reply.jour_id, reply.root_id, options)
+ @root.update_column('updated_at', Time.now)
+ @is_teacher = User.current.allowed_to?(:as_teacher, @root.course) || User.current.admin?
+ when 'JournalsForMessage'
+ options = {:user_id => User.current.id,
+ :status => true,
+ :m_parent_id => params[:reply_id],
+ :m_reply_id => params[:reply_id],
+ :reply_id => reply.user.id,
+ :notes => params[:reply_message],
+ :root_id => reply.root_id,
+ :is_readed => false}
+ @root = reply.root
+ comment = add_reply_adapter(@root, options)
+ @root.update_attribute(:updated_on,Time.now)
+ when 'Message'
+ @root = reply.root
+ comment = Message.new
+ comment.author = User.current
+ comment.board = reply.board
+ comment.content = params[:reply_message]
+ comment.subject = "RE: #{@root.subject}"
+ comment.reply_id = params[:reply_id]
+ comment.root_id = reply.root_id
+ reply.children << comment
+ @is_project = params[:is_project] if params[:is_project]
+ when 'BlogComment'
+ @root = reply.root
+ comment = BlogComment.new
+ comment.author = User.current
+ comment.blog = reply.blog
+ comment.title = "RE: #{@root.title}"
+ comment.content = params[:reply_message]
+ comment.reply_id = params[:reply_id]
+ comment.root_id = reply.root_id
+ reply.children << comment
+ when 'OrgDocumentComment'
+ @root = reply.root
+ comment = OrgDocumentComment.new(:creator_id => User.current.id, :reply_id => params[:reply_id])
+ comment.title = "RE:#{@root.title}"
+ comment.content = params[:reply_message]
+ comment.root_id = reply.root_id
+ reply.children << comment
+ when 'News'
+ @root = News.find reply.commented_id
+ comment = @root.comments.build(:author_id => User.current.id, :reply_id => params[:reply_id], :comments => params[:reply_message], :parent_id => reply.id)
+ comment.save
+ when 'Issue'
+ @root = reply.issue
+ comment = @root.journals.build(:user_id => User.current.id, :reply_id => params[:reply_id], :notes => params[:reply_message], :parent_id => reply.id)
+ comment.save
+ @is_project = params[:is_project] if params[:is_project]
+ when 'Syllabus'
+ @root = Syllabus.find reply.jour_id
+ options = {:notes => params[:reply_message], :reply_id => reply.user_id,:user_id => User.current.id,:m_parent_id => params[:reply_id].to_i,:m_reply_id => params[:reply_id].to_i, :root_id => reply.root_id}
+ comment = Syllabus.add_syllabus_jour(User.current, params[:reply_message], reply.jour_id, reply.root_id, options)
+ @root.update_column('updated_at', Time.now)
+ @count = @root.journals_for_messages.count
+ @comments = @root.journals_for_messages.reorder("created_on desc").limit(3)
+ end
+ update_course_activity(@root.class.to_s,@root.id)
+ update_user_activity(@root.class.to_s,@root.id)
+ update_forge_activity(@root.class.to_s,@root.id)
+ update_org_activity(@root.class.to_s,@root.id)
+ update_principal_activity(@root.class.to_s,@root.id)
+ respond_to do |format|
+ format.js
+ end
+ end
+
def refresh_changests
if !(@user.nil?) && !(@user.memberships.nil?)
@user.memberships.each do |member|
@@ -3617,18 +3702,12 @@ class UsersController < ApplicationController
if params[:type].present?
case params[:type]
when 'OrgDocumentComment'
- #obj = OrgDocumentComment.where('id = ?', params[:id].to_i).first
@user_activity_id = params[:div_id].to_i if params[:div_id]
@type = 'OrgDocumentComment'
- #comments = []
@journals = OrgDocumentComment.where("root_id = #{params[:id].to_i}").reorder("created_at desc")
when 'Message','is_project_message'
- #obj = Message.where('id = ?', params[:id].to_i).first
@type = 'Message'
- @is_course = params[:is_course]
- @is_board = params[:is_board]
@user_activity_id = params[:div_id].to_i if params[:div_id]
- #comments = []
@journals = Message.where("root_id = #{params[:id].to_i}").reorder("created_on desc")
when 'News'
obj = News.where('id = ?', params[:id].to_i).first
@@ -3641,8 +3720,6 @@ class UsersController < ApplicationController
@type = 'Syllabus'
@user_activity_id = params[:div_id].to_i if params[:div_id]
when 'JournalsForMessage'
- #obj = JournalsForMessage.where('id = ?', params[:id].to_i).first
- #journals = []
@journals = JournalsForMessage.where("root_id = #{params[:id].to_i}").reorder("created_on desc")
@type = 'JournalsForMessage'
@user_activity_id = params[:div_id].to_i if params[:div_id]
@@ -3659,20 +3736,17 @@ class UsersController < ApplicationController
when 'BlogComment'
obj = BlogComment.where('id = ?', params[:id].to_i).first
@user_activity_id = params[:div_id].to_i if params[:div_id]
- @homepage = params[:homepage].to_i
@type = 'BlogComment'
- @user_id = obj.author_id
- #comments = []
@journals = BlogComment.where("root_id = #{params[:id].to_i}").reorder("created_on desc")
when 'HomeworkCommon'
obj = HomeworkCommon.where('id = ?', params[:id].to_i).first
@type = 'HomeworkCommon'
@journals = obj.journals_for_messages.reorder("created_on desc")
- @hw_status = params[:hw_status].to_i if params[:hw_status]
@is_teacher = User.current.allowed_to?(:as_teacher,obj.course)
@user_activity_id = params[:user_activity_id].to_i if params[:user_activity_id]
end
end
+ @journals = get_no_children_comments_all @journals
end
def homepage
diff --git a/app/controllers/words_controller.rb b/app/controllers/words_controller.rb
index e4b480e2f..2ce505e15 100644
--- a/app/controllers/words_controller.rb
+++ b/app/controllers/words_controller.rb
@@ -116,7 +116,7 @@ class WordsController < ApplicationController
else
@user_activity_id = -1
end
- @hw_status = params[:hw_status].to_i
+ @hw_status = params[:hw_status].to_i if
@is_teacher = User.current.allowed_to?(:as_teacher, @homework.course) || User.current.admin?
elsif @journal_destroyed.jour_type == 'Syllabus'
@syllabus = Syllabus.find @journal_destroyed.jour_id
@@ -315,7 +315,7 @@ class WordsController < ApplicationController
respond_to do |format|
format.js{
@user_activity_id = params[:user_activity_id].to_i
- @hw_status = params[:hw_status].to_i
+ @hw_status = params[:hw_status].to_i if params[:hw_status]
@is_teacher = User.current.allowed_to?(:as_teacher, @homework_common.course) || User.current.admin?
}
end
@@ -349,7 +349,7 @@ class WordsController < ApplicationController
respond_to do |format|
format.js{
@user_activity_id = params[:user_activity_id].to_i
- @hw_status = params[:hw_status].to_i
+ @hw_status = params[:hw_status].to_i if params[:hw_status]
@is_teacher = User.current.allowed_to?(:as_teacher, @homework_common.course) || User.current.admin?
}
end
@@ -454,45 +454,5 @@ class WordsController < ApplicationController
end
obj
end
-
- def add_reply_adapter obj, options
- #modify by nwb
- #添加对课程留言的支持
- #留言回复应该不关系其所属的Class,而关心的是其所属的父留言
- case obj.jour_type
- when 'Principal'
- obj.jour.add_jour(nil, nil, nil, options)
- when 'Project'
- Project.add_new_jour(nil, nil, obj.jour_id, options)
- when 'Course'
- Course.add_new_jour(nil, nil, obj.jour_id, options)
- when 'Bid'
- obj.jour.add_jour(nil, nil, nil, options)
- when 'Contest'
- obj.jour.add_jour(nil, nil, obj.jour_id, options)
- when 'Softapplication'
- obj.jour.add_jour(nil, nil, obj.jour_id, options)
- when 'HomeworkAttach'
- obj.jour.add_jour(nil, nil, obj.jour_id, options)
- end
- # obj = obj_distinguish_url_origin || User.find_by_id(2)
- # if obj.kind_of? User
- # obj.add_jour(nil, nil, nil, options)
- # elsif obj.kind_of? Project
- # Project.add_new_jour(nil, nil, obj.id, options)
- # elsif obj.kind_of? Course
- # Course.add_new_jour(nil, nil, obj.id, options)
- # elsif obj.kind_of? Bid
- # obj.add_jour(nil, nil, nil, options)
- # elsif obj.kind_of? Contest
- # obj.add_jour(nil, nil, obj.id, options) #new added
- # elsif obj.kind_of? Softapplication
- # obj.add_jour(nil, nil, obj.id, options) #new added
- # elsif obj.kind_of? HomeworkAttach
- # obj.add_jour(nil, nil, obj.id, options) #new added
- # else
- # raise "create reply obj unknow type.#{obj.class}"
- # end
- end
#######end of message
end
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index c52182b01..ad3d2c61d 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -3394,6 +3394,61 @@ def secdomain_with_protocol secdomain
return Setting.protocol + "://" + secdomain + ".trustie.net"
end
+#根据回复类型获取回复
+def get_reply_by_type type, reply_id
+ reply = nil
+ case type
+ when 'HomeworkCommon'
+ reply = JournalsForMessage.find reply_id
+ when 'JournalsForMessage'
+ reply = JournalsForMessage.find reply_id
+ when 'Message'
+ reply = Message.find reply_id
+ when 'BlogComment'
+ reply = BlogComment.find reply_id
+ when 'OrgDocumentComment'
+ reply = OrgDocumentComment.find reply_id
+ when 'News'
+ reply = Comment.find reply_id
+ when 'Issue'
+ reply = Journal.find reply_id
+ when 'Syllabus'
+ reply = JournalsForMessage.find reply_id
+ end
+ reply
+end
+
+#获取不包含子节点的回复(前三个)
+def get_no_children_comments comments
+ result = {}
+ no_children_comments = []
+ count = 0
+ three_more = false
+ comments.each do |comment|
+ if comment.children.blank?
+ count = count + 1
+ if count > 3
+ three_more = true
+ end
+ break if count > 3
+ no_children_comments << comment
+ end
+ end
+ result[:three_more] = three_more
+ result[:no_children_comments] = no_children_comments
+ result
+end
+
+#获取不包含子节点的回复(所有)
+def get_no_children_comments_all comments
+ no_children_comments = []
+ comments.each do |comment|
+ if comment.children.blank?
+ no_children_comments << comment
+ end
+ end
+ no_children_comments
+end
#获取回复的所有父节点
def get_reply_parents parents_rely, comment
@@ -3746,3 +3801,43 @@ def homework_type_option
type
end
+def add_reply_adapter obj, options
+ #modify by nwb
+ #添加对课程留言的支持
+ #留言回复应该不关系其所属的Class,而关心的是其所属的父留言
+ case obj.jour_type
+ when 'Principal'
+ obj.jour.add_jour(nil, nil, nil, options)
+ when 'Project'
+ Project.add_new_jour(nil, nil, obj.jour_id, options)
+ when 'Course'
+ Course.add_new_jour(nil, nil, obj.jour_id, options)
+ #when 'Bid'
+ # obj.jour.add_jour(nil, nil, nil, options)
+ #when 'Contest'
+ # obj.jour.add_jour(nil, nil, obj.jour_id, options)
+ #when 'Softapplication'
+ # obj.jour.add_jour(nil, nil, obj.jour_id, options)
+ #when 'HomeworkAttach'
+ # obj.jour.add_jour(nil, nil, obj.jour_id, options)
+ end
+ # obj = obj_distinguish_url_origin || User.find_by_id(2)
+ # if obj.kind_of? User
+ # obj.add_jour(nil, nil, nil, options)
+ # elsif obj.kind_of? Project
+ # Project.add_new_jour(nil, nil, obj.id, options)
+ # elsif obj.kind_of? Course
+ # Course.add_new_jour(nil, nil, obj.id, options)
+ # elsif obj.kind_of? Bid
+ # obj.add_jour(nil, nil, nil, options)
+ # elsif obj.kind_of? Contest
+ # obj.add_jour(nil, nil, obj.id, options) #new added
+ # elsif obj.kind_of? Softapplication
+ # obj.add_jour(nil, nil, obj.id, options) #new added
+ # elsif obj.kind_of? HomeworkAttach
+ # obj.add_jour(nil, nil, obj.id, options) #new added
+ # else
+ # raise "create reply obj unknow type.#{obj.class}"
+ # end
+end
+
diff --git a/app/views/blog_comments/_blog_comment_show_replies.html.erb b/app/views/blog_comments/_blog_comment_show_replies.html.erb
index ba33aaf5a..3a3e8ef81 100644
--- a/app/views/blog_comments/_blog_comment_show_replies.html.erb
+++ b/app/views/blog_comments/_blog_comment_show_replies.html.erb
@@ -10,7 +10,7 @@
<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => 33, :height => 33, :alt => "用户头像"), user_url_in_org(comment.creator_user.id) %>
- <%= render :partial => 'users/message_contents', :locals => {:comment => comment}%>
+ <%= render :partial => 'users/message_contents', :locals => {:comment => comment, :type => 'BlogComment', :user_activity_id => @article.id}%>
<% if !comment.content_detail.blank? %>