mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-10 14:59:51 +08:00
Merge remote-tracking branch 'origin/standalone_develop' into standalone_develop
This commit is contained in:
@@ -42,7 +42,11 @@
|
||||
<li><%= sidebar_item(admins_topic_cooperators_path, '合作伙伴管理', icon: 'user', controller: 'admins-topic-cooperators') %></li>
|
||||
<% end %>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<%= sidebar_item_group('#setting-glcc', 'GLCC配置', icon: 'fire') do %>
|
||||
<li><%= sidebar_item(admins_topic_glcc_news_index_path, '新闻稿管理', icon: 'edit', controller: 'admins-topic-glcc_news') %></li>
|
||||
<% end %>
|
||||
</li>
|
||||
<li>
|
||||
<%= sidebar_item_group('#setting-submenu', '网站建设', icon: 'cogs') do %>
|
||||
<li><%= sidebar_item(admins_faqs_path, 'FAQ', icon: 'question-circle', controller: 'admins-faqs') %></li>
|
||||
|
||||
44
app/views/admins/topic/glcc_news/_form_modal.html.erb
Normal file
44
app/views/admins/topic/glcc_news/_form_modal.html.erb
Normal file
@@ -0,0 +1,44 @@
|
||||
<div class="modal fade glcc-news-change-modal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><%= type == "create" ? "新增" : "编辑" %></h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<%= form_for @glcc, url: {controller: "topic/glcc_news", action: "#{type}"} 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",required: true%>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>
|
||||
跳转地址 <span class="ml10 color-orange mr20">*</span>
|
||||
</label>
|
||||
<%= p.text_field :url,class: "form-control input-lg",required: true%>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>
|
||||
帖子ID <span class="ml10 color-orange mr20">*</span>
|
||||
</label>
|
||||
<%= p.text_field :uuid,class: "form-control input-lg",required: true%>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>
|
||||
排序等级
|
||||
</label>
|
||||
<%= p.number_field :order_index, class: "form-control",placeholder: ""%>
|
||||
</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>
|
||||
33
app/views/admins/topic/glcc_news/_list.html.erb
Normal file
33
app/views/admins/topic/glcc_news/_list.html.erb
Normal file
@@ -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="20%">标题</th>
|
||||
<th width="20%">跳转地址</th>
|
||||
<th width="10%">帖子ID</th>
|
||||
<th width="20%">排序等级</th>
|
||||
<th width="25%">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% if glcc_news.present? %>
|
||||
<% glcc_news.each_with_index do |news, index| %>
|
||||
<tr class="glcc-news-item-<%= news.id %>">
|
||||
<td><%= list_index_no((params[:page] || 1).to_i, index) %></td>
|
||||
<td><%= news.title %></td>
|
||||
<td><%= news.url %></td>
|
||||
<td><%= news.uuid %></td>
|
||||
<td><%= news.order_index %></td>
|
||||
<td class="action-container">
|
||||
<%= link_to "编辑", edit_admins_topic_glcc_news_path(news), remote: true, class: "action" %>
|
||||
<%= link_to "删除", admins_topic_glcc_news_path(news), 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: glcc_news } %>
|
||||
2
app/views/admins/topic/glcc_news/edit.js.erb
Normal file
2
app/views/admins/topic/glcc_news/edit.js.erb
Normal file
@@ -0,0 +1,2 @@
|
||||
$("#glcc-news-modals").html("<%= j render(partial: 'admins/topic/glcc_news/form_modal', locals: {type: 'update'}) %>")
|
||||
$(".glcc-news-change-modal").modal('show');
|
||||
18
app/views/admins/topic/glcc_news/index.html.erb
Normal file
18
app/views/admins/topic/glcc_news/index.html.erb
Normal file
@@ -0,0 +1,18 @@
|
||||
<% define_admin_breadcrumbs do %>
|
||||
<% add_admin_breadcrumb('新闻稿管理') %>
|
||||
<% end %>
|
||||
|
||||
<div class="box search-form-container project-list-form">
|
||||
<%= form_tag(admins_topic_glcc_news_index_path, method: :get, class: 'form-inline search-form flex-1', remote: true) do %>
|
||||
<%= text_field_tag(:search, params[:search], class: 'form-control col-12 col-md-2 mr-3', placeholder: '标题检索') %>
|
||||
<%= submit_tag('搜索', class: 'btn btn-primary ml-3', 'data-disable-with': '搜索中...') %>
|
||||
<input type="reset" class="btn btn-secondary clear-btn" value="清空"/>
|
||||
<% end %>
|
||||
<%= link_to "新增", new_admins_topic_glcc_news_path, remote: true, class: "btn btn-primary pull-right", "data-disabled-with":"...新增" %>
|
||||
</div>
|
||||
|
||||
<div class="box admin-list-container glcc-news-list-container">
|
||||
<%= render partial: 'admins/topic/glcc_news/list', locals: { glcc_news: @glcc_news } %>
|
||||
</div>
|
||||
<div id="glcc-news-modals">
|
||||
</div>
|
||||
1
app/views/admins/topic/glcc_news/index.js.erb
Normal file
1
app/views/admins/topic/glcc_news/index.js.erb
Normal file
@@ -0,0 +1 @@
|
||||
$('.glcc-news-list-container').html("<%= j( render partial: 'admins/topic/glcc_news/list', locals: { glcc_news: @glcc_news } ) %>");
|
||||
2
app/views/admins/topic/glcc_news/new.js.erb
Normal file
2
app/views/admins/topic/glcc_news/new.js.erb
Normal file
@@ -0,0 +1,2 @@
|
||||
$("#glcc-news-modals").html("<%= j render(partial: 'admins/topic/glcc_news/form_modal', locals: {type: 'create'}) %>")
|
||||
$(".glcc-news-change-modal").modal('show');
|
||||
4
app/views/topics/_glcc_news.json.jbuilder
Normal file
4
app/views/topics/_glcc_news.json.jbuilder
Normal file
@@ -0,0 +1,4 @@
|
||||
json.(glcc_news, :id, :title, :url, :uuid)
|
||||
request_memo = Forum::Memos::GetService.call(glcc_news&.uuid)
|
||||
json.visits request_memo.nil? ? 0 : request_memo["memo"]["viewed_count"]
|
||||
json.created_time request_memo.nil? ? format_time(Time.now) : request_memo["memo"]["published_time"]
|
||||
@@ -17,6 +17,8 @@ json.topics do
|
||||
json.partial! "excellent_project", locals: {excellent_project: topic}
|
||||
when "Topic::ExperienceForum"
|
||||
json.partial! "experience_forum", locals: {experience_forum: topic}
|
||||
when "Topic::GlccNews"
|
||||
json.partial! "glcc_news", locals: {glcc_news: topic}
|
||||
when "Topic::PinnedForum"
|
||||
json.partial! "pinned_forum", locals: {pinned_forum: topic}
|
||||
else
|
||||
@@ -39,6 +41,8 @@ json.topics do
|
||||
json.partial! "excellent_project", locals: {excellent_project: topic}
|
||||
when "Topic::ExperienceForum"
|
||||
json.partial! "experience_forum", locals: {experience_forum: topic}
|
||||
when "Topic::GlccNews"
|
||||
json.partial! "glcc_news", locals: {glcc_news: topic}
|
||||
when "Topic::PinnedForum"
|
||||
json.partial! "pinned_forum", locals: {pinned_forum: topic}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user