mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-07-14 22:24:36 +08:00
新增:用户反馈意见后台管理逻辑
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
<div class="modal fade feedback-history-change-modal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered" role="document" style="max-width: 800px">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">发送邮件给<%= @feedback&.user&.mail%></h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<%= form_for @feedback_message_history, url: {controller: "feedbacks", action: "create_history"} do |p| %>
|
||||
<div class="modal-body">
|
||||
<div class="form-group">
|
||||
<label>
|
||||
邮件标题 <span class="ml10 color-orange mr20">*</span>
|
||||
</label>
|
||||
<%= p.text_field :title,class: "form-control input-lg", placeholder: "邮件标题", value: "您提交的意见反馈有新回复",required: true, maxlength: 64, readonly: true%>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>
|
||||
<span class="color-grey-6 pt10">
|
||||
邮件正文
|
||||
<span class="ml10 color-orange mr20">*</span>
|
||||
</span>
|
||||
</label>
|
||||
<div class="mt-10">
|
||||
<div class="pl-0 my-3 setting-item-body" id="feedback-history-email-editor">
|
||||
<%= p.text_area :content, class:"form-control", style: 'display: none;', rows: "10", cols: "20", placeholer: "请输入邮件正文" %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
|
||||
<%= p.submit "确认", class: "btn btn-primary submit-btn" %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,33 @@
|
||||
<table class="table table-hover text-center subject-list-table">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<th width="5%">序号</th>
|
||||
<th width="10%">用户名</th>
|
||||
<th width="20%">用户邮箱</th>
|
||||
<th width="20%"><%= sort_tag('创建时间', name: 'created_at', path: admins_feedbacks_path) %></th>
|
||||
<th width="20%">反馈意见</th>
|
||||
<th width="25%">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% if feedbacks.present? %>
|
||||
<% feedbacks.each_with_index do |feedback, index| %>
|
||||
<tr class="feedback-item-<%= feedback.id %>">
|
||||
<td><%= list_index_no((params[:page] || 1).to_i, index) %></td>
|
||||
<td><%= feedback&.user&.login%></td>
|
||||
<td><%= feedback&.user&.mail%></td>
|
||||
<td><%= feedback.created_at&.strftime('%Y-%m-%d %H:%M') %></td>
|
||||
<td><%= feedback.content %></td>
|
||||
<td class="action-container">
|
||||
<%= link_to "发送邮件", new_history_admins_feedback_path(feedback), remote: true, class: "action" %>
|
||||
<%#= link_to "删除", admins_feedback_path(feedback), method: :delete, data:{confirm: "确认删除的吗?"}, class: "action" %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= render 'admins/shared/no_data_for_table' %>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<%= render partial: 'admins/shared/paginate', locals: { objects: feedbacks } %>
|
||||
@@ -0,0 +1,9 @@
|
||||
<% define_admin_breadcrumbs do %>
|
||||
<% add_admin_breadcrumb('反馈意见') %>
|
||||
<% end %>
|
||||
|
||||
<div class="box admin-list-container feedback-list-container">
|
||||
<%= render partial: 'admins/feedbacks/list', locals: { feedbacks: @feedbacks } %>
|
||||
</div>
|
||||
<div id="feedback-modals">
|
||||
</div>
|
||||
@@ -0,0 +1 @@
|
||||
$('.feedback-list-container').html("<%= j( render partial: 'admins/feedbacks/list', locals: { feedbacks: @feedbacks } ) %>");
|
||||
@@ -0,0 +1,3 @@
|
||||
$("#feedback-modals").html("<%= j render(partial: 'admins/feedbacks/history_form_modal', locals: {type: 'new_history'}) %>")
|
||||
$(".feedback-history-change-modal").modal('show');
|
||||
createMDEditor('feedback-history-email-editor', {width: 750, height: 300, placeholder: '请输入邮件正文',watch: false });
|
||||
@@ -36,6 +36,7 @@
|
||||
<%= sidebar_item_group('#setting-submenu', '网站建设', icon: 'cogs') do %>
|
||||
<li><%= sidebar_item(admins_faqs_path, 'FAQ', icon: 'question-circle', controller: 'admins-faqs') %></li>
|
||||
<li><%= sidebar_item(admins_nps_path, 'NPS用户调研', icon: 'question-circle', controller: 'admins-nps') %></li>
|
||||
<li><%= sidebar_item(admins_feedbacks_path, '用户反馈', icon: 'question-circle', controller: 'admins-feedbacks') %></li>
|
||||
<% end %>
|
||||
</li>
|
||||
<li>
|
||||
|
||||
Reference in New Issue
Block a user