From 9da18bcad4dc7c39ad4de28a96e308ed25fa90cf Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 31 Jul 2015 13:58:27 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E8=80=81=E5=B8=88=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E7=BB=93=E6=9E=9C=E7=9A=84=E8=BF=94=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_common_controller.rb | 4 +++- db/schema.rb | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb index 918c1b8b9..f48633a53 100644 --- a/app/controllers/homework_common_controller.rb +++ b/app/controllers/homework_common_controller.rb @@ -364,7 +364,9 @@ class HomeworkCommonController < ApplicationController client.request(request) end result = JSON.parse(res.body) - @result = result[:result][0][:status] + result[:results].each do |re| + @result = re[:status] + end end private diff --git a/db/schema.rb b/db/schema.rb index 3791eb248..29aeb1f16 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20150730093403) do +ActiveRecord::Schema.define(:version => 20150730130816) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -635,6 +635,7 @@ ActiveRecord::Schema.define(:version => 20150730093403) do t.datetime "created_at", :null => false t.datetime "updated_at", :null => false t.integer "result", :default => 0 + t.text "error_msg" end create_table "homework_users", :force => true do |t| From b045b2a648e9c546895b104b857aa7ea46c0b1f4 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 31 Jul 2015 14:03:19 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=BB=E9=A1=B5?= =?UTF-8?q?=E7=95=99=E8=A8=80=E5=A4=9A=E5=87=BA=E7=9A=84=EF=BC=9B=E4=B8=A4?= =?UTF-8?q?=E4=B8=AA=E5=86=92=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_user_jour_reply.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/users/_user_jour_reply.html.erb b/app/views/users/_user_jour_reply.html.erb index c3b3d86c1..8f775c0fa 100644 --- a/app/views/users/_user_jour_reply.html.erb +++ b/app/views/users/_user_jour_reply.html.erb @@ -2,8 +2,8 @@
<%= link_to image_tag(url_to_avatar(reply.user),:width => '32',:height => '32'), user_path(reply.user),:class => "users_pic_sub fl mr5" %>
- <%= link_to "#{reply.user.login} : ".html_safe, user_path(reply.user),:class => 'course_name fl c_blue02 ', :target => "_blank"%> -  回复:  + <%= link_to "#{reply.user.login} ".html_safe, user_path(reply.user),:class => 'course_name fl c_blue02 ', :target => "_blank"%> +  回复  <%= link_to "#{parent_jour.user.login} : ".html_safe, user_path(parent_jour.user),:class => 'course_name fl c_blue02 mr5 ', :target => "_blank"%>
<%= reply.notes.html_safe %> From a52c9062170586f16c4825778fc505853ee7f419 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 31 Jul 2015 14:18:32 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=95=99=E8=A8=80?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E6=8F=92=E4=BB=B6=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_user_jour_reply.html.erb | 14 +++++----- public/javascripts/user.js | 34 +++++++++++++++++++++++ 2 files changed, 41 insertions(+), 7 deletions(-) diff --git a/app/views/users/_user_jour_reply.html.erb b/app/views/users/_user_jour_reply.html.erb index 8f775c0fa..eb44852bb 100644 --- a/app/views/users/_user_jour_reply.html.erb +++ b/app/views/users/_user_jour_reply.html.erb @@ -13,24 +13,24 @@ <%= time_tag(reply.created_on).html_safe%>
- <%= link_to l(:button_reply),'javascript:void(0);',:nhname=>"reply_btn", :class => "ml5 c_purple" %> + <%= link_to l(:button_reply),'javascript:void(0);',:nhname=>"sub_reply_btn", :class => "ml5 c_purple" %> <% if User.current.admin? || reply.user == User.current%> <%= link_to(l(:label_newfeedback_delete), {:controller => 'words', :action => 'destroy', :object_id => reply, :user_id => reply.user}, :remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "c_purple ml5", :title => l(:button_delete)) %> <% end %>
- <% end %>
From e2ec37026cfd09c6169b4a7d96b26bb4fb592fe9 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 31 Jul 2015 14:46:05 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E4=B8=8D=E6=98=AF=E8=87=AA=E5=B7=B1?= =?UTF-8?q?=E7=9A=84=E4=B8=AA=E4=BA=BA=E4=B8=BB=E9=A1=B5=E4=B9=9F=E6=98=BE?= =?UTF-8?q?=E7=A4=BAtop=5Fview?= 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, 2 deletions(-) diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 2a9e96432..e53d734c6 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -1,6 +1,5 @@ <%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg',"user" %> <% @center_flag = (User.current == @user) %> -<% if @center_flag %>
<% if @user.allowed_to?(:add_project, nil, :global => true) %> @@ -17,7 +16,6 @@ <% end %>
-<% end %>
From a74409fa048e7a3a58d9a74c868e4037e9fa785e Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 31 Jul 2015 15:18:57 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E5=9B=9E=E5=A4=8D=E5=AD=90=E7=95=99?= =?UTF-8?q?=E8=A8=80=E4=B8=8D=E6=88=90=E5=8A=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_user_jour_reply.html.erb | 2 +- app/views/words/create_reply.js.erb | 5 ++++- public/javascripts/user.js | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/views/users/_user_jour_reply.html.erb b/app/views/users/_user_jour_reply.html.erb index eb44852bb..8822fdc56 100644 --- a/app/views/users/_user_jour_reply.html.erb +++ b/app/views/users/_user_jour_reply.html.erb @@ -26,7 +26,7 @@ - +

取消 diff --git a/app/views/words/create_reply.js.erb b/app/views/words/create_reply.js.erb index a7f0b42c7..6aad1bfb5 100644 --- a/app/views/words/create_reply.js.erb +++ b/app/views/words/create_reply.js.erb @@ -1,7 +1,10 @@ <% if @save_succ %> <% if !@jfm.nil? && @jfm.jour_type == 'Principal' %> $("#<%= @jfm.m_parent_id%>").children("div[nhname='reply_list']").prepend("<%= escape_javascript( render(:partial => 'users/user_jour_reply',:locals => {:reply=>@jfm} )) %>"); - $("#<%= @jfm.m_reply_id%>").children("div[nhname='div_form']").hide(); + div_1 = $("#<%= @jfm.m_reply_id%>").children("div[nhname='div_form']"); + div_1.hide(); + div_2 = $("#<%= @jfm.m_reply_id%>").children("div[nhname='sub_div_form']"); + div_2.hide(); <% else %> var pre_append = $('<%= j( diff --git a/public/javascripts/user.js b/public/javascripts/user.js index 30bc44120..c7690a015 100644 --- a/public/javascripts/user.js +++ b/public/javascripts/user.js @@ -110,7 +110,7 @@ $(function(){ params.container = $(this).parent().parent('div'); params.div_form = $("div[nhname='sub_div_form']",params.container); params.form = $("form",params.div_form); - params.textarea = $("textarea[name='sub_user_notes']",params.div_form); + params.textarea = $("textarea[name='user_notes']",params.div_form); params.textarea.prev('div').css("height","60px"); params.contentmsg = $("p[nhname='sub_contentmsg']",params.div_form); params.toolbar_container = $("div[nhname='sub_toolbar_container']",params.div_form); From d5e97c6131f9acc33eab7cf57ffc74514233788e Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 31 Jul 2015 15:25:01 +0800 Subject: [PATCH 7/8] =?UTF-8?q?1=E3=80=81=E7=95=99=E8=A8=80=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E6=98=BE=E7=A4=BAtop=5Fview=202=E3=80=81=E7=95=99?= =?UTF-8?q?=E8=A8=80=E7=95=8C=E9=9D=A2=E5=88=A0=E9=99=A4=E9=83=A8=E5=88=86?= =?UTF-8?q?=E7=95=99=E8=A8=80=E5=90=8E=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_user_jour_reply.html.erb | 68 ++++++++++++----------- app/views/users/user_newfeedback.html.erb | 14 ++++- 2 files changed, 46 insertions(+), 36 deletions(-) diff --git a/app/views/users/_user_jour_reply.html.erb b/app/views/users/_user_jour_reply.html.erb index 8822fdc56..ee94cb35a 100644 --- a/app/views/users/_user_jour_reply.html.erb +++ b/app/views/users/_user_jour_reply.html.erb @@ -1,38 +1,40 @@ - <% parent_jour = JournalsForMessage.where("id = #{reply.m_reply_id}").first %> -
- <%= link_to image_tag(url_to_avatar(reply.user),:width => '32',:height => '32'), user_path(reply.user),:class => "users_pic_sub fl mr5" %> -
- <%= link_to "#{reply.user.login} ".html_safe, user_path(reply.user),:class => 'course_name fl c_blue02 ', :target => "_blank"%> -  回复  - <%= link_to "#{parent_jour.user.login} : ".html_safe, user_path(parent_jour.user),:class => 'course_name fl c_blue02 mr5 ', :target => "_blank"%> -
- <%= reply.notes.html_safe %> +<% parent_jour = JournalsForMessage.where("id = #{reply.m_reply_id}").first %> +<% if parent_jour%> +
+ <%= link_to image_tag(url_to_avatar(reply.user),:width => '32',:height => '32'), user_path(reply.user),:class => "users_pic_sub fl mr5" %> +
+ <%= link_to "#{reply.user.login} ".html_safe, user_path(reply.user),:class => 'course_name fl c_blue02 ', :target => "_blank"%> +  回复  + <%= link_to "#{parent_jour.user.login} : ".html_safe, user_path(parent_jour.user),:class => 'course_name fl c_blue02 mr5 ', :target => "_blank"%> +
+ <%= reply.notes.html_safe %> +
-
<%= time_tag(reply.created_on).html_safe%> -
- <%= link_to l(:button_reply),'javascript:void(0);',:nhname=>"sub_reply_btn", :class => "ml5 c_purple" %> - <% if User.current.admin? || reply.user == User.current%> - <%= link_to(l(:label_newfeedback_delete), {:controller => 'words', :action => 'destroy', :object_id => reply, :user_id => reply.user}, - :remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "c_purple ml5", :title => l(:button_delete)) %> - <% end %> -
-
- -
-
\ No newline at end of file +
+<% end%> \ No newline at end of file diff --git a/app/views/users/user_newfeedback.html.erb b/app/views/users/user_newfeedback.html.erb index 91c049f7a..a8107ce5f 100644 --- a/app/views/users/user_newfeedback.html.erb +++ b/app/views/users/user_newfeedback.html.erb @@ -1,8 +1,16 @@ +
+ + <% if @user.user_extensions.identity == 0 && @user.allowed_to?(:add_course, nil, :global => true) %> + 新建课程 + <% end %> +
+
+ <%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg',"user" %>
-
-

用户留言

-
+ + +
<%= form_for('new_form',:url => leave_user_message_path(@user.id),:method => "post") do |f|%> From d5cf0c65a7311a6ab54d837151bfa6358f1a76b1 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 31 Jul 2015 15:38:50 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E9=AA=8C=E8=AF=81=E6=AD=A3=E7=A1=AE?= =?UTF-8?q?=E5=92=8C=E9=94=99=E8=AF=AF=E4=B9=8B=E5=90=8E=EF=BC=8C=E5=8F=AF?= =?UTF-8?q?=E4=BB=A5=E7=BB=A7=E7=BB=AD=E7=82=B9=E5=87=BB=E8=BF=9B=E8=A1=8C?= =?UTF-8?q?=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/homework_common/programing_test.js.erb | 2 +- public/stylesheets/public.css | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/homework_common/programing_test.js.erb b/app/views/homework_common/programing_test.js.erb index b6bcfdc86..74ec9439a 100644 --- a/app/views/homework_common/programing_test.js.erb +++ b/app/views/homework_common/programing_test.js.erb @@ -1,2 +1,2 @@ -$("#test_send_<%= @index%>").replaceWith(" fl ml5 mt1'><%= @result == 0 ? '正确' : '错误'%>"); +$("#test_send_<%= @index%>").replaceWith(" fl ml5 mt1' onclick='programing_test(<%= @index%>)' id='test_send_<%= @index%>'><%= @result == 0 ? '正确' : '错误'%>"); $("#test_result_<%= @index%>").val("<%= @result%>"); \ No newline at end of file diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index 1bf889cba..576a9da0c 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -170,9 +170,9 @@ a:hover.grey_btn{ background:#717171; color:#fff;} a.green_btn{background:#28be6c;color:#fff;font-size:14px; font-weight:normal; padding:2px 8px; text-align:center;cursor: pointer;} a:hover.green_btn{ background:#14ad5a;} .blue_btn{ background:#64bdd9; color:#fff; font-size:14px; font-weight:normal;padding:2px 8px; text-align:center;} -a.blue_btn{background:#64bdd9;color:#fff;font-size:14px; font-weight:normal; padding:2px 8px; text-align:center;} +a.blue_btn{background:#64bdd9;color:#fff;font-size:14px; font-weight:normal; padding:2px 8px; text-align:center;cursor: pointer;} .red_btn{ background:red; color:#fff; font-size:14px; font-weight:normal;padding:2px 8px; text-align:center;} -a.red_btn{background:red; color:#fff;font-size:14px; font-weight:normal; padding:2px 8px; text-align:center;} +a.red_btn{background:red; color:#fff;font-size:14px; font-weight:normal; padding:2px 8px; text-align:center;cursor: pointer;} a.orange_btn_homework{background:#d63502;color:#fff;font-size:14px; font-weight:normal; padding:2px 10px; text-align:center;} a:hover.blue_btn{ background:#329cbd;cursor: pointer;} a.orange_btn{ background:#ff5722;color:#fff;font-size:14px; font-weight:normal; padding:2px 10px; text-align:center; }