不上线的先还原

This commit is contained in:
yuanke 2016-06-16 14:08:54 +08:00
parent 82ebd1e4c9
commit 049a21c7d0
3 changed files with 11 additions and 15 deletions

View File

@ -14,10 +14,9 @@ class OrgSubfieldsController < ApplicationController
SubfieldSubdomainDir.create(:org_subfield_id => @subfield.id, :name => params[:sub_dir].downcase) SubfieldSubdomainDir.create(:org_subfield_id => @subfield.id, :name => params[:sub_dir].downcase)
end end
end end
#默认类型为帖子 @subfield.update_attributes(:field_type => params[:field_type])
@subfield.update_attributes(:field_type => params[:field_type]||"Post")
# admin配置的类型 # admin配置的类型
update_status_by_type(@subfield, params[:field_type]||"Post") update_status_by_type(@subfield, params[:field_type])
else else
@res = false @res = false
end end

View File

@ -1,7 +1,6 @@
<%if @save_flag%> <%if @save_flag%>
//$('#new_forum_div').slideToggle();$('#create_btn').parent().slideToggle(); $('#new_forum_div').slideToggle();$('#create_btn').parent().slideToggle();
//$('#reorder_time').click(); $('#reorder_time').click();
window.location.href= "http://"+"<%= Setting.host_name%>"+"/forums/" + "<%= @forum.id%>"
<%else%> <%else%>
$("#error").html("<%= @forum.errors.full_messages[0]%>").show(); $("#error").html("<%= @forum.errors.full_messages[0]%>").show();
<%end %> <%end %>

View File

@ -1,11 +1,9 @@
<% if @res %> <% if @res %>
$("#org_subfield_list").html(""); $("#org_subfield_list").html("");
$("#org_subfield_list").html("<%= escape_javascript(render :partial => 'organizations/subfield_list', :locals => {:subfields => subfield_to_addmin?(@organization)}) %>"); $("#org_subfield_list").html("<%= escape_javascript(render :partial => 'organizations/subfield_list', :locals => {:subfields => subfield_to_addmin?(@organization)}) %>");
$("#sub_field_left_lists").html(""); $("#sub_field_left_lists").html("");
$("#sub_field_left_lists").html("<%= escape_javascript(render :partial => 'organizations/org_left_subfield_list', :locals => {:organization => @organization}) %>"); $("#sub_field_left_lists").html("<%= escape_javascript(render :partial => 'organizations/org_left_subfield_list', :locals => {:organization => @organization}) %>");
$("#org_custom_admin").html("<%= escape_javascript(render :partial => 'organizations/org_custom_admin') %>"); $("#org_custom_admin").html("<%= escape_javascript(render :partial => 'organizations/org_custom_admin') %>");
//默认选中第一个
$("input[name='field_type']").get(0).checked=true;
<% end %> <% end %>
$("#subfield_name").val(""); $("#subfield_name").val("");
$("#sub_dir").val(""); $("#sub_dir").val("");