diff --git a/app/controllers/org_subfields_controller.rb b/app/controllers/org_subfields_controller.rb index 2b41983cc..3edda8285 100644 --- a/app/controllers/org_subfields_controller.rb +++ b/app/controllers/org_subfields_controller.rb @@ -14,10 +14,9 @@ class OrgSubfieldsController < ApplicationController SubfieldSubdomainDir.create(:org_subfield_id => @subfield.id, :name => params[:sub_dir].downcase) end end - #默认类型为帖子 - @subfield.update_attributes(:field_type => params[:field_type]||"Post") + @subfield.update_attributes(:field_type => params[:field_type]) # admin配置的类型 - update_status_by_type(@subfield, params[:field_type]||"Post") + update_status_by_type(@subfield, params[:field_type]) else @res = false end diff --git a/app/views/forums/create.js.erb b/app/views/forums/create.js.erb index 8323ec6d7..88e535e72 100644 --- a/app/views/forums/create.js.erb +++ b/app/views/forums/create.js.erb @@ -1,7 +1,6 @@ <%if @save_flag%> -//$('#new_forum_div').slideToggle();$('#create_btn').parent().slideToggle(); -//$('#reorder_time').click(); -window.location.href= "http://"+"<%= Setting.host_name%>"+"/forums/" + "<%= @forum.id%>" +$('#new_forum_div').slideToggle();$('#create_btn').parent().slideToggle(); +$('#reorder_time').click(); <%else%> $("#error").html("<%= @forum.errors.full_messages[0]%>").show(); <%end %> \ No newline at end of file diff --git a/app/views/org_subfields/create.js.erb b/app/views/org_subfields/create.js.erb index 2149f6dcd..a7647b0ad 100644 --- a/app/views/org_subfields/create.js.erb +++ b/app/views/org_subfields/create.js.erb @@ -1,11 +1,9 @@ <% if @res %> - $("#org_subfield_list").html(""); - $("#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("<%= escape_javascript(render :partial => 'organizations/org_left_subfield_list', :locals => {:organization => @organization}) %>"); - $("#org_custom_admin").html("<%= escape_javascript(render :partial => 'organizations/org_custom_admin') %>"); - //默认选中第一个 - $("input[name='field_type']").get(0).checked=true; +$("#org_subfield_list").html(""); +$("#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("<%= escape_javascript(render :partial => 'organizations/org_left_subfield_list', :locals => {:organization => @organization}) %>"); +$("#org_custom_admin").html("<%= escape_javascript(render :partial => 'organizations/org_custom_admin') %>"); <% end %> - $("#subfield_name").val(""); - $("#sub_dir").val(""); \ No newline at end of file +$("#subfield_name").val(""); +$("#sub_dir").val(""); \ No newline at end of file