Merge branch 'standalone_develop' into pm_project_develop

This commit is contained in:
2024-09-12 09:21:10 +08:00
48 changed files with 440 additions and 64 deletions

View File

@@ -2,7 +2,12 @@
<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>
<h5 class="modal-title">
发送邮件给<%= @feedback&.user&.mail%>
<% if @feedback&.user&.mail.end_with?('@example.org') || @feedback&.user&.mail.end_with?('@gitlink.org.cn')%>
<span style="color: red">(该邮箱不可用)</span>
<% end %>
</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>

View File

@@ -30,6 +30,18 @@
</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">
<%= f.number_field :position, class: "form-control",placeholder: ""%>
</div>
</div>
<div class="form-group">
<%= f.submit "确认", class: "btn btn-primary submit-btn" %>

View File

@@ -4,6 +4,7 @@
<th width="5%">序号</th>
<th width="15%">名称</th>
<th width="35%">简介</th>
<th width="10%"><%= sort_tag('排序等级', name: 'position', path: admins_project_licenses_path) %></th>
<%
=begin%>
<th width="10%"><%= sort_tag('项目数', name: 'projects_count', path: admins_project_licenses_path) %></th>
@@ -24,6 +25,7 @@
<td>
<%= project_license.content.to_s.truncate(200) %>
</td>
<td><%= project_license.position %></td>
<%
=begin%>
<td><%= project_license.projects_count %></td>

View File

@@ -3,10 +3,15 @@
<% 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 %>
<%= form_tag(admins_projects_path, method: :get, class: 'form-inline search-form flex-1', id: 'project-list-form', 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="清空"/>
<div class="form-group mr-2 pull-right" style='margin-left:auto'>
<label for="status">项目类别:</label>
<% type_options = [['全部项目', ''], ['公开项目', 'public'], ['私有项目', 'private'], ['Fork项目', 'fork'], ['原创项目', 'original']] %>
<%= select_tag(:category, options_for_select(type_options, params[:category]), class: 'form-control', id: 'project-category') %>
</div>
<% end %>
</div>
@@ -16,3 +21,9 @@
<div id="projects-modals">
</div>
<script>
$("#project-category").on('change', function() {
$("#project-list-form").submit()
});
</script>

View File

@@ -50,7 +50,7 @@
<li>
<%= sidebar_item_group('#setting-index', '首页配置', icon: 'file', has_permission: current_user.admin? || current_user.business?) do %>
<li><%= sidebar_item(admins_topic_banners_path, 'banner管理', icon: 'image', controller: 'admins-topic-banners', has_permission: current_user.admin? || current_user.business?) %></li>
<li><%= sidebar_item(admins_topic_cards_path, '卡片管理', icon: 'archive', controller: 'admins-topic-cards', has_permission: current_user.admin? || current_user.business?) %></li>
<!--<li><%#= sidebar_item(admins_topic_cards_path, '卡片管理', icon: 'archive', controller: 'admins-topic-cards', has_permission: current_user.admin? || current_user.business?) %></li>-->
<li><%= sidebar_item(admins_topic_activity_forums_path, '平台动态管理', icon: 'bell', controller: 'admins-topic-activity_forums', has_permission: current_user.admin? || current_user.business?) %></li>
<li><%= sidebar_item(admins_topic_excellent_projects_path, '优秀仓库管理', icon: 'git', controller: 'admins-topic-excellent_projects', has_permission: current_user.admin? || current_user.business?) %></li>
<li><%= sidebar_item(admins_topic_pinned_forums_path, '精选文章管理', icon: 'edit', controller: 'admins-topic-pinned_forums', has_permission: current_user.admin? || current_user.business?) %></li>

View File

@@ -1,5 +1,5 @@
json.total_count @result_object[:total_data].to_i
json.branches @result_object[:data].each do |branch|
json.partial! "api/v1/projects/branches/simple_gitea_detail", branch: branch, default_branch: @result_object[:default_branch]
json.has_pull_request @project.has_pull_request(branch['name'])
end

View File

@@ -5,6 +5,7 @@ json.projects @projects.each do |project|
json.type project.numerical_for_project_type
json.praised project.praised_by?(current_user)
json.last_update_time render_unix_time(project.updated_on)
json.full_last_update_time project.updated_on
json.time_ago time_from_now(project.updated_on)
json.language do
if project.project_language.blank?

View File

@@ -13,6 +13,7 @@ json.is_public project.is_public
json.mirror_url project.repository&.mirror_url
json.type project&.numerical_for_project_type
json.last_update_time render_unix_time(project.updated_on)
json.full_last_update_time project.updated_on
json.time_ago time_from_now(project.updated_on)
json.forked_from_project_id project.forked_from_project_id
json.open_devops project.open_devops?

View File

@@ -23,10 +23,10 @@ json.issues do
json.pull_request_base pr.base
json.pull_request_staus pr.status == 1 ? "merged" : (pr.status == 2 ? "closed" : "open")
json.is_original pr.is_original
json.fork_project_id pr.fork_project_id.present? ? pr.fork_project_id : pr.project_id
json.fork_project_identifier pr.fork_project_id.present? ? pr&.fork_project&.identifier : pr.project&.identifier
json.fork_project_user pr.fork_project_id.present? ? pr&.fork_project&.owner.try(:login) : pr.project&.owner.try(:login)
json.fork_project_user_name pr.fork_project_id.present? ? pr&.fork_project&.owner.try(:show_real_name) : pr.project&.owner.try(:show_real_name)
json.fork_project_id pr.fork_project_id
json.fork_project_identifier pr.fork_project.present? ? pr&.fork_project&.identifier : pr.fork_project_identifier
json.fork_project_user pr.fork_project.present? ? pr&.fork_project&.owner.try(:login) : pr.fork_project_owner
json.fork_project_user_name pr.fork_project.present? ? pr&.fork_project&.owner.try(:show_real_name) : User.find_by(login: pr.fork_project_owner).try(:show_real_name)
json.reviewers pr.reviewers.pluck(:login)
json.id issue.id

View File

@@ -25,9 +25,10 @@ end
json.pull_request do
json.extract! @pull_request, :id,:base, :head, :status, :is_original
json.pull_request_staus @pull_request.status == 1 ? "merged" : (@pull_request.status == 2 ? "closed" : "open")
json.fork_project_id @pull_request.fork_project_id.present? ? @pull_request.fork_project_id : @pull_request.project_id
json.fork_project_user @pull_request.fork_project_id.present? ? @pull_request&.fork_project&.owner.try(:login) : @pull_request.project&.owner.try(:login)
json.fork_project_user_name @pull_request.fork_project_id.present? ? @pull_request&.fork_project&.owner.try(:show_real_name) : @pull_request.project&.owner.try(:show_real_name)
json.fork_project_id @pull_request.fork_project_id
json.fork_project_identifier @pull_request.fork_project.present? ? @pull_request&.fork_project&.identifier : @pull_request.fork_project_identifier
json.fork_project_user @pull_request.fork_project.present? ? @pull_request&.fork_project&.owner.try(:login) : @pull_request.fork_project_owner
json.fork_project_user_name @pull_request.fork_project.present? ? @pull_request&.fork_project&.owner.try(:show_real_name) : User.find_by(login: @pull_request.fork_project_owner).try(:show_real_name)
json.create_user @pull_request&.user&.login
json.mergeable @gitea_pull["mergeable"]
json.state @gitea_pull["state"]

View File

@@ -1,4 +1,5 @@
json.total_count @organizations.total_count
json.organizations @organizations do |organization|
json.partial! "/organizations/organizations/detail", organization: organization
json.is_home_top @home_top_ids.include?(organization.id)
end

View File

@@ -1,4 +1,5 @@
json.count @total_count
json.projects do
json.partial! '/projects/project_detail', collection: @projects, as: :project
json.projects @projects do |project|
json.partial! '/projects/project_detail', project: project
json.is_home_top @home_top_ids.include?(project.id)
end