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/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/app/views/layouts/base_users_new.html.erb b/app/views/layouts/base_users_new.html.erb index a8233253f..b5258c6aa 100644 --- a/app/views/layouts/base_users_new.html.erb +++ b/app/views/layouts/base_users_new.html.erb @@ -164,7 +164,7 @@ <% end %> diff --git a/app/views/users/_user_jour_reply.html.erb b/app/views/users/_user_jour_reply.html.erb index c3b3d86c1..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=>"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/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 %>
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|%> 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/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| diff --git a/public/javascripts/user.js b/public/javascripts/user.js index 5cf18590a..c7690a015 100644 --- a/public/javascripts/user.js +++ b/public/javascripts/user.js @@ -104,6 +104,40 @@ $(function(){ },300); }); + $("a[nhname='sub_reply_btn']").live('click',function(){ + var params = {}; + params.kindutil = K; + 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='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); + params.cancel_btn = $("a[nhname='sub_cancel_btn']",params.div_form); + params.submit_btn = $("a[nhname='sub_submit_btn']",params.div_form); + if(params.textarea.data('init') == undefined){ + params.editor = init_editor(params); + init_form(params); + params.cancel_btn.click(function(){ + nh_reset_form(params); + toggleAndSettingWordsVal(params.div_form, params.textarea); + }); + params.submit_btn.click(function(){ + params.form.submit(); + }); + params.textarea.data('init',1); + } + params.cancel_btn.click(); + setTimeout(function(){ + if(!params.div_form.is(':hidden')){ + params.textarea.show(); + params.textarea.focus(); + params.textarea.hide(); + } + },300); + }); + $("div[nhname='new_message']").each(function(){ var params = {}; params.kindutil = K; 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; }