From 73adf1844f79628f070f97cc60f15a7d3f41d42b Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 9 Oct 2017 14:13:59 +0800 Subject: [PATCH 01/32] =?UTF-8?q?TPI=E8=AF=84=E8=AE=BA=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E6=96=B0=E7=89=88=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/shixuns_controller.rb | 12 +- app/views/games/_game_show.html.erb | 6 +- .../games/_shixun_comment_block.html.erb | 26 ++- app/views/games/_shixun_comment_list.html.erb | 208 ++++++++++++++---- app/views/shixuns/_shixun_reply.html.erb | 8 + .../shixuns/_shixun_reply_detail.html.erb | 42 ++++ 6 files changed, 240 insertions(+), 62 deletions(-) create mode 100644 app/views/shixuns/_shixun_reply.html.erb create mode 100644 app/views/shixuns/_shixun_reply_detail.html.erb diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 2fb901d77..0ed9da3c5 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -769,13 +769,13 @@ class ShixunsController < ApplicationController end def shixun_discuss - @discusses = @shixun.discusses.where(:parent_id => nil).reorder("created_at desc") + @discusses = @shixun.discusses.reorder("created_at desc") @discusses_count = @discusses.count - @limit = 15 - @is_remote = true - @discusses_pages = Paginator.new @discusses_count, @limit, params['page'] || 1 - @offset ||= @discusses_pages.offset - @discusses = paginateHelper @discusses, @limit + #@limit = 15 + #@is_remote = true + #@discusses_pages = Paginator.new @discusses_count, @limit, params['page'] || 1 + # @offset ||= @discusses_pages.offset + #@discusses = paginateHelper @discusses, @limit #@game_challenge = params[:challenge_id].blank? ? Challenge.find(@discusses.challenge_id) : Challenge.find(params[:challenge_id]) @game_challenge = Challenge.find(params[:challenge_id].to_i) end diff --git a/app/views/games/_game_show.html.erb b/app/views/games/_game_show.html.erb index 98e1391c5..5751bf232 100644 --- a/app/views/games/_game_show.html.erb +++ b/app/views/games/_game_show.html.erb @@ -81,12 +81,12 @@
+ + + + +<% if false %> +- <% 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") %> - | +
+ <% 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 %> - - <%= render :partial => "discusses/dis_praise", :locals => {:discuss => dis} %> - - - <% if User.current.manager_of_shixun?(@shixun) && dis.children.count == 0 %> - 回复 - <% end %> - <% if (User.current.manager_of_shixun?(@shixun) || User.current == dis.user) && dis.children.count == 0 %> - 删除 - <% end %> - -
-<%= dis.content %>
- - - <% dis.children.each do |child| %> -- 老师回复 - <%= time_from_now child.created_at %> - - <%= render :partial => "discusses/dis_praise", :locals => {:discuss => child} %> - - - <% if User.current.manager_of_shixun?(@shixun) || (User.current == dis.user && dis.children.count == 0) %> - 删除 - <% end %> - -
-<%= child.content %>
- - -试卷列表
<% if @is_teacher %> + 新建 + + 试卷选用 <% end %> @@ -72,4 +73,11 @@代码查重已完成,点击查看结果
<%=des%>
请至少选择一个身份
请至少选择一个课程
确定要删除吗?
删除分班后,该分班的学生需要重新选择分班。' +
'' +
'
| + + + | +
试卷已导入
但需要您设置发布时间和截止时间,以激活相应的试卷
您的其它班级下没有试卷可供导入
确定温馨提示:[单选题]属于客观题将由系统自动评分,请设置标准答案 保存 - 取消 + 取消
diff --git a/app/views/exercise/_new_MCQ.html.erb b/app/views/exercise/_new_MCQ.html.erb index a5439bd21..858342cbe 100644 --- a/app/views/exercise/_new_MCQ.html.erb +++ b/app/views/exercise/_new_MCQ.html.erb @@ -51,7 +51,7 @@温馨提示:[多选题]属于客观题将由系统自动评分,请设置标准答案 保存 - 取消 + 取消
diff --git a/app/views/exercise/_new_multi.html.erb b/app/views/exercise/_new_multi.html.erb index 53caea779..2c3f970c1 100644 --- a/app/views/exercise/_new_multi.html.erb +++ b/app/views/exercise/_new_multi.html.erb @@ -25,7 +25,7 @@ 温馨提示:[简答题]属于主观题需要人工评分,未作答的情况下系统将自动评分 参考答案仅作为人工评分的参考 保存 - 取消 + 取消 diff --git a/app/views/exercise/_new_single.html.erb b/app/views/exercise/_new_single.html.erb index 9623b9657..b11faf259 100644 --- a/app/views/exercise/_new_single.html.erb +++ b/app/views/exercise/_new_single.html.erb @@ -34,7 +34,7 @@温馨提示:[填空题]属于客观题将由系统自动评分,请设置标准答案 保存 - 取消 + 取消
From d264d65a0119ee4a9acac5f30a41f9ac879e3cdb Mon Sep 17 00:00:00 2001 From: cxt<%= @subject.name %> - <% if User.current.manager_of_subject?(@subject) %> + <% if @is_manager %> <% end %>
@@ -17,32 +17,35 @@ <%# end %> <%# if !User.current.manager_of_subject?(@subject) || @subject.status > 1 %>简介 - <% if User.current.manager_of_subject?(@subject) %> - + <% if @is_manager %> + <% end %>
<%= stage.name %> - <% if User.current.manager_of_subject?(@subject) %> + <% if @is_manager %> <% else %> @@ -37,8 +36,11 @@
<%= stage.description %>
<% stage.stage_shixuns.each_with_index do |stage_shixun, index| %> <% shixun = stage_shixun.shixun %> + <% is_shixun_manager = User.current.manager_of_shixun?(shixun) %> + <% shixun_exec = allow_shixun_exec(shixun) %> + <% myshixun = Myshixun.where(:user_id => User.current.id, :shixun_id => shixun.id).first %>学习须知 - <% if User.current.manager_of_subject?(@subject) %> + <% if @is_manager %> <% end %>
@@ -162,7 +162,7 @@<%= image_tag(url_to_avatar(@subject.user), :width =>"80", :height => "80", :class => "bor-radius-all", :alt=>"头像") %>
<%= @subject.user.try(:show_name) %>
-<%= @subject.user.school_name %>
+<%= @subject.user.school_name %>
<%=revise_attachment.description %>
- <% end %> -<%=revise_attachment.description %>
- <% end %> - -<%=revise_attachment.description %>
+ <% end %> +<%=revise_attachment.description %>
+ <% end %> + +
+ <%= 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 +138,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 +155,9 @@ 删除 <% end %> -
-<%= child.content %>
- - -+ <%= pagination_links_full @discusses_pages, @discusses_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %> +
+- <%= pagination_links_full @discusses_pages, @discusses_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %> -
- -