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 @shixun.discusses.blank? %> + <%= render :partial => "welcome/no_data" %> + <% else %> + <% @discusses.each do |dis| %> +
+ <%= link_to image_tag(url_to_avatar(dis.user), :alt => "头像", :width => 35, :height => 35), user_path(dis.user),:class => "fl mt5", :target => '_blank' %> +
+

+ <%= 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 %>

- -
-
- <% end %> +
+
+ <% end %> +
+
+ <% end %> + +
+
+
    + <%= pagination_links_full @discusses_pages, @discusses_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %> +
+
<% end %> - -
-
-
    - <%= pagination_links_full @discusses_pages, @discusses_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %> -
-
-
-
- <% end %> +
+ +
-
- - - +<% end %> \ No newline at end of file diff --git a/app/views/shixuns/_shixun_reply.html.erb b/app/views/shixuns/_shixun_reply.html.erb new file mode 100644 index 000000000..40d9244ba --- /dev/null +++ b/app/views/shixuns/_shixun_reply.html.erb @@ -0,0 +1,8 @@ +
+ <% unless comment.parent.nil? %> +
+ <%= render :partial => 'shixuns/shixun_reply', :locals => {:comment => comment.parent, :parent_id => parent_id, :type => type, :user_activity_id => user_activity_id} %> +
+ <% end %> + <%= render :partial => 'shixuns/shixun_reply_detail', :locals => {:comment => comment, :parent_id => parent_id, :type => type, :user_activity_id => user_activity_id} %> +
\ No newline at end of file diff --git a/app/views/shixuns/_shixun_reply_detail.html.erb b/app/views/shixuns/_shixun_reply_detail.html.erb new file mode 100644 index 000000000..20fe648d3 --- /dev/null +++ b/app/views/shixuns/_shixun_reply_detail.html.erb @@ -0,0 +1,42 @@ +
+ <%= link_to image_tag(url_to_avatar(comment.creator_user), :width => "32", :height => "32"), user_path(comment.creator_user), :target => "_blank", :alt => "用户头像" %> +
+ +
+
+
+ <%= comment.content_detail.html_safe %> +
+ + <%= link_to comment.creator_user.show_real_name, user_path(comment.creator_user), :class => "content-username hide fl" %> + <%= time_from_now(comment.respond_to?(:created_on) ? comment.created_on : comment.created_at) %> +
+
+
+ <%= link_to('回复'.html_safe, + {:controller => 'users', + :action => 'reply_to_comment', + :reply_id => comment.id, + :type => type, + :user_activity_id => user_activity_id, + :parent_id => parent_id}, + :remote => true, + :method => 'get',:class=>"color-grey", + :title => l(:button_reply)) %>| + + <%=render :partial=> "praise_tread/edu_praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> + +
+
+
+ +
+ +
+
+
\ No newline at end of file From 26de87d603596a723fd92988fea0adf535a124d6 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 9 Oct 2017 14:34:33 +0800 Subject: [PATCH 02/32] =?UTF-8?q?=E7=82=B9=E5=87=BB=E6=84=8F=E8=A7=81?= =?UTF-8?q?=E5=8F=8D=E9=A6=88=E5=BA=94=E8=AF=A5=E8=B7=B3=E8=BD=AC=E5=88=B0?= =?UTF-8?q?=E7=BB=99Educoder=E7=95=99=E8=A8=80=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/show.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index ab4313c78..98fe4b9ce 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -273,7 +273,7 @@
- +
From ce33efba30d7680e677c2cd2fe71424f5d345e04 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Mon, 9 Oct 2017 17:23:17 +0800 Subject: [PATCH 03/32] =?UTF-8?q?TPI=E8=AF=84=E8=AE=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/games/_game_show.html.erb | 4 +- .../games/_shixun_comment_block.html.erb | 2 +- app/views/games/_shixun_comment_list.html.erb | 51 ++++++++++--------- app/views/praise_tread/_edu_praise.html.erb | 4 +- app/views/shixuns/_shixun_reply.html.erb | 2 +- .../shixuns/_shixun_reply_detail.html.erb | 36 ++++++------- app/views/users/_reply_to_comment.html.erb | 2 +- public/stylesheets/css/edu-common.css | 2 +- 8 files changed, 53 insertions(+), 50 deletions(-) diff --git a/app/views/games/_game_show.html.erb b/app/views/games/_game_show.html.erb index 5751bf232..c61c1dd2b 100644 --- a/app/views/games/_game_show.html.erb +++ b/app/views/games/_game_show.html.erb @@ -79,10 +79,10 @@
diff --git a/app/views/praise_tread/_edu_praise.html.erb b/app/views/praise_tread/_edu_praise.html.erb index 0704eebad..84a727c5c 100644 --- a/app/views/praise_tread/_edu_praise.html.erb +++ b/app/views/praise_tread/_edu_praise.html.erb @@ -6,7 +6,7 @@ 赞 <%# num = activity.praise_tread_cache ? activity.praise_tread_cache.praise_num : 0 %> - <%= get_praise_num(activity) %> + <%= get_praise_num(activity)>0 ? get_praise_num(activity):"" %> <% else %> 赞 - <%= get_praise_num(activity) %> + <%= get_praise_num(activity)>0 ? get_praise_num(activity):"" %> <%# num = activity.praise_tread_cache ? activity.praise_tread_cache.praise_num : 0 %> diff --git a/app/views/shixuns/_shixun_reply.html.erb b/app/views/shixuns/_shixun_reply.html.erb index 40d9244ba..f1a8d28b3 100644 --- a/app/views/shixuns/_shixun_reply.html.erb +++ b/app/views/shixuns/_shixun_reply.html.erb @@ -1,4 +1,4 @@ -
+
<% unless comment.parent.nil? %>
<%= render :partial => 'shixuns/shixun_reply', :locals => {:comment => comment.parent, :parent_id => parent_id, :type => type, :user_activity_id => user_activity_id} %> diff --git a/app/views/shixuns/_shixun_reply_detail.html.erb b/app/views/shixuns/_shixun_reply_detail.html.erb index 20fe648d3..479e77279 100644 --- a/app/views/shixuns/_shixun_reply_detail.html.erb +++ b/app/views/shixuns/_shixun_reply_detail.html.erb @@ -8,33 +8,33 @@ });
-
+
<%= comment.content_detail.html_safe %>
- - <%= link_to comment.creator_user.show_real_name, user_path(comment.creator_user), :class => "content-username hide fl" %> - <%= time_from_now(comment.respond_to?(:created_on) ? comment.created_on : comment.created_at) %> -
-
-
- <%= link_to('回复'.html_safe, - {:controller => 'users', - :action => 'reply_to_comment', - :reply_id => comment.id, - :type => type, - :user_activity_id => user_activity_id, - :parent_id => parent_id}, - :remote => true, - :method => 'get',:class=>"color-grey", - :title => l(:button_reply)) %>| +
+ <%= link_to comment.creator_user.show_real_name, user_path(comment.creator_user), :class => "content-username hide fl" %> + <%= time_from_now(comment.respond_to?(:created_on) ? comment.created_on : comment.created_at) %> +
+
+ <%= link_to('回复'.html_safe, + {:controller => 'users', + :action => 'reply_to_comment', + :reply_id => comment.id, + :type => type, + :user_activity_id => user_activity_id, + :parent_id => parent_id}, + :remote => true, + :method => 'get',:class=>"color-grey", + :title => l(:button_reply)) %>| <%=render :partial=> "praise_tread/edu_praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> -
+
+
diff --git a/app/views/users/_reply_to_comment.html.erb b/app/views/users/_reply_to_comment.html.erb index 7449c1285..9ce1a439a 100644 --- a/app/views/users/_reply_to_comment.html.erb +++ b/app/views/users/_reply_to_comment.html.erb @@ -1,4 +1,4 @@ -
+
<% if User.current.logged? %>
<%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(User.current), :alt => "用户头像" %>
diff --git a/public/stylesheets/css/edu-common.css b/public/stylesheets/css/edu-common.css index 30b12ad56..0fb798733 100644 --- a/public/stylesheets/css/edu-common.css +++ b/public/stylesheets/css/edu-common.css @@ -198,7 +198,7 @@ a.course-bth-blue{cursor: pointer;background-color:#199ed8 ;color: #ffffff !impo .break_word_firefox{white-space: pre-wrap !important;word-break: break-all;} .pre_word{white-space: pre-wrap;word-wrap: break-word;word-break: normal;} .pr {position:relative;} -.df {display:flex;} +.df {display:flex;display: -webkit-flex;display: -ms-flex;} .w100{width: 100px;} .w150{width: 150px;} .w200{width: 200px;} From 6eeaf998f41b39f55cf192e8e0af90db86aa5576 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 9 Oct 2017 17:30:35 +0800 Subject: [PATCH 04/32] =?UTF-8?q?html=E5=AE=9E=E8=AE=AD=EF=BC=8C=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E8=AF=84=E6=B5=8B=E5=90=8E=EF=BC=8C=E8=BF=98=E6=98=AF?= =?UTF-8?q?=E4=B8=80=E7=89=87=E7=99=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/games/_code_actions.html.erb | 5 ++++- public/javascripts/edu/edu_tpi.js | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/views/games/_code_actions.html.erb b/app/views/games/_code_actions.html.erb index 5dbeb1731..3866f42af 100644 --- a/app/views/games/_code_actions.html.erb +++ b/app/views/games/_code_actions.html.erb @@ -39,6 +39,7 @@ <% end %> // 渲染用户的HTML的CODE。 function tpi_html_show(){ + $($(".blacktab_con")[0]).trigger("click"); var contents = editor_CodeMirror.getValue(); $("#data_param").val(contents); $("#html_form").attr("action", "/iframes/html_content"); @@ -194,8 +195,10 @@ data.language, data.compile_success ); - $("#blacktab_nav_1").trigger("click"); if(data.status == 2){ + if(data.language == "Html"){ + tpi_html_show(); + } clearInterval(cm); clearInterval(intId); var icon = $("#game_status_<%= @game_challenge.id %>"); // 实训列表的icon diff --git a/public/javascripts/edu/edu_tpi.js b/public/javascripts/edu/edu_tpi.js index 4afdd76a5..0609d2608 100644 --- a/public/javascripts/edu/edu_tpi.js +++ b/public/javascripts/edu/edu_tpi.js @@ -167,6 +167,7 @@ function choice_answer(st, nThis){ // 评测区域点击TAB切换样式 function check_tab(allClassName,addClassName,item){ + console.log(editor_CodeMirror); //点击tab添加样式 $("."+allClassName).removeClass(addClassName); $(item).addClass(addClassName); From 0b08a7005b3f3567232e3a2dc51e506fee86bdb2 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 10 Oct 2017 09:20:17 +0800 Subject: [PATCH 05/32] =?UTF-8?q?TPI=E8=AF=84=E8=AE=BA=E7=82=B9=E8=B5=9E?= =?UTF-8?q?=E5=B1=80=E9=83=A8=E5=88=B7=E6=96=B0=E6=A0=B7=E5=BC=8F=E4=B8=8D?= =?UTF-8?q?=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/discusses/_dis_praise.html.erb | 4 ++-- app/views/praise_tread/praise_minus.js.erb | 2 +- app/views/praise_tread/praise_plus.js.erb | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/views/discusses/_dis_praise.html.erb b/app/views/discusses/_dis_praise.html.erb index 5cbb6c287..529ff0f81 100644 --- a/app/views/discusses/_dis_praise.html.erb +++ b/app/views/discusses/_dis_praise.html.erb @@ -2,14 +2,14 @@ - + 赞 <%= discuss.praise_tread_cache ? (discuss.praise_tread_cache.praise_num == 0 ? "" : discuss.praise_tread_cache.praise_num ) : "" %> <% else %> - + 赞 <%= discuss.praise_tread_cache ? (discuss.praise_tread_cache.praise_num == 0 ? "" : discuss.praise_tread_cache.praise_num ) : "" %> <% end %> \ No newline at end of file diff --git a/app/views/praise_tread/praise_minus.js.erb b/app/views/praise_tread/praise_minus.js.erb index 3b974fe5c..f9906e82d 100644 --- a/app/views/praise_tread/praise_minus.js.erb +++ b/app/views/praise_tread/praise_minus.js.erb @@ -8,7 +8,7 @@ <% elsif @type.to_s == 'Memo' %> $('#praise_count_<%= @obj.id %>').html('<%= j(render :partial => 'praise_tread/activity_praise', :locals => {:activity => @obj, :user_activity_id => @obj.id, :type => "Memo"})%>'); <% else @type.to_s == 'reply' %> - <% if ((@obj_type == 'JournalsForMessage' && @obj.jour_type == 'HomeworkCommon') || @obj_type == 'Message') && @obj_id == @user_activity_id %> + <% if ((@obj_type == 'JournalsForMessage' && @obj.jour_type == 'HomeworkCommon') || @obj_type == 'Message' || @obj_type == 'Discuss') && @obj_id == @user_activity_id %> $('.reply_praise_count_<%=@user_activity_id %>').html('<%=j(render :partial=> "praise_tread/edu_praise", :locals => {:activity=>@obj, :user_activity_id=>@user_activity_id,:type=>"reply"})%>'); <% else %> $('.reply_praise_count_<%=@obj_id %>').html('<%=j(render :partial=> "praise_tread/praise", :locals => {:activity=>@obj, :user_activity_id=>@user_activity_id,:type=>"reply"})%>'); diff --git a/app/views/praise_tread/praise_plus.js.erb b/app/views/praise_tread/praise_plus.js.erb index fe1c72c29..56af5cd45 100644 --- a/app/views/praise_tread/praise_plus.js.erb +++ b/app/views/praise_tread/praise_plus.js.erb @@ -12,6 +12,8 @@ $('.reply_praise_count_<%=@user_activity_id %>').html('<%=j(render :partial=> "praise_tread/edu_praise", :locals => {:activity=>@obj, :user_activity_id=>@user_activity_id,:type=>"reply"})%>'); <% elsif @obj_type == 'Memo' %> $('.reply_praise_count_<%=@user_activity_id %>').html('<%=j(render :partial=> "praise_tread/edu_praise", :locals => {:activity=>@obj, :user_activity_id=>@user_activity_id,:type=>"reply"})%>'); + <% elsif @obj_type == 'Discuss' %> + $('.reply_praise_count_<%=@user_activity_id %>').html('<%=j(render :partial=> "praise_tread/edu_praise", :locals => {:activity=>@obj, :user_activity_id=>@user_activity_id,:type=>"reply"})%>'); <% else %> $('.reply_praise_count_<%=@obj_id %>').html('<%=j(render :partial=> "praise_tread/praise", :locals => {:activity=>@obj, :user_activity_id=>@user_activity_id,:type=>"reply"})%>'); <% end %> From c1efa0778803813b044ccc3fba25b7afe0118a29 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 10 Oct 2017 15:11:53 +0800 Subject: [PATCH 06/32] =?UTF-8?q?=E5=AE=9E=E8=AE=ADTPM=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E8=AF=84=E8=AE=BA=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/shixuns_controller.rb | 7 +- app/views/games/_game_show.html.erb | 8 +- app/views/games/_shixun_comment_list.html.erb | 245 ++++++------------ app/views/layouts/base_shixun.html.erb | 5 +- app/views/shixuns/shixun_discuss.html.erb | 18 ++ app/views/shixuns/shixun_discuss.js.erb | 4 +- app/views/users/_reply_to.html.erb | 7 +- app/views/users/reply_to.js.erb | 6 +- 8 files changed, 124 insertions(+), 176 deletions(-) create mode 100644 app/views/shixuns/shixun_discuss.html.erb diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 0ed9da3c5..5fa2e541c 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -777,7 +777,12 @@ class ShixunsController < ApplicationController # @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) + challenge_id = params[:challenge_id].nil? ? @shixun.challenges.first.try(:id) : params[:challenge_id].to_i + @game_challenge = Challenge.find(challenge_id) + respond_to do |format| + format.js + format.html + end end def destroy diff --git a/app/views/games/_game_show.html.erb b/app/views/games/_game_show.html.erb index c61c1dd2b..f47e82a37 100644 --- a/app/views/games/_game_show.html.erb +++ b/app/views/games/_game_show.html.erb @@ -74,7 +74,13 @@
diff --git a/app/views/games/_shixun_comment_list.html.erb b/app/views/games/_shixun_comment_list.html.erb index 40da83e39..7c49cbca2 100644 --- a/app/views/games/_shixun_comment_list.html.erb +++ b/app/views/games/_shixun_comment_list.html.erb @@ -1,104 +1,98 @@ <% no_children_comments = get_no_children_comments_all @discusses %> -
-
-
-
- <% if @discusses.blank? %> - <%= render :partial => "welcome/no_data" %> - <% else %> - <% 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 => 'shixuns/shixun_reply', :locals => {:comment => comment.parent, :parent_id => comment.id, :user_activity_id => @game_challenge.id, :type => @game_challenge.class.to_s} %> - <% else %> +
+ <% if @discusses.blank? %> + <%= render :partial => "welcome/no_data" %> + <% else %> + <% 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 => 'shixuns/shixun_reply', :locals => {:comment => comment.parent, :parent_id => comment.id, :user_activity_id => @game_challenge.id, :type => @game_challenge.class.to_s} %> + <% else %> +
+
+
-
-
-
- <%=render :partial => 'shixuns/shixun_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 => 'shixuns/shixun_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 => 'shixuns/shixun_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 => 'shixuns/shixun_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 => 'shixuns/shixun_reply_detail', :locals => {:comment => parents_rely[length - 1], :type => @game_challenge.class.to_s, :user_activity_id => @game_challenge.id, :parent_id => comment.id} %>
- <%=render :partial => 'shixuns/shixun_reply_detail', :locals => {:comment => parents_rely[0], :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 => 'shixuns/shixun_reply_detail', :locals => {:comment => parents_rely[3], :type => @game_challenge.class.to_s, :user_activity_id => @game_challenge.id, :parent_id => comment.id} %>
- <% end %> + <%=render :partial => 'shixuns/shixun_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 => 'shixuns/shixun_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 => 'shixuns/shixun_reply_detail', :locals => {:comment => parents_rely[0], :type => @game_challenge.class.to_s, :user_activity_id => @game_challenge.id, :parent_id => comment.id} %>
<% end %> - -
-
<%= comment.content.html_safe %>
+
+ <% 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) %> -
-

- <% 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") %> - | +

+
+ <%= 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) %> +
+

+ <% 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"}%> -

-
- -
-
-
-
-
- -
+

+
+
+
+
- -
-
+
- <% end %> - <% end %> - <% end %> -
-
-
+
+
+
+
+ <% end %> + <% end %> + <% end %>
+ -<% if false %> -
-
-
-
- <% if @shixun.discusses.blank? %> - <%= render :partial => "welcome/no_data" %> - <% else %> - <% @discusses.each do |dis| %> -
- <%= link_to image_tag(url_to_avatar(dis.user), :alt => "头像", :width => 35, :height => 35), user_path(dis.user),:class => "fl mt5", :target => '_blank' %> -
-

- <%= 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 %>

- -
-
- <% end %> -
-
- <% end %> - -
-
-
    - <%= pagination_links_full @discusses_pages, @discusses_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %> -
-
-
-
- <% end %> -
- -
-
-
-<% end %> - - \ No newline at end of file diff --git a/app/views/shixuns/shixun_discuss.js.erb b/app/views/shixuns/shixun_discuss.js.erb index 81a34c89f..39af37924 100644 --- a/app/views/shixuns/shixun_discuss.js.erb +++ b/app/views/shixuns/shixun_discuss.js.erb @@ -2,7 +2,9 @@ $("#shixun_comment_block").replaceWith("<%= j(render :partial => "games/shixun_c $(".-tab-nav li").removeClass("tab_hover"); $('#tab_nav_4').addClass("tab_hover"); $(".tab-info").hide(); -$('#tab_con_4').show().html("<%= j(render :partial => "games/shixun_comment_list") %>"); +$('#tab_con_4').show(); +$("#game_comment_show").html("<%= j(render :partial => "games/shixun_comment_list") %>"); + <% if @discusses_count > 0 %> $("#discusses_count").html("<%= @discusses_count %>"); <% end %> diff --git a/app/views/users/_reply_to.html.erb b/app/views/users/_reply_to.html.erb index 2c4a7b6cc..b9e01a157 100644 --- a/app/views/users/_reply_to.html.erb +++ b/app/views/users/_reply_to.html.erb @@ -109,7 +109,7 @@

<% end%> - <% else @type == 'Memo' %> + <% else %> <%= form_for('discuss', :url => {:controller => 'discusses', :action => 'create', :dis_id => reply.dis_id, :dis_type => "Shixun", :challenge_id => reply.try(:challenge_id)}, :method => "post", :remote => true, :html => {:id => 'new_comment_form'}) do |f| %>
@@ -117,7 +117,8 @@ 发送

- <% end%> <% end %> + <% end%> + <% end %>
@@ -125,4 +126,4 @@ <%= render :partial => "users/show_unlogged_reply" %> <% end %>
-
\ No newline at end of file +
diff --git a/app/views/users/reply_to.js.erb b/app/views/users/reply_to.js.erb index 00bceece4..81f588d25 100644 --- a/app/views/users/reply_to.js.erb +++ b/app/views/users/reply_to.js.erb @@ -1,13 +1,13 @@ if($("#reply_message_<%= @reply.id%>").html() == "") { $(".reply_to_message").html(""); <% if params[:is_project] %> - $("#reply_message_<%= @reply.id%>").replaceWith("<%= escape_javascript(render :partial => 'projects/reply_to', :locals => {:reply => @reply}) %>"); + $("#reply_message_<%= @reply.id%>").replaceWith("<%= escape_javascript(render :partial => 'projects/reply_to', :locals => {:reply => @reply}) %>"); <% else %> - $("#reply_message_<%= @reply.id%>").html("<%= escape_javascript(render :partial => 'users/reply_to', :locals => {:reply => @reply}) %>"); + $("#reply_message_<%= @reply.id%>").html("<%= escape_javascript(render :partial => 'users/reply_to', :locals => {:reply => @reply}) %>"); <% end %> $("#reply_iconup_<%=@reply.id %>").show(); $(function(){ - sd_create_editor_from_data(<%= @reply.id%>,null,"100%", "<%=@reply.class.to_s%>"); + sd_create_editor_from_data(<%= @reply.id%>,null,"100%", "<%= @reply.class.to_s%>"); }); }else { $("#reply_message_<%= @reply.id%>").html(""); From 8a88006e69c835572da86e4a3b42666105b6a3d0 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Tue, 10 Oct 2017 15:24:13 +0800 Subject: [PATCH 07/32] =?UTF-8?q?TPI=20and=20TPM=20=E8=AF=84=E8=AE=BA?= =?UTF-8?q?=E5=9B=9E=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/shixuns/_shixun_reply.html.erb | 2 +- .../shixuns/_shixun_reply_detail.html.erb | 78 ++++++++++--------- 2 files changed, 41 insertions(+), 39 deletions(-) diff --git a/app/views/shixuns/_shixun_reply.html.erb b/app/views/shixuns/_shixun_reply.html.erb index f1a8d28b3..40d9244ba 100644 --- a/app/views/shixuns/_shixun_reply.html.erb +++ b/app/views/shixuns/_shixun_reply.html.erb @@ -1,4 +1,4 @@ -
+
<% unless comment.parent.nil? %>
<%= render :partial => 'shixuns/shixun_reply', :locals => {:comment => comment.parent, :parent_id => parent_id, :type => type, :user_activity_id => user_activity_id} %> diff --git a/app/views/shixuns/_shixun_reply_detail.html.erb b/app/views/shixuns/_shixun_reply_detail.html.erb index 479e77279..57bd65674 100644 --- a/app/views/shixuns/_shixun_reply_detail.html.erb +++ b/app/views/shixuns/_shixun_reply_detail.html.erb @@ -1,42 +1,44 @@ -
- <%= link_to image_tag(url_to_avatar(comment.creator_user), :width => "32", :height => "32"), user_path(comment.creator_user), :target => "_blank", :alt => "用户头像" %> -
- -
-
-
- <%= comment.content_detail.html_safe %> +
+
+ <%= link_to image_tag(url_to_avatar(comment.creator_user), :width => "32", :height => "32"), user_path(comment.creator_user), :target => "_blank", :alt => "用户头像" %>
-
- <%= link_to comment.creator_user.show_real_name, user_path(comment.creator_user), :class => "content-username hide fl" %> - <%= time_from_now(comment.respond_to?(:created_on) ? comment.created_on : comment.created_at) %> -
-
- <%= link_to('回复'.html_safe, - {:controller => 'users', - :action => 'reply_to_comment', - :reply_id => comment.id, - :type => type, - :user_activity_id => user_activity_id, - :parent_id => parent_id}, - :remote => true, - :method => 'get',:class=>"color-grey", - :title => l(:button_reply)) %>| - - <%=render :partial=> "praise_tread/edu_praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> - + +
+
+
+ <%= comment.content_detail.html_safe %> +
+
+ <%= link_to comment.creator_user.show_real_name, user_path(comment.creator_user), :class => "content-username hide fl" %> + <%= time_from_now(comment.respond_to?(:created_on) ? comment.created_on : comment.created_at) %> +
+
+ <%= link_to('回复'.html_safe, + {:controller => 'users', + :action => 'reply_to_comment', + :reply_id => comment.id, + :type => type, + :user_activity_id => user_activity_id, + :parent_id => parent_id}, + :remote => true, + :method => 'get',:class=>"color-grey", + :title => l(:button_reply)) %>| + + <%=render :partial=> "praise_tread/edu_praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> + +
+
+ +
+ +
- - -
- -
-
-
\ No newline at end of file +
+
\ No newline at end of file From 091ee1e352cca703423c7f0bdb474dbd70e49962 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Wed, 11 Oct 2017 17:05:00 +0800 Subject: [PATCH 08/32] =?UTF-8?q?=E5=90=84=E7=A7=8D=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=EF=BC=88=E6=97=A0=E6=9D=83=E9=99=90=E7=AD=89?= =?UTF-8?q?=EF=BC=89=E7=9A=84=E7=94=A8=E6=88=B7=E5=8F=8D=E9=A6=88=EF=BC=8C?= =?UTF-8?q?=E5=9C=A8=E8=AE=BA=E5=9D=9B=E4=B8=AD=E7=9A=84=E6=9D=A5=E6=BA=90?= =?UTF-8?q?=E6=96=87=E5=AD=97=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/locales/commons/zh.yml | 2 +- db/migrate/20171011084944_modify_content_for_memos.rb | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20171011084944_modify_content_for_memos.rb diff --git a/config/locales/commons/zh.yml b/config/locales/commons/zh.yml index 001cfec7a..c7d9c5121 100644 --- a/config/locales/commons/zh.yml +++ b/config/locales/commons/zh.yml @@ -367,7 +367,7 @@ zh: label_feedback_tips: "在此输入对平台的问题和建议,您也可以通过QQ、微信留言,谢谢!" label_technical_support: "QQ 在线支持:" label_feedback_success: "您的意见已经反馈到公共贴吧的新手讨论吧,我们会第一时间解决您的问题,谢谢支持!" - label_feedback_value: "该帖来自用户反馈:)" + label_feedback_value: "来自用户反馈" label_email_feedback_tips: "请留下您的联系方式(注册邮箱除外),否则我们无法及时联系到您。请管理员尽快帮我解决邮箱激活问题" diff --git a/db/migrate/20171011084944_modify_content_for_memos.rb b/db/migrate/20171011084944_modify_content_for_memos.rb new file mode 100644 index 000000000..0ef42aa14 --- /dev/null +++ b/db/migrate/20171011084944_modify_content_for_memos.rb @@ -0,0 +1,10 @@ +#encoding: utf-8 +class ModifyContentForMemos < ActiveRecord::Migration + def up + memos = Memo.where("content like '该帖来自用户反馈%'") + memos.update_all(:content => "来自用户反馈") if memos.present? + end + + def down + end +end From c49b82d5142141bd3fb63837212f737575e32960 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 12 Oct 2017 16:40:35 +0800 Subject: [PATCH 09/32] =?UTF-8?q?=E6=B6=88=E6=81=AF=E6=9C=BA=E5=88=B6?= =?UTF-8?q?=E6=9C=AA=E4=B8=8A=E7=BA=BF=E4=B9=8B=E5=89=8D=EF=BC=8C=E8=AF=B7?= =?UTF-8?q?=E5=B0=86=E5=AE=9E=E8=AE=AD=E7=9A=84=E8=AF=84=E8=AE=BA=E9=80=9A?= =?UTF-8?q?=E8=BF=87=E5=8F=91=E7=95=99=E8=A8=80=E7=9A=84=E5=BD=A2=E5=BC=8F?= =?UTF-8?q?=E9=80=9A=E7=9F=A5=E7=94=A8=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/discusses_controller.rb | 33 ++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/app/controllers/discusses_controller.rb b/app/controllers/discusses_controller.rb index 37f3bb165..e434eaef9 100644 --- a/app/controllers/discusses_controller.rb +++ b/app/controllers/discusses_controller.rb @@ -1,3 +1,4 @@ +# encoding: utf-8 class DiscussesController < ApplicationController include ApplicationHelper before_filter :find_dis_object, :except => [:destroy] @@ -6,10 +7,40 @@ class DiscussesController < ApplicationController def create if @model if params[:reply_id].blank? + notes = User.current.show_name.to_s + " 评论了你发布的实训:#{params[:content]}" @model.discusses << Discuss.new(:content => params[:content], :user_id => User.current.id, :praise_count => 0, :challenge_id => params[:challenge_id]) + JournalsForMessage.create( + :jour_id => @model.user_id, + :jour_type => "Principal", + :user_id => User.current.id, + :reply_id => 0, + :is_readed => 0, + :private => 1, + :notes => notes + ) else - @model.discusses << Discuss.new(:content => params[:content], :user_id => User.current.id, :parent_id => params[:reply_id], :root_id => params[:reply_id], :praise_count => 0, :challenge_id => params[:challenge_id]) + notes = User.current.show_name.to_s + " 评论了你的回复:#{params[:content]}" + user_id = Discuss.find(params[:reply_id]).try(:user_id) + @model.discusses << Discuss.new( + :content => params[:content], + :user_id => User.current.id, + :parent_id => params[:reply_id], + :root_id => params[:reply_id], + :praise_count => 0, + :challenge_id => params[:challenge_id] + ) + JournalsForMessage.create( + :jour_id => user_id, + :jour_type => "Principal", + :user_id => User.current.id, + :reply_id => 0, + :is_readed => 0, + :private => 1, + :notes => notes + ) end + + if params[:dis_type] == "Shixun" redirect_to shixun_discuss_shixun_path(@model, :challenge_id => params[:challenge_id]) end From 24dda6a3c63a4572809c1986dbb33ffc86dce43f Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 12 Oct 2017 16:41:38 +0800 Subject: [PATCH 10/32] =?UTF-8?q?TPI=E7=9A=84webssh=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E5=90=8E=E5=86=8D=E8=BF=9E=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/games/_repository.html.erb | 5 ----- 1 file changed, 5 deletions(-) diff --git a/app/views/games/_repository.html.erb b/app/views/games/_repository.html.erb index 2faefaefa..f735604cc 100644 --- a/app/views/games/_repository.html.erb +++ b/app/views/games/_repository.html.erb @@ -54,11 +54,6 @@
<%= file_update_myshixun_game_path(@game, :myshixun_id => @myshixun, :path => @path) %>
\ No newline at end of file diff --git a/app/views/subjects/_my_course_shixun_list.html.erb b/app/views/subjects/_my_course_shixun_list.html.erb index 6b4416489..dd4c34e8a 100644 --- a/app/views/subjects/_my_course_shixun_list.html.erb +++ b/app/views/subjects/_my_course_shixun_list.html.erb @@ -1,6 +1,6 @@
-

选择实训

+

选择实训

From 3d503336e0b389c9974cea72f7a663fd99dcac47 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Fri, 13 Oct 2017 10:15:43 +0800 Subject: [PATCH 17/32] =?UTF-8?q?=E6=A9=99=E8=89=B2=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/css/edu-common.css | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/public/stylesheets/css/edu-common.css b/public/stylesheets/css/edu-common.css index fb481a197..b2412de3b 100644 --- a/public/stylesheets/css/edu-common.css +++ b/public/stylesheets/css/edu-common.css @@ -130,10 +130,9 @@ a.task-btn{cursor: pointer;display: inline-block;font-weight: bold;border: none; a:hover.task-btn {background: #c3c3c3; color: #666;} a.task-btn-green{background: #29bd8b; color: #fff!important;} a:hover.task-btn-green{background: #19b17e;} -a.task-btn-orange{ background:#fc8675; color:#fff !important;} -a:hover.task-btn-orange{ background:#fc8675;} -a.task-btn-blue{background: #3498db; color:#fff!important;} a.task-btn-orange{background: #FF7500; color:#fff!important;} +a:hover.task-btn-orange{ background:#ff7500;} +a.task-btn-blue{background: #3498db; color:#fff!important;} a:hover.task-btn-blue{background: #5faee3;color:#fff;} a.task-btn-grey{background-color: #d4d6d8; color: #4d555d!important;} a:hover.task-btn-grey{background-color: #d4d6d8; color: #4d555d;} From 6b08813b4f41f403114f1069e50d7debc6052b84 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 13 Oct 2017 10:27:54 +0800 Subject: [PATCH 18/32] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E8=AF=95=E5=8D=B7?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E5=9C=A8=E8=AF=95=E5=8D=B7=E6=A0=87=E9=A2=98?= =?UTF-8?q?=E5=A4=84=E6=8C=89=E5=9B=9E=E8=BD=A6=E8=AF=95=E5=8D=B7=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E5=B0=B1=E4=BF=9D=E5=AD=98=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/exercise/_edit_head.html.erb | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/app/views/exercise/_edit_head.html.erb b/app/views/exercise/_edit_head.html.erb index 1aa23f3d8..9a7f5e0c8 100644 --- a/app/views/exercise/_edit_head.html.erb +++ b/app/views/exercise/_edit_head.html.erb @@ -9,4 +9,23 @@ 保存 取消

-<% end %> \ No newline at end of file +<% end %> + + \ No newline at end of file From 3039110297674922df931fb7937e62eb2191a94a Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Fri, 13 Oct 2017 10:43:06 +0800 Subject: [PATCH 19/32] =?UTF-8?q?=E5=8F=91=E9=80=81=E3=80=81=E7=A1=AE?= =?UTF-8?q?=E5=AE=9A=E3=80=81=E8=AF=84=E6=B5=8B=E7=AD=89=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E6=A9=99=E8=89=B2=E8=83=8C=E6=99=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/account/avatar.html.erb | 4 +-- app/views/account/security_settings.html.erb | 6 ++-- app/views/admin/_authentication_list.html.erb | 2 +- .../courses/_compare_code_tips_1.html.erb | 4 +-- .../courses/_compare_code_tips_2.html.erb | 2 +- .../courses/_join_private_course.html.erb | 2 +- app/views/courses/new.html.erb | 2 +- app/views/courses/settings.html.erb | 2 +- .../courses/settings/_add_teachers.html.erb | 2 +- .../courses/settings/_change_manager.html.erb | 2 +- .../settings/_choose_course_group.html.erb | 2 +- .../settings/_import_students.html.erb | 2 +- app/views/courses/settings/_moduels.html.erb | 4 +-- .../_search_not_students_list.html.erb | 2 +- app/views/exercise/_edit_MC.html.erb | 2 +- app/views/exercise/_edit_MCQ.html.erb | 2 +- app/views/exercise/_edit_head.html.erb | 2 +- app/views/exercise/_edit_multi.html.erb | 2 +- app/views/exercise/_edit_single.html.erb | 2 +- app/views/exercise/_exercise_setting.html.erb | 2 +- app/views/exercise/_new_MC.html.erb | 2 +- app/views/exercise/_new_MCQ.html.erb | 2 +- app/views/exercise/_new_head.html.erb | 2 +- app/views/exercise/_new_multi.html.erb | 2 +- app/views/exercise/_new_single.html.erb | 2 +- app/views/exercise/setting.html.erb | 2 +- .../files/_attachment_history_popub.html.erb | 2 +- app/views/files/_hidden_file.html.erb | 2 +- app/views/files/_upload_course_files.erb | 2 +- app/views/games/_code_actions.html.erb | 30 ++++++++--------- app/views/games/_game_answer_tip_pop.html.erb | 2 +- app/views/games/_send_error_pop.html.erb | 2 +- app/views/games/show.js.erb | 4 +-- .../_homework_bank_list.html.erb | 2 +- .../_new_common_homework.html.erb | 2 +- .../_new_group_homework.html.erb | 2 +- .../_new_program_homework.html.erb | 2 +- .../_new_shixun_homework_list.html.erb | 2 +- .../_send_homework_bank.html.erb | 2 +- .../_new_common_homework.html.erb | 2 +- .../_new_group_homework.html.erb | 2 +- .../_new_program_homework.html.erb | 2 +- .../_new_shixun_homework_list.html.erb | 2 +- app/views/homework_common/setting.html.erb | 2 +- .../_add_auto_users_trial.html.erb | 2 +- .../managements/_all_department.html.erb | 2 +- app/views/managements/_all_schools.html.erb | 2 +- .../_applicable_course_list.html.erb | 2 +- .../managements/_authentication_list.html.erb | 2 +- .../managements/_create_department.html.erb | 2 +- .../managements/_modify_mirror_modal.html.erb | 2 +- app/views/managements/_new_add_unit.html.erb | 6 ++-- app/views/managements/_new_major.html.erb | 2 +- .../_pro_authentication_list.html.erb | 2 +- .../_shixun_authorization_list.html.erb | 2 +- .../_subject_authorization_list.html.erb | 2 +- .../_trial_authorization_list.html.erb | 2 +- .../managements/_update_department.html.erb | 2 +- .../managements/add_departments_part.html.erb | 2 +- .../managements/applicable_course.html.erb | 4 +-- .../managements/auto_users_trial.html.erb | 2 +- .../class_publish_shixuns.html.erb | 2 +- app/views/managements/class_shixuns.html.erb | 2 +- app/views/managements/classroom.html.erb | 2 +- .../managements/classroom_classment.html.erb | 4 +-- .../managements/classroom_classment.js.erb | 2 +- app/views/managements/close_shixuns.html.erb | 2 +- app/views/managements/depart.html.erb | 2 +- app/views/managements/departments.html.erb | 2 +- .../managements/departments_part.html.erb | 2 +- app/views/managements/profession.html.erb | 2 +- .../managements/publish_shixuns.html.erb | 2 +- .../managements/shixun_feedback.html.erb | 2 +- .../shixun_feedback_message.html.erb | 2 +- app/views/managements/shixuns.html.erb | 2 +- app/views/managements/unit.html.erb | 2 +- app/views/managements/update_user.html.erb | 4 +-- app/views/managements/upload_logo.html.erb | 4 +-- app/views/managements/users.html.erb | 2 +- app/views/managements/users_trial.html.erb | 2 +- app/views/memos/_form.html.erb | 2 +- app/views/memos/_memo_all_replies.html.erb | 2 +- app/views/memos/show.html.erb | 2 +- app/views/messages/_course_show.html.erb | 2 +- .../messages/_message_all_replies.html.erb | 2 +- app/views/my/_apply_add_department.html.erb | 2 +- app/views/my/_apply_add_school.html.erb | 2 +- app/views/my/account.html.erb | 2 +- app/views/school/index.html.erb | 4 +-- app/views/school/upload_logo.html.erb | 8 ++--- app/views/shixuns/_achieve_ways.html.erb | 2 +- app/views/shixuns/_add_collaborators.html.erb | 2 +- app/views/shixuns/_apply_mirror.html.erb | 2 +- .../shixuns/_apply_publish_notice.html.erb | 2 +- app/views/shixuns/_form.html.erb | 2 +- app/views/shixuns/_monitor_tip.html.erb | 4 +-- .../shixuns/_search_course_list.html.erb | 2 +- app/views/shixuns/_shixun_pob.html.erb | 2 +- .../student_work/_homework_setting.html.erb | 2 +- .../_new_pro_student_work.html.erb | 4 +-- .../_no_teacher_score_notice.html.erb | 2 +- .../student_work/_score_appeal_box.html.erb | 2 +- .../_student_work_replies.html.erb | 2 +- .../_student_work_score_div.html.erb | 2 +- .../student_work/_upload_attachment.html.erb | 4 +-- app/views/student_work/edit.html.erb | 2 +- app/views/student_work/index.html.erb | 2 +- app/views/student_work/new.html.erb | 2 +- app/views/subjects/_choose_shixun.html.erb | 2 +- .../subjects/_course_shixun_list.html.erb | 2 +- app/views/subjects/_publish_notice.html.erb | 4 +-- app/views/subjects/edit.html.erb | 2 +- app/views/subjects/new.html.erb | 2 +- .../_sy_change_manager.html.erb | 2 +- .../syllabuses/_add_sy_member_box.html.erb | 2 +- .../syllabuses/_delete_syllabus.html.erb | 6 ++-- .../syllabuses/_sy_send_homework.html.erb | 2 +- .../syllabuses/_sy_send_resource.html.erb | 2 +- .../_sy_send_resource_and_homework.html.erb | 2 +- app/views/syllabuses/edit.html.erb | 2 +- app/views/syllabuses/new.html.erb | 2 +- app/views/syllabuses/show.html.erb | 2 +- .../users/_import_resource_info.html.erb | 2 +- app/views/users/_myjoin_shixun_list.html.erb | 2 +- app/views/users/_myshixuns_list.html.erb | 2 +- app/views/users/_reply_to.html.erb | 22 ++++++------- app/views/users/_reply_to_comment.html.erb | 2 +- .../users/_resource_share_popup.html.erb | 2 +- .../users/_share_message_to_course.html.erb | 2 +- .../users/_show_user_homework_form.html.erb | 2 +- app/views/welcome/_one_btn_mask_pop.html.erb | 2 +- app/views/welcome/_two_btn_mask_pop.html.erb | 8 ++--- public/javascripts/edu/application.js | 32 +++++++++---------- public/javascripts/edu/base_edu.js | 6 ++-- public/javascripts/edu/course.js | 8 ++--- public/javascripts/edu/homework.js | 6 ++-- public/stylesheets/css/edu-common.css | 4 +-- 137 files changed, 209 insertions(+), 209 deletions(-) diff --git a/app/views/account/avatar.html.erb b/app/views/account/avatar.html.erb index b0a5eed9f..4fd128767 100644 --- a/app/views/account/avatar.html.erb +++ b/app/views/account/avatar.html.erb @@ -16,7 +16,7 @@
- 本地上传 + 本地上传 @@ -100,7 +100,7 @@ testend = teststr.match(/[^\\]+\.[^\(]+/i); //直接完整文件名的 filename.innerHTML = testend; $(filename).css("color", '#333'); - $(".avatar-save").removeClass("task-btn-grey").addClass("task-btn-blue"); + $(".avatar-save").removeClass("task-btn-grey").addClass("task-btn-orange"); $(".avatar-save").on("click", save_avatar); } diff --git a/app/views/account/security_settings.html.erb b/app/views/account/security_settings.html.erb index 7c60bf230..13f6fe657 100644 --- a/app/views/account/security_settings.html.erb +++ b/app/views/account/security_settings.html.erb @@ -4,7 +4,7 @@ <% if @user.phone.blank? %>
  • 未绑定
  •  
  • -
  • 绑定
  • +
  • 绑定
  • <% else %>
  • 已绑定
  • 您绑定的手机:<%= @user.user_phone %>
  • @@ -16,7 +16,7 @@ <% if @user.mail.blank? %>
  • 未绑定
  •  
  • -
  • 绑定
  • +
  • 绑定
  • <% else %>
  • 已绑定
  • 您绑定的邮箱:<%= @user.user_mail %>
  • @@ -27,7 +27,7 @@ - + diff --git a/app/views/admin/_authentication_list.html.erb b/app/views/admin/_authentication_list.html.erb index a2e1a2862..d35d2b6e6 100644 --- a/app/views/admin/_authentication_list.html.erb +++ b/app/views/admin/_authentication_list.html.erb @@ -36,7 +36,7 @@
  • - 确定 + 确定 取消
  • diff --git a/app/views/courses/_compare_code_tips_1.html.erb b/app/views/courses/_compare_code_tips_1.html.erb index 19bf87edb..da52a5ae0 100644 --- a/app/views/courses/_compare_code_tips_1.html.erb +++ b/app/views/courses/_compare_code_tips_1.html.erb @@ -10,8 +10,8 @@

    代码查重已完成,点击查看结果

    diff --git a/app/views/courses/_compare_code_tips_2.html.erb b/app/views/courses/_compare_code_tips_2.html.erb index 699ff94dd..434265a86 100644 --- a/app/views/courses/_compare_code_tips_2.html.erb +++ b/app/views/courses/_compare_code_tips_2.html.erb @@ -10,7 +10,7 @@

    <%=des%>

    diff --git a/app/views/courses/_join_private_course.html.erb b/app/views/courses/_join_private_course.html.erb index 6c6362652..fd7e0be01 100644 --- a/app/views/courses/_join_private_course.html.erb +++ b/app/views/courses/_join_private_course.html.erb @@ -28,7 +28,7 @@

    请至少选择一个身份

  • - 确定 + 确定 取消
  • diff --git a/app/views/courses/new.html.erb b/app/views/courses/new.html.erb index b83aaf3f9..8be672ced 100644 --- a/app/views/courses/new.html.erb +++ b/app/views/courses/new.html.erb @@ -84,7 +84,7 @@
  • - 保存 + 保存 <%= link_to '取消', courses_path, :class => 'task-btn fl' %>
  • diff --git a/app/views/courses/settings.html.erb b/app/views/courses/settings.html.erb index fe69cbbd1..962077bbb 100644 --- a/app/views/courses/settings.html.erb +++ b/app/views/courses/settings.html.erb @@ -79,7 +79,7 @@
  • - 保存 + 保存 <%= link_to '取消', course_path(@course), :class => 'task-btn fl ' %>
  • diff --git a/app/views/courses/settings/_add_teachers.html.erb b/app/views/courses/settings/_add_teachers.html.erb index 86fc7b18f..5fb7a0e7b 100644 --- a/app/views/courses/settings/_add_teachers.html.erb +++ b/app/views/courses/settings/_add_teachers.html.erb @@ -52,7 +52,7 @@ 取消 - 确定 + 确定
    <% end %>
    diff --git a/app/views/courses/settings/_change_manager.html.erb b/app/views/courses/settings/_change_manager.html.erb index b201df8b0..6484a0bba 100644 --- a/app/views/courses/settings/_change_manager.html.erb +++ b/app/views/courses/settings/_change_manager.html.erb @@ -28,7 +28,7 @@
    <% end %> 请选择一个教师 - 确定 + 确定 取消
    diff --git a/app/views/courses/settings/_choose_course_group.html.erb b/app/views/courses/settings/_choose_course_group.html.erb index c5e8acedc..2a1b6b4ac 100644 --- a/app/views/courses/settings/_choose_course_group.html.erb +++ b/app/views/courses/settings/_choose_course_group.html.erb @@ -15,7 +15,7 @@ <% end %>
    \ No newline at end of file diff --git a/app/views/courses/settings/_import_students.html.erb b/app/views/courses/settings/_import_students.html.erb index 2a6e8aed7..452f0670f 100644 --- a/app/views/courses/settings/_import_students.html.erb +++ b/app/views/courses/settings/_import_students.html.erb @@ -20,7 +20,7 @@
    - 确定 + 确定 取消
    <% end %> diff --git a/app/views/courses/settings/_moduels.html.erb b/app/views/courses/settings/_moduels.html.erb index 19b50d9ce..79f79f640 100644 --- a/app/views/courses/settings/_moduels.html.erb +++ b/app/views/courses/settings/_moduels.html.erb @@ -29,7 +29,7 @@ <% end %> -保存 +保存 取消
  • - 测试代码 + 测试代码
  • @@ -135,7 +135,7 @@ <% unless @is_test %>
  • - 提交 + 提交 <%= link_to '取消', student_work_index_path(:homework => @homework.id), :class => 'task-btn fr mr10' %>
  • <% end %> \ No newline at end of file diff --git a/app/views/student_work/_no_teacher_score_notice.html.erb b/app/views/student_work/_no_teacher_score_notice.html.erb index 9230a0153..dab17b9f3 100644 --- a/app/views/student_work/_no_teacher_score_notice.html.erb +++ b/app/views/student_work/_no_teacher_score_notice.html.erb @@ -8,7 +8,7 @@ 是否确定提交?

    diff --git a/app/views/student_work/_score_appeal_box.html.erb b/app/views/student_work/_score_appeal_box.html.erb index b10a17e35..6897b3078 100644 --- a/app/views/student_work/_score_appeal_box.html.erb +++ b/app/views/student_work/_score_appeal_box.html.erb @@ -19,7 +19,7 @@
    diff --git a/app/views/student_work/_student_work_replies.html.erb b/app/views/student_work/_student_work_replies.html.erb index 3154829fb..814d4df18 100644 --- a/app/views/student_work/_student_work_replies.html.erb +++ b/app/views/student_work/_student_work_replies.html.erb @@ -15,7 +15,7 @@ <%= hidden_field_tag 'user_activity_id',params[:user_activity_id],:value => @homework.id %>
    - 发布 + 发布

    <% end%> diff --git a/app/views/student_work/_student_work_score_div.html.erb b/app/views/student_work/_student_work_score_div.html.erb index b24fde87e..17d8b3436 100644 --- a/app/views/student_work/_student_work_score_div.html.erb +++ b/app/views/student_work/_student_work_score_div.html.erb @@ -44,7 +44,7 @@
  • - 确定 + 确定
  • diff --git a/app/views/student_work/_upload_attachment.html.erb b/app/views/student_work/_upload_attachment.html.erb index 5cedbbcd7..71c8a627c 100644 --- a/app/views/student_work/_upload_attachment.html.erb +++ b/app/views/student_work/_upload_attachment.html.erb @@ -16,7 +16,7 @@
    - + 选择文件 <%= file_field_tag 'attachments[dummy][file]', :id => '_file', @@ -50,7 +50,7 @@

    - 确定 + 确定 取消
    diff --git a/app/views/student_work/edit.html.erb b/app/views/student_work/edit.html.erb index 47c54f64e..770a40052 100644 --- a/app/views/student_work/edit.html.erb +++ b/app/views/student_work/edit.html.erb @@ -121,7 +121,7 @@
    <% end %>
  • - 提交 + 提交 <%=link_to '取消', student_work_index_path(:homework => @homework.id),:class=>'task-btn fr mr10' %>
  • <% else %> diff --git a/app/views/student_work/index.html.erb b/app/views/student_work/index.html.erb index 56721b607..daf089f54 100644 --- a/app/views/student_work/index.html.erb +++ b/app/views/student_work/index.html.erb @@ -312,7 +312,7 @@ <%#= user_work_status @homework %> <%# end %> <%# if @homework.homework_type == 4 && !@homework.student_works.where(:user_id => User.current.id, :work_status => 0).blank? %> - <%#= link_to "开始实战", shixun_path(@homework.homework_commons_shixuns.shixun),:class => 'task-btn task-btn-blue fr mr10',:target => "_blank" %> + <%#= link_to "开始实战", shixun_path(@homework.homework_commons_shixuns.shixun),:class => 'task-btn task-btn-orange fr mr10',:target => "_blank" %> <%# end %> <% end %> diff --git a/app/views/student_work/new.html.erb b/app/views/student_work/new.html.erb index a8c9fc348..7a502d7b3 100644 --- a/app/views/student_work/new.html.erb +++ b/app/views/student_work/new.html.erb @@ -121,7 +121,7 @@ <% end %>
  • - 提交 + 提交 <%=link_to '取消', student_work_index_path(:homework => @homework.id),:class=>'task-btn fr mr10' %>
  • <% end %> diff --git a/app/views/subjects/_choose_shixun.html.erb b/app/views/subjects/_choose_shixun.html.erb index cb314cf8f..0022810e8 100644 --- a/app/views/subjects/_choose_shixun.html.erb +++ b/app/views/subjects/_choose_shixun.html.erb @@ -16,7 +16,7 @@

    请至少选择一个课程

  • - 确定 + 确定 取消
  • diff --git a/app/views/subjects/_course_shixun_list.html.erb b/app/views/subjects/_course_shixun_list.html.erb index 579ee004b..8171c479a 100644 --- a/app/views/subjects/_course_shixun_list.html.erb +++ b/app/views/subjects/_course_shixun_list.html.erb @@ -36,7 +36,7 @@
    - 选择 + 选择 取消
    diff --git a/app/views/subjects/_publish_notice.html.erb b/app/views/subjects/_publish_notice.html.erb index 7b546e7eb..749d1c0f3 100644 --- a/app/views/subjects/_publish_notice.html.erb +++ b/app/views/subjects/_publish_notice.html.erb @@ -17,9 +17,9 @@
    <% if @status == 1 %> - <%= link_to "知道啦", subject_path(@subject), :class => "task-btn task-btn-blue pop_close" %> + <%= link_to "知道啦", subject_path(@subject), :class => "task-btn task-btn-orange pop_close" %> <% else %> - 知道啦 + 知道啦 <% end %>
    diff --git a/app/views/subjects/edit.html.erb b/app/views/subjects/edit.html.erb index 845ad9424..fe5139a6a 100644 --- a/app/views/subjects/edit.html.erb +++ b/app/views/subjects/edit.html.erb @@ -48,7 +48,7 @@
  • <%= link_to "取消", subject_path(@subject), :class => "task-btn fl mr10 ml20" %> - 保存 + 保存
  • <% end %> diff --git a/app/views/subjects/new.html.erb b/app/views/subjects/new.html.erb index cfa6ae8ea..2c34ce5db 100644 --- a/app/views/subjects/new.html.erb +++ b/app/views/subjects/new.html.erb @@ -54,7 +54,7 @@
  • <%= link_to "取消", subjects_path(), :class => "task-btn fl mr10 ml20" %> - 保存 + 保存
  • <% end %> diff --git a/app/views/syllabus_member/_sy_change_manager.html.erb b/app/views/syllabus_member/_sy_change_manager.html.erb index 17ae3157a..9a32d61bc 100644 --- a/app/views/syllabus_member/_sy_change_manager.html.erb +++ b/app/views/syllabus_member/_sy_change_manager.html.erb @@ -27,7 +27,7 @@ <% end %> 请先选择成员 - 确定 + 确定 取消
    diff --git a/app/views/syllabuses/_add_sy_member_box.html.erb b/app/views/syllabuses/_add_sy_member_box.html.erb index 453fac9e0..527cc7e70 100644 --- a/app/views/syllabuses/_add_sy_member_box.html.erb +++ b/app/views/syllabuses/_add_sy_member_box.html.erb @@ -22,7 +22,7 @@ <% end %> 该用户已添加至右侧列表 - 确定 + 确定 取消
    diff --git a/app/views/syllabuses/_delete_syllabus.html.erb b/app/views/syllabuses/_delete_syllabus.html.erb index 632dcddc3..253528553 100644 --- a/app/views/syllabuses/_delete_syllabus.html.erb +++ b/app/views/syllabuses/_delete_syllabus.html.erb @@ -18,12 +18,12 @@ <% if @syllabus.courses.not_deleted.empty? %>
    - 取消 - <%=link_to '确认', syllabus_path(@syllabus), :class => 'task-btn task-btn-blue fr', :method => 'delete'%> + 取消 + <%=link_to '确认', syllabus_path(@syllabus), :class => 'task-btn task-btn-orange fr', :method => 'delete'%>
    <% else %>
    - 确定 + 确定
    <% end %> \ No newline at end of file diff --git a/app/views/syllabuses/_sy_send_homework.html.erb b/app/views/syllabuses/_sy_send_homework.html.erb index 9b7f994b3..c076066ef 100644 --- a/app/views/syllabuses/_sy_send_homework.html.erb +++ b/app/views/syllabuses/_sy_send_homework.html.erb @@ -26,7 +26,7 @@ <% end %>
    - 确定 + 确定 取消
    diff --git a/app/views/syllabuses/_sy_send_resource.html.erb b/app/views/syllabuses/_sy_send_resource.html.erb index 68f8bfe33..c65c1f57d 100644 --- a/app/views/syllabuses/_sy_send_resource.html.erb +++ b/app/views/syllabuses/_sy_send_resource.html.erb @@ -26,7 +26,7 @@ <% end %>
    - 确定 + 确定 取消
    diff --git a/app/views/syllabuses/_sy_send_resource_and_homework.html.erb b/app/views/syllabuses/_sy_send_resource_and_homework.html.erb index 05dca5296..01b75bd26 100644 --- a/app/views/syllabuses/_sy_send_resource_and_homework.html.erb +++ b/app/views/syllabuses/_sy_send_resource_and_homework.html.erb @@ -23,7 +23,7 @@ <% end %>
    - 确定 + 确定 取消
    diff --git a/app/views/syllabuses/edit.html.erb b/app/views/syllabuses/edit.html.erb index 7151e2b5b..a56e3cbbe 100644 --- a/app/views/syllabuses/edit.html.erb +++ b/app/views/syllabuses/edit.html.erb @@ -104,7 +104,7 @@
  • - 保存 + 保存 <%= link_to "取消",syllabus_path(@syllabus),:class => "task-btn fr mr10"%>
  • diff --git a/app/views/syllabuses/new.html.erb b/app/views/syllabuses/new.html.erb index 8e09b90c6..afecf5cb3 100644 --- a/app/views/syllabuses/new.html.erb +++ b/app/views/syllabuses/new.html.erb @@ -107,7 +107,7 @@
  • - 保存 + 保存 <%= link_to "取消",user_path(User.current),:class => "task-btn fr mr10"%>
  • diff --git a/app/views/syllabuses/show.html.erb b/app/views/syllabuses/show.html.erb index 55494445a..0c4ee4554 100644 --- a/app/views/syllabuses/show.html.erb +++ b/app/views/syllabuses/show.html.erb @@ -58,7 +58,7 @@ --> <%# if @is_syllabus_teacher || @is_authen_teacher %> - <%#= link_to '选用', choose_user_course_syllabus_path(@syllabus, :type => 'A'), :class => 'task-btn task-btn-blue fr ml20', :style => '', :remote => true %> + <%#= link_to '选用', choose_user_course_syllabus_path(@syllabus, :type => 'A'), :class => 'task-btn task-btn-orange fr ml20', :style => '', :remote => true %> <%# end %> diff --git a/app/views/users/_import_resource_info.html.erb b/app/views/users/_import_resource_info.html.erb index 7139e1e7b..b90b41df2 100644 --- a/app/views/users/_import_resource_info.html.erb +++ b/app/views/users/_import_resource_info.html.erb @@ -57,7 +57,7 @@ <%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %> - 选用 + 选用 取消
    diff --git a/app/views/users/_myjoin_shixun_list.html.erb b/app/views/users/_myjoin_shixun_list.html.erb index d693a1bae..e8fb646c7 100644 --- a/app/views/users/_myjoin_shixun_list.html.erb +++ b/app/views/users/_myjoin_shixun_list.html.erb @@ -25,7 +25,7 @@ <%= time_from_now(shixun.updated_at) %>更新

    - 查看详情 + 查看详情 <% end %> <% end %> diff --git a/app/views/users/_myshixuns_list.html.erb b/app/views/users/_myshixuns_list.html.erb index 5a5a5c5fb..774e50be9 100644 --- a/app/views/users/_myshixuns_list.html.erb +++ b/app/views/users/_myshixuns_list.html.erb @@ -16,7 +16,7 @@ <%= format_time(shixun.updated_at) %> 更新

    - 查看详情 + 查看详情 <% end %> <% end %> diff --git a/app/views/users/_reply_to.html.erb b/app/views/users/_reply_to.html.erb index 2c4a7b6cc..0696d0755 100644 --- a/app/views/users/_reply_to.html.erb +++ b/app/views/users/_reply_to.html.erb @@ -9,7 +9,7 @@
    - +

    <% end%> @@ -19,7 +19,7 @@
    - +

    <% end%> @@ -33,7 +33,7 @@ <%= hidden_field_tag 'activity_id',params[:activity_id],:value =>@activity_id %>
    - +
    <% end%> <% elsif @type == 'Message' %> @@ -43,7 +43,7 @@ <%= hidden_field_tag 'user_activity_id',params[:user_activity_id],:value =>@user_activity_id %>
    - +

    <% end%> @@ -54,7 +54,7 @@ <%= hidden_field_tag 'parent_id', params[:parent_id], :value => reply.id %>
    - +

    <% end%> @@ -64,7 +64,7 @@ <%= hidden_field_tag 'user_activity_id',params[:user_activity_id],:value =>@user_activity_id %>
    - +

    <% end%> @@ -73,7 +73,7 @@ <%= hidden_field_tag 'user_activity_id',params[:user_activity_id],:value =>@user_activity_id %>
    - +

    <% end%> @@ -83,7 +83,7 @@ <%= hidden_field_tag 'user_activity_id',params[:user_activity_id],:value =>@user_activity_id %>
    - +

    <% end %> @@ -92,7 +92,7 @@
    - +

    <% end%> @@ -105,7 +105,7 @@ <%= hidden_field_tag 'user_activity_id',params[:user_activity_id],:value =>@user_activity_id %>
    - +

    <% end%> @@ -114,7 +114,7 @@
    - 发送 + 发送

    <% end%> <% end %> diff --git a/app/views/users/_reply_to_comment.html.erb b/app/views/users/_reply_to_comment.html.erb index 7449c1285..d6bd8cb3e 100644 --- a/app/views/users/_reply_to_comment.html.erb +++ b/app/views/users/_reply_to_comment.html.erb @@ -6,7 +6,7 @@ <%= form_for('new_form',:url => {:controller => 'users', :action => 'reply_detail', :reply_id => reply.id, :type => @type, :is_project => @is_project, :user_activity_id => @user_activity_id},:method => "post", :remote => true) do |f| %>
    - +

    <% end%> diff --git a/app/views/users/_resource_share_popup.html.erb b/app/views/users/_resource_share_popup.html.erb index 3bcb67e7c..9c8adf94c 100644 --- a/app/views/users/_resource_share_popup.html.erb +++ b/app/views/users/_resource_share_popup.html.erb @@ -24,7 +24,7 @@
    - 确定 + 确定 取消
    diff --git a/app/views/users/_share_message_to_course.html.erb b/app/views/users/_share_message_to_course.html.erb index 86a59b22f..1e713fd77 100644 --- a/app/views/users/_share_message_to_course.html.erb +++ b/app/views/users/_share_message_to_course.html.erb @@ -29,7 +29,7 @@
    <%#= submit_tag '确定', :class => 'sendSourceText', :onfocus => 'this.blur();' %> - 确定 + 确定 取消
    diff --git a/app/views/users/_show_user_homework_form.html.erb b/app/views/users/_show_user_homework_form.html.erb index 029912924..b674289a5 100644 --- a/app/views/users/_show_user_homework_form.html.erb +++ b/app/views/users/_show_user_homework_form.html.erb @@ -25,7 +25,7 @@
    - 确定 + 确定 取消
    diff --git a/app/views/welcome/_one_btn_mask_pop.html.erb b/app/views/welcome/_one_btn_mask_pop.html.erb index af9ccf6a6..977713bb7 100644 --- a/app/views/welcome/_one_btn_mask_pop.html.erb +++ b/app/views/welcome/_one_btn_mask_pop.html.erb @@ -21,7 +21,7 @@ <%#= tip2 %>

    -->
    diff --git a/app/views/welcome/_two_btn_mask_pop.html.erb b/app/views/welcome/_two_btn_mask_pop.html.erb index 6b035ca4b..46d028f4c 100644 --- a/app/views/welcome/_two_btn_mask_pop.html.erb +++ b/app/views/welcome/_two_btn_mask_pop.html.erb @@ -26,12 +26,12 @@ <% end %> <%# if @authentication %> - + <%# else %> - - + + <%# end %>
    @@ -41,7 +41,7 @@

    请填写推荐人信息或申请理由

    - 试用申请 + 试用申请
    <% end %> diff --git a/public/javascripts/edu/application.js b/public/javascripts/edu/application.js index 0c0c8885f..e7d63f74f 100644 --- a/public/javascripts/edu/application.js +++ b/public/javascripts/edu/application.js @@ -267,14 +267,14 @@ function pop_box_new(value, Width, Height){ function op_confirm_box(url, str){ var htmlvalue = '

    提示

    '+ '

    ' + str + '

    取消'+ - '确定
    '; + '确定'; pop_box_new(htmlvalue, 578, 205); } function op_confirm_box_loading(url, str){ var htmlvalue = '

    提示

    '+ '

    ' + str + '

    取消'+ - '确定
    '; + '确定'; pop_box_new(htmlvalue, 578, 205); } @@ -282,7 +282,7 @@ function op_confirm_box_loading(url, str){ function s_op_confirm_box(url, str){ var htmlvalue = '

    提示

    '+ '

    ' + str + '

    取消'+ - '确定
    '; + '确定'; pop_box_new(htmlvalue, 480, 205); } @@ -290,7 +290,7 @@ function s_op_confirm_box(url, str){ function delete_confirm_box(url, str){ var htmlvalue = '

    提示

    '+ '

    ' + str + '

    取消'+ - '确定
    '; + '确定'; pop_box_new(htmlvalue, 480, 140); } @@ -298,7 +298,7 @@ function delete_confirm_box(url, str){ function delete_confirm_box_2(url, str){ var htmlvalue = '

    提示

    '+ '

    ' + str + '

    取消'+ - '确定
    '; + '确定'; pop_box_new(htmlvalue, 480, 140); } @@ -306,7 +306,7 @@ function delete_confirm_box_2(url, str){ function delete_confirm_box_3(url, str){ var htmlvalue = '

    提示

    '+ '

    ' + str + '

    取消'+ - '确定
    '; + '确定'; pop_box_new(htmlvalue, 480, 140); } @@ -314,7 +314,7 @@ function delete_confirm_box_3(url, str){ function delete_confirm_box_4(url, str){ var htmlvalue = '

    提示

    '+ '

    ' + str + '

    取消'+ - '确定
    '; + '确定'; pop_box_new(htmlvalue, 480, 140); } @@ -323,7 +323,7 @@ function delete_confirm_box_4(url, str){ function notice_sure_box(str){ var htmlvalue = '

    提示

    '+ '

    ' + str + '

    '+ - '知道啦
    '; + '知道啦'; pop_box_new(htmlvalue, 480, 140); } @@ -332,7 +332,7 @@ function notice_sure_box(str){ function notice_box(str){ var htmlvalue = '

    提示

    '+ '

    ' + str + '

    '+ - '确定
    '; + '确定'; pop_box_new(htmlvalue, 480, 140); } @@ -342,7 +342,7 @@ function notice_box(str){ function long_notice_box(str){ var htmlvalue = '

    提示

    '+ '

    ' + str + '

    '+ - '确定
    '; + '确定'; pop_box_new(htmlvalue, 575, 140); } @@ -351,7 +351,7 @@ function long_notice_box(str){ function yes_notice_box(str){ var htmlvalue = '

    提示

    '+ '

    ' + str + '

    '+ - '知道啦
    '; + '知道啦'; pop_box_new(htmlvalue, 575, 200); } @@ -360,7 +360,7 @@ function yes_notice_box(str){ function sure_box_redirect(url, str){ var htmlvalue = '

    提示

    '+ '

    ' + str + '

    '+ - '知道啦
    '; + '知道啦'; pop_box_new(htmlvalue, 480, 140); } @@ -369,7 +369,7 @@ function sure_box_redirect(url, str){ function sure_box_redirect_without_newtab(url, str){ var htmlvalue = '

    提示

    '+ '

    ' + str + '

    '+ - '知道啦
    '; + '知道啦'; pop_box_new(htmlvalue, 480, 140); } @@ -378,7 +378,7 @@ function sure_box_redirect_without_newtab(url, str){ function notice_box_redirect(url, str){ var htmlvalue = '

    提示

    '+ '

    ' + str + '

    '+ - '确定
    '; + '确定'; pop_box_new(htmlvalue, 480, 140); } @@ -387,7 +387,7 @@ function notice_box_redirect(url, str){ function notice_box_redirect_remote(url, str){ var htmlvalue = '

    提示

    '+ '

    ' + str + '

    '+ - '确定
    '; + '确定'; pop_box_new(htmlvalue, 480, 140); } @@ -395,7 +395,7 @@ function notice_box_redirect_remote(url, str){ function re_entry(url){ var htmlvalue = '

    提示

    '+ '

    您的会话已退出,请重新登录^_^

    '+ - '重新登录
    '; + '重新登录'; pop_box_new(htmlvalue, 480, 140); } diff --git a/public/javascripts/edu/base_edu.js b/public/javascripts/edu/base_edu.js index d99948fc5..9c6aa1469 100644 --- a/public/javascripts/edu/base_edu.js +++ b/public/javascripts/edu/base_edu.js @@ -836,7 +836,7 @@ function hide_edit_setting(){ function setting_cancel_edit(fn){ var htmlvalue = '

    提示

    '+ '

    修改的内容将全部丢失
    是否确认取消保存

    取消'+ - '确定
    '; + '确定'; pop_box_new(htmlvalue, 480, 140); } @@ -1088,7 +1088,7 @@ function alert_choose_homework_bank_type(){ '
    请先选择作业类型
    ' + '
    ' + '取消' + - '确定' + + '确定' + '
    ' + '' + '' + @@ -1174,7 +1174,7 @@ function destroy_all_hb(url){ $("#choose_homework_bank_to_send_notice_h").html("").hide(); var htmlvalue = '

    提示

    '+ '

    确定要删除所选题目吗?

    取消'+ - '确定
    '; + '确定'; pop_box_new(htmlvalue,480,140); $("#destroy_all_hb_btn").on('click',function(){ $.ajax({ diff --git a/public/javascripts/edu/course.js b/public/javascripts/edu/course.js index 8199bd090..43fca60da 100644 --- a/public/javascripts/edu/course.js +++ b/public/javascripts/edu/course.js @@ -161,7 +161,7 @@ function add_new_group(id){ '' + '
    ' + '该分班已存在' + - '确定' + + '确定' + '取消' + '' + ''; @@ -217,7 +217,7 @@ function rename_group_name(course_id, group_id){ '' + '
    ' + '该分班已存在' + - '确定' + + '确定' + '取消' + '' + ''; @@ -262,7 +262,7 @@ function delete_group(course_id, group_id){ '

    确定要删除吗?
    删除分班后,该分班的学生需要重新选择分班。' + '' + '

    ' + - '确定' + + '确定' + '取消' + '
    ' + ''; @@ -546,7 +546,7 @@ function delete_students(type, id, group_id){ $("#no_student_notice").hide(); var htmlvalue = '

    提示

    '+ '

    确定要删除这些学生吗?

    取消'+ - '确定
    '; + '确定'; pop_box_new(htmlvalue, 480, 140); $("#confirm-button").on('click',function(){ hideModal(); diff --git a/public/javascripts/edu/homework.js b/public/javascripts/edu/homework.js index 7d28bd571..3ef194430 100644 --- a/public/javascripts/edu/homework.js +++ b/public/javascripts/edu/homework.js @@ -123,7 +123,7 @@ $(function(){ if($('.edu-tab-con-box .ProResultList').length<=0){ var htmlvalue = '

    提示

    '+ '

    测试后才能提交,是否立刻测试?

    取消'+ - '确定
    '; + '确定'; pop_box_new(htmlvalue,575,140); $("#code-test-button").on('click',function(){ test_program(); @@ -139,7 +139,7 @@ $(function(){ console.log(tested); var htmlvalue = '

    提示

    '+ '

    测试不通过,是否强制提交?

    取消'+ - '确定
    '; + '确定'; pop_box_new(htmlvalue,575,140); $('#commit-program-work-btn').show(); return; @@ -314,7 +314,7 @@ function alert_choose_homework_type(id){ '
    请先选择作业类型
    ' + '
    ' + '取消' + - '确定' + + '确定' + '
    ' + '' + '' + diff --git a/public/stylesheets/css/edu-common.css b/public/stylesheets/css/edu-common.css index b2412de3b..d37444981 100644 --- a/public/stylesheets/css/edu-common.css +++ b/public/stylesheets/css/edu-common.css @@ -132,8 +132,8 @@ a.task-btn-green{background: #29bd8b; color: #fff!important;} a:hover.task-btn-green{background: #19b17e;} a.task-btn-orange{background: #FF7500; color:#fff!important;} a:hover.task-btn-orange{ background:#ff7500;} -a.task-btn-blue{background: #3498db; color:#fff!important;} -a:hover.task-btn-blue{background: #5faee3;color:#fff;} +a.task-btn-blue{background: #199ed8; color:#fff!important;} +a:hover.task-btn-blue{background: #199ed8;color:#fff;} a.task-btn-grey{background-color: #d4d6d8; color: #4d555d!important;} a:hover.task-btn-grey{background-color: #d4d6d8; color: #4d555d;} a.task-btn-grey-white{background-color: #c2c4c6; color: #fff;} From c3cf3d0eddeafe5f921d0f2a8b2da9def5cb2105 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 13 Oct 2017 10:43:30 +0800 Subject: [PATCH 20/32] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E7=9A=84=E4=BD=9C=E4=B8=9A=E6=8F=8F=E8=BF=B0=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E4=B8=8E=E5=AE=9E=E8=AE=AD=E7=AE=80=E4=BB=8B=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/student_work/index.html.erb | 43 ++++++++++++++++++++++----- 1 file changed, 36 insertions(+), 7 deletions(-) diff --git a/app/views/student_work/index.html.erb b/app/views/student_work/index.html.erb index 56721b607..db00d8010 100644 --- a/app/views/student_work/index.html.erb +++ b/app/views/student_work/index.html.erb @@ -2,8 +2,16 @@ <%= javascript_include_tag "/assets/codemirror/codemirror_python_ruby_c" %> <%= javascript_include_tag "resizeable_table" %> <%= stylesheet_link_tag "/assets/codemirror/codemirror" %> + <%= stylesheet_link_tag '/editormd/css/editormd','/editormd/css/editormd.min.css' %> +<%= javascript_include_tag '/editormd/lib/marked.min.js','/editormd/lib/prettify.min.js','/editormd/lib/raphael.min.js','/editormd/lib/underscore.min.js','/editormd/lib/sequence-diagram.min.js', + '/editormd/lib/flowchart.min.js','/editormd/lib/jquery.flowchart.min.js','/editormd/editormd.js'%> <%= import_ke(enable_at: true, prettify: false, init_activity: true) %> <% end %> + <% is_group_project_homework = @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %> \ No newline at end of file diff --git a/app/views/exercise/_select_examination_list.html.erb b/app/views/exercise/_select_examination_list.html.erb index 9b84fb7ef..968c63c2a 100644 --- a/app/views/exercise/_select_examination_list.html.erb +++ b/app/views/exercise/_select_examination_list.html.erb @@ -1,85 +1,28 @@ - -
    -
    -

    选择试卷

    - -
    -
    -
    - 我的试卷 - -
    -
    - - × -
    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - -
    - - -
    -
    -
    -
    - -
    -
    - -
    - 确认 - 取消 -
    -
    -
    - -
    +
    + + + <% @exercises.each do |exercise| %> + + + + <% end %> + +
    + + +
    - +
    + 确定 + 取消 +
    +
    \ No newline at end of file diff --git a/app/views/exercise/import_other_exercise.js.erb b/app/views/exercise/import_other_exercise.js.erb index 5227d7cd2..2b454b3d9 100644 --- a/app/views/exercise/import_other_exercise.js.erb +++ b/app/views/exercise/import_other_exercise.js.erb @@ -1,9 +1 @@ -var htmlvalue = '

    提示

    '+ - '

    试卷已导入
    但需要您设置发布时间和截止时间,以激活相应的试卷

    ' + - '知道了
    '; -pop_box_new(htmlvalue, 400, 152); - -function click_OK(){ - hideModal(); - window.location.href = "<%= exercise_index_path(:course_id => @course.id) %>"; -} \ No newline at end of file +notice_box_redirect("<%= student_exercise_list_exercise_path(@exercise, :tab => 3) %>", "导入成功"); \ No newline at end of file diff --git a/app/views/exercise/index.html.erb b/app/views/exercise/index.html.erb index 22412b59b..7a456dfef 100644 --- a/app/views/exercise/index.html.erb +++ b/app/views/exercise/index.html.erb @@ -1,12 +1,5 @@ <%= stylesheet_link_tag 'polls', :media => 'all' %> \ No newline at end of file + \ No newline at end of file diff --git a/app/views/exercise/other_exercise.js.erb b/app/views/exercise/other_exercise.js.erb index 68d5c804b..d04ed1d03 100644 --- a/app/views/exercise/other_exercise.js.erb +++ b/app/views/exercise/other_exercise.js.erb @@ -1,8 +1,10 @@ <% if @exercises.blank? %> -var htmlvalue = '

    提示

    '+ - '

    您的其它班级下没有试卷可供导入

    确定
    '; -pop_box_new(htmlvalue, 300, 140); + notice_box("您的其它班级下没有试卷可供导入"); <% else %> -var html_value = '<%= escape_javascript(render :partial => 'other_exercises',:locals => {:exercises => @exercises, :course_id=>@course_id}) %>'; -pop_box_new(html_value, 745, 600); + <% unless params[:search] %> + var html_value = '<%= escape_javascript(render :partial => 'other_exercises') %>'; + pop_box_new(html_value, 620, 568); + <% else %> + $("#test_nav_1").html("<%= j(render :partial => "select_examination_list") %>"); + <% end %> <% end %> \ No newline at end of file From 28c588cb5ffbaffc56d08980fc94dae8852682f7 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 13 Oct 2017 15:12:39 +0800 Subject: [PATCH 24/32] =?UTF-8?q?=E7=BC=96=E8=BE=91=E8=AF=95=E5=8D=B7?= =?UTF-8?q?=E4=B8=AD=E7=82=B9=E5=87=BB=E6=9F=90=E9=A2=98=E7=9A=84=E2=80=9C?= =?UTF-8?q?=E5=90=91=E4=B8=8B=E6=8F=92=E5=85=A5xx=E9=A2=98=E2=80=9D?= =?UTF-8?q?=E6=8C=89=E9=92=AE=EF=BC=8C=E5=BC=B9=E5=87=BA=E6=96=B0=E5=BB=BA?= =?UTF-8?q?=E9=A2=98=E7=9B=AE=E5=90=8E=E7=82=B9=E5=87=BB=E5=8F=96=E6=B6=88?= =?UTF-8?q?=EF=BC=8C=E5=86=8D=E7=BC=96=E8=BE=91=E6=9F=90=E9=A2=98=EF=BC=8C?= =?UTF-8?q?=E7=BB=99=E5=87=BA=E6=8F=90=E7=A4=BA=E4=B8=8D=E8=83=BD=E7=BC=96?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/exercise/_new_MC.html.erb | 2 +- app/views/exercise/_new_MCQ.html.erb | 2 +- app/views/exercise/_new_multi.html.erb | 2 +- app/views/exercise/_new_single.html.erb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/exercise/_new_MC.html.erb b/app/views/exercise/_new_MC.html.erb index 934218340..fca7c23cd 100644 --- a/app/views/exercise/_new_MC.html.erb +++ b/app/views/exercise/_new_MC.html.erb @@ -56,7 +56,7 @@

    温馨提示:[单选题]属于客观题将由系统自动评分,请设置标准答案 保存 - 取消 + 取消

    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 Date: Fri, 13 Oct 2017 15:13:54 +0800 Subject: [PATCH 25/32] =?UTF-8?q?=E5=9C=A8=E8=AF=95=E5=8D=B7=E6=9C=AA?= =?UTF-8?q?=E5=8F=91=E5=B8=83=E6=97=B6=E5=8A=A0=E5=85=A5=E6=96=B0=E7=9A=84?= =?UTF-8?q?=E5=AD=A6=E7=94=9F=EF=BC=8C=E8=AF=95=E5=8D=B7=E5=88=B0=E8=BE=BE?= =?UTF-8?q?=E5=8F=91=E5=B8=83=E6=97=B6=E9=97=B4=E5=90=8E=EF=BC=8C=E7=AD=94?= =?UTF-8?q?=E9=A2=98=E7=BB=9F=E8=AE=A1=E4=B8=AD=E6=96=B0=E5=AD=A6=E7=94=9F?= =?UTF-8?q?=E6=9C=89=E4=B8=A4=E6=9D=A1=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/students_for_course.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/students_for_course.rb b/app/models/students_for_course.rb index 662d57bd2..14071a3be 100644 --- a/app/models/students_for_course.rb +++ b/app/models/students_for_course.rb @@ -62,7 +62,7 @@ class StudentsForCourse < ActiveRecord::Base def create_exercise_users course = self.course str = "" - exercises = course.exercises.where("exercise_status > 0") + exercises = course.exercises.where("exercise_status > 1") if exercises.count != 0 exercises.each do |ex| if ex.exercise_users.where("user_id = #{self.student_id}").count == 0 From a3cf8e9697ed0239772c90dd5b0964988008eb76 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 13 Oct 2017 16:23:39 +0800 Subject: [PATCH 26/32] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/subjects_controller.rb | 2 ++ app/helpers/subjects_helper.rb | 17 ++++++++++++ app/views/subjects/_subject_top.html.erb | 33 +++++++++++++----------- app/views/subjects/show.html.erb | 30 ++++++++++----------- 4 files changed, 52 insertions(+), 30 deletions(-) diff --git a/app/controllers/subjects_controller.rb b/app/controllers/subjects_controller.rb index 528109a28..9d05cc44b 100644 --- a/app/controllers/subjects_controller.rb +++ b/app/controllers/subjects_controller.rb @@ -6,6 +6,7 @@ class SubjectsController < ApplicationController before_filter :find_subject, :except => [:index, :new, :create, :create_subject, :new_subject, :append_to_stage] include ApplicationHelper + include SubjectsHelper def index @order = params[:order] || "myshixun_count" @@ -33,6 +34,7 @@ class SubjectsController < ApplicationController def show @stages = @subject.stages + @is_manager = User.current.manager_of_subject?(@subject) end def new diff --git a/app/helpers/subjects_helper.rb b/app/helpers/subjects_helper.rb index b2c94dbab..7757cd8d8 100644 --- a/app/helpers/subjects_helper.rb +++ b/app/helpers/subjects_helper.rb @@ -3,4 +3,21 @@ module SubjectsHelper shixuns = Shixun.where(:id => subject.stage_shixuns.map(&:shixun_id)) co_users = User.where(:id => shixuns.map(&:user_id)).where("id != #{subject.user_id}") end + + def subject_data subject + result = {} + subject_choices = 0 + subject_shixuns = 0 + subject_score = 0 + subject.stage_shixuns.each do |stage_shixun| + shixun = stage_shixun.shixun + subject_choices += shixun.challenges.where(:st => [1, 2]).count + subject_shixuns += shixun.challenges.where(:st => 0).count + subject_score += shixun.shixun_score + end + result[:subject_choices] = subject_choices + result[:subject_shixuns] = subject_shixuns + result[:subject_score] = subject_score + result + end end diff --git a/app/views/subjects/_subject_top.html.erb b/app/views/subjects/_subject_top.html.erb index 3622c68dc..91776268f 100644 --- a/app/views/subjects/_subject_top.html.erb +++ b/app/views/subjects/_subject_top.html.erb @@ -1,7 +1,7 @@

    <%= @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 @subject.stages.count>0 %> + <% if @subject.stages.count > 0 %>
    • <%= @subject.stages.count %> 章节
    • <% end %> - <% if @subject.stage_shixuns.count>0 %> + <% if @subject.stage_shixuns.count > 0 %>
    • <%= @subject.stage_shixuns.count %> 实训
    • <% end %> - <% if @subject.subject_choices>0 %> + <% subject_relate_data = subject_data(@subject) %> + <% if subject_relate_data[:subject_choices] > 0 %>
    • - <%= @subject.subject_choices %> 选择题任务 + <%= subject_relate_data[:subject_choices] %> 选择题任务
    • <% end %> - <% if @subject.subject_shixuns>0 %> + <% if subject_relate_data[:subject_shixuns] > 0 %>
    • - <%= @subject.subject_shixuns %> 实践任务 + <%= subject_relate_data[:subject_shixuns] %> 实践任务
    • <% end %> - <% if @subject.subject_score>0 %> -
    • <%= @subject.subject_score %> 经验值
    • + <% if subject_relate_data[:subject_score] > 0 %> +
    • <%= subject_relate_data[:subject_score] %> 经验值
    • <% end %>
    - <% if @subject.status == 0 && @subject.stages.count > 0 && User.current.manager_of_subject?(@subject) %> - <%= link_to '申请发布', publish_subject_path(@subject), :class => "course-btn fr", :remote => true %> - <% elsif @subject.status == 1 && User.current.manager_of_subject?(@subject) %> - <%= link_to '撤销申请', cancel_publish_subject_path(@subject), :class => "course-btn fr" %> - <% elsif @subject.status == 2 && User.current.manager_of_subject?(@subject) %> - 撤销发布 + <% if @is_manager %> + <% if @subject.status == 0 && @subject.stages.count > 0 %> + <%= link_to '申请发布', publish_subject_path(@subject), :class => "course-btn fr", :remote => true %> + <% elsif @subject.status == 1 %> + <%= link_to '撤销申请', cancel_publish_subject_path(@subject), :class => "course-btn fr" %> + <% elsif @subject.status == 2 %> + 撤销发布 + <% end %> <% end %>
    diff --git a/app/views/subjects/show.html.erb b/app/views/subjects/show.html.erb index 4aea081d4..65d9b66fa 100644 --- a/app/views/subjects/show.html.erb +++ b/app/views/subjects/show.html.erb @@ -3,12 +3,12 @@ '/editormd/lib/flowchart.min.js','/editormd/lib/jquery.flowchart.min.js','/editormd/editormd.js'%>
    - <% if !@subject.description.blank? || User.current.manager_of_subject?(@subject) %> + <% if !@subject.description.blank? || @is_manager %>

    简介 - <% if User.current.manager_of_subject?(@subject) %> - + <% if @is_manager %> + <% end %>

    @@ -20,13 +20,12 @@ <% end %>
    - <% count = 0 %> <% @stages.each_with_index do |stage, s_index| %>

    <%= 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 %>
    ;" onclick="<%= allow_shixun_exec(shixun) ? "" : (shixun.status < 2 && !User.current.manager_of_shixun?(shixun) ? "" : "shixun_link('#{shixun.identifier}')") %>"> + style="<%= shixun_exec ? "" : "cursor: pointer" %>;" onclick="<%= shixun_exec ? "" : (shixun.status < 2 && !is_shixun_manager ? "" : "shixun_link('#{shixun.identifier}')") %>">
  • <%= s_index + 1 %>-<%= index + 1 %>  <%= shixun.name %> @@ -48,8 +50,7 @@ <%= shixun.shixun_status %> <% else %> <% if shixun.status > 1 %> - <% if my_shixun_status(shixun, User.current) == "已通关" %> - + <% if myshixun && myshixun.status == 1 %> <% else %> @@ -58,8 +59,7 @@ <% end %> <% end %> - <% if allow_shixun_exec(shixun) %> - <% myshixun = Myshixun.where(:user_id => User.current.id, :shixun_id => shixun.id).first %> + <% if shixun_exec %> <% is_modify = ShixunModify.where(:myshixun_id => myshixun.try(:id), :shixun_id => shixun.try(:id), :status => 1).first %> <% if shixun.status > 1 %> <% if User.current.try(:mail).blank? %> @@ -72,7 +72,7 @@ <% end %> <% end %> <% else %> - <% if User.current.manager_of_shixun?(shixun) %> + <% if is_shixun_manager %> <% if User.current.try(:mail).blank? %> <% else %> @@ -85,7 +85,7 @@ <% end %> <% end %> <% end %> - <% if shixun.status < 2 && !User.current.manager_of_shixun?(shixun) %> + <% if shixun.status < 2 && !is_shixun_manager %> <% else %> <%= link_to "查看详情", shixun_path(shixun), :class => "task-btn task-btn-green ml10", :style=>"display: none", :target => "_blank" %> @@ -98,7 +98,7 @@ <% end %>
  • - <% if User.current.manager_of_subject?(@subject) %> + <% if @is_manager %>
    <% if @stages.count == 0 %> <%= form_for('', :url => {:controller => 'stages', :action => 'create', :subject => @subject.id}, :method => "post", :html => {:id => 'new_stage_form'}) do |f| %> @@ -143,7 +143,7 @@

    学习须知 - <% 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 %>

    From 2b7615c877deb553321ce1653200258e8dda2d6d Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 13 Oct 2017 17:33:45 +0800 Subject: [PATCH 27/32] =?UTF-8?q?=E8=AF=95=E5=8D=B7=E9=A2=98=E7=9B=AEke?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E5=99=A8=E4=B8=8A=E4=BC=A0=E5=9B=BE=E7=89=87?= =?UTF-8?q?=EF=BC=8C=E7=BB=99=E5=87=BA=E5=9B=BE=E7=89=87=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E7=9A=84=E6=8F=90=E7=A4=BA=E6=A1=86=E4=BD=8D=E7=BD=AE=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E5=B1=85=E4=B8=AD=EF=BC=8C=E4=B8=94=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E4=B8=8D=E6=98=AF=E5=85=AC=E7=94=A8=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/kindeditor/kindeditor.js | 3 +-- public/javascripts/edu/application.js | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/public/assets/kindeditor/kindeditor.js b/public/assets/kindeditor/kindeditor.js index f1fa69302..264c361df 100644 --- a/public/assets/kindeditor/kindeditor.js +++ b/public/assets/kindeditor/kindeditor.js @@ -5762,8 +5762,7 @@ _plugin('core', function(K) { } else { //alert(data.message); // alert("仅支持如下图片格式:bmp,jpeg,jpg,png,gif,BMP,JPEG,JPG,PNG,GIF"); - var htmlvalue = "
    仅支持如下图片格式:bmp,jpeg,jpg,png,gif,BMP,JPEG,JPG,PNG,GIF!

    "; - pop_up_box(htmlvalue,580,30,50); + long_notice_box("仅支持如下图片格式:bmp,jpeg,jpg,png,gif,BMP,JPEG,JPG,PNG,GIF!"); } }, afterError : function(str) { diff --git a/public/javascripts/edu/application.js b/public/javascripts/edu/application.js index e7d63f74f..17e1d1797 100644 --- a/public/javascripts/edu/application.js +++ b/public/javascripts/edu/application.js @@ -291,7 +291,7 @@ function delete_confirm_box(url, str){ var htmlvalue = '

    提示

    '+ '

    ' + str + '

    '; - pop_box_new(htmlvalue, 480, 140); + pop_box_new(htmlvalue, 480, 160); } //点击删除时的确认弹框: 走destroy方法,remote为true @@ -299,7 +299,7 @@ function delete_confirm_box_2(url, str){ var htmlvalue = '

    提示

    '+ '

    ' + str + '

    '; - pop_box_new(htmlvalue, 480, 140); + pop_box_new(htmlvalue, 480, 160); } //点击删除时的确认弹框: 走destroy方法 @@ -307,7 +307,7 @@ function delete_confirm_box_3(url, str){ var htmlvalue = '

    提示

    '+ '

    ' + str + '

    '; - pop_box_new(htmlvalue, 480, 140); + pop_box_new(htmlvalue, 480, 160); } // 点击删除时的确认弹框: 走destroy方法 有“载入中”的提示 @@ -315,7 +315,7 @@ function delete_confirm_box_4(url, str){ var htmlvalue = '

    提示

    '+ '

    ' + str + '

    '; - pop_box_new(htmlvalue, 480, 140); + pop_box_new(htmlvalue, 480, 160); } //提示框:只有一个按钮,点击关闭弹框 @@ -324,7 +324,7 @@ function notice_sure_box(str){ var htmlvalue = '

    提示

    '+ '

    ' + str + '

    '; - pop_box_new(htmlvalue, 480, 140); + pop_box_new(htmlvalue, 480, 160); } //提示框:只有一个确定按钮,点击关闭弹框 @@ -333,7 +333,7 @@ function notice_box(str){ var htmlvalue = '

    提示

    '+ '

    ' + str + '

    '+ '确定
    '; - pop_box_new(htmlvalue, 480, 140); + pop_box_new(htmlvalue, 480, 160); } @@ -343,7 +343,7 @@ function long_notice_box(str){ var htmlvalue = '

    提示

    '+ '

    ' + str + '

    '+ '确定
    '; - pop_box_new(htmlvalue, 575, 140); + pop_box_new(htmlvalue, 575, 160); } // 长提示框:只有一个“知道啦”按钮,点击关闭弹框 @@ -361,7 +361,7 @@ function sure_box_redirect(url, str){ var htmlvalue = '

    提示

    '+ '

    ' + str + '

    '; - pop_box_new(htmlvalue, 480, 140); + pop_box_new(htmlvalue, 480, 160); } //提示框:只有一个知道啦按钮,点击打开新窗口 @@ -370,7 +370,7 @@ function sure_box_redirect_without_newtab(url, str){ var htmlvalue = '

    提示

    '+ '

    ' + str + '

    '; - pop_box_new(htmlvalue, 480, 140); + pop_box_new(htmlvalue, 480, 160); } //提示框:只有一个确定按钮,点击跳转 @@ -379,7 +379,7 @@ function notice_box_redirect(url, str){ var htmlvalue = '

    提示

    '+ '

    ' + str + '

    '+ '确定
    '; - pop_box_new(htmlvalue, 480, 140); + pop_box_new(htmlvalue, 480, 160); } //提示框:只有一个确定按钮,点击跳转(局部刷新) @@ -388,7 +388,7 @@ function notice_box_redirect_remote(url, str){ var htmlvalue = '

    提示

    '+ '

    ' + str + '

    '+ '确定
    '; - pop_box_new(htmlvalue, 480, 140); + pop_box_new(htmlvalue, 480, 160); } //重新登录 @@ -396,7 +396,7 @@ function re_entry(url){ var htmlvalue = '

    提示

    '+ '

    您的会话已退出,请重新登录^_^

    '; - pop_box_new(htmlvalue, 480, 140); + pop_box_new(htmlvalue, 480, 160); } // 警告/提示弹框点击“x”关闭 From efac20f6a62cf3ef417e3e23685a9c909acc4755 Mon Sep 17 00:00:00 2001 From: XuCheng642 <287102909@qq.com> Date: Fri, 13 Oct 2017 18:49:10 +0800 Subject: [PATCH 28/32] =?UTF-8?q?=E5=8D=95=E4=BD=8D=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E5=89=94=E9=99=A4=E5=BD=93=E5=89=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/managements_controller.rb | 46 ++++--- app/controllers/school_controller.rb | 22 +++- app/models/school.rb | 2 +- .../_contestant_work_attachment.html.erb | 110 ++++++++--------- app/views/forums/_file_form.html.erb | 2 +- app/views/forums/forum_form_add.html | 2 +- .../_reference_answers_attachments.html.erb | 114 +++++++++--------- app/views/layouts/base_management.html.erb | 13 +- .../_add_auto_users_trial.html.erb | 3 +- .../managements/_departments_list.html.erb | 12 +- .../_departments_part_list.html.erb | 12 +- app/views/managements/upload_logo.html.erb | 7 +- .../student_work/_revise_attachment.html.erb | 76 ++++++------ .../users/_user_homework_attachment.html.erb | 2 +- 14 files changed, 228 insertions(+), 195 deletions(-) diff --git a/app/controllers/managements_controller.rb b/app/controllers/managements_controller.rb index 6ffabcbbb..0d9dd4446 100644 --- a/app/controllers/managements_controller.rb +++ b/app/controllers/managements_controller.rb @@ -434,7 +434,7 @@ end @menu_type = 6 @sub_type = 2 @sx_order = params[:sx_order].blank? ? "desc" : params[:sx_order] - @department = ApplyAddDepartment.where(:status => 1) + @department = Department.where(:is_auth => 1) search=params[:search] if search.blank? @department = @department @@ -557,24 +557,28 @@ end def upload_logo @menu_type = 6 @sub_type = 1 + @next_type = 1 @school = School.find(params[:school]) - apply_schools = ApplyAddSchools.where("status = 0") - apply_school_ids = apply_schools.empty? ? "(-1)" : "(" + apply_schools.map{|sc| sc.school_id}.join(',') + ")" - if !params[:search].nil? - search = "%#{params[:search].to_s.strip.downcase}%" - @schools = School.where("id not in #{apply_school_ids} and #{School.table_name}.name like :p", :p => search) - else - @schools = School.where("id not in #{apply_school_ids}") - end end # 修改单位名称为其他 def school_upload_logo school = School.where(:id => params[:applied_id]).first - UserExtensions.where(:school_id => params[:applied_id]).update_all(:school_id => params[:school_id]) - Department.where(:school_id => params[:applied_id]).update_all(:school_id => params[:school_id]) ApplyAddSchools.where(:school_id => params[:applied_id]).destroy_all - ApplyAddDepartment.where(:school_id => params[:applied_id]).destroy_all + before_apply_departments = Department.where(:school_id => params[:applied_id]) + after_apply_deparments = Department.where(:school_id => params[:school_id]) + before_apply_departments.each do |department| + after_dep = Department.where(:school_id => params[:school_id], :name => department.name).first + if after_dep + UserExtensions.where(:school_id => params[:applied_id], :department_id => department.id).update_all(:department_id => after_dep.id) + else + new_department = Department.create(:name => department.name,:school_id =>params[:school_id], :is_auth => 1) + UserExtensions.where(:school_id => params[:applied_id]).update_all(:department_id => new_department.id) + end + ApplyAddDepartment.where(:department_id => department.id).destroy_all + department.destroy + end + UserExtensions.where(:school_id => params[:applied_id]).update_all(:school_id => params[:school_id]) school.destroy redirect_to departments_part_managements_path end @@ -583,8 +587,7 @@ end def school_message_update school = School.where(:name =>params[:schoolname]).first school_id = school.id - School.where(:id => school_id).update_all(:province => params[:province],:city =>params[:city],:address => params[:address]) - ApplyAddSchools.where(:school_id => school_id).update_all(:province => params[:province],:city =>params[:city],:address => params[:address]) + School.where(:id => school_id).update_all(:province => params[:province],:city =>params[:city],:address => params[:address],:shool_code => params[:school_code]) redirect_to departments_part_managements_path end @@ -654,6 +657,9 @@ end applied_department = ApplyAddDepartment.find(params[:id]) applied_message = AppliedMessage.where(:applied_id => applied_department.id, :applied_type => "ApplyAddDepartment") applied_message.update_all(:status => 1) + if applied_department.department + applied_department.department.update_attributes(:is_auth => 1) + end applied_department.update_attribute(:status, 1) unless applied_department.nil? AppliedMessage.create(:user_id => applied_department.user_id, :status => 1, :viewed => 0, :applied_id => applied_department.id, :applied_type => "ApplyAddDepartment", :name => applied_department.name ) UserExtensions.where(:user_id => applied_department.user_id).update_all(:department_id => applied_department.department_id) @@ -804,12 +810,12 @@ end # 单位审批修改 def all_schools apply_schools = ApplyAddSchools.where("status = 0") - apply_school_ids = apply_schools.empty? ? "(-1)" : "(" + apply_schools.map{|sc| sc.school_id}.join(',') + ")" + apply_school_ids = apply_schools.empty? ? "(#{params[:school_id].to_i})" : "(" + apply_schools.map{|sc| sc.school_id}.join(',') + ")" if !params[:search].nil? search = "%#{params[:search].to_s.strip.downcase}%" - @schools = School.where("id not in #{apply_school_ids} and #{School.table_name}.name like :p", :p => search) + @schools = School.where("id not in #{apply_school_ids} and id != #{params[:school_id].to_i} and #{School.table_name}.name like :p", :p => search) else - @schools = School.where("id not in #{apply_school_ids}") + @schools = School.where("id not in #{apply_school_ids} and id != #{params[:school_id].to_i}") end @edit_id = params[:school_id] @search = params[:search] @@ -835,6 +841,9 @@ end users.update_all(:school_id => school.id) ApplyAddDepartment.where(:school_id => aas.school_id).update_all(:school_id => school.id) + + + Department.where(:school_id => aas.school_id).update_all(:school_id => school.id) aas.school.destroy aas.update_attribute(:school_id, school.id) @@ -1251,6 +1260,7 @@ end @menu_type = 7 @sub_type = 3 @apply_action = School.where(:auto_users_trial => 1).order('updated_at desc') + @auto_school_ids = @apply_action.empty? ? "(-1)" : "(" + @apply_action.map(&:id).join(",") + ")" @apply_action_count = @apply_action.count limit = 20 @is_remote = true @@ -1578,7 +1588,7 @@ end @sub_type = 5 @type = trial_authorization_status params[:type] # sql = select * from apply_actions where dealer_id is null - @authorizations = ApplyAction.where(:container_type => "ApplyShixun", :status => @type, :dealer_id =>'').order("created_at desc") + @authorizations = ApplyAction.where(:container_type => "ApplyShixun", :status => @type).order("created_at desc") search = params[:search] unless search.blank? @authorizations = @authorizations.where(:container_id => Shixun.where(:id => @authorizations.map(&:container_id)).where("name like '%#{search}%'").map(&:id)).order("created_at desc") diff --git a/app/controllers/school_controller.rb b/app/controllers/school_controller.rb index d2e431a16..208cadae3 100644 --- a/app/controllers/school_controller.rb +++ b/app/controllers/school_controller.rb @@ -126,12 +126,22 @@ class SchoolController < ApplicationController chinese << char end end - if(condition == '') - @school = School.reorder('pinyin').page((params[:page].to_i || 1) - 1).per(100) - @school_count = School.count + if params[:no_school_ids] + if(condition == '') + @school = School.where("id not in #{params[:no_school_ids]}").reorder('pinyin').page((params[:page].to_i || 1) - 1).per(100) + @school_count = School.count + else + @school = School.where("id not in #{params[:no_school_ids]} and name like '%#{chinese.join("")}%' and pinyin like '%#{pinyin.join("")}%'").reorder('pinyin').page((params[:page].to_i || 1) - 1).per(100) + @school_count = School.where("id not in #{params[:no_school_ids]} and name like '%#{chinese.join("")}%' and pinyin like '%#{pinyin.join("")}%'").count + end else - @school = School.where("name like '%#{chinese.join("")}%' and pinyin like '%#{pinyin.join("")}%'").reorder('pinyin').page((params[:page].to_i || 1) - 1).per(100) - @school_count = School.where("name like '%#{chinese.join("")}%' and pinyin like '%#{pinyin.join("")}%'").count + if(condition == '') + @school = School.reorder('pinyin').page((params[:page].to_i || 1) - 1).per(100) + @school_count = School.count + else + @school = School.where("name like '%#{chinese.join("")}%' and pinyin like '%#{pinyin.join("")}%'").reorder('pinyin').page((params[:page].to_i || 1) - 1).per(100) + @school_count = School.where("name like '%#{chinese.join("")}%' and pinyin like '%#{pinyin.join("")}%'").count + end end result = [] @@ -171,6 +181,8 @@ class SchoolController < ApplicationController school.name = params[:name].strip school.pinyin = Pinyin.t(params[:name].strip, splitter: '') school.province = params[:province] + school.city = params[:city] + school.address = params[:address] #status 0未处理 1通过 2拒绝 applyschool = ApplyAddSchools.new diff --git a/app/models/school.rb b/app/models/school.rb index d07303e09..ab0b697c9 100644 --- a/app/models/school.rb +++ b/app/models/school.rb @@ -1,6 +1,6 @@ class School < ActiveRecord::Base default_scope :order => 'created_at desc' - attr_accessible :name, :province, :pinyin, :city, :address, :logo_link,:auto_users_trial + attr_accessible :name, :province, :pinyin, :city, :address, :logo_link,:auto_users_trial,:shool_code has_many :courses has_many :departments, :dependent => :destroy diff --git a/app/views/contestant_works/_contestant_work_attachment.html.erb b/app/views/contestant_works/_contestant_work_attachment.html.erb index ae88d4565..01344d163 100644 --- a/app/views/contestant_works/_contestant_work_attachment.html.erb +++ b/app/views/contestant_works/_contestant_work_attachment.html.erb @@ -1,56 +1,56 @@ -
    - - <% if defined?(container) && container && container.saved_attachments %> - <% container.attachments.each_with_index do |attachment, i| %> - - <%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename link_file', :readonly=>'readonly')%> - <%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %> - <%= l(:field_is_public)%>: - <%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false,:class => 'is_public')%> - <%= link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') unless attachment.id.nil? %> - <%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %> - -
    - <% end %> - <% container.saved_attachments.each_with_index do |attachment, i| %> - - <%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly=>'readonly')%> - <%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %> - <%= l(:field_is_public)%>: - <%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false,:class => 'is_public')%> - <%= link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') unless attachment.id.nil? %> - <%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %> - -
    - <% end %> - <% end %> -
    - <%= file_field_tag 'attachments[dummy][file]', - :id => '_file', - :class => ie8? ? '' : 'file_selector', - :multiple => true, - :onchange => 'addInputFiles(this);', - :style => ie8? ? '' : 'display:none', - :data => { - :max_file_size => Setting.attachment_max_size.to_i.kilobytes, - :max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)), - :max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i, - :upload_path => uploads_path(:format => 'js',:project =>nil), - :description_placeholder => l(:label_optional_description), - :field_is_public => l(:field_is_public), - :are_you_sure => l(:text_are_you_sure), - :file_count => l(:label_file_count), - :lebel_file_uploding => l(:lebel_file_uploding), - :delete_all_files => l(:text_are_you_sure_all) - } %> -
    -
    - - - -<% content_for :header_tags do %> - <%= javascript_include_tag 'attachments' %> +
    + + <% if defined?(container) && container && container.saved_attachments %> + <% container.attachments.each_with_index do |attachment, i| %> + + <%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename link_file', :readonly=>'readonly')%> + <%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %> + <%= l(:field_is_public)%>: + <%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false,:class => 'is_public')%> + <%= link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') unless attachment.id.nil? %> + <%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %> + +
    + <% end %> + <% container.saved_attachments.each_with_index do |attachment, i| %> + + <%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly=>'readonly')%> + <%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %> + <%= l(:field_is_public)%>: + <%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false,:class => 'is_public')%> + <%= link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') unless attachment.id.nil? %> + <%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %> + +
    + <% end %> + <% end %> +
    + <%= file_field_tag 'attachments[dummy][file]', + :id => '_file', + :class => ie8? ? '' : 'file_selector', + :multiple => true, + :onchange => 'addInputFiles(this);', + :style => ie8? ? '' : 'display:none', + :data => { + :max_file_size => Setting.attachment_max_size.to_i.kilobytes, + :max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)), + :max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i, + :upload_path => uploads_path(:format => 'js',:project =>nil), + :description_placeholder => l(:label_optional_description), + :field_is_public => l(:field_is_public), + :are_you_sure => l(:text_are_you_sure), + :file_count => l(:label_file_count), + :lebel_file_uploding => l(:lebel_file_uploding), + :delete_all_files => l(:text_are_you_sure_all) + } %> +
    +
    + + + +<% content_for :header_tags do %> + <%= javascript_include_tag 'attachments' %> <% end %> \ No newline at end of file diff --git a/app/views/forums/_file_form.html.erb b/app/views/forums/_file_form.html.erb index 93c2e089f..94e7a1ce7 100644 --- a/app/views/forums/_file_form.html.erb +++ b/app/views/forums/_file_form.html.erb @@ -77,7 +77,7 @@ - + 上传附件 diff --git a/app/views/forums/forum_form_add.html b/app/views/forums/forum_form_add.html index 78240dfaa..1464fb5ec 100644 --- a/app/views/forums/forum_form_add.html +++ b/app/views/forums/forum_form_add.html @@ -49,7 +49,7 @@
  • - + 上传附件 diff --git a/app/views/homework_common/_reference_answers_attachments.html.erb b/app/views/homework_common/_reference_answers_attachments.html.erb index 8344f1b0a..5e6f84d0b 100644 --- a/app/views/homework_common/_reference_answers_attachments.html.erb +++ b/app/views/homework_common/_reference_answers_attachments.html.erb @@ -1,58 +1,58 @@ -
    - - <% if defined?(container) && container && container.saved_attachments %> - <% container.attachments.each_with_index do |attachment, i| %> - - <%= text_field_tag("ref_attachments[p#{i}][filename]", attachment.filename, :class => 'filename link_file', :readonly=>'readonly')%> - <%= text_field_tag("ref_attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %> - <%= l(:field_is_public)%>: - <%= check_box_tag("ref_attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false,:class => 'is_public')%> - <%= link_to(''.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') unless attachment.id.nil? %> - <%= hidden_field_tag "ref_attachments[p#{i}][token]", "#{attachment.token}" %> - -
    - <% end %> - <% container.saved_attachments.each_with_index do |attachment, i| %> - - <%= text_field_tag("ref_attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly=>'readonly')%> - <%= text_field_tag("ref_attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %> - <%= l(:field_is_public)%>: - <%= check_box_tag("ref_attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false,:class => 'is_public')%> - <%= link_to(''.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') unless attachment.id.nil? %> - <%= hidden_field_tag "ref_attachments[p#{i}][token]", "#{attachment.token}" %> - -
    - <% end %> - <% end %> -
    - <%= file_field_tag 'ref_attachments[dummy][file]', - :id => 'ref_file', - :class => ie8? ? '' : 'file_selector', - :multiple => true, - :onchange => 'addInputFiles(this);', - :style => ie8? ? '' : 'display:none', - :data => { - :max_file_size => Setting.attachment_max_size.to_i.kilobytes, - :max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)), - :max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i, - :upload_path => uploads_path(:format => 'js',:project =>nil), - :description_placeholder => l(:label_optional_description), - :field_is_public => l(:field_is_public), - :are_you_sure => l(:text_are_you_sure), - :file_count => l(:label_file_count), - :lebel_file_uploding => l(:lebel_file_uploding), - :delete_all_files => l(:text_are_you_sure_all) - } %> -
    -
    - - - -<% content_for :header_tags do %> - <%= javascript_include_tag 'attachments' %> +
    + + <% if defined?(container) && container && container.saved_attachments %> + <% container.attachments.each_with_index do |attachment, i| %> + + <%= text_field_tag("ref_attachments[p#{i}][filename]", attachment.filename, :class => 'filename link_file', :readonly=>'readonly')%> + <%= text_field_tag("ref_attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %> + <%= l(:field_is_public)%>: + <%= check_box_tag("ref_attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false,:class => 'is_public')%> + <%= link_to(''.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') unless attachment.id.nil? %> + <%= hidden_field_tag "ref_attachments[p#{i}][token]", "#{attachment.token}" %> + +
    + <% end %> + <% container.saved_attachments.each_with_index do |attachment, i| %> + + <%= text_field_tag("ref_attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly=>'readonly')%> + <%= text_field_tag("ref_attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %> + <%= l(:field_is_public)%>: + <%= check_box_tag("ref_attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false,:class => 'is_public')%> + <%= link_to(''.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') unless attachment.id.nil? %> + <%= hidden_field_tag "ref_attachments[p#{i}][token]", "#{attachment.token}" %> + +
    + <% end %> + <% end %> +
    + <%= file_field_tag 'ref_attachments[dummy][file]', + :id => 'ref_file', + :class => ie8? ? '' : 'file_selector', + :multiple => true, + :onchange => 'addInputFiles(this);', + :style => ie8? ? '' : 'display:none', + :data => { + :max_file_size => Setting.attachment_max_size.to_i.kilobytes, + :max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)), + :max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i, + :upload_path => uploads_path(:format => 'js',:project =>nil), + :description_placeholder => l(:label_optional_description), + :field_is_public => l(:field_is_public), + :are_you_sure => l(:text_are_you_sure), + :file_count => l(:label_file_count), + :lebel_file_uploding => l(:lebel_file_uploding), + :delete_all_files => l(:text_are_you_sure_all) + } %> +
    +
    + + + +<% content_for :header_tags do %> + <%= javascript_include_tag 'attachments' %> <% end %> \ No newline at end of file diff --git a/app/views/layouts/base_management.html.erb b/app/views/layouts/base_management.html.erb index 57d2fc743..1f3deff18 100644 --- a/app/views/layouts/base_management.html.erb +++ b/app/views/layouts/base_management.html.erb @@ -34,13 +34,16 @@ <% when 5 %> 竞赛 <% when 6 %> - <%= @sub_type == 1 ? "单位列表" :"单位部门列表" %> + <% if @sub_type == 1%> + <%= link_to '单位列表',departments_part_managements_path() %> + <% if @next_type ==1 %> + > <%= @school.name %> + <% end %> + <% else %> + 单位部门列表 + <% end %> <% when 7 %> <%= @sub_type == 1 ? "用户列表" :(@sub_type == 2? "试用授权列表" : "自动授权列表") %> - - - - <% when 8 %> <%= @sub_type == 1 ? "作业回复":(@sub_type == 2? "实训反馈" : "课堂讨论区") %> <% when 9 %> diff --git a/app/views/managements/_add_auto_users_trial.html.erb b/app/views/managements/_add_auto_users_trial.html.erb index 8d9b2b1b2..1ebd464f9 100644 --- a/app/views/managements/_add_auto_users_trial.html.erb +++ b/app/views/managements/_add_auto_users_trial.html.erb @@ -41,10 +41,11 @@ d_lastSearchCondition = $(e.target).val().trim(); page = 1; //有新的搜索,页面重置为1 $.ajax({ - url: '<%= url_for(:controller => 'school',:action => 'on_search') %>' + '?name=' + e.target.value + '&school_id=' + $("input[name='occupation']").val() + '&page=' + d_page, + url: '<%= url_for(:controller => 'school',:action => 'on_search') %>' + '?name=' + e.target.value + '&school_id=' + $("input[name='occupation']").val() + '&page=' + d_page+"&no_school_ids=<%= @auto_school_ids %>", type: 'post', success: function (data) { d_schoolsResult = data.schools; + console.log(d_schoolsResult) count = data.count; maxPage = Math.ceil(count / 100); //最大页码值 if (d_schoolsResult.length != undefined && d_schoolsResult.length != 0) { diff --git a/app/views/managements/_departments_list.html.erb b/app/views/managements/_departments_list.html.erb index 992731543..87d3226a4 100644 --- a/app/views/managements/_departments_list.html.erb +++ b/app/views/managements/_departments_list.html.erb @@ -11,21 +11,21 @@ - <% @department.each_with_index do |department,index| %> + <% @department.each_with_index do |department,index| %> <%= index + 1 %> <%= department.name %> <%= School.where(:id => department.school_id).first %> - <%= UserExtensions.where(:department_id => department.department_id, :school_id => department.school_id ).count %> - <%= ApplyUserAuthentication.where(:auth_type => 2, :status => 1, :user_id => UserExtensions.where(:department_id => department.department_id,:school_id => department.school_id).map(&:user_id)).count%> + <%= UserExtensions.where(:department_id => department.id, :school_id => department.school_id ).count %> + <%= ApplyUserAuthentication.where(:auth_type => 2, :status => 1, :user_id => UserExtensions.where(:department_id => department.id,:school_id => department.school_id).map(&:user_id)).count%> <%= format_time department.created_at %> - <% if UserExtensions.where(:department_id => department.department_id,:school_id => department.school_id ).count == 0 %> - 删除  + <% if UserExtensions.where(:department_id => department.id,:school_id => department.school_id ).count == 0 %> + 删除  <% else %> -- <% end %> - <%= link_to '更改', update_department_managements_path(:school_id=> department.school_id,:department_id => department.department_id), :remote => true, :class => "application-default-link" %> + <%= link_to '更改', update_department_managements_path(:school_id=> department.school_id,:department_id => department.id), :remote => true, :class => "application-default-link" %> <% end %> diff --git a/app/views/managements/_departments_part_list.html.erb b/app/views/managements/_departments_part_list.html.erb index 3d74c33d7..4d2c35df7 100644 --- a/app/views/managements/_departments_part_list.html.erb +++ b/app/views/managements/_departments_part_list.html.erb @@ -3,13 +3,14 @@ ID LOGO - 单位名称 - 地区 + 单位名称 + 地区 详细地址 用户数 部门数 - 创建于 color-light-green ml5"> - 修改时间 color-light-green ml5"> + 创建于 color-light-green ml5"> + 修改时间 color-light-green ml5"> + 学校标识码 @@ -31,7 +32,8 @@ <%= schools.departments.count %> <%= format_time schools.created_at %> <%= format_time schools.updated_at %> - + <%= schools.shool_code %> + 删除  <%#= link_to("修改", upload_logo_school_path(schools.id,:schools_name => @schools_name), :class => 'icon icon-copy') %> diff --git a/app/views/managements/upload_logo.html.erb b/app/views/managements/upload_logo.html.erb index eb3fda2a6..45516e2ec 100644 --- a/app/views/managements/upload_logo.html.erb +++ b/app/views/managements/upload_logo.html.erb @@ -70,10 +70,15 @@
  • - "> +
    请填写单位的详细地址
  • +
  • + + +
    +
  • 取消 确定 diff --git a/app/views/student_work/_revise_attachment.html.erb b/app/views/student_work/_revise_attachment.html.erb index 362070b3b..6b07ecf07 100644 --- a/app/views/student_work/_revise_attachment.html.erb +++ b/app/views/student_work/_revise_attachment.html.erb @@ -1,38 +1,38 @@ -<% revise_attachment = work.attachments.where("attachtype = 7").first %> -<% if @homework.end_time < Time.now %> - <% if revise_attachment && work.user != User.current %> -
    - 作业修订附件 -
    -
    - 追加附件: - <%= render :partial => 'work_attachments_status', :locals => {:attachments => work.attachments.where("attachtype = 7"), :status => 2} %> - <% unless revise_attachment.description == "" %> - 追加理由:

    <%=revise_attachment.description %>

    - <% end %> -
    -
    -
    注意:此处的附件是在作业截止日期过后提交的
    -
    - <% end %> - <% if work.user == User.current && !User.current.allowed_to?(:as_teacher, @homework.course) %> -
    - 作业修订附件 -
    - <% if revise_attachment %> -
    - 追加附件: - <%= render :partial => 'work_attachments_status', :locals => {:attachments => work.attachments.where("attachtype = 7"), :status => 1} %> - <% unless revise_attachment.description == "" %> - 追加理由:

    <%=revise_attachment.description %>

    - <% end %> -
    -
    注意:此处的附件是在作业截止日期过后提交的
    -
    - <% end %> -
    - - <% end %> -<% end %> +<% revise_attachment = work.attachments.where("attachtype = 7").first %> +<% if @homework.end_time < Time.now %> + <% if revise_attachment && work.user != User.current %> +
    + 作业修订附件 +
    +
    + 追加附件: + <%= render :partial => 'work_attachments_status', :locals => {:attachments => work.attachments.where("attachtype = 7"), :status => 2} %> + <% unless revise_attachment.description == "" %> + 追加理由:

    <%=revise_attachment.description %>

    + <% end %> +
    +
    +
    注意:此处的附件是在作业截止日期过后提交的
    +
    + <% end %> + <% if work.user == User.current && !User.current.allowed_to?(:as_teacher, @homework.course) %> +
    + 作业修订附件 +
    + <% if revise_attachment %> +
    + 追加附件: + <%= render :partial => 'work_attachments_status', :locals => {:attachments => work.attachments.where("attachtype = 7"), :status => 1} %> + <% unless revise_attachment.description == "" %> + 追加理由:

    <%=revise_attachment.description %>

    + <% end %> +
    +
    注意:此处的附件是在作业截止日期过后提交的
    +
    + <% end %> +
    + + <% end %> +<% end %> diff --git a/app/views/users/_user_homework_attachment.html.erb b/app/views/users/_user_homework_attachment.html.erb index fc530a086..6d7250fa5 100644 --- a/app/views/users/_user_homework_attachment.html.erb +++ b/app/views/users/_user_homework_attachment.html.erb @@ -53,7 +53,7 @@
    - + 上传附件 From 818631b573dc7cff9b23c94658fe0498f658e94f Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 13 Oct 2017 19:07:06 +0800 Subject: [PATCH 29/32] =?UTF-8?q?=E6=B7=BB=E5=8A=A0gitlab=20API=EF=BC=8C?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=BD=93=E5=89=8Duser=E7=9A=84=E6=9F=90?= =?UTF-8?q?=E4=B8=AA=E9=A1=B9=E7=9B=AEid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/games_controller.rb | 8 +++++++- lib/gitlab-cli/lib/gitlab/client/projects.rb | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index d5522b898..5509707df 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -91,7 +91,13 @@ class GamesController < ApplicationController # git_repository_url @myshixun, "Myshixun" # @st 0 实践任务 1 选择题任务 def show - # 展示全部实训 + # g = Gitlab.client + # g_name = g.project(@myshixun.gpid).try(:name) + # if g_name.include?("-") + # g.delete_project() + # end + # 展示全部实训 + # git_myshixun_url_ip @myshixun, user_id @is_subject = params[:is_subject] if @game.status == 1 # 放置页面ajax数据还没获取就关闭 diff --git a/lib/gitlab-cli/lib/gitlab/client/projects.rb b/lib/gitlab-cli/lib/gitlab/client/projects.rb index a773c29bb..7ff2bb91c 100644 --- a/lib/gitlab-cli/lib/gitlab/client/projects.rb +++ b/lib/gitlab-cli/lib/gitlab/client/projects.rb @@ -19,6 +19,10 @@ class Gitlab::Client end end + def current_user_project(user_id, project_name) + get("/projects/current_user_projects?user_id=#{user_id}&project_name=#{project_name}") + end + # Gets information about a project. # # @example From eab4e2a88ca2257ed9b94076065563c6b6935c9b Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 13 Oct 2017 19:19:03 +0800 Subject: [PATCH 30/32] =?UTF-8?q?PHP/Web=E5=AE=9E=E8=AE=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/games/_code_actions.html.erb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/views/games/_code_actions.html.erb b/app/views/games/_code_actions.html.erb index 16f0c03fb..14b1654b5 100644 --- a/app/views/games/_code_actions.html.erb +++ b/app/views/games/_code_actions.html.erb @@ -1,8 +1,11 @@ <% if @myshixun.shixun.try(:language) == "PHP/Web" %> - 查看网页效果 -<% end %> + " target="_blank" class="shixun-task-btn task-btn-orange mr15 mt8"> + 查看网页效果 + + +<%# end %> <% if @st == 0 %>
    "> 加载上次通过的代码 From 3733b3ed92bd992705f2c267679d6c2dc51e5f74 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 13 Oct 2017 19:26:04 +0800 Subject: [PATCH 31/32] =?UTF-8?q?PHP=E5=AE=9E=E8=AE=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/games/_code_actions.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/games/_code_actions.html.erb b/app/views/games/_code_actions.html.erb index e65ff207d..ad78c8a64 100644 --- a/app/views/games/_code_actions.html.erb +++ b/app/views/games/_code_actions.html.erb @@ -5,7 +5,7 @@ 查看网页效果 -<%# end %> +<% end %> <% if @st == 0 %>
    "> 加载上次通过的代码 From 7ff96b64ad283b376b056d1f93f931d5b6163179 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 13 Oct 2017 19:31:14 +0800 Subject: [PATCH 32/32] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E5=BE=97=E5=88=86bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_common_controller.rb | 10 +++++----- lib/tasks/homework_publishtime.rake | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb index 26f89d0e3..c35555780 100644 --- a/app/controllers/homework_common_controller.rb +++ b/app/controllers/homework_common_controller.rb @@ -335,11 +335,11 @@ class HomeworkCommonController < ApplicationController if @homework.homework_type == 4 if @homework_detail_manual.answer_open_evaluation != params[:answer_open_evaluation].to_i @homework_detail_manual.answer_open_evaluation = params[:answer_open_evaluation].to_i - # if @homework.end_time < Time.now - # @homework.student_works.each do |student_work| - # set_shixun_final_score @homework, student_work, @homework_detail_manual.answer_open_evaluation - # end - # end + if @homework.end_time < Time.now + @homework.student_works.each do |student_work| + set_shixun_final_score @homework, student_work, @homework_detail_manual.answer_open_evaluation + end + end end @homework.score_open = params[:homework_score_open] ? 1 : 0 else diff --git a/lib/tasks/homework_publishtime.rake b/lib/tasks/homework_publishtime.rake index 686803b80..273e2a2ec 100644 --- a/lib/tasks/homework_publishtime.rake +++ b/lib/tasks/homework_publishtime.rake @@ -14,7 +14,7 @@ namespace :homework_publishtime do if myshixun.nil? 0 else - myshixun.games.select{|game| game.status == 2 && game.answer_open == 0}.count + myshixun.games.select{|game| game.status == 2 && !game.answer_open}.count end end