init project

This commit is contained in:
Jasder
2020-03-09 00:40:16 +08:00
commit 2937b2a94d
6549 changed files with 7215173 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
alert("删除成功");
$(".course-item-<%= @course.id %>").find(".delete-course-action").remove();

View File

@@ -0,0 +1,15 @@
<% define_admin_breadcrumbs do %>
<% add_admin_breadcrumb('项目列表') %>
<% end %>
<div class="box search-form-container project-list-form">
<%= form_tag(admins_projects_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 %>
</div>
<div class="box admin-list-container project-list-container">
<%= render partial: 'admins/projects/shared/list', locals: { projects: @projects } %>
</div>

View File

@@ -0,0 +1 @@
$('.project-list-container').html("<%= j( render partial: 'admins/projects/shared/list', locals: { projects: @projects } ) %>");

View File

@@ -0,0 +1,50 @@
<table class="table table-hover text-center subject-list-table">
<thead class="thead-light">
<tr>
<th width="4%">序号</th>
<th width="4%">ID</th>
<th width="15%" class="text-left">项目名称</th>
<th width="6%">公开</th>
<th width="5%">issue</th>
<th width="5%">资源</th>
<th width="6%">版本库</th>
<th width="8%">PullRequest</th>
<th width="6%">里程碑</th>
<th width="10%">成员</th>
<th width="10%">管理员</th>
<th width="11%"><%= sort_tag('创建时间', name: 'created_at', path: admins_projects_path) %></th>
<th width="10%">操作</th>
</tr>
</thead>
<tbody>
<% if projects.present? %>
<% projects.each_with_index do |project, index| %>
<tr class="project-item-<%= project.id %>">
<td><%= list_index_no((params[:page] || 1).to_i, index) %></td>
<td><%= project.id %></td>
<td class="text-left">
<%= link_to(project.name, "/projects/#{project.id}", target: '_blank') %>
</td>
<td><%= project.is_public ? '√' : '' %></td>
<td><%= project.issues.size %></td>
<td><%= project.attachments.size %></td>
<td><%= project.project_score.try(:changeset_num).to_i %></td>
<td><%= project.project_score.try(:pull_request_num).to_i %></td>
<td><%= project.versions.size %></td>
<td><%= project.members.size %></td>
<td>
<%= project.owner ? link_to(project.owner&.real_name, "/users/#{project.owner&.login}", target: '_blank') : "" %>
</td>
<td><%= project.created_on&.strftime('%Y-%m-%d %H:%M') %></td>
<td class="action-container">
<%= delete_link '删除', admins_project_path(project, element: ".project-item-#{project.id}"), class: 'delete-project-action' %>
</td>
</tr>
<% end %>
<% else %>
<%= render 'admins/shared/no_data_for_table' %>
<% end %>
</tbody>
</table>
<%= render partial: 'admins/shared/paginate', locals: { objects: projects } %>