Change Bug

This commit is contained in:
sylor_huang@126.com 2020-10-14 09:55:49 +08:00
parent 93e887e0e5
commit 8ad3160ab7
6 changed files with 46 additions and 91 deletions

View File

@ -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

View File

@ -1,16 +1,16 @@
<div class="box admin-list-container users-list-container">
<table class="table table-hover users-list-table">
<thead class="thead-light">
<table class="table table-hover users-list-table">
<thead class="thead-light">
<tr>
<th width="30%" class="edu-txt-left">
<span class="pl15">版块</span>
<%= javascript_void_link "<i class='fa fa-plus-circle'></i>".html_safe, class: 'btn btn-primary btn-sm', data: { toggle: 'modal', target: '.admins-add-forum-section-modal'}, parent_id: "" %>
<%= link_to "<i class='fa fa-plus-circle'></i>".html_safe,new_admins_forum_section_path, remote: true, class: "btn btn-primary btn-sm" %>
</th>
<th width="30%">主页推荐</th>
<th width="40%" class="edu-txt-left"><span class="pl15">一级版主任命/解除</span></th>
</tr>
</thead>
<tbody id="forum-section-contents">
</thead>
<tbody id="forum-section-contents">
<% 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 @@
</td>
</tr>
<% end %>
</tbody>
</table>
</tbody>
</table>
</div>
<div class="edu-back-white mt10">
<%= render partial: 'admins/shared/paginate', locals: { objects: @forum_sections } %>
<%= render partial: 'admins/shared/paginate', locals: { objects: @forum_sections } %>
</div>
<script>
function first_menu_click(that) {
@ -43,7 +41,7 @@
children_tags.removeClass("active")
}
}
function first_menu_action(that) {
var target = $(that);
var target_action = target.find(".operateList");
@ -55,19 +53,15 @@
target_action.addClass("active");
}
}
function recommend_form_submit(id) {
$("#"+id).trigger("click")
}
$(document).mouseup(function(e){
var _con = $('.menu_operate'); // 设置目标区域
if(!_con.is(e.target) && _con.has(e.target).length === 0){
_con.find(".operateList").removeClass("active")
}
});
</script>
});
</script>

View File

@ -4,7 +4,7 @@
<div class="edu-class-container">
<div class="ex_container" id="leave_message">
<%= render partial: "admins/forum_sections/forums_plateSetting.html.erb" %>
<%= render partial: "admins/forum_sections/forums_plateSetting" %>
</div>
</div>

View File

@ -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')
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')

View File

@ -1,54 +1,7 @@
<% parent_id = params[:parent_id] %>
<div class="modal fade admins-add-forum-section-modal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal fade admins-add-forum-section-modal" tabindex="-1" role="dialog" aria-hidden="true" id="admin-forum-section-modal">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title"> <%= parent_id.present? ? "新建二级版块" : "新建一级版块" %></h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<%= form_tag(admins_forum_sections_path, method: :post, class: "", remote: true) do %>
<div class="modal-body">
<%= hidden_field_tag :parent_id,parent_id %>
<div>
<div class="grid-item-top">
<span class="mr10 color-grey">名称:</span>
<div>
<%= text_field_tag :title, nil,class: "form-control input-lg", placeholder: "请输入名称最大限制20个字符", maxlength: 20 %>
</div>
</div>
<div class="grid-item-top mt20">
<span class="mr10 color-grey">描述:</span>
<div>
<%= text_area_tag :description,nil,class: "form-control input-lg", placeholder: "请输入描述", maxlength: 200, rows: 4 %>
</div>
</div>
<div class="grid-item-top mt20">
<span class="mr10 color-grey">封面:</span>
<div>
<div class="upload-image-100 pointer" onclick="$('#_file_section_picture').click();" id="admin-logo-upload">
<div style="line-height: 100px;">上传封面</div>
</div>
<div class="none poa top-bottom-0">
<input type="file" name="attachments[dummy][file]" id="_file_section_picture">
<%# <%=render partial: "admins/forum_sections/upload_logo"> %>
</div>
<div class="font-12 color-grey">
尺寸 100*100支持.jpg .jpeg .bmp .gif .png格式照片。
</div>
</div>
</div>
<div class="grid-item-top mt20 none" id="add-section-forum">
<%=render partial: "admins/forum_sections/shared/error_section", locals: {error_messages: ""} %>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
<%= submit_tag "确定", class: "btn btn-primary submit-btn" %>
</div>
<% end %>
<div class="modal-content" id="admin-forum-section-content">
</div>
</div>
</div>

View File

@ -1,23 +1,26 @@
<div class="task-popup" style="width:500px;">
<div class="task-popup-title clearfix f14">
<%= is_create == "1" ? "新建" : "编辑"%>
<div class="modal-header">
<h5 class="modal-title">
<%= is_create === "1" ? "新建" : "编辑" %>
<%= parent_id.present? ? "二级版块" : "一级版块" %>
</div>
<%= form_tag(admins_forum_sections_path, method: :post, class: "", remote: true) do %>
</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<%= form_tag(admins_forum_sections_path, method: :post, class: "", remote: true) do %>
<div class="modal-body">
<%= hidden_field_tag :parent_id,parent_id %>
<div class="task-popup-content ml55">
<div>
<div class="grid-item-top">
<span class="mr10 color-grey">名称:</span>
<div>
<%= text_field_tag :title, nil,class: "form-control input-lg", placeholder: "请输入名称最大限制20个字符", maxlength: 20 %>
<div id="edit_forum_section_notice" class="none color-red">不能重名</div>
</div>
</div>
<div class="grid-item-top mt20">
<span class="mr10 color-grey">描述:</span>
<div>
<%= text_area_tag :description,nil,class: "width300", placeholder: "请输入描述", maxlength: 200, rows: 4 %>
<div id="new_forum_section_notice" class="none color-red">不能超过200字</div>
<%= text_area_tag :description,nil,class: "form-control input-lg", placeholder: "请输入描述", maxlength: 200, rows: 4 %>
</div>
</div>
<div class="grid-item-top mt20">
@ -27,20 +30,21 @@
<div style="line-height: 100px;">上传封面</div>
</div>
<div class="none poa top-bottom-0">
<%= render partial: "admins/forum_sections/upload_logo" %>
<input type="file" name="attachments[dummy][file]" id="_file_section_picture">
<%# <%=render partial: "admins/forum_sections/upload_logo"> %>
</div>
<div class="font-12 color-grey">
尺寸 100*100支持.jpg .jpeg .bmp .gif .png格式照片。
</div>
</div>
</div>
<div class="grid-item-top mt20 none" id="add-section-forum">
<%=render partial: "admins/forum_sections/shared/error_section", locals: {error_messages: ""} %>
</div>
</div>
<div class="cl"></div>
<div class="edu-txt-center mbt10">
<li class="inline">
<a href="javascript:void(0)" class="task-btn fl mr50" onclick="hideModal();">取消</a>
<%= submit_tag "确定", class: "edu-default-btn edu-blueback-btn" %>
</li>
</div>
<% end %>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
<%= submit_tag "确定", class: "btn btn-primary submit-btn" %>
</div>
<% end %>