diff --git a/app/controllers/admins/forum_sections_controller.rb b/app/controllers/admins/forum_sections_controller.rb index fe55db52..1ce0abb2 100644 --- a/app/controllers/admins/forum_sections_controller.rb +++ b/app/controllers/admins/forum_sections_controller.rb @@ -23,6 +23,7 @@ class Admins::ForumSectionsController < Admins::BaseController def new @parent_id = params[:parent_id] + @forum_section = ForumSection.new end def create diff --git a/app/views/admins/forum_sections/_new_forum.html.erb b/app/views/admins/forum_sections/_new_forum.html.erb index ad0804dc..cc7fb519 100644 --- a/app/views/admins/forum_sections/_new_forum.html.erb +++ b/app/views/admins/forum_sections/_new_forum.html.erb @@ -1,6 +1,7 @@
- <%= parent_id.present? ? "新建二级版块" : "新建一级版块" %> + <%= is_create == "1" ? "新建" : "编辑"%> + <%= parent_id.present? ? "二级版块" : "一级版块" %>
<%= form_tag(admins_forum_sections_path, method: :post, class: "", remote: true) do %> <%= hidden_field_tag :parent_id,parent_id %> diff --git a/app/views/admins/forum_sections/new.js.erb b/app/views/admins/forum_sections/new.js.erb index 1410a7ee..41128ebb 100644 --- a/app/views/admins/forum_sections/new.js.erb +++ b/app/views/admins/forum_sections/new.js.erb @@ -1,2 +1,2 @@ -var htmlvalue = "<%= j render :partial => 'admins/forum_sections/new_forum', locals: {parent_id: @parent_id} %>"; -pop_box_new(htmlvalue, 520, 400); \ No newline at end of file +var htmlvalue = "<%= j render :partial => 'admins/forum_sections/new_forum', locals: {parent_id: @parent_id, is_create: "1", forum_section: @forum_section} %>"; +$('#identifier').modal('show') \ No newline at end of file