From 8ad3160ab724c15f87082900582021b4f79e19cf Mon Sep 17 00:00:00 2001 From: "sylor_huang@126.com" Date: Wed, 14 Oct 2020 09:55:49 +0800 Subject: [PATCH] Change Bug --- .../admins/forum_sections_controller.rb | 3 ++ .../_forums_plateSetting.html.erb | 32 +++++------ .../admins/forum_sections/index.html.erb | 2 +- app/views/admins/forum_sections/new.js.erb | 5 +- .../shared/_add_section.html.erb | 53 ++----------------- .../{ => shared}/_new_forum.html.erb | 42 ++++++++------- 6 files changed, 46 insertions(+), 91 deletions(-) rename app/views/admins/forum_sections/{ => shared}/_new_forum.html.erb (50%) diff --git a/app/controllers/admins/forum_sections_controller.rb b/app/controllers/admins/forum_sections_controller.rb index 1ce0abb2..2531cb0d 100644 --- a/app/controllers/admins/forum_sections_controller.rb +++ b/app/controllers/admins/forum_sections_controller.rb @@ -24,6 +24,9 @@ class Admins::ForumSectionsController < Admins::BaseController def new @parent_id = params[:parent_id] @forum_section = ForumSection.new + respond_to do |format| + format.js + end end def create diff --git a/app/views/admins/forum_sections/_forums_plateSetting.html.erb b/app/views/admins/forum_sections/_forums_plateSetting.html.erb index 81f9be66..0d3e31bd 100644 --- a/app/views/admins/forum_sections/_forums_plateSetting.html.erb +++ b/app/views/admins/forum_sections/_forums_plateSetting.html.erb @@ -1,16 +1,16 @@
- - +
+ - - + + <% if @forum_sections_count > 0 %> <% @forum_sections.each do |forum| %> <%= render partial: "admins/forum_sections/forum_section_detail", locals: {forum: forum} %> @@ -22,13 +22,11 @@ <% end %> - -
版块 - <%= javascript_void_link "".html_safe, class: 'btn btn-primary btn-sm', data: { toggle: 'modal', target: '.admins-add-forum-section-modal'}, parent_id: "" %> + <%= link_to "".html_safe,new_admins_forum_section_path, remote: true, class: "btn btn-primary btn-sm" %> 主页推荐 一级版主任命/解除
+ +
- - - <%= render partial: 'admins/shared/paginate', locals: { objects: @forum_sections } %> + <%= render partial: 'admins/shared/paginate', locals: { objects: @forum_sections } %>
\ No newline at end of file + }); + diff --git a/app/views/admins/forum_sections/index.html.erb b/app/views/admins/forum_sections/index.html.erb index 90633f9d..d9ce73c8 100644 --- a/app/views/admins/forum_sections/index.html.erb +++ b/app/views/admins/forum_sections/index.html.erb @@ -4,7 +4,7 @@
- <%= render partial: "admins/forum_sections/forums_plateSetting.html.erb" %> + <%= render partial: "admins/forum_sections/forums_plateSetting" %>
diff --git a/app/views/admins/forum_sections/new.js.erb b/app/views/admins/forum_sections/new.js.erb index 41128ebb..4a2ebef4 100644 --- a/app/views/admins/forum_sections/new.js.erb +++ b/app/views/admins/forum_sections/new.js.erb @@ -1,2 +1,3 @@ -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 +var htmlvalue = "<%= j render :partial => 'admins/forum_sections/shared/new_forum', locals: {parent_id: @parent_id, is_create: "1", forum_section: @forum_section} %>"; +$("#admin-forum-section-content").html(htmlvalue) +$('#admin-forum-section-modal').modal('show') \ No newline at end of file diff --git a/app/views/admins/forum_sections/shared/_add_section.html.erb b/app/views/admins/forum_sections/shared/_add_section.html.erb index 58b3f735..87e46487 100644 --- a/app/views/admins/forum_sections/shared/_add_section.html.erb +++ b/app/views/admins/forum_sections/shared/_add_section.html.erb @@ -1,54 +1,7 @@ -<% parent_id = params[:parent_id] %> -