Merge branch 'szzh' into dev_hjq
This commit is contained in:
commit
b42d8c6d2c
|
@ -364,7 +364,9 @@ class HomeworkCommonController < ApplicationController
|
||||||
client.request(request)
|
client.request(request)
|
||||||
end
|
end
|
||||||
result = JSON.parse(res.body)
|
result = JSON.parse(res.body)
|
||||||
@result = result[:result][0][:status]
|
result[:results].each do |re|
|
||||||
|
@result = re[:status]
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
$("#test_send_<%= @index%>").replaceWith("<span class='<%= @result == 0 ? 'green_btn' : 'red_btn'%> fl ml5 mt1'><%= @result == 0 ? '正确' : '错误'%></span>");
|
$("#test_send_<%= @index%>").replaceWith("<a class='<%= @result == 0 ? 'green_btn' : 'red_btn'%> fl ml5 mt1' onclick='programing_test(<%= @index%>)' id='test_send_<%= @index%>'><%= @result == 0 ? '正确' : '错误'%></a>");
|
||||||
$("#test_result_<%= @index%>").val("<%= @result%>");
|
$("#test_result_<%= @index%>").val("<%= @result%>");
|
|
@ -164,7 +164,7 @@
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<div class="subNav ">
|
<div class="subNav ">
|
||||||
<%= link_to "留言",feedback_path(User.current),:class => "f14 c_blue02"%>
|
<%= link_to "留言",feedback_path(@user),:class => "f14 c_blue02"%>
|
||||||
</div>
|
</div>
|
||||||
</div><!--侧导航 end-->
|
</div><!--侧导航 end-->
|
||||||
|
|
||||||
|
|
|
@ -1,38 +1,40 @@
|
||||||
<% parent_jour = JournalsForMessage.where("id = #{reply.m_reply_id}").first %>
|
<% parent_jour = JournalsForMessage.where("id = #{reply.m_reply_id}").first %>
|
||||||
<div class="mes_box02" id = '<%= reply.id %>'>
|
<% 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" %>
|
<div class="mes_box02" id = '<%= reply.id %>'>
|
||||||
<div class=" mes_box02_info fl">
|
<%= 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"%>
|
<div class=" mes_box02_info fl">
|
||||||
<span class="fl c_grey"> 回复: </span>
|
<%= 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"%>
|
<span class="fl c_grey"> 回复 </span>
|
||||||
<div class="cl">
|
<%= 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 %>
|
<div class="cl">
|
||||||
|
<%= reply.notes.html_safe %>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<span class="c_grey fr">
|
<span class="c_grey fr">
|
||||||
<%= time_tag(reply.created_on).html_safe%>
|
<%= time_tag(reply.created_on).html_safe%>
|
||||||
</span>
|
</span>
|
||||||
<div class="fr cr">
|
<div class="fr cr">
|
||||||
<%= 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%>
|
<% 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},
|
<%= 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)) %>
|
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "c_purple ml5", :title => l(:button_delete)) %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
|
||||||
<div nhname='div_form' class="mt10 ml40" style="display:none;">
|
|
||||||
<form action="<%= url_for(:controller => 'words', :action => 'create_reply') %>" data-remote="true" method="post">
|
|
||||||
<input id="reference_id" name="reference_id" type="hidden" value="<%= (reply.m_parent_id.nil? || reply.m_parent_id==0 ) ? reply.id : reply.m_parent_id %>">
|
|
||||||
<input id="reference_user_id" name="reference_user_id" type="hidden" value="<%= reply.user.id %>">
|
|
||||||
<input id="reference_message_id" name="reference_message_id" type="hidden" value="<%= reply.id %>">
|
|
||||||
<input id="show_name" name="show_name" type="hidden" value="true">
|
|
||||||
<textarea name='user_notes' style="display:none;"></textarea>
|
|
||||||
<p nhname='contentmsg'></p>
|
|
||||||
<div nhname='toolbar_container' style="float:left;padding-top:3px;"></div>
|
|
||||||
<a nhname="cancel_btn" href="javascript:;" class="grey_n_btn fr" style="margin-top:3px;">取消</a>
|
|
||||||
<a nhname="submit_btn" href="javascript:;" class="blue_n_btn fr mr5" style="margin-top:3px;">发布</a>
|
|
||||||
</form>
|
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div>
|
<div nhname='sub_div_form' class="mt10 ml40" style="display:none;">
|
||||||
<div class="cl"></div>
|
<form action="<%= url_for(:controller => 'words', :action => 'create_reply') %>" data-remote="true" method="post">
|
||||||
</div><!--mes_box02 end-->
|
<input id="reference_id" name="reference_id" type="hidden" value="<%= (reply.m_parent_id.nil? || reply.m_parent_id==0 ) ? reply.id : reply.m_parent_id %>">
|
||||||
|
<input id="reference_user_id" name="reference_user_id" type="hidden" value="<%= reply.user.id %>">
|
||||||
|
<input id="reference_message_id" name="reference_message_id" type="hidden" value="<%= reply.id %>">
|
||||||
|
<input id="show_name" name="show_name" type="hidden" value="true">
|
||||||
|
<textarea name='user_notes' style="display:none;"></textarea>
|
||||||
|
<p nhname='sub_contentmsg'></p>
|
||||||
|
<div nhname='sub_toolbar_container' style="float:left;padding-top:3px;"></div>
|
||||||
|
<a nhname="sub_cancel_btn" href="javascript:void(0);" class="grey_n_btn fr" style="margin-top:3px;">取消</a>
|
||||||
|
<a nhname="sub_submit_btn" href="javascript:void(0);" class="blue_n_btn fr mr5" style="margin-top:3px;">发布</a>
|
||||||
|
</form>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div><!--mes_box02 end-->
|
||||||
|
<% end%>
|
|
@ -1,6 +1,5 @@
|
||||||
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg',"user" %>
|
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg',"user" %>
|
||||||
<% @center_flag = (User.current == @user) %>
|
<% @center_flag = (User.current == @user) %>
|
||||||
<% if @center_flag %>
|
|
||||||
<div class="top_new">
|
<div class="top_new">
|
||||||
<span class="<%= (@user.user_extensions.identity == 0 && @user.allowed_to?(:add_course, nil, :global => true)) ? 'top_new_bg' : 'top_newcourses_bg'%> fl"></span>
|
<span class="<%= (@user.user_extensions.identity == 0 && @user.allowed_to?(:add_course, nil, :global => true)) ? 'top_new_bg' : 'top_newcourses_bg'%> fl"></span>
|
||||||
<% if @user.allowed_to?(:add_project, nil, :global => true) %>
|
<% if @user.allowed_to?(:add_project, nil, :global => true) %>
|
||||||
|
@ -17,7 +16,6 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<div id="RSide" class="fl">
|
<div id="RSide" class="fl">
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,16 @@
|
||||||
|
<div class="top_new">
|
||||||
|
<span class="<%= (@user.user_extensions.identity == 0 && @user.allowed_to?(:add_course, nil, :global => true)) ? 'top_new_bg' : 'top_newcourses_bg'%> fl"></span>
|
||||||
|
<% if @user.user_extensions.identity == 0 && @user.allowed_to?(:add_course, nil, :global => true) %>
|
||||||
|
<a href="<%= url_for(:controller => 'courses', :action => 'new',) %>" class="green_n_btn fr mt2" target="_blank">新建课程</a>
|
||||||
|
<% end %>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg',"user" %>
|
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg',"user" %>
|
||||||
<div id="RSide" class="fl">
|
<div id="RSide" class="fl">
|
||||||
<div class="users_r_top">
|
<!--<div class="users_r_top">-->
|
||||||
<h2 class="users_r_h2">用户留言</h2>
|
<!--<h2 class="users_r_h2">用户留言</h2>-->
|
||||||
</div>
|
<!--</div>-->
|
||||||
<div class="message_box mb10">
|
<div class="message_box mb10">
|
||||||
<div nhname='new_message' style="display:none;">
|
<div nhname='new_message' style="display:none;">
|
||||||
<%= form_for('new_form',:url => leave_user_message_path(@user.id),:method => "post") do |f|%>
|
<%= form_for('new_form',:url => leave_user_message_path(@user.id),:method => "post") do |f|%>
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
<% if @save_succ %>
|
<% if @save_succ %>
|
||||||
<% if !@jfm.nil? && @jfm.jour_type == 'Principal' %>
|
<% 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_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 %>
|
<% else %>
|
||||||
|
|
||||||
var pre_append = $('<%= j(
|
var pre_append = $('<%= j(
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
#
|
#
|
||||||
# It's strongly recommended to check this file into your version control system.
|
# 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|
|
create_table "activities", :force => true do |t|
|
||||||
t.integer "act_id", :null => false
|
t.integer "act_id", :null => false
|
||||||
|
@ -635,6 +635,7 @@ ActiveRecord::Schema.define(:version => 20150730093403) do
|
||||||
t.datetime "created_at", :null => false
|
t.datetime "created_at", :null => false
|
||||||
t.datetime "updated_at", :null => false
|
t.datetime "updated_at", :null => false
|
||||||
t.integer "result", :default => 0
|
t.integer "result", :default => 0
|
||||||
|
t.text "error_msg"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "homework_users", :force => true do |t|
|
create_table "homework_users", :force => true do |t|
|
||||||
|
|
|
@ -104,6 +104,40 @@ $(function(){
|
||||||
},300);
|
},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(){
|
$("div[nhname='new_message']").each(function(){
|
||||||
var params = {};
|
var params = {};
|
||||||
params.kindutil = K;
|
params.kindutil = K;
|
||||||
|
|
|
@ -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.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;}
|
a:hover.green_btn{ background:#14ad5a;}
|
||||||
.blue_btn{ background:#64bdd9; color:#fff; font-size:14px; font-weight:normal;padding:2px 8px; text-align:center;}
|
.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;}
|
.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.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: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; }
|
a.orange_btn{ background:#ff5722;color:#fff;font-size:14px; font-weight:normal; padding:2px 10px; text-align:center; }
|
||||||
|
|
Loading…
Reference in New Issue