From fde3fd0d94c5e52e611b88ba7d93d85243b8f74d Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Fri, 17 Jun 2016 14:40:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E8=B4=B4=E5=90=A7=E8=B7=B3?= =?UTF-8?q?=E5=85=A5=E8=AF=A5=E8=B4=B4=E5=90=A7=E5=B8=96=E5=AD=90=E5=88=97?= =?UTF-8?q?=E8=A1=A8=EF=BC=8C=E7=BB=84=E7=BB=87=E6=A0=8F=E7=9B=AE=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E9=BB=98=E8=AE=A4=E9=80=89=E6=8B=A9=E7=AC=AC=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E6=A0=8F=E7=9B=AE=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/org_subfields_controller.rb | 5 +++-- app/views/forums/create.js.erb | 9 +++++---- app/views/org_subfields/create.js.erb | 12 +++++++----- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/app/controllers/org_subfields_controller.rb b/app/controllers/org_subfields_controller.rb index 3edda8285..2b41983cc 100644 --- a/app/controllers/org_subfields_controller.rb +++ b/app/controllers/org_subfields_controller.rb @@ -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 diff --git a/app/views/forums/create.js.erb b/app/views/forums/create.js.erb index 88e535e72..bea3f3872 100644 --- a/app/views/forums/create.js.erb +++ b/app/views/forums/create.js.erb @@ -1,6 +1,7 @@ <%if @save_flag%> -$('#new_forum_div').slideToggle();$('#create_btn').parent().slideToggle(); -$('#reorder_time').click(); +//$('#new_forum_div').slideToggle();$('#create_btn').parent().slideToggle(); +//$('#reorder_time').click(); + window.location.href= "http://"+"<%= Setting.host_name%>"+"/forums/" + "<%= @forum.id%>" <%else%> -$("#error").html("<%= @forum.errors.full_messages[0]%>").show(); -<%end %> \ No newline at end of file + $("#error").html("<%= @forum.errors.full_messages[0]%>").show(); +<%end %> diff --git a/app/views/org_subfields/create.js.erb b/app/views/org_subfields/create.js.erb index a7647b0ad..a65f53719 100644 --- a/app/views/org_subfields/create.js.erb +++ b/app/views/org_subfields/create.js.erb @@ -1,9 +1,11 @@ <% 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') %>"); + $("#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; <% end %> $("#subfield_name").val(""); $("#sub_dir").val(""); \ No newline at end of file