mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-24 05:35:46 +08:00
Merge pull request 'FIX 路由优化' (#138) from develop into dev_trustie_server
This commit is contained in:
32
app/views/admins/reversed_keywords/_form_modal.html.erb
Normal file
32
app/views/admins/reversed_keywords/_form_modal.html.erb
Normal file
@@ -0,0 +1,32 @@
|
||||
<div class="modal fade reversed-keyword-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 @keyword, url: {controller: "reversed_keywords", action: "#{type}"} do |p| %>
|
||||
<div class="modal-body">
|
||||
<div class="form-group">
|
||||
<label>
|
||||
系统保留关键词标识 <span class="ml10 color-orange mr20">*</span>
|
||||
</label>
|
||||
<%= p.text_field :identifier,class: "form-control input-lg",required: true%>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>
|
||||
系统保留关键词描述
|
||||
</label>
|
||||
<%= p.text_area :description,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>
|
||||
37
app/views/admins/reversed_keywords/_list.html.erb
Normal file
37
app/views/admins/reversed_keywords/_list.html.erb
Normal file
@@ -0,0 +1,37 @@
|
||||
<table class="table table-hover text-center subject-list-table">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<th width="5%">序号</th>
|
||||
<th width="30%"><%= sort_tag('标识', name: 'identifier', path: admins_reversed_keywords_path) %></th>
|
||||
<th width="20%">描述</th>
|
||||
<th width="20%"><%= sort_tag('限制是否开启', name: 'closed', path: admins_reversed_keywords_path) %></th>
|
||||
<th width="20%"><%= sort_tag('创建时间', name: 'created_at', path: admins_reversed_keywords_path) %></th>
|
||||
<th width="25%">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% if keywords.present? %>
|
||||
<% keywords.each_with_index do |keyword, index| %>
|
||||
<tr class="reversed-keyword-item-<%= keyword.id %>">
|
||||
<td><%= list_index_no((params[:page] || 1).to_i, index) %></td>
|
||||
<td>
|
||||
<%= link_to(keyword.identifier, "javascript:void(0)") %>
|
||||
</td>
|
||||
<td><%= keyword.description %></td>
|
||||
<td class="keyword_closed"><%= !keyword.closed ? '√' : '' %></td>
|
||||
<td><%= keyword.created_at&.strftime('%Y-%m-%d %H:%M') %></td>
|
||||
<td class="action-container">
|
||||
<%= javascript_void_link '开启限制', class: 'action unclose-action', data: { id: keyword.id }, style: keyword.closed? ? '' : 'display: none;' %>
|
||||
<%= javascript_void_link '关闭限制', class: 'action close-action', data: { id: keyword.id }, style: keyword.closed? ? 'display: none;' : '' %>
|
||||
<%= link_to "编辑", edit_admins_reversed_keyword_path(keyword), remote: true, class: "action" %>
|
||||
<%= link_to "删除", admins_reversed_keyword_path(keyword), 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: keywords } %>
|
||||
2
app/views/admins/reversed_keywords/edit.js.erb
Normal file
2
app/views/admins/reversed_keywords/edit.js.erb
Normal file
@@ -0,0 +1,2 @@
|
||||
$("#reversed-keyword-modals").html("<%= j render(partial: 'admins/reversed_keywords/form_modal', locals: {type: 'update'}) %>")
|
||||
$(".reversed-keyword-change-modal").modal('show');
|
||||
18
app/views/admins/reversed_keywords/index.html.erb
Normal file
18
app/views/admins/reversed_keywords/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_reversed_keywords_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_reversed_keyword_path, remote: true, class: "btn btn-primary pull-right", "data-disabled-with":"...新增" %>
|
||||
</div>
|
||||
|
||||
<div class="box admin-list-container reversed-keyword-list-container">
|
||||
<%= render partial: 'admins/reversed_keywords/list', locals: { keywords: @keywords } %>
|
||||
</div>
|
||||
<div id="reversed-keyword-modals">
|
||||
</div>
|
||||
1
app/views/admins/reversed_keywords/index.js.erb
Normal file
1
app/views/admins/reversed_keywords/index.js.erb
Normal file
@@ -0,0 +1 @@
|
||||
$('.reversed-keyword-list-container').html("<%= j( render partial: 'admins/reversed_keywords/list', locals: { keywords: @keywords } ) %>");
|
||||
2
app/views/admins/reversed_keywords/new.js.erb
Normal file
2
app/views/admins/reversed_keywords/new.js.erb
Normal file
@@ -0,0 +1,2 @@
|
||||
$("#reversed-keyword-modals").html("<%= j render(partial: 'admins/reversed_keywords/form_modal', locals: {type: 'create'}) %>")
|
||||
$(".reversed-keyword-change-modal").modal('show');
|
||||
@@ -26,6 +26,7 @@
|
||||
<li><%= sidebar_item(admins_project_categories_path, '分类列表', icon: 'sitemap', controller: 'admins-project_categories') %></li>
|
||||
<li><%= sidebar_item(admins_project_licenses_path, '开源许可证', icon: 'file-text-o', controller: 'admins-project_licenses') %></li>
|
||||
<li><%= sidebar_item(admins_project_ignores_path, '忽略文件', icon: 'git', controller: 'admins-project_ignores') %></li>
|
||||
<li><%= sidebar_item(admins_reversed_keywords_path, '系统保留关键词', icon: 'key', controller: 'admins-reversed_keywords') %></li>
|
||||
<% end %>
|
||||
</li>
|
||||
|
||||
|
||||
24
app/views/owners/show.json.jbuilder
Normal file
24
app/views/owners/show.json.jbuilder
Normal file
@@ -0,0 +1,24 @@
|
||||
json.type @owner.type
|
||||
if @owner.is_a?(Organization)
|
||||
json.partial! "organizations/organizations/detail", organization: @owner
|
||||
json.can_create_project @can_create_project
|
||||
json.is_admin @is_admin
|
||||
json.is_member @is_member
|
||||
else
|
||||
json.partial! 'users/user', locals: { user: @owner }
|
||||
json.undo_messages @waiting_applied_messages.size
|
||||
json.undo_transfer_projects @common_applied_transfer_projects.size
|
||||
json.undo_join_projects @common_applied_projects.size
|
||||
json.undo_events @undo_events
|
||||
json.user_composes_count @user_composes_count
|
||||
json.user_org_count @user_org_count
|
||||
json.common_projects_count @projects_common_count
|
||||
json.mirror_projects_count @projects_mirrior_count
|
||||
json.sync_mirror_projects_count @projects_sync_mirrior_count
|
||||
json.created_time format_time(@owner.created_on)
|
||||
json.email @owner.show_email ? @owner.mail : nil
|
||||
json.province @owner.show_location ? @owner.province : nil
|
||||
json.city @owner.show_location ? @owner.city : nil
|
||||
json.custom_department @owner.show_department ? @owner.custom_department : nil
|
||||
json.description @owner.description
|
||||
end
|
||||
@@ -1,20 +1,20 @@
|
||||
json.user_id user.id
|
||||
json.name user.full_name
|
||||
json.username @user.full_name
|
||||
json.real_name @user.real_name
|
||||
json.username user.full_name
|
||||
json.real_name user.real_name
|
||||
json.grade user.grade
|
||||
json.gender @user.gender
|
||||
json.login @user.login
|
||||
json.user_id @user.id
|
||||
json.image_url url_to_avatar(@user)
|
||||
json.admin @user.admin?
|
||||
json.user_identity @user.identity
|
||||
json.is_watch current_user&.watched?(@user)
|
||||
json.watched_count @user.fan_count #粉丝
|
||||
json.watching_count @user.follow_count #关注数
|
||||
json.created_time format_time(@user.created_on)
|
||||
json.email @user.show_email ? @user.mail : nil
|
||||
json.province @user.show_location ? @user.province : nil
|
||||
json.city @user.show_location ? @user.city : nil
|
||||
json.custom_department @user.show_department ? @user.custom_department : nil
|
||||
json.description @user.description
|
||||
json.gender user.gender
|
||||
json.login user.login
|
||||
json.user_id user.id
|
||||
json.image_url url_to_avatar(user)
|
||||
json.admin user.admin?
|
||||
json.user_identity user.identity
|
||||
json.is_watch current_user&.watched?(user)
|
||||
json.watched_count user.fan_count #粉丝
|
||||
json.watching_count user.follow_count #关注数
|
||||
json.created_time format_time(user.created_on)
|
||||
json.email user.show_email ? user.mail : nil
|
||||
json.province user.show_location ? user.province : nil
|
||||
json.city user.show_location ? user.city : nil
|
||||
json.custom_department user.show_department ? user.custom_department : nil
|
||||
json.description user.description
|
||||
@@ -4,5 +4,6 @@ json.array! users do |user|
|
||||
json.login user.login
|
||||
json.user_id user.id
|
||||
json.image_url url_to_avatar(user)
|
||||
json.profile_completed user.profile_completed
|
||||
end
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
json.username @user.full_name
|
||||
json.real_name @user.real_name
|
||||
json.nickname @user.nickname
|
||||
json.gender @user.gender
|
||||
json.login @user.login
|
||||
json.user_id @user.id
|
||||
|
||||
Reference in New Issue
Block a user