mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-02 19:30:48 +08:00
新增:项目疑修排行榜
This commit is contained in:
37
app/views/admins/issues_rank/index.html.erb
Normal file
37
app/views/admins/issues_rank/index.html.erb
Normal file
@@ -0,0 +1,37 @@
|
||||
<% define_admin_breadcrumbs do %>
|
||||
<% add_admin_breadcrumb('项目排行榜', admins_path) %>
|
||||
<% end %>
|
||||
|
||||
|
||||
<div class="box search-form-container user-list-form">
|
||||
<%= form_tag(admins_issues_rank_index_path, method: :get, class: 'form-inline search-form flex-1', id: 'issue-rank-date-form') do %>
|
||||
<div class="input-group">
|
||||
<span class="input-group-text">开始日期</span>
|
||||
<input class="form-control datetimepicker" type="text" name="begin_date" value="<%= params[:begin_date] || (Date.today - 7.days).to_s%>" aria-label="选择日期">
|
||||
</div>
|
||||
<div class="input-group">
|
||||
<span class="input-group-text">截止日期</span>
|
||||
<input class="form-control datetimepicker" type="text" name="end_date" value="<%= params[:end_date] || Date.today.to_s%>" aria-label="选择日期">
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="box admin-list-container issue-rank-list-container">
|
||||
<%= render partial: 'admins/issues_rank/shared/data_list', locals: { statistics: @statistics } %>
|
||||
</div>
|
||||
<script>
|
||||
$(".datetimepicker").on('change', function() {
|
||||
$("#issue-rank-date-form").submit()
|
||||
});
|
||||
$(".datetimepicker").on('change', function() {
|
||||
$("#issue-rank-date-form").submit()
|
||||
});
|
||||
$('.datetimepicker').datetimepicker({
|
||||
language: 'zh-CN', // 中文语言包
|
||||
autoclose: 1, // 选中日期后自动关闭
|
||||
format: 'yyyy-mm-dd', // 日期格式
|
||||
minView: "month", // 最小日期显示单元,这里最小显示月份界面,即可以选择到日
|
||||
todayBtn: 1, // 显示今天按钮
|
||||
todayHighlight: 1, // 显示今天高亮
|
||||
});
|
||||
</script>
|
||||
1
app/views/admins/issues_rank/index.js.erb
Normal file
1
app/views/admins/issues_rank/index.js.erb
Normal file
@@ -0,0 +1 @@
|
||||
$('.issue-rank-list-container').html("<%= j( render partial: 'admins/issues_rank/shared/data_list', locals: { statistics: @statistics } ) %>");
|
||||
26
app/views/admins/issues_rank/shared/_data_list.html.erb
Normal file
26
app/views/admins/issues_rank/shared/_data_list.html.erb
Normal file
@@ -0,0 +1,26 @@
|
||||
<table class="table table-hover text-center subject-list-table">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<th width="20%">排名</th>
|
||||
<th width="20%">项目</th>
|
||||
<th width="20%">新增疑修数</th>
|
||||
<th width="20%">关闭疑修数</th>
|
||||
<th width="20%">当前疑修数量</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% statistics.each_with_index do |item, index| %>
|
||||
<tr class="">
|
||||
<td><%= index + 1%></td>
|
||||
<td>
|
||||
<a target="_blank" href="<%= "/#{item&.project&.owner&.login}/#{item&.project&.identifier}"%>">
|
||||
<%= "#{item&.project&.owner&.real_name}/#{item&.project&.name}" %>
|
||||
</a>
|
||||
</td>
|
||||
<td><%= item&.issues %></td>
|
||||
<td><%= item&.closed_issues %></td>
|
||||
<td><%= item&.issues_count %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -81,6 +81,7 @@
|
||||
<%= sidebar_item_group('#rank-submenu', '活跃度排行', icon: 'calendar') do %>
|
||||
<li><%= sidebar_item(admins_users_rank_index_path, '用户活跃度排行', icon: 'user', controller: 'admins-users_rank') %></li>
|
||||
<li><%= sidebar_item(admins_projects_rank_index_path, '项目活跃度排行', icon: 'database', controller: 'admins-projects_rank') %></li>
|
||||
<li><%= sidebar_item(admins_issues_rank_index_path, '疑修活跃度排行', icon: 'database', controller: 'admins-issues_rank') %></li>
|
||||
<% end %>
|
||||
</li>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user