组织配置里面栏目类型默认为帖子

This commit is contained in:
yuanke 2016-06-13 13:35:01 +08:00
parent 3a46a409a9
commit e86419c28b
2 changed files with 5 additions and 2 deletions

View File

@ -14,9 +14,10 @@ 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])
#默认类型为帖子
@subfield.update_attributes(:field_type => params[:field_type]||"Post")
# admin配置的类型
update_status_by_type(@subfield, params[:field_type])
update_status_by_type(@subfield, params[:field_type]||"Post")
else
@res = false
end

View File

@ -4,6 +4,8 @@
$("#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;
<% end %>
$("#subfield_name").val("");
$("#sub_dir").val("");