From 5c4e4e7c8ad2190c35595ba914ef78c2b24472ef Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Thu, 7 Jul 2016 16:55:34 +0800
Subject: [PATCH 01/60] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=A0=E9=99=A4?=
=?UTF-8?q?=E7=8F=AD=E7=BA=A7=E5=90=8E=E5=86=8D=E5=88=A0=E9=99=A4=E8=AF=BE?=
=?UTF-8?q?=E7=A8=8B=EF=BC=8C=E6=8F=90=E7=A4=BA=E9=94=99=E8=AF=AF=E7=9A=84?=
=?UTF-8?q?=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/syllabuses/_delete_syllabus.html.erb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/views/syllabuses/_delete_syllabus.html.erb b/app/views/syllabuses/_delete_syllabus.html.erb
index fbc0a0995..b043186aa 100644
--- a/app/views/syllabuses/_delete_syllabus.html.erb
+++ b/app/views/syllabuses/_delete_syllabus.html.erb
@@ -1,6 +1,6 @@
- <% if @syllabus.courses.empty? %>
+ <% if @syllabus.courses.empty? || @syllabus.courses.not_deleted.empty? %>
确认删除该课程吗?
<% else %>
该课程下已经存在班级,不能删除。
@@ -8,7 +8,7 @@
- <% if @syllabus.courses.empty? %>
+ <% if @syllabus.courses.empty?|| @syllabus.courses.not_deleted.empty? %>
<%=link_to '确认', syllabus_path(@syllabus), :class => 'Blue-btn fl', :method => 'delete'%>
关闭
<% else %>
From 41fc812ca4444ad8b8d3756b935d76960385dd02 Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Thu, 7 Jul 2016 17:34:38 +0800
Subject: [PATCH 02/60] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=8F=AD=E7=BA=A7?=
=?UTF-8?q?=E9=85=8D=E7=BD=AE--=E6=B7=BB=E5=8A=A0=E6=88=90=E5=91=98?=
=?UTF-8?q?=EF=BC=9A=E7=94=A8=E6=88=B7=E5=90=8D=E7=A7=B0=E5=A4=AA=E9=95=BF?=
=?UTF-8?q?=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/views/courses/_member.html.erb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/views/courses/_member.html.erb b/app/views/courses/_member.html.erb
index 1bfe3cbd7..95177c92c 100644
--- a/app/views/courses/_member.html.erb
+++ b/app/views/courses/_member.html.erb
@@ -1,7 +1,7 @@
<% @members.each do |member| %>
<%#= link_to_user_header member.principal,true,:class => "w150 c_orange fl" %>
- <%= link_to "#{member.principal}(#{member.principal.show_name})", user_path(member.principal), :class => "w150 linkBlue fl" %>
+ <%= link_to "#{member.principal}(#{member.principal.show_name})", user_path(member.principal), :class => "w150 linkBlue fl", :style=>"white-space: nowrap;overflow: hidden;text-overflow: ellipsis;", :title => "#{member.principal}(#{member.principal.show_name})" %>
<%= zh_course_role(h member.roles.sort.collect(&:to_s).join(', ')) %>
<%= form_for(member, {:as => :membership, :remote => true, :url => membership_path(member),
From 00d59a55961924b64f857739b17f455b377108cc Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Mon, 11 Jul 2016 15:47:33 +0800
Subject: [PATCH 03/60] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=AF=BE=E7=A8=8B?=
=?UTF-8?q?=E5=9D=90=E4=B8=8B=E4=B8=8B=EF=BC=8C=E6=8F=90=E7=A4=BA=E5=86=85?=
=?UTF-8?q?=E5=AE=B9=E7=9A=84=E8=A1=A8=E8=BE=BE=E5=BD=A2=E5=BC=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/student_work/_show.html.erb | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/app/views/student_work/_show.html.erb b/app/views/student_work/_show.html.erb
index 484e8eb0e..cfc5c42ad 100644
--- a/app/views/student_work/_show.html.erb
+++ b/app/views/student_work/_show.html.erb
@@ -59,9 +59,14 @@
内容:
-
- <%= work.description.html_safe if work.description%>
-
+ <% com_contents = work.work_status %>
+ <% if com_contents != 0 && work.description %>
+
+ <%= work.description.html_safe if work.description%>
+
+ <% else %>
+ 该作品未在线下完成提交
+ <% end %>
From 97599849ee6d76e960a5a40b4207f68ae6212353 Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Mon, 11 Jul 2016 16:03:45 +0800
Subject: [PATCH 04/60] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=AF=BE=E7=A8=8B?=
=?UTF-8?q?=E4=B8=AD=E4=BD=9C=E5=93=81=E4=B8=8B=E5=86=85=E5=AE=B9=E6=98=BE?=
=?UTF-8?q?=E7=A4=BA=E4=BB=A3=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/student_work/_show.html.erb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/views/student_work/_show.html.erb b/app/views/student_work/_show.html.erb
index cfc5c42ad..039baa386 100644
--- a/app/views/student_work/_show.html.erb
+++ b/app/views/student_work/_show.html.erb
@@ -62,7 +62,7 @@
<% com_contents = work.work_status %>
<% if com_contents != 0 && work.description %>
- <%= work.description.html_safe if work.description%>
+ <%= work.description.html_safe %>
<% else %>
该作品未在线下完成提交
From 304f18ac5e179d76b81192cb86b83da2c2cbdddf Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Tue, 12 Jul 2016 15:05:42 +0800
Subject: [PATCH 05/60] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=AF=BE=E7=A8=8B?=
=?UTF-8?q?=E4=B8=AD=EF=BC=8C=E5=AF=B9=E5=8A=A8=E6=80=81=E8=BF=9B=E8=A1=8C?=
=?UTF-8?q?=E7=AD=9B=E9=80=89=E7=9A=84=E9=A1=B5=E9=9D=A2=E5=91=88=E7=8E=B0?=
=?UTF-8?q?=E6=96=B9=E5=BC=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/courses/show.html.erb | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/app/views/courses/show.html.erb b/app/views/courses/show.html.erb
index b9d97e18a..cabbb5d04 100644
--- a/app/views/courses/show.html.erb
+++ b/app/views/courses/show.html.erb
@@ -9,7 +9,23 @@
@@ -97,90 +82,7 @@
- <% unless @comments.empty? %>
-
-
回复(<%=@comments.count %>)
-
-
-
- <% @comments.each_with_index do |reply,i| %>
-
-
-
- <%= link_to image_tag(url_to_avatar(reply.author), :width => 33,:height => 33), user_path(reply.author) %>
-
-
-
- <% if reply.try(:author).try(:realname) == ' ' %>
- <%= link_to reply.try(:author), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %>
- <% else %>
- <%= link_to reply.try(:author).try(:realname), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %>
- <% end %>
-
-
- <%= reply.comments.html_safe%>
-
-
- <%= format_time(reply.created_on) %>
-
-
-
-
-
-
- <% end %>
-
-
- <% end %>
-
- <% if @news.commentable? %>
-
-
-
-
- <%= form_for @comment, :url=>{:controller => 'comments', :action => 'create', :id => @news}, :html => {:multipart => true, :id => 'add_comment_form'} do |f| %>
-
-
-
-
- <%= l(:label_cancel_with_space) %>
-
-
-
- <% end %>
-
-
-
- <% end %>
+ <%= render :partial => 'news/news_all_replies' %>
-
-
- <%= link_to image_tag(url_to_avatar(comment.creator_user), :width => 33, :height => 33, :alt => "用户头像"), user_url_in_org(comment.creator_user.id) %>
-
-
-
- <%= link_to comment.creator_user.show_name, user_url_in_org(comment.creator_user.id), :class => "newsBlue mr10 f14" %>
- <%= time_from_now(comment.created_on) %>
-
- <% if !comment.parent.nil? && !comment.parent.parent.nil? %>
- <%= render :partial => 'users/message_contents', :locals => {:comment => comment}%>
- <% end %>
- <% if !comment.content_detail.blank? %>
-
-
-
-
-
-
- <%= link_to(
- l(:button_reply),
- {:controller => 'users' ,:action => 'reply_to', :reply_id => comment.id, :type => type, :user_activity_id => user_activity_id, :activity_id => activity_id, :homepage => homepage},
- :remote => true,
- :method => 'get',
- :title => l(:button_reply)) if !comment.root.locked? %>
-
-
- <% if comment.author == User.current %>
- <%= link_to(
- l(:button_delete),
- {:controller => 'blog_comments',:action => 'destroy', :id => comment.id, :user_activity_id => user_activity_id, :homepage => homepage},
- :method => :delete,
- :remote => true,
- :class => 'fr mr20',
- :data => {:confirm => l(:text_are_you_sure)},
- :title => l(:button_delete)) %>
- <% end %>
-
-
-
-
-
- <% end %>
-
-
-
- <% end %>
-
\ No newline at end of file
diff --git a/app/views/users/_course_homework.html.erb b/app/views/users/_course_homework.html.erb
index 783193e46..874a6b403 100644
--- a/app/views/users/_course_homework.html.erb
+++ b/app/views/users/_course_homework.html.erb
@@ -294,28 +294,12 @@
<% count=activity.journals_for_messages.count %>
-
-
回复
- ︿
- <%= count>0 ? "(#{count})" : "" %> ▪
-
- <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
-
-
-
- <%if count>3 %>
-
- <% end %>
-
+ <%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id, :is_in_course => -1,:course_activity=>course_activity} %>
<% comments = activity.journals_for_messages.reorder("created_on desc").limit(3) %>
<% if count > 0 %>
- <%=render :partial => 'users/homework_replies', :locals => {:comments => comments, :is_in_course => -1,:course_activity=>course_activity, :is_teacher => is_teacher, :user_activity_id => user_activity_id} %>
+ <%=render :partial => 'users/news_replies', :locals => {:comments => comments, :type => 'HomeworkCommon', :is_in_course => -1,:course_activity=>course_activity, :is_teacher => is_teacher, :user_activity_id => user_activity_id} %>
<% end %>
diff --git a/app/views/users/_course_journalsformessage.html.erb b/app/views/users/_course_journalsformessage.html.erb
index c9fe344ba..3225a1a8b 100644
--- a/app/views/users/_course_journalsformessage.html.erb
+++ b/app/views/users/_course_journalsformessage.html.erb
@@ -40,16 +40,14 @@
<% all_comments = []%>
<% count=get_all_children(all_comments, activity).count %>
- <%# allow_delete = (activity.user == User.current || User.current.admin? || User.current.allowed_to?(:as_teacher,activity.course)) %>
- <%# count = fetch_user_leaveWord_reply(activity).count %>
- <%= render :partial => 'users/journal_reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id} %>
+ <%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id} %>
<% all_comments = []%>
<% comments = get_all_children(all_comments, activity)[0..2] %>
<% if count > 0 %>
- <%= render :partial => 'users/journal_replies', :locals => {:comments => comments, :user_activity_id => user_activity_id, :type => 'JournalsForMessage', :activity_id =>activity.id}%>
+ <%= render :partial => 'users/message_replies', :locals => {:comments => comments, :user_activity_id => user_activity_id, :type => 'JournalsForMessage', :activity_id =>activity.id}%>
<% end %>
diff --git a/app/views/users/_course_message.html.erb b/app/views/users/_course_message.html.erb
index 48daa6e95..0c16a4367 100644
--- a/app/views/users/_course_message.html.erb
+++ b/app/views/users/_course_message.html.erb
@@ -81,7 +81,7 @@
<% all_comments = []%>
<% count=get_all_children(all_comments, activity).count %>
- <%= render :partial => 'users/message_reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id,:is_course => is_course,:is_board =>is_board} %>
+ <%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id,:is_course => is_course,:is_board =>is_board} %>
<% all_comments = []%>
<% comments = get_all_children(all_comments, activity)[0..2] %>
diff --git a/app/views/users/_course_news.html.erb b/app/views/users/_course_news.html.erb
index 18f16b068..f46282ff8 100644
--- a/app/views/users/_course_news.html.erb
+++ b/app/views/users/_course_news.html.erb
@@ -62,6 +62,7 @@
+
<% count=activity.comments.count %>
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id} %>
@@ -69,31 +70,32 @@
<% comments = activity.comments.reorder("created_on desc").limit(3) %>
<% if count > 0 %>
- <%= render :partial => 'users/all_replies', :locals => {:comments => comments}%>
+ <%= render :partial => 'users/news_replies', :locals => {:comments => comments, :user_activity_id => user_activity_id, :type => 'News', :activity_id => activity.id} %>
+
+ <% end %>
+ <% if activity.commentable? %>
+
+
<%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(User.current), :alt => "用户头像" %>
+
+ <% if User.current.logged? %>
+
+ <%= form_for('new_form',:url => {:controller => 'comments', :action => 'create', :id => activity},:method => "post", :remote => true) do |f|%>
+
+
+
+
发送
+
+
+ <% end%>
+
+ <% else %>
+ <%= render :partial => "users/show_unlogged" %>
+ <% end %>
+
+
+
<% end %>
-
-
-
<%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(User.current), :alt => "用户头像" %>
-
- <% if User.current.logged? %>
-
- <%= form_for('new_form',:url => {:controller => 'comments', :action => 'create', :id => activity},:method => "post", :remote => true) do |f|%>
-
-
-
-
发送
-
-
- <% end%>
-
- <% else %>
- <%= render :partial => "users/show_unlogged" %>
- <% end %>
-
-
-
-
-
-
- <%= link_to image_tag(url_to_avatar(comment.user), :width => "33", :height => "33", :class =>"mt8"), user_path(comment.user_id), :alt => "用户头像" %>
-
-
-
- <%= link_to comment.user.show_name, user_path(comment.user_id), :class => "newsBlue mr10 f14" %>
- <%= time_from_now(comment.created_on) %>
-
- <% unless comment.m_parent_id.nil? %>
- <% parents_rely = [] %>
- <% parents_rely = get_reply_parents parents_rely, comment %>
- <% length = parents_rely.length %>
-
- <% end %>
-
-
-
-
-
-
- <%= link_to(
- l(:button_reply),
- {:controller => 'users' ,:action => 'reply_to', :reply_id => comment.id, :type => 'HomeworkCommon', :is_in_course => is_in_course, :user_activity_id => user_activity_id, :course_activity => course_activity},
- :remote => true,
- :method => 'get',
- :title => l(:button_reply)) %>
-
-
-
- <% if User.current.admin? ||is_teacher || comment.user == User.current%>
- <%= link_to('删除', {:controller => 'words', :action => 'destroy', :object_id => comment, :user_id => comment.user,:is_in_course => is_in_course, :user_activity_id => user_activity_id, :course_activity => course_activity},
- :remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "fr mr20", :title => l(:button_delete)) %>
- <% end %>
-
-
-
-
-
-
-
-
- <% end %>
-
\ No newline at end of file
diff --git a/app/views/users/_journal_reply_banner.html.erb b/app/views/users/_journal_reply_banner.html.erb
deleted file mode 100644
index 25175542f..000000000
--- a/app/views/users/_journal_reply_banner.html.erb
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
- 回复
- ︿
- <%= count>0 ? "(#{count})" : "" %> ▪
-
- <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
-
-
-
<%#= format_date(activity.updated_on) %>
- <%if count>3 %>
-
- <% end %>
-
\ No newline at end of file
diff --git a/app/views/users/_message_replies.html.erb b/app/views/users/_message_replies.html.erb
index c6f9d91b0..10a8e2b55 100644
--- a/app/views/users/_message_replies.html.erb
+++ b/app/views/users/_message_replies.html.erb
@@ -13,7 +13,7 @@
<%= link_to comment.creator_user.show_name, user_url_in_org(comment.creator_user.id), :class => "newsBlue mr10 f14" %>
- <%= time_from_now(comment.created_on) %>
+ <%= time_from_now(comment.respond_to?(:created_on) ? comment.created_on : comment.created_at) %>
<% if !comment.parent.nil? && !comment.parent.parent.nil? %>
<%= render :partial => 'users/message_contents', :locals => {:comment => comment}%>
@@ -28,6 +28,7 @@
+ <% if type == 'Message' %>
<%= link_to(
l(:button_reply),
@@ -37,7 +38,7 @@
:title => l(:button_reply)) %>
- <% if comment.course_destroyable_by?(User.current) %>
+ <% if comment.course_destroyable_by?(User.current) %>
<%= link_to(
l(:button_delete),
delete_board_message_path(comment,:board_id =>comment.board.id, :user_activity_id => user_activity_id, :activity_id => activity_id, :is_course => is_course, :is_board => is_board),
@@ -48,6 +49,61 @@
:title => l(:button_delete)
) %>
<% end %>
+ <% elsif type == 'JournalsForMessage' %>
+
+ <%= link_to(
+ l(:button_reply),
+ {:controller => 'users' ,:action => 'reply_to', :reply_id => comment.id, :type => type, :user_activity_id => user_activity_id, :activity_id => activity_id},
+ :remote => true,
+ :method => 'get',
+ :title => l(:button_reply)) %>
+
+
+ <% if comment.creator_user == User.current || User.current.admin? %>
+ <%= link_to('删除', {:controller => 'words', :action => 'destroy', :object_id => comment, :user_id => comment.user, :user_activity_id => user_activity_id, :activity_id => activity_id},
+ :remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "fr mr20", :title => l(:button_delete)) %>
+ <% end %>
+ <% elsif type == 'OrgDocumentComment' %>
+
+ <%= link_to(
+ l(:button_reply),
+ {:controller => 'users' ,:action => 'reply_to', :reply_id => comment.id, :type => type, :user_activity_id => user_activity_id, :activity_id => activity_id},
+ :remote => true,
+ :method => 'get',
+ :title => l(:button_reply)) %>
+
+
+ <% if comment.creator_user == User.current %>
+ <%= link_to(
+ l(:button_delete),
+ {:controller => 'org_document_comments',:action => 'destroy', :id => comment.id, :user_activity_id => user_activity_id},
+ :method => :delete,
+ :remote => true,
+ :class => 'fr mr20',
+ :data => {:confirm => l(:text_are_you_sure)},
+ :title => l(:button_delete)) %>
+ <% end %>
+ <% elsif type == 'BlogComment' %>
+
+ <%= link_to(
+ l(:button_reply),
+ {:controller => 'users' ,:action => 'reply_to', :reply_id => comment.id, :type => type, :user_activity_id => user_activity_id, :activity_id => activity_id, :homepage => homepage},
+ :remote => true,
+ :method => 'get',
+ :title => l(:button_reply)) if !comment.root.locked? %>
+
+
+ <% if comment.author == User.current %>
+ <%= link_to(
+ l(:button_delete),
+ {:controller => 'blog_comments',:action => 'destroy', :id => comment.id, :user_activity_id => user_activity_id, :homepage => homepage},
+ :method => :delete,
+ :remote => true,
+ :class => 'fr mr20',
+ :data => {:confirm => l(:text_are_you_sure)},
+ :title => l(:button_delete)) %>
+ <% end %>
+ <% end %>
diff --git a/app/views/users/_message_reply_banner.html.erb b/app/views/users/_message_reply_banner.html.erb
deleted file mode 100644
index 0c8cda379..000000000
--- a/app/views/users/_message_reply_banner.html.erb
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
- 回复
- ︿
- <%= count>0 ? "(#{count})" : "" %> ▪
-
- <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
-
-
-
<%#= format_date(activity.updated_on) %>
- <%if count>3 %>
-
- <% end %>
-
\ No newline at end of file
diff --git a/app/views/users/_journal_replies.html.erb b/app/views/users/_news_replies.html.erb
similarity index 58%
rename from app/views/users/_journal_replies.html.erb
rename to app/views/users/_news_replies.html.erb
index e6b9f6f7b..e6f28b653 100644
--- a/app/views/users/_journal_replies.html.erb
+++ b/app/views/users/_news_replies.html.erb
@@ -13,20 +13,20 @@
<%= link_to comment.creator_user.show_name, user_url_in_org(comment.creator_user.id), :class => "newsBlue mr10 f14" %>
- <%= time_from_now(comment.created_on) %>
+ <%= time_from_now(comment.respond_to?(:created_on) ? comment.created_on : comment.created_at) %>
- <% if !comment.parent.nil? && !comment.parent.parent.nil? %>
+ <% if !comment.parent.nil? %>
<% parents_rely = [] %>
- <% parents_rely = get_reply_parents_no_root parents_rely, comment %>
+ <% parents_rely = get_reply_parents parents_rely, comment %>
<% length = parents_rely.length %>