From 60707b1ed8caa77f4c26ab708e4f16a4262248d6 Mon Sep 17 00:00:00 2001 From: miss <994230062@qq.com> Date: Sat, 30 Sep 2017 16:56:55 +0800 Subject: [PATCH 01/14] =?UTF-8?q?=E4=BA=8C=E6=AC=A1=E5=9B=9E=E5=A4=8D?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E7=9A=84=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/games/_game_show.html.erb | 4 ++-- app/views/games/_shixun_comment_list.html.erb | 1 - app/views/shixuns/index.html.erb | 6 +++--- public/stylesheets/css/edu-public.css | 1 - public/stylesheets/css/taskstyle.css | 6 +++--- 5 files changed, 8 insertions(+), 10 deletions(-) diff --git a/app/views/games/_game_show.html.erb b/app/views/games/_game_show.html.erb index 18e5eded5..7068bfccb 100644 --- a/app/views/games/_game_show.html.erb +++ b/app/views/games/_game_show.html.erb @@ -83,10 +83,10 @@ <%= render :partial => "games/shixun_comment_block" %>
+ <%= link_to dis.user.show_name, user_path(dis.user), :class => "fl link-color-grey mr20" ,:style => "display: block" %> + <%= time_from_now dis.created_at %> + <% if dis.try(:challenge_id).present? %> + [第<%= Challenge.find(dis.try(:challenge_id)).try(:position) %>关] + <% end %> + <%= render :partial => "discusses/dis_praise", :locals => {:discuss => dis} %> @@ -27,15 +134,15 @@ <% end %> -
-<%= dis.content %>
+ +<%= dis.content %>
- - <% dis.children.each do |child| %> -- 老师回复 - <%= time_from_now child.created_at %> +
+ <% dis.children.each do |child| %> ++ 老师回复 + <%= time_from_now child.created_at %> <%= render :partial => "discusses/dis_praise", :locals => {:discuss => child} %> @@ -44,9 +151,9 @@ 删除 <% end %> -
-<%= child.content %>
- - -<%= memo.content.html_safe %>
+- <% if comment.creator_user == User.current || User.current.admin? || User.current.manager_of_shixun?(comment.dis_id) %> - 删除 - <% end %> - | - <%= link_to( - '回复'.html_safe, - {:controller => 'users' ,:action => 'reply_to',:reply_id => comment.id, :type => @game_challenge.class.to_s, :user_activity_id => @game_challenge.id}, - :remote => true, - :method => 'get', - :title => l(:button_reply),:class => "color-grey") %> - | - - <%=render :partial=> "praise_tread/edu_praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> - -
-
- <%= link_to dis.user.show_name, user_path(dis.user), :class => "fl link-color-grey mr20" ,:style => "display: block" %>
- <%= time_from_now dis.created_at %>
- <% if dis.try(:challenge_id).present? %>
- [第<%= Challenge.find(dis.try(:challenge_id)).try(:position) %>关]
- <% end %>
-
+ <% @discusses.each do |dis| %>
+
+ <%= link_to dis.user.show_name, user_path(dis.user), :class => "fl link-color-grey mr20" ,:style => "display: block" %>
+ <%= time_from_now dis.created_at %>
+ <% if dis.try(:challenge_id).present? %>
+ [第<%= Challenge.find(dis.try(:challenge_id)).try(:position) %>关]
+ <% end %>
+
<%= render :partial => "discusses/dis_praise", :locals => {:discuss => dis} %>
@@ -138,15 +27,15 @@
<% end %>
- <%= dis.content %> <%= dis.content %>
- 老师回复
- <%= time_from_now child.created_at %>
+
+ 老师回复
+ <%= time_from_now child.created_at %>
<%= render :partial => "discusses/dis_praise", :locals => {:discuss => child} %>
@@ -155,9 +44,9 @@
删除
<% end %>
- <%= child.content %>
- <%= pagination_links_full @discusses_pages, @discusses_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %>
-
-
+
+
<% unless @exercise.is_public %> - <% end %> + + <% end %> <%= @exercise.exercise_name %>
<%= link_to "返回", exercise_index_path(:course_id => @course.id), :class => "fr font-12 mr15 mt3 color-grey" %> @@ -42,8 +43,9 @@ <%= link_to "导出成绩", student_exercise_list_exercise_path(@exercise, :course_id => @course.id, :format => 'xls'), :id => "export_exercise_work", :class => "fr white-btn orange-btn ml10 mt8" %> From aac531ca540efbcef17c2c079c31a108801110d2 Mon Sep 17 00:00:00 2001 From: cxt
- <%= link_to dis.user.show_name, user_path(dis.user), :class => "fl link-color-grey mr20" ,:style => "display: block" %> - <%= time_from_now dis.created_at %> - <% if dis.try(:challenge_id).present? %> - [第<%= Challenge.find(dis.try(:challenge_id)).try(:position) %>关] - <% end %> - +
+ <% no_children_comments.each do |comment| %>
+ <% unless comment.nil? %>
+
+
+
+ <%= link_to image_tag(url_to_avatar(comment.creator_user), :width => 50, :height => 50, :alt => "用户头像"), user_url_in_org(comment.creator_user), :target => '_blank' %>
+
+
+
+
+ <% if !comment.parent.nil? %>
+ <% parents_rely = [] %>
+ <% parents_rely = get_reply_parents parents_rely, comment %>
+ <% length = parents_rely.length %>
+
+ <% if length <= 5 %>
+ <%=render :partial => 'student_work/homework_reply', :locals => {:comment => comment.parent, :parent_id => comment.id, :user_activity_id => @game_challenge.id, :type => @game_challenge.class.to_s} %>
+ <% else %>
+
+
+
+
+
+ <%=render :partial => 'student_work/homework_reply_detail', :locals => {:comment => parents_rely[length - 1], :type => @game_challenge.class.to_s, :user_activity_id => @game_challenge.id, :parent_id => comment.id} %>
+
+
+
+ <%= link_to '点击展开隐藏楼层', show_all_replies_users_path(:comment => comment, :type => comment.class, :user_activity_id => @game_challenge.id, :parent_id => comment.id),:remote=>true, :class => '' %>
+
+ <%=render :partial => 'student_work/homework_reply_detail', :locals => {:comment => parents_rely[3], :type => @game_challenge.class.to_s, :user_activity_id => @game_challenge.id, :parent_id => comment.id} %>
+
+ <%=render :partial => 'student_work/homework_reply_detail', :locals => {:comment => parents_rely[2], :type => @game_challenge.class.to_s, :user_activity_id => @game_challenge.id, :parent_id => comment.id} %>
+
+ <%=render :partial => 'student_work/homework_reply_detail', :locals => {:comment => parents_rely[1], :type => @game_challenge.class.to_s, :user_activity_id => @game_challenge.id, :parent_id => comment.id} %>
+
+ <%=render :partial => 'student_work/homework_reply_detail', :locals => {:comment => parents_rely[0], :type => @game_challenge.class.to_s, :user_activity_id => @game_challenge.id, :parent_id => comment.id} %>
+
+ <% end %>
+
+ <% end %>
+
+
+ <%= comment.content.html_safe %>
+
+
+
+
+
+
+
+
+
+
+
+ <%= link_to comment.creator_user.show_real_name, user_url_in_org(comment.creator_user), :class => "content-username hide fl" %>
+ <%= time_from_now(comment.respond_to?(:created_on) ? comment.created_on : comment.created_at) %>
+
+
+
+
+
+ <% end %>
+ <% end %>
+
+
+ <% if comment.creator_user == User.current || User.current.admin? || User.current.manager_of_shixun?(comment.dis_id) %> + 删除 + <% end %> + | + <%= link_to( + '回复'.html_safe, + {:controller => 'users' ,:action => 'reply_to',:reply_id => comment.id, :type => @game_challenge.class.to_s, :user_activity_id => @game_challenge.id}, + :remote => true, + :method => 'get', + :title => l(:button_reply),:class => "color-grey") %> + | + + <%=render :partial=> "praise_tread/edu_praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> + +
+