From 3f35b7f806f5e7f9415f59d1bbeacaaa89e90369 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 29 Nov 2016 09:36:38 +0800 Subject: [PATCH 01/35] =?UTF-8?q?=E8=B4=B4=E5=90=A7=E5=9B=9E=E5=A4=8D?= =?UTF-8?q?=E6=94=B9=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/memos_controller.rb | 71 +++++++++-------- app/controllers/users_controller.rb | 11 +++ app/helpers/application_helper.rb | 2 + app/models/memo.rb | 15 +++- app/views/forums/_show_topics.html.erb | 3 +- app/views/layouts/base_forums.html.erb | 5 +- app/views/memos/_memo_all_replies.html.erb | 77 +++++++++++++++++++ app/views/memos/_reply_message.html.erb | 31 ++++++++ app/views/memos/quote.js.erb | 10 +-- app/views/memos/show.html.erb | 58 +------------- app/views/memos/show.js.erb | 1 + app/views/praise_tread/praise_plus.js.erb | 10 +-- app/views/users/reply_detail.js.erb | 4 +- app/views/users/show_all_replies.js.erb | 2 +- .../20161128072528_add_root_id_to_memos.rb | 26 +++++++ db/schema.rb | 31 +++++--- 16 files changed, 243 insertions(+), 114 deletions(-) create mode 100644 app/views/memos/_memo_all_replies.html.erb create mode 100644 app/views/memos/_reply_message.html.erb create mode 100644 app/views/memos/show.js.erb create mode 100644 db/migrate/20161128072528_add_root_id_to_memos.rb diff --git a/app/controllers/memos_controller.rb b/app/controllers/memos_controller.rb index a47ddf787..69a1b829c 100644 --- a/app/controllers/memos_controller.rb +++ b/app/controllers/memos_controller.rb @@ -14,17 +14,17 @@ class MemosController < ApplicationController # layout 'base_memos' def quote - @subject = @memo.subject - @subject = "RE: #{@subject}" unless @subject.starts_with?('RE:') - - @content = "#{ll(Setting.default_language, :text_user_wrote, @memo.author)}
  " - @content << @memo.content.to_s.strip.gsub(%r{
((.|\s)*?)
}m, '[...]').gsub(/(\r?\n|\r\n?)/, "\n") + "\n\n
" - @content = "
" << @content - #@content = "> #{ll(Setting.default_language, :text_user_wrote, @memo.author)}\n> " - #@content << @memo.content.to_s.strip.gsub(%r{
((.|\s)*?)
}m, '[...]').gsub(/(\r?\n|\r\n?)/, "\n> ") + "\n\n" - #@content_html = textilizable(@content) - @temp = Memo.new - @temp.content = @content + # @subject = @memo.subject + # @subject = "RE: #{@subject}" unless @subject.starts_with?('RE:') + # + # @content = "#{ll(Setting.default_language, :text_user_wrote, @memo.author)}
  " + # @content << @memo.content.to_s.strip.gsub(%r{
((.|\s)*?)
}m, '[...]').gsub(/(\r?\n|\r\n?)/, "\n") + "
\n\n
" + # @content = "
" << @content + # #@content = "> #{ll(Setting.default_language, :text_user_wrote, @memo.author)}\n> " + # #@content << @memo.content.to_s.strip.gsub(%r{
((.|\s)*?)
}m, '[...]').gsub(/(\r?\n|\r\n?)/, "\n> ") + "\n\n" + # #@content_html = textilizable(@content) + # @temp = Memo.new + # @temp.content = @content end def new @@ -47,6 +47,8 @@ class MemosController < ApplicationController @quote = params[:quote] end + + #unless params[:quote].nil? # @quote = params[:quote][:quote] #end @@ -55,6 +57,10 @@ class MemosController < ApplicationController @memo.forum_id = params[:forum_id] @memo.author_id = User.current.id + if params[:memo][:parent_id] + @memo.root_id = (Memo.find params[:memo][:parent_id]).root_id.nil? ? params[:memo][:parent_id].to_i : (Memo.find params[:memo][:parent_id]).root_id + end + @memo.save_attachments(params[:attachments] || (params[:memo] && params[:memo][:uploads])) @memo.content = @quote + @memo.content respond_to do |format| @@ -111,32 +117,37 @@ class MemosController < ApplicationController @memo = @memo.root # 取出楼主,防止输入帖子id让回复作为主贴显示 @memo.update_column(:viewed_count, (@memo.viewed_count.to_i + 1)) - page = params[:page] - if params[:r] && page.nil? - offset = @memo.children.where("#{Memo.table_name}.id < ?", params[:r].to_i).count - page = 1 + offset / pre_count - else - - end - @reply_count = @memo.children.count - @reply_pages = Paginator.new @reply_count, pre_count, page - @replies = @memo.children. - includes(:author, :attachments). - reorder("#{Memo.table_name}.created_at DESC"). - limit(@reply_pages.per_page). - offset(@reply_pages.offset). - all + # page = params[:page] + # if params[:r] && page.nil? + # offset = @memo.children.where("#{Memo.table_name}.id < ?", params[:r].to_i).count + # page = 1 + offset / pre_count + # else + # end + + # @reply_count = @memo.children.count + # @reply_pages = Paginator.new @reply_count, pre_count, page + # @replies = @memo.children. + # includes(:author, :attachments). + # reorder("#{Memo.table_name}.created_at DESC"). + # limit(@reply_pages.per_page). + # offset(@reply_pages.offset). + # all + + @replies = Memo.where("root_id = #{@memo.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] @memo_new = Memo.new @my_topic_count = Memo.where("forum_id = #{@memo.forum_id} and author_id = #{User.current.id} and parent_id is null").count @my_replies_count = Memo.where("forum_id = #{@memo.forum_id} and author_id = #{User.current.id} and parent_id is not null").count - # @memo = Memo.find_by_id(params[:id]) - # @forum = Forum.find(params[:forum_id]) - # @replies = @memo.replies - # @mome_new = Memo.new respond_to do |format| + format.js format.html {render :layout=> 'base_forums'}#:layout=> 'base_forums', format.json { render json: @memo } format.xml { render xml: @memo } diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index aebc82b14..26b09e6e8 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -155,6 +155,8 @@ class UsersController < ApplicationController @comment = Comment.find params[:comment].to_i when 'Journal','is_project_issue' @comment = Journal.find params[:comment].to_i + when 'Memo' + @comment = Memo.find params[:comment].to_i end @user_activity_id = params[:user_activity_id] @parent_id = params[:parent_id] if params[:parent_id] @@ -299,6 +301,15 @@ class UsersController < ApplicationController @root.update_column('updated_at', Time.now) @count = @root.journals_for_messages.count @comments = @root.journals_for_messages.reorder("created_on desc").limit(3) + when 'Memo' + @root = reply.root + comment = Memo.new + comment.author = User.current + comment.forum = reply.forum + comment.content = params[:reply_message] + comment.subject = "#{@root.subject}" + comment.root_id = reply.root_id + reply.children << comment end update_course_activity(@root.class.to_s,@root.id) update_user_activity(@root.class.to_s,@root.id) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 8301407ae..5b74f631a 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -3422,6 +3422,8 @@ def get_reply_by_type type, reply_id reply = Journal.find reply_id when 'Syllabus' reply = JournalsForMessage.find reply_id + when 'Memo' + reply = Memo.find reply_id end reply end diff --git a/app/models/memo.rb b/app/models/memo.rb index 793d534d4..2ea4a63eb 100644 --- a/app/models/memo.rb +++ b/app/models/memo.rb @@ -79,7 +79,8 @@ class Memo < ActiveRecord::Base "lock", "sticky", "parent_id", - "replies_count" + "replies_count", + "root_id" after_create :add_author_as_watcher, :reset_counters!, :send_mail, :send_message,:create_memo_ealasticsearch_index after_update :update_memo_ealasticsearch_index @@ -126,6 +127,18 @@ class Memo < ActiveRecord::Base Mailer.run.forum_message_added(self) if Setting.notified_events.include?('forum_message_added') end + def creator_user + self.author + end + + def created_time + self.created_on + end + + def content_detail + self.content + end + # 公共贴吧消息记录 # 原则:贴吧创始人;发帖人,wanglingchun(特殊用户) def send_message diff --git a/app/views/forums/_show_topics.html.erb b/app/views/forums/_show_topics.html.erb index c3b8b4dbe..80b77a79b 100644 --- a/app/views/forums/_show_topics.html.erb +++ b/app/views/forums/_show_topics.html.erb @@ -18,7 +18,8 @@
- <%= link_to (topic.replies_count), forum_memo_path(topic.forum, topic),:target =>'_blank',:class=>'linkGrey2' %> + <% replies_count = Memo.where("root_id = #{topic.id}").count %> + <%= link_to (replies_count), forum_memo_path(topic.forum, topic),:target =>'_blank',:class=>'linkGrey2' %> <%= get_praise_num(topic)%>
diff --git a/app/views/layouts/base_forums.html.erb b/app/views/layouts/base_forums.html.erb index b57feb5bd..f5509959b 100644 --- a/app/views/layouts/base_forums.html.erb +++ b/app/views/layouts/base_forums.html.erb @@ -7,13 +7,10 @@ <%= csrf_meta_tag %> <%= favicon %> - <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','application','prettify', 'nyan', :media => 'all' %> + <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','application','prettify', :media => 'all' %> <%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %> <%= javascript_include_tag('jquery-1.8.3-ui-1.9.2-ujs-2.0.3', 'application', 'jquery.colorbox-min') %> - <%= import_ke(enable_at: false, prettify: true, init_activity: false) %> - - <%= heads_for_theme %> <%= call_hook :view_layouts_base_html_head %> diff --git a/app/views/memos/_memo_all_replies.html.erb b/app/views/memos/_memo_all_replies.html.erb new file mode 100644 index 000000000..33e699d9b --- /dev/null +++ b/app/views/memos/_memo_all_replies.html.erb @@ -0,0 +1,77 @@ +<% @replies.each do |reply| %> + + +
+
+ <%= link_to image_tag(url_to_avatar(reply.author), :width => 33,:height => 33), user_path(reply.author) %> +
+
+
+ <%= render :partial => 'users/message_contents', :locals => {:comment => reply, :type => 'Memo', :user_activity_id => @memo.id}%> +
+
+

<%= reply.content.gsub(/script/, "script ").html_safe %>

+
+
+
+ + + <%= render :partial => "praise_tread/praise", :locals => {:activity => reply, :user_activity_id => reply.id, :type => "reply"} %> + + + <%= link_to( + l(:button_reply), + {:action => 'quote', :id => reply}, + :remote => true, + :method => 'get', + :title => l(:button_reply)) %> + + + <%= link_to( + l(:button_delete), + forum_memo_path(@memo.forum, reply), + :method => :delete, + :id => "delete_reply_#{reply.id}", + :class => 'fr mr20 undis', + :data => {:confirm => l(:text_are_you_sure)}, + :title => l(:button_delete) + ) if @memo.author.id == User.current.id || User.current.admin? %> + +
+
+
+

+
+
+
+<% end %> +<% if @limit_count > @page * @limit + 10 %> +
+
+ + + <%= link_to '点击展开更多回复', forum_memo_path(@memo.forum_id, @memo, :page => @page),:remote=>true %> +
+
+<% end %> \ No newline at end of file diff --git a/app/views/memos/_reply_message.html.erb b/app/views/memos/_reply_message.html.erb new file mode 100644 index 000000000..ff8436a84 --- /dev/null +++ b/app/views/memos/_reply_message.html.erb @@ -0,0 +1,31 @@ +
+
+ <%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(User.current), :alt => "用户头像" %> +
+
+ <% if User.current.logged? %> +
+ <%= form_for('memo',:url=>forum_memos_path,:method => "post") do |f|%> + <%= f.hidden_field :subject, :required => true, value: reply.subject %> + <%= f.hidden_field :forum_id, :required => true, value: reply.forum_id %> + <%= f.hidden_field :parent_id, :required => true, value: reply.id %> + <%= hidden_field_tag :quote,"",:required => false,:style => 'display:none' %> +
+ + +
+

+ <% end%> +
+ <% else %> + <%= render :partial => "users/show_unlogged" %> + <% end %> +
+
+
+
+ \ No newline at end of file diff --git a/app/views/memos/quote.js.erb b/app/views/memos/quote.js.erb index 3dbf9eb95..d757dc7f5 100644 --- a/app/views/memos/quote.js.erb +++ b/app/views/memos/quote.js.erb @@ -1,5 +1,5 @@ -//ckeditor.setData("<%= raw escape_javascript(@content) %>"); -$('#message_quote').html("<%= raw escape_javascript(@temp.content.html_safe) %>"); -$('#quote').val("<%= raw escape_javascript(@content) %>"); -showAndScrollTo("new_memo", "cke_editor01"); -$("img").removeAttr("align"); \ No newline at end of file +if($("#reply_message_<%= @memo.id%>").length > 0) { + $("#reply_message_<%= @memo.id%>").replaceWith("<%= escape_javascript(render :partial => 'memos/reply_message', :locals => {:reply => @memo}) %>"); +}else if($("#reply_to_message_<%= @memo.id%>").length >0) { + $("#reply_to_message_<%= @memo.id%>").replaceWith("

"); +} \ No newline at end of file diff --git a/app/views/memos/show.html.erb b/app/views/memos/show.html.erb index 25732c36b..922afe740 100644 --- a/app/views/memos/show.html.erb +++ b/app/views/memos/show.html.erb @@ -4,22 +4,6 @@ <% end %> -
- - <% end %> +
+ <%= render :partial => 'memos/memo_all_replies' %>
diff --git a/app/views/memos/show.js.erb b/app/views/memos/show.js.erb new file mode 100644 index 000000000..8ac3f6194 --- /dev/null +++ b/app/views/memos/show.js.erb @@ -0,0 +1 @@ +$("#more_memo_replies").replaceWith("<%= escape_javascript(render :partial => 'memos/memo_all_replies')%>"); \ No newline at end of file diff --git a/app/views/praise_tread/praise_plus.js.erb b/app/views/praise_tread/praise_plus.js.erb index 29041cd57..c06ad88e5 100644 --- a/app/views/praise_tread/praise_plus.js.erb +++ b/app/views/praise_tread/praise_plus.js.erb @@ -1,13 +1,13 @@ -<% if @obj_type == 'Memo'%> - $('#praise_tread_<%= @obj.id %>').html('<%= j( - render :partial => "/memos/praise_tread",:locals => {:obj => @obj,:user_id => User.current.id,:horizontal => @horizontal} - )%>'); -<% elsif @activity %> +<% if @activity %> <% if @type.to_s == 'activity' %> $('#praise_count_<%=@user_activity_id %>').html('<%=j(render :partial=> "praise_tread/praise", :locals => {:activity=>@obj, :user_activity_id=>@user_activity_id,:type=>"activity"})%>'); <% else @type.to_s == 'reply' %> $('#reply_praise_count_<%=@user_activity_id %>').html('<%=j(render :partial=> "praise_tread/praise", :locals => {:activity=>@obj, :user_activity_id=>@user_activity_id,:type=>"reply"})%>'); <% end %> +<% elsif @obj_type == 'Memo'%> + $('#praise_tread_<%= @obj.id %>').html('<%= j( + render :partial => "/memos/praise_tread",:locals => {:obj => @obj,:user_id => User.current.id,:horizontal => @horizontal} + )%>'); <% else %> $('#praise_tread_<%= @obj.id %>').html('<%= j( render :partial => "/praise_tread/praise_tread",:locals => {:obj => @obj,:user_id => User.current.id,:horizontal => @horizontal} diff --git a/app/views/users/reply_detail.js.erb b/app/views/users/reply_detail.js.erb index 097d36720..23de03a76 100644 --- a/app/views/users/reply_detail.js.erb +++ b/app/views/users/reply_detail.js.erb @@ -43,6 +43,8 @@ $("#activity_post_reply_<%= @user_activity_id%>").html("<%= escape_javascript(re window.location.href = "<%=org_document_comment_path(:id => @root.id, :organization_id => @root.organization.id) %>"; <% end %> <% elsif @type == 'Syllabus' %> -$("#activity_post_reply_<%= @user_activity_id %>").html("<%= escape_javascript(render :partial => 'syllabuses/syllabus_post_reply', :locals => {:activity => @root, :user_activity_id => @user_activity_id}) %>"); + $("#activity_post_reply_<%= @user_activity_id %>").html("<%= escape_javascript(render :partial => 'syllabuses/syllabus_post_reply', :locals => {:activity => @root, :user_activity_id => @user_activity_id}) %>"); +<% elsif @type == 'Memo' %> + window.location.href = "<%=forum_memo_path(@root.forum_id, @root) %>"; <% end %> sd_create_editor_from_data(<%= @user_activity_id%>,"","100%", "UserActivity"); \ No newline at end of file diff --git a/app/views/users/show_all_replies.js.erb b/app/views/users/show_all_replies.js.erb index d5d2a6b54..b02cb0add 100644 --- a/app/views/users/show_all_replies.js.erb +++ b/app/views/users/show_all_replies.js.erb @@ -5,7 +5,7 @@ $('#comment_reply_<%=@comment.id %>').html("<%= escape_javascript(render :partial => 'projects/journal_comment_reply', :locals => {:comment => @comment.parent, :user_activity_id => @user_activity_id, :parent_id => @parent_id})%>"); <% elsif params[:type] == 'is_project_issue' %> $('#comment_reply_<%=@comment.id %>').html("<%= escape_javascript(render :partial => 'projects/project_issue_comments_reply', :locals => {:comment => @comment.parent, :user_activity_id => @user_activity_id, :parent_id => @parent_id})%>"); - <% elsif (@comment.class.to_s == 'Message' || @comment.class.to_s == 'BlogComment' || @comment.class.to_s == 'OrgDocumentComment') %> + <% elsif (@comment.class.to_s == 'Message' || @comment.class.to_s == 'BlogComment' || @comment.class.to_s == 'OrgDocumentComment' || @comment.class.to_s == 'Memo') %> $('#comment_reply_<%=@comment.id %>').html("<%= escape_javascript(render :partial => 'users/journal_comment_reply', :locals => {:comment => @comment.parent, :type => params[:type], :user_activity_id => @user_activity_id, :parent_id => @parent_id})%>"); <% else %> $('#comment_reply_<%=@comment.id %>').html("<%= escape_javascript(render :partial => 'users/comment_reply', :locals => {:comment => @comment.parent, :type => params[:type], :user_activity_id => @user_activity_id, :parent_id => @parent_id})%>"); diff --git a/db/migrate/20161128072528_add_root_id_to_memos.rb b/db/migrate/20161128072528_add_root_id_to_memos.rb new file mode 100644 index 000000000..2f7d60ea1 --- /dev/null +++ b/db/migrate/20161128072528_add_root_id_to_memos.rb @@ -0,0 +1,26 @@ +class AddRootIdToMemos < ActiveRecord::Migration + def change + add_column :memos, :root_id, :integer + add_index :memos, :root_id + + def get_base_parent comment + comm = comment + while comm.parent + comm = comm.parent + end + comm + end + + count = Memo.all.count / 30 + 2 + transaction do + for i in 1 ... count do i + Memo.page(i).per(30).each do |memo| + unless memo.parent.nil? + parent = get_base_parent memo + memo.update_column('root_id', parent.id) + end + end + end + end + end +end diff --git a/db/schema.rb b/db/schema.rb index a57b4fa4c..bd3645e2c 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20161125024643) do +ActiveRecord::Schema.define(:version => 20161128072528) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -325,16 +325,14 @@ ActiveRecord::Schema.define(:version => 20161125024643) do add_index "changeset_parents", ["parent_id"], :name => "changeset_parents_parent_ids" create_table "changesets", :force => true do |t| - t.integer "repository_id", :null => false - t.string "revision", :null => false + t.integer "repository_id", :null => false + t.string "revision", :null => false t.string "committer" - t.datetime "committed_on", :null => false + t.datetime "committed_on", :null => false t.text "comments" t.date "commit_date" t.string "scmid" t.integer "user_id" - t.integer "project_id" - t.integer "type", :default => 0 end add_index "changesets", ["committed_on"], :name => "index_changesets_on_committed_on" @@ -518,6 +516,20 @@ ActiveRecord::Schema.define(:version => 20161125024643) do t.integer "container_id", :default => 0 end + create_table "course_class_post", :id => false, :force => true do |t| + t.integer "班级id", :default => 0, :null => false + t.string "班级名" + t.integer "帖子id", :default => 0, :null => false + t.integer "主贴id" + t.string "帖子标题", :default => "", :null => false + t.text "帖子内容" + t.integer "帖子用户id" + t.integer "帖子回复数", :default => 0, :null => false + t.integer "最后回帖id" + t.datetime "发帖时间", :null => false + t.datetime "帖子更新时间", :null => false + end + create_table "course_contributor_scores", :force => true do |t| t.integer "course_id" t.integer "user_id" @@ -996,10 +1008,6 @@ ActiveRecord::Schema.define(:version => 20161125024643) do t.datetime "updated_at", :null => false end - create_table "innodb_monitor", :id => false, :force => true do |t| - t.integer "a" - end - create_table "invite_lists", :force => true do |t| t.integer "project_id" t.integer "user_id" @@ -1211,8 +1219,11 @@ ActiveRecord::Schema.define(:version => 20161125024643) do t.datetime "created_at", :null => false t.datetime "updated_at", :null => false t.integer "viewed_count", :default => 0 + t.integer "root_id" end + add_index "memos", ["root_id"], :name => "index_memos_on_root_id" + create_table "message_alls", :force => true do |t| t.integer "user_id" t.integer "message_id" From 4c45518913b614628949cacf0cffb5a87c297de0 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 29 Nov 2016 10:22:54 +0800 Subject: [PATCH 02/35] =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=91=98=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E6=97=A0=E6=B3=95=E6=90=9C=E7=B4=A2=E8=8B=B1=E6=96=87?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=E7=9A=84=E8=AF=BE=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/admin_controller.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index 1f8cdd275..d8fc9ce28 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -175,8 +175,10 @@ class AdminController < ApplicationController def courses @name = params[:name].to_s.strip.downcase if @name && @name != "" - @courses = Course.select{ |course| course.teacher && ((course.teacher.show_name).include?(@name) || course.name.include?(@name))} - @courses = @courses.sort{|x, y| y.created_at <=> x.created_at} + all_user_ids = Course.all.map{|course| course.tea_id} + user_str_ids = search_user_by_name all_user_ids, @name + user_ids = user_str_ids.empty? ? "(-1)" : "(" + user_str_ids.join(",") + ")" + @courses = Course.where("tea_id in #{user_ids} or name like '%#{@name}%'").reorder("created_at desc") else @courses = Course.order('created_at desc') end From 896f8a2ac79a4b18e369fc2bf6426107ec25afd6 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 29 Nov 2016 11:03:05 +0800 Subject: [PATCH 03/35] =?UTF-8?q?=E7=8F=AD=E7=BA=A7=E6=B4=BB=E8=B7=83?= =?UTF-8?q?=E5=BA=A6=E4=B8=AA=E6=95=B0=E4=B8=BA0=E6=97=B6=E4=B8=8D?= =?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/courses/_course_activity_users.html.erb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/courses/_course_activity_users.html.erb b/app/views/courses/_course_activity_users.html.erb index 459f60f3d..cffd383e6 100644 --- a/app/views/courses/_course_activity_users.html.erb +++ b/app/views/courses/_course_activity_users.html.erb @@ -1,4 +1,5 @@ -<% unless contributor_course_scor(course.id).count == 0 %> +<% count = contributor_course_scor(course.id).select{|ccs| ccs.con_score != 0 && !ccs.con_score.nil?}.count %> +<% unless count == 0 %>

    From fcadf65688dabf8b1a154680e3351142736fdd1c Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 29 Nov 2016 11:14:35 +0800 Subject: [PATCH 04/35] =?UTF-8?q?=E7=8F=AD=E7=BA=A7=E5=AD=A6=E7=94=9F?= =?UTF-8?q?=E5=88=97=E8=A1=A8=EF=BC=9A=E5=88=A0=E9=99=A4=E6=88=90=E5=91=98?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E6=88=90=E5=91=98=E5=88=97=E8=A1=A8=E6=9C=AA?= =?UTF-8?q?=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/delete_member.js.erb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/views/courses/delete_member.js.erb b/app/views/courses/delete_member.js.erb index 89588f4c1..4e31a87c1 100644 --- a/app/views/courses/delete_member.js.erb +++ b/app/views/courses/delete_member.js.erb @@ -1,5 +1,9 @@ hideModal(); -$("#member_li_<%=params[:member_id] %>").html(""); +var all_indexes = $("#member_li_<%=params[: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_<%=params[:member_id] %>").remove(); $("#st_groups").html("<%=escape_javascript(render :partial => 'new_groups_name', :locals => {:course_groups => @course_groups}) %>"); $("#group_children_list").html("<%= escape_javascript( render :partial => 'layouts/group_children_list', :locals => {:course => @course})%>"); $("#student_number").html("<%= studentCount(@course) %>"); From cb67e136d699cee9ba6a88324e77c3794a412231 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 29 Nov 2016 14:06:25 +0800 Subject: [PATCH 05/35] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E7=9A=84=E5=85=B3?= =?UTF-8?q?=E8=81=94=E9=A1=B9=E7=9B=AE=E5=88=97=E8=A1=A8=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/student_work/_relate_projects.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/student_work/_relate_projects.html.erb b/app/views/student_work/_relate_projects.html.erb index b538d2aa6..c6a372a47 100644 --- a/app/views/student_work/_relate_projects.html.erb +++ b/app/views/student_work/_relate_projects.html.erb @@ -23,7 +23,7 @@

    <%= link_to project.members.count, allow_visit ? member_project_path(project) : 'javascript:void(0)', :class => "c_blue" %>成员  | <%= link_to project.project_score.issue_num, allow_visit ? project_issues_path(project) : 'javascript:void(0)', :class => "c_blue" %>问题  | - <%= link_to project.project_score.attach_num, allow_visit ? file_project_path(project) : 'javascript:void(0)', :class => "c_blue" %>资源 + <%= link_to project.project_score.changeset_num, visible_repository?(project) ? ({:controller => 'repositories', :action => 'show', :id => project, :repository_id => gitlab_repository(project).try(:identifier)}) : 'javascript:void(0)', :class => "c_blue" %>提交

From 97f40e4697f4291e670d0ec85c3f3ca581ca79ce Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 29 Nov 2016 14:38:26 +0800 Subject: [PATCH 06/35] =?UTF-8?q?=E5=8C=BF=E8=AF=84=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E7=9A=84=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../_evaluation_un_group_member_work.html.erb | 16 +++++++++++++++- .../student_work/_evaluation_un_work.html.erb | 14 +++++++++++++- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/app/views/student_work/_evaluation_un_group_member_work.html.erb b/app/views/student_work/_evaluation_un_group_member_work.html.erb index 347bea20e..23bef1cb0 100644 --- a/app/views/student_work/_evaluation_un_group_member_work.html.erb +++ b/app/views/student_work/_evaluation_un_group_member_work.html.erb @@ -27,7 +27,21 @@
<% if st.student_score.nil? %> - 未参与 + <% pro = @homework.student_work_projects.where("user_id = #{st.user_id}").first + if pro.nil? || pro.student_work_id == "" || pro.student_work_id.nil? + work = st + else + work = StudentWork.find pro.student_work_id + end %> + <% if @homework.homework_detail_manual.comment_status < 2 %> + 未参与 + <% elsif @homework.homework_detail_manual.comment_status == 2 && work.student_works_evaluation_distributions.count != 0 %> + 待匿评 + <% elsif @homework.homework_detail_manual.comment_status == 3 && work.student_works_evaluation_distributions.count != 0 %> + 未评分 + <% else %> + 迟交 + <% end %> <% else %> <%= format("%.1f", st.student_score) %> <% end %> diff --git a/app/views/student_work/_evaluation_un_work.html.erb b/app/views/student_work/_evaluation_un_work.html.erb index 9b247f3d6..42985806c 100644 --- a/app/views/student_work/_evaluation_un_work.html.erb +++ b/app/views/student_work/_evaluation_un_work.html.erb @@ -69,7 +69,19 @@ <% if @homework.anonymous_comment == 0%> <% if student_work.student_score.nil? %> - 未参与 + <% if student_work.work_status != 0 %> + <% if @homework.homework_detail_manual.comment_status < 2 %> + 未参与 + <% elsif @homework.homework_detail_manual.comment_status >= 2 && student_work.student_works_evaluation_distributions.count == 0 %> + 迟交 + <% elsif @homework.homework_detail_manual.comment_status == 2 && student_work.student_works_evaluation_distributions.count != 0 %> + 待匿评 + <% elsif @homework.homework_detail_manual.comment_status == 3 && student_work.student_works_evaluation_distributions.count != 0 %> + 未评分 + <% end %> + <% else %> + -- + <% end %> <% else %> <%=format("%.1f",student_work.student_score) %> <% end %> From 4814c1db3d1efce400ba56dd5d866d1937ca73bd Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 29 Nov 2016 15:29:30 +0800 Subject: [PATCH 07/35] =?UTF-8?q?=E5=8F=A0=E5=B1=82=E4=B8=AD=E7=9A=84?= =?UTF-8?q?=E5=9B=9E=E5=A4=8D=E3=80=81=E8=B5=9E=E7=9A=84=E6=98=BE=E9=9A=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../_blog_comment_show_replies.html.erb | 2 +- app/views/courses/_history.html.erb | 2 +- app/views/issues/_issue_replies.html.erb | 2 +- app/views/memos/_memo_all_replies.html.erb | 2 +- app/views/messages/_course_show_replies.html.erb | 2 +- app/views/messages/_org_show_replies.html.erb | 2 +- app/views/messages/_project_show_replies.html.erb | 2 +- app/views/news/_news_replies_detail.html.erb | 2 +- .../_document_show_replies.html.erb | 2 +- .../organizations/_org_course_homework.html.erb | 2 +- .../organizations/_org_course_message.html.erb | 2 +- app/views/organizations/_org_course_news.html.erb | 2 +- .../organizations/_org_project_issue.html.erb | 2 +- app/views/organizations/_project_message.html.erb | 2 +- app/views/praise_tread/praise_minus.js.erb | 2 +- app/views/praise_tread/praise_plus.js.erb | 2 +- app/views/projects/_comment_reply_detail.html.erb | 10 +++++----- app/views/projects/_history.html.erb | 2 +- .../_project_issue_comments_reply_detail.html.erb | 12 ++++++------ .../projects/_project_issue_expand_show.html.erb | 2 +- .../projects/_project_message_replies.html.erb | 2 +- app/views/projects/_project_news_replies.html.erb | 2 +- app/views/users/_comment_reply_detail.html.erb | 14 +++++++------- app/views/users/_message_replies.html.erb | 2 +- app/views/users/_news_replies.html.erb | 2 +- app/views/words/_journal_reply_items.html.erb | 2 +- 26 files changed, 41 insertions(+), 41 deletions(-) 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 3a3e8ef81..23cabb67d 100644 --- a/app/views/blog_comments/_blog_comment_show_replies.html.erb +++ b/app/views/blog_comments/_blog_comment_show_replies.html.erb @@ -19,7 +19,7 @@
- + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> diff --git a/app/views/courses/_history.html.erb b/app/views/courses/_history.html.erb index eb7ecff7a..a0b526eee 100644 --- a/app/views/courses/_history.html.erb +++ b/app/views/courses/_history.html.erb @@ -25,7 +25,7 @@
<% ids = 'project_respond_form_'+ journal.id.to_s%> - + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>journal, :user_activity_id=>journal.id,:type=>"reply"}%> <% if reply_allow %> diff --git a/app/views/issues/_issue_replies.html.erb b/app/views/issues/_issue_replies.html.erb index e67040138..c23cabe1b 100644 --- a/app/views/issues/_issue_replies.html.erb +++ b/app/views/issues/_issue_replies.html.erb @@ -24,7 +24,7 @@
- + <%= render :partial => "praise_tread/praise", :locals => {:activity => comment, :user_activity_id => comment.id, :type => "reply"} %> diff --git a/app/views/memos/_memo_all_replies.html.erb b/app/views/memos/_memo_all_replies.html.erb index 33e699d9b..05ec1c1df 100644 --- a/app/views/memos/_memo_all_replies.html.erb +++ b/app/views/memos/_memo_all_replies.html.erb @@ -36,7 +36,7 @@
- + <%= render :partial => "praise_tread/praise", :locals => {:activity => reply, :user_activity_id => reply.id, :type => "reply"} %> diff --git a/app/views/messages/_course_show_replies.html.erb b/app/views/messages/_course_show_replies.html.erb index e56d19406..3ea86596f 100644 --- a/app/views/messages/_course_show_replies.html.erb +++ b/app/views/messages/_course_show_replies.html.erb @@ -18,7 +18,7 @@
- + <%= render :partial => "praise_tread/praise", :locals => {:activity => reply, :user_activity_id => reply.id, :type => "reply"} %> diff --git a/app/views/messages/_org_show_replies.html.erb b/app/views/messages/_org_show_replies.html.erb index df1b2c301..9b63c80ed 100644 --- a/app/views/messages/_org_show_replies.html.erb +++ b/app/views/messages/_org_show_replies.html.erb @@ -18,7 +18,7 @@
- + <%= render :partial => "praise_tread/praise", :locals => {:activity => reply, :user_activity_id => reply.id, :type => "reply"} %> diff --git a/app/views/messages/_project_show_replies.html.erb b/app/views/messages/_project_show_replies.html.erb index b2f22aecb..637fade8a 100644 --- a/app/views/messages/_project_show_replies.html.erb +++ b/app/views/messages/_project_show_replies.html.erb @@ -18,7 +18,7 @@
- + <%= render :partial => "praise_tread/praise", :locals => {:activity => reply, :user_activity_id => reply.id, :type => "reply"} %> diff --git a/app/views/news/_news_replies_detail.html.erb b/app/views/news/_news_replies_detail.html.erb index 924a6a329..0f4ede154 100644 --- a/app/views/news/_news_replies_detail.html.erb +++ b/app/views/news/_news_replies_detail.html.erb @@ -19,7 +19,7 @@
- + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> diff --git a/app/views/org_document_comments/_document_show_replies.html.erb b/app/views/org_document_comments/_document_show_replies.html.erb index c3faef645..8507a6272 100644 --- a/app/views/org_document_comments/_document_show_replies.html.erb +++ b/app/views/org_document_comments/_document_show_replies.html.erb @@ -20,7 +20,7 @@
- + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> diff --git a/app/views/organizations/_org_course_homework.html.erb b/app/views/organizations/_org_course_homework.html.erb index e6d94042d..f78a22e6f 100644 --- a/app/views/organizations/_org_course_homework.html.erb +++ b/app/views/organizations/_org_course_homework.html.erb @@ -356,7 +356,7 @@
- + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> diff --git a/app/views/organizations/_org_course_message.html.erb b/app/views/organizations/_org_course_message.html.erb index ea074344d..aa3237643 100644 --- a/app/views/organizations/_org_course_message.html.erb +++ b/app/views/organizations/_org_course_message.html.erb @@ -112,7 +112,7 @@ <%= link_to reply.try(:author).try(:realname), user_url_in_org(reply.author_id), :class => "newsBlue mr10 f14" %> <% end %> <%= format_time(reply.created_on) %> - + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
diff --git a/app/views/organizations/_org_course_news.html.erb b/app/views/organizations/_org_course_news.html.erb index 6b2146cb1..bbb7b84eb 100644 --- a/app/views/organizations/_org_course_news.html.erb +++ b/app/views/organizations/_org_course_news.html.erb @@ -81,7 +81,7 @@ <%= link_to comment.try(:author).try(:realname), user_url_in_org(comment.author_id), :class => "newsBlue mr10 f14" %> <% end %> <%= format_time(comment.created_on) %> - + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
diff --git a/app/views/organizations/_org_project_issue.html.erb b/app/views/organizations/_org_project_issue.html.erb index 42f725d12..48814eb23 100644 --- a/app/views/organizations/_org_project_issue.html.erb +++ b/app/views/organizations/_org_project_issue.html.erb @@ -92,7 +92,7 @@ <%= link_to reply.try(:user).try(:realname), user_url_in_org(reply.user_id), :class => "newsBlue mr10 f14" %> <% end %> <%= format_time(reply.created_on) %> - + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
diff --git a/app/views/organizations/_project_message.html.erb b/app/views/organizations/_project_message.html.erb index ae11b0042..fadb29c9e 100644 --- a/app/views/organizations/_project_message.html.erb +++ b/app/views/organizations/_project_message.html.erb @@ -91,7 +91,7 @@ <%= link_to reply.try(:author).try(:realname), user_url_in_org(reply.author_id), :class => "newsBlue mr10 f14" %> <% end %> <%= format_time(reply.created_on) %> - + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
diff --git a/app/views/praise_tread/praise_minus.js.erb b/app/views/praise_tread/praise_minus.js.erb index b55624930..057ecb8bd 100644 --- a/app/views/praise_tread/praise_minus.js.erb +++ b/app/views/praise_tread/praise_minus.js.erb @@ -2,7 +2,7 @@ <% if @type.to_s == 'activity' %> $('#praise_count_<%=@user_activity_id %>').html('<%= j(render :partial=> "praise_tread/praise", :locals => {:activity=>@obj, :user_activity_id=>@user_activity_id,:type=>"activity"})%>'); <% else @type.to_s == 'reply' %> - $('#reply_praise_count_<%=@user_activity_id %>').html('<%=j(render :partial=> "praise_tread/praise", :locals => {:activity=>@obj, :user_activity_id=>@user_activity_id,:type=>"reply"})%>'); + $('.reply_praise_count_<%=@user_activity_id %>').html('<%=j(render :partial=> "praise_tread/praise", :locals => {:activity=>@obj, :user_activity_id=>@user_activity_id,:type=>"reply"})%>'); <% end %> <% else %> $('#praise_tread').html('<%= j( diff --git a/app/views/praise_tread/praise_plus.js.erb b/app/views/praise_tread/praise_plus.js.erb index c06ad88e5..5edc8c4cf 100644 --- a/app/views/praise_tread/praise_plus.js.erb +++ b/app/views/praise_tread/praise_plus.js.erb @@ -2,7 +2,7 @@ <% if @type.to_s == 'activity' %> $('#praise_count_<%=@user_activity_id %>').html('<%=j(render :partial=> "praise_tread/praise", :locals => {:activity=>@obj, :user_activity_id=>@user_activity_id,:type=>"activity"})%>'); <% else @type.to_s == 'reply' %> - $('#reply_praise_count_<%=@user_activity_id %>').html('<%=j(render :partial=> "praise_tread/praise", :locals => {:activity=>@obj, :user_activity_id=>@user_activity_id,:type=>"reply"})%>'); + $('.reply_praise_count_<%=@user_activity_id %>').html('<%=j(render :partial=> "praise_tread/praise", :locals => {:activity=>@obj, :user_activity_id=>@user_activity_id,:type=>"reply"})%>'); <% end %> <% elsif @obj_type == 'Memo'%> $('#praise_tread_<%= @obj.id %>').html('<%= j( diff --git a/app/views/projects/_comment_reply_detail.html.erb b/app/views/projects/_comment_reply_detail.html.erb index f6e2b8fb3..9c29a8ae9 100644 --- a/app/views/projects/_comment_reply_detail.html.erb +++ b/app/views/projects/_comment_reply_detail.html.erb @@ -1,7 +1,7 @@
<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => "33", :height => "33"), user_path(comment.creator_user.id), :alt => "用户头像" %>
-
+
<%= link_to comment.creator_user.show_name, user_path(comment.creator_user.id), :class => "content-username" %> <%= time_from_now(comment.respond_to?(:created_on) ? comment.created_on : comment.created_at) %>
@@ -16,10 +16,10 @@ <%= comment.content_detail.html_safe %> <% end %>
-
+
- - +
+ <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> @@ -31,7 +31,7 @@ :title => l(:button_reply)) %> - +
diff --git a/app/views/projects/_history.html.erb b/app/views/projects/_history.html.erb index d9abdf47b..4c9e48391 100644 --- a/app/views/projects/_history.html.erb +++ b/app/views/projects/_history.html.erb @@ -16,7 +16,7 @@
<% ids = 'project_respond_form_'+ journal.id.to_s%> - + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>journal, :user_activity_id=>journal.id,:type=>"reply"}%> <% if journal.user == User.current|| User.current.admin? %> diff --git a/app/views/projects/_project_issue_comments_reply_detail.html.erb b/app/views/projects/_project_issue_comments_reply_detail.html.erb index 58b9f941e..e3a675fc5 100644 --- a/app/views/projects/_project_issue_comments_reply_detail.html.erb +++ b/app/views/projects/_project_issue_comments_reply_detail.html.erb @@ -1,7 +1,7 @@
<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => "33", :height => "33"), user_path(comment.creator_user.id), :alt => "用户头像" %>
-
+
<%= link_to comment.creator_user.show_name, user_path(comment.creator_user.id), :class => "content-username" %> <%= time_from_now(comment.respond_to?(:created_on) ? comment.created_on : comment.created_at) %>
@@ -16,13 +16,13 @@ <%= comment.content_detail.html_safe %> <% end %>
-
+
- - +
+ <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> - + <%= link_to( l(:button_reply), {:controller => 'users' ,:action => 'reply_to_comment', :reply_id => comment.id, :type => 'Issue', :user_activity_id => user_activity_id, :parent_id => parent_id, :is_project => true}, @@ -31,7 +31,7 @@ :title => l(:button_reply)) %> - +
diff --git a/app/views/projects/_project_issue_expand_show.html.erb b/app/views/projects/_project_issue_expand_show.html.erb index 6ea9442dc..2debb7789 100644 --- a/app/views/projects/_project_issue_expand_show.html.erb +++ b/app/views/projects/_project_issue_expand_show.html.erb @@ -29,7 +29,7 @@
- + <%= render :partial => "praise_tread/praise", :locals => {:activity => comment, :user_activity_id => comment.id, :type => "reply"} %> diff --git a/app/views/projects/_project_message_replies.html.erb b/app/views/projects/_project_message_replies.html.erb index 91eec6cf5..1fefb172c 100644 --- a/app/views/projects/_project_message_replies.html.erb +++ b/app/views/projects/_project_message_replies.html.erb @@ -20,7 +20,7 @@
- + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> diff --git a/app/views/projects/_project_news_replies.html.erb b/app/views/projects/_project_news_replies.html.erb index 6b6d9e1fc..2ca86b314 100644 --- a/app/views/projects/_project_news_replies.html.erb +++ b/app/views/projects/_project_news_replies.html.erb @@ -29,7 +29,7 @@
- + <%= render :partial => "praise_tread/praise", :locals => {:activity => comment, :user_activity_id => comment.id, :type => "reply"} %> diff --git a/app/views/users/_comment_reply_detail.html.erb b/app/views/users/_comment_reply_detail.html.erb index 23382d972..12cd6874a 100644 --- a/app/views/users/_comment_reply_detail.html.erb +++ b/app/views/users/_comment_reply_detail.html.erb @@ -1,7 +1,7 @@
<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => "33", :height => "33"), user_path(comment.creator_user), :alt => "用户头像" %>
-
+
<%= link_to comment.creator_user.show_name, user_path(comment.creator_user), :class => "content-username" %> <%= time_from_now(comment.respond_to?(:created_on) ? comment.created_on : comment.created_at) %>
@@ -16,16 +16,16 @@ <%= comment.content_detail.html_safe %> <% end %>
-
+
- - +
+ <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> <% if type == 'Message' %> <% topic = comment.root %> <% if !topic.locked? && authorize_for('messages', 'reply') %> - + <%= link_to( l(:button_reply), {:controller => 'users' ,:action => 'reply_to_comment', :reply_id => comment.id, :type => type, :user_activity_id => user_activity_id, :parent_id => parent_id}, @@ -36,7 +36,7 @@ <% end %> <% else %> - + <%= link_to( l(:button_reply), {:controller => 'users' ,:action => 'reply_to_comment', :reply_id => comment.id, :type => type, :user_activity_id => user_activity_id, :parent_id => parent_id}, @@ -46,7 +46,7 @@ <% end %> - +
diff --git a/app/views/users/_message_replies.html.erb b/app/views/users/_message_replies.html.erb index 7c834f201..86f5f8220 100644 --- a/app/views/users/_message_replies.html.erb +++ b/app/views/users/_message_replies.html.erb @@ -20,7 +20,7 @@
- + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> <% if type == 'Message' %> diff --git a/app/views/users/_news_replies.html.erb b/app/views/users/_news_replies.html.erb index 8861bd5c5..f14a7557f 100644 --- a/app/views/users/_news_replies.html.erb +++ b/app/views/users/_news_replies.html.erb @@ -29,7 +29,7 @@
- + <%= render :partial => "praise_tread/praise", :locals => {:activity => comment, :user_activity_id => comment.id, :type => "reply"} %> <% if type == 'HomeworkCommon' %> diff --git a/app/views/words/_journal_reply_items.html.erb b/app/views/words/_journal_reply_items.html.erb index 2e06c1fb1..eefe52bd2 100644 --- a/app/views/words/_journal_reply_items.html.erb +++ b/app/views/words/_journal_reply_items.html.erb @@ -36,7 +36,7 @@ <%= format_time reply.created_on %>