From b4bca892b50c25a8e2ccb91b2b75333376b36204 Mon Sep 17 00:00:00 2001 From: xxq250 Date: Sat, 15 Apr 2023 15:00:25 +0800 Subject: [PATCH 01/13] =?UTF-8?q?top=E7=94=A8=E6=88=B7=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E6=8E=92=E8=A1=8C=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/project_rank_controller.rb | 7 +++-- app/controllers/user_rank_controller.rb | 7 +++-- app/views/project_rank/_detail.json.jbuilder | 3 +- app/views/user_rank/_detail.json.jbuilder | 29 +++++++++++++++++++- 4 files changed, 40 insertions(+), 6 deletions(-) diff --git a/app/controllers/project_rank_controller.rb b/app/controllers/project_rank_controller.rb index 5cea074fb..424f3ced5 100644 --- a/app/controllers/project_rank_controller.rb +++ b/app/controllers/project_rank_controller.rb @@ -1,10 +1,13 @@ class ProjectRankController < ApplicationController # 根据时间获取热门项目 - def index + def index + limit = 9 + limit = params[:limit].to_i - 1 if params[:limit].present? + limit = 99 if limit > 99 $redis_cache.zunionstore("recent-days-project-rank-#{time}", get_timeable_key_names) deleted_data = $redis_cache.smembers("v2-project-rank-deleted") $redis_cache.zrem("recent-days-project-rank-#{time}", deleted_data) unless deleted_data.blank? - @project_rank = $redis_cache.zrevrange("recent-days-project-rank-#{time}", 0, 9, withscores: true) + @project_rank = $redis_cache.zrevrange("recent-days-project-rank-#{time}", 0, limit, withscores: true) rescue Exception => e @project_rank = [] end diff --git a/app/controllers/user_rank_controller.rb b/app/controllers/user_rank_controller.rb index dddca485c..1d1a7b4f3 100644 --- a/app/controllers/user_rank_controller.rb +++ b/app/controllers/user_rank_controller.rb @@ -1,8 +1,11 @@ class UserRankController < ApplicationController # 根据时间获取热门开发者 - def index + def index + limit = 3 + limit = params[:limit].to_i - 1 if params[:limit].present? + limit = 99 if limit > 99 $redis_cache.zunionstore("recent-days-user-rank", get_timeable_key_names) - @user_rank = $redis_cache.zrevrange("recent-days-user-rank", 0, 3, withscores: true) + @user_rank = $redis_cache.zrevrange("recent-days-user-rank", 0, limit, withscores: true) rescue Exception => e @user_rank = [] end diff --git a/app/views/project_rank/_detail.json.jbuilder b/app/views/project_rank/_detail.json.jbuilder index 5e45f518e..f3305649b 100644 --- a/app/views/project_rank/_detail.json.jbuilder +++ b/app/views/project_rank/_detail.json.jbuilder @@ -28,4 +28,5 @@ json.forks project_common["forks"] json.watchers project_common["watchers"] json.praises project_common["praises"] json.issues project_common["issues"] -json.pulls project_common["pullrequests"] \ No newline at end of file +json.pulls project_common["pullrequests"] +json.commits project_common["commits"] \ No newline at end of file diff --git a/app/views/user_rank/_detail.json.jbuilder b/app/views/user_rank/_detail.json.jbuilder index 7632c408b..9733a4632 100644 --- a/app/views/user_rank/_detail.json.jbuilder +++ b/app/views/user_rank/_detail.json.jbuilder @@ -18,4 +18,31 @@ else json.identifier popular_project_common["identifier"] json.description popular_project_common["description"] end -end \ No newline at end of file +end + +ids = $redis_cache.zrevrange("v2-user-project-rank:#{item[0]}", 0, 999, withscores: true).map{|a|a[0]} +visits = 0 +forks = 0 +watchers = 0 +praises = 0 +issues = 0 +pulls = 0 +commits = 0 +ids.each do |pid| + project_common = $redis_cache.hgetall("v2-project-common:#{pid}") + visits = visits + project_common["visits"] + forks = forks + project_common["forks"] + watchers = watchers + project_common["watchers"] + praises = praises + project_common["praises"] + issues = issues + project_common["issues"] + pulls = pulls + project_common["pullrequests"] + commits = commits + project_common["commits"] +end + +json.visits visits +json.forks forks +json.watchers watchers +json.praises praises +json.issues issues +json.pulls pulls +json.commits commits \ No newline at end of file From 9200a9e527cdb6278a686a4f243091083cd04e49 Mon Sep 17 00:00:00 2001 From: xxq250 Date: Sat, 15 Apr 2023 15:02:40 +0800 Subject: [PATCH 02/13] =?UTF-8?q?top=E7=94=A8=E6=88=B7=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E6=8E=92=E8=A1=8C=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/user_rank/_detail.json.jbuilder | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/views/user_rank/_detail.json.jbuilder b/app/views/user_rank/_detail.json.jbuilder index 9733a4632..d94ef342e 100644 --- a/app/views/user_rank/_detail.json.jbuilder +++ b/app/views/user_rank/_detail.json.jbuilder @@ -30,13 +30,13 @@ pulls = 0 commits = 0 ids.each do |pid| project_common = $redis_cache.hgetall("v2-project-common:#{pid}") - visits = visits + project_common["visits"] - forks = forks + project_common["forks"] - watchers = watchers + project_common["watchers"] - praises = praises + project_common["praises"] - issues = issues + project_common["issues"] - pulls = pulls + project_common["pullrequests"] - commits = commits + project_common["commits"] + visits = visits + project_common["visits"].to_i + forks = forks + project_common["forks"].to_i + watchers = watchers + project_common["watchers"].to_i + praises = praises + project_common["praises"].to_i + issues = issues + project_common["issues"].to_i + pulls = pulls + project_common["pullrequests"].to_i + commits = commits + project_common["commits"].to_i end json.visits visits From d2b4b500b6dee498203f71363af9d4c4c9f82ccd Mon Sep 17 00:00:00 2001 From: xxq250 Date: Sat, 15 Apr 2023 22:18:34 +0800 Subject: [PATCH 03/13] =?UTF-8?q?top=E7=94=A8=E6=88=B7=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E6=8E=92=E8=A1=8C=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/project_rank/_detail.json.jbuilder | 3 ++- app/views/user_rank/_detail.json.jbuilder | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/views/project_rank/_detail.json.jbuilder b/app/views/project_rank/_detail.json.jbuilder index f3305649b..d5b4b016b 100644 --- a/app/views/project_rank/_detail.json.jbuilder +++ b/app/views/project_rank/_detail.json.jbuilder @@ -29,4 +29,5 @@ json.watchers project_common["watchers"] json.praises project_common["praises"] json.issues project_common["issues"] json.pulls project_common["pullrequests"] -json.commits project_common["commits"] \ No newline at end of file +json.commits project_common["commits"] +json.issues project_common["issues"] \ No newline at end of file diff --git a/app/views/user_rank/_detail.json.jbuilder b/app/views/user_rank/_detail.json.jbuilder index d94ef342e..e3f8ce5d0 100644 --- a/app/views/user_rank/_detail.json.jbuilder +++ b/app/views/user_rank/_detail.json.jbuilder @@ -28,6 +28,7 @@ praises = 0 issues = 0 pulls = 0 commits = 0 +issues = 0 ids.each do |pid| project_common = $redis_cache.hgetall("v2-project-common:#{pid}") visits = visits + project_common["visits"].to_i @@ -37,6 +38,7 @@ ids.each do |pid| issues = issues + project_common["issues"].to_i pulls = pulls + project_common["pullrequests"].to_i commits = commits + project_common["commits"].to_i + issues = issues + project_common["issues"].to_i end json.visits visits @@ -45,4 +47,5 @@ json.watchers watchers json.praises praises json.issues issues json.pulls pulls -json.commits commits \ No newline at end of file +json.commits commits +json.issues issues \ No newline at end of file From 5c563db6e4573231cd006f0f5b8e51116a90153d Mon Sep 17 00:00:00 2001 From: xxq250 Date: Mon, 17 Apr 2023 10:13:23 +0800 Subject: [PATCH 04/13] =?UTF-8?q?commit=E5=8A=A0=E5=85=A5=E5=88=B0?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=8A=A8=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/commit_logs_controller.rb | 12 +++++++++++- app/models/commit_log.rb | 2 ++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/app/controllers/commit_logs_controller.rb b/app/controllers/commit_logs_controller.rb index cc071340e..7c0828b6b 100644 --- a/app/controllers/commit_logs_controller.rb +++ b/app/controllers/commit_logs_controller.rb @@ -19,12 +19,22 @@ class CommitLogsController < ApplicationController params[:commits].each do |commit| commit_id = commit[:id] message = commit[:message] - CommitLog.create(user: user, project: project, repository_id: repository_id, + commit_log = CommitLog.create(user: user, project: project, repository_id: repository_id, name: repository_name, full_name: repository_full_name, ref: ref, commit_id: commit_id, message: message) + commit_log.project_trends.create(user_id: user.id, project_id: project&.id, action_type: "create") # 统计数据新增 CacheAsyncSetJob.perform_later("project_common_service", {commits: 1}, project.id) end end + + def activity + commit_sql = CommitLog.select("user_id,project_id, '' as ref").order(id: :desc).limit(10).to_sql + project_sql = Project.select("user_id,id as project_id, '' as ref").order(id: :desc).limit(10).to_sql + project_sql = Issue.select("user_id,project_id, '' as ref").order(id: :desc).limit(10).to_sql + project_sql = Issue.select("user_id,project_id, '' as ref").order(id: :desc).limit(10).to_sql + privacy_organizations_sql = Project.with_visibility("privacy").joins(:organization_users).where(organization_users: {user_id: current_user.id}).to_sql + @organizations = Organization.from("( #{ logged_organizations_sql } UNION #{ privacy_organizations_sql } ) AS users") + end end diff --git a/app/models/commit_log.rb b/app/models/commit_log.rb index 9b51b0631..22cdb1e18 100644 --- a/app/models/commit_log.rb +++ b/app/models/commit_log.rb @@ -3,4 +3,6 @@ class CommitLog < ApplicationRecord belongs_to :project belongs_to :repository + has_many :project_trends, as: :trend, dependent: :destroy + end From 08d2ccada2e836e6864f8893d689840d09b6e468 Mon Sep 17 00:00:00 2001 From: xxq250 Date: Mon, 17 Apr 2023 10:13:30 +0800 Subject: [PATCH 05/13] =?UTF-8?q?commit=E5=8A=A0=E5=85=A5=E5=88=B0?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=8A=A8=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/migrate/20230417032154_update_commit_log_utf8.rb | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 db/migrate/20230417032154_update_commit_log_utf8.rb diff --git a/db/migrate/20230417032154_update_commit_log_utf8.rb b/db/migrate/20230417032154_update_commit_log_utf8.rb new file mode 100644 index 000000000..fa8ac44d7 --- /dev/null +++ b/db/migrate/20230417032154_update_commit_log_utf8.rb @@ -0,0 +1,6 @@ +class UpdateCommitLogUtf8 < ActiveRecord::Migration[5.2] + def change + execute("ALTER TABLE `commit_logs` MODIFY `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;") + execute("ALTER TABLE `commit_logs` MODIFY `full_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;") + end +end From 71c1a0f436316b5c99647cbb0d7cebdd8ea56193 Mon Sep 17 00:00:00 2001 From: xxq250 Date: Mon, 17 Apr 2023 10:15:57 +0800 Subject: [PATCH 06/13] =?UTF-8?q?commit=E5=8A=A0=E5=85=A5=E5=88=B0?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=8A=A8=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/commit_log.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/models/commit_log.rb b/app/models/commit_log.rb index 22cdb1e18..def2846fa 100644 --- a/app/models/commit_log.rb +++ b/app/models/commit_log.rb @@ -5,4 +5,8 @@ class CommitLog < ApplicationRecord has_many :project_trends, as: :trend, dependent: :destroy + def title + self.message + end + end From 2175e798e11806a2189261290b9669b1d58b7c98 Mon Sep 17 00:00:00 2001 From: xxq250 Date: Mon, 17 Apr 2023 10:27:28 +0800 Subject: [PATCH 07/13] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/project_trends_controller.rb | 12 ++++++++++-- app/views/project_trends/last.json.jbuilder | 8 ++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 app/views/project_trends/last.json.jbuilder diff --git a/app/controllers/project_trends_controller.rb b/app/controllers/project_trends_controller.rb index f283d05f7..4c0b2348f 100644 --- a/app/controllers/project_trends_controller.rb +++ b/app/controllers/project_trends_controller.rb @@ -1,6 +1,6 @@ class ProjectTrendsController < ApplicationController - before_action :load_repository - before_action :check_project_public + before_action :load_repository, except: [:last] + before_action :check_project_public, except: [:last] def index project_trends = @project.project_trends.preload(:user, trend: :user, project: :owner) @@ -42,6 +42,14 @@ class ProjectTrendsController < ApplicationController @project_trends = project_trends.page(@page).per(@limit) end + def last + project_trends = ProjectTrend.preload(:user, trend: :user, project: :owner).order("id desc") + @page = params[:page] || 1 + @limit = params[:limit] || 20 + @project_trends_count = project_trends.count + @project_trends = project_trends.page(@page).per(@limit) + end + private def check_project_public diff --git a/app/views/project_trends/last.json.jbuilder b/app/views/project_trends/last.json.jbuilder new file mode 100644 index 000000000..04edf97a9 --- /dev/null +++ b/app/views/project_trends/last.json.jbuilder @@ -0,0 +1,8 @@ +json.partial! "commons/success" +json.total_count @project_trends_count +json.project_trends do + json.array! @project_trends.to_a.each do |trend| + json.partial! "detail", trend: trend + end +end + From cba729f48210a63482526568e4cf24ecb07817fd Mon Sep 17 00:00:00 2001 From: xxq250 Date: Mon, 17 Apr 2023 10:27:50 +0800 Subject: [PATCH 08/13] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/commit_logs_controller.rb | 9 --------- config/routes.rb | 1 + 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/app/controllers/commit_logs_controller.rb b/app/controllers/commit_logs_controller.rb index 7c0828b6b..b034f673c 100644 --- a/app/controllers/commit_logs_controller.rb +++ b/app/controllers/commit_logs_controller.rb @@ -28,13 +28,4 @@ class CommitLogsController < ApplicationController end end - - def activity - commit_sql = CommitLog.select("user_id,project_id, '' as ref").order(id: :desc).limit(10).to_sql - project_sql = Project.select("user_id,id as project_id, '' as ref").order(id: :desc).limit(10).to_sql - project_sql = Issue.select("user_id,project_id, '' as ref").order(id: :desc).limit(10).to_sql - project_sql = Issue.select("user_id,project_id, '' as ref").order(id: :desc).limit(10).to_sql - privacy_organizations_sql = Project.with_visibility("privacy").joins(:organization_users).where(organization_users: {user_id: current_user.id}).to_sql - @organizations = Organization.from("( #{ logged_organizations_sql } UNION #{ privacy_organizations_sql } ) AS users") - end end diff --git a/config/routes.rb b/config/routes.rb index 8b943f543..36f056c2a 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1074,6 +1074,7 @@ Rails.application.routes.draw do get 'oauth/get_token_callback', to: 'oauth#get_token_callback' resources :commit_logs, :only => [:create] + get 'activity/last', to: 'project_trends#last' scope '/app' do get '/', to: 'installations#app' From 0a693a77b89b6d564fb6085d3273162e9ecb58e6 Mon Sep 17 00:00:00 2001 From: xxq250 Date: Mon, 17 Apr 2023 10:38:10 +0800 Subject: [PATCH 09/13] =?UTF-8?q?commit=E5=8A=A0=E5=85=A5=E5=88=B0?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=8A=A8=E6=80=81=EF=BC=8C=E5=B9=B6=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../project_trends/_detail.json.jbuilder | 7 + config/locales/zh-CN.yml | 479 +++++++++--------- 2 files changed, 247 insertions(+), 239 deletions(-) diff --git a/app/views/project_trends/_detail.json.jbuilder b/app/views/project_trends/_detail.json.jbuilder index 04de10f6a..29609bd28 100644 --- a/app/views/project_trends/_detail.json.jbuilder +++ b/app/views/project_trends/_detail.json.jbuilder @@ -18,6 +18,13 @@ if trend.trend_type == "Issue" json.partial! "issues/simple_issue_item", locals: {issue: trend.trend} elsif trend.trend_type == "VersionRelease" json.partial! "version_releases/simple_version_release", locals: {version: trend.trend} +elsif trend.trend_type == "CommitLog" + commit_log = trend.trend + json.user do + json.partial! 'users/user_simple', locals: {user: commit_log.user} + end + json.ref commit_log.ref.to_s.gsub("refs/heads/", "") + json.extract! commit_log, :id,:name,:full_name,:message, :commit_id,:created_at,:updated_at else json.name trend.trend&.title json.created_at format_time(trend.trend&.created_at) diff --git a/config/locales/zh-CN.yml b/config/locales/zh-CN.yml index e7c586417..d5c68d448 100644 --- a/config/locales/zh-CN.yml +++ b/config/locales/zh-CN.yml @@ -1,240 +1,241 @@ -zh-CN: - error: - record_not_found: 您访问的页面不存在或已被删除 - forbidden: 您没有权限进行该操作 - unauthorized: 未登录 - - button_test: 测试 - button_edit: 编辑 - button_delete: 删除 - - admins_apply_status: - status: - 'pending': '待审批' - 'processed': '已审批' - 'refused': '已拒绝' - 'agreed': '已同意' - trend: - Issue: 疑修(Issue) - PullRequest: 合并请求(PR) - VersionRelease: 版本发布 - create: 创建了 - journal: 回复了 - close: 关闭了 - merge: 合并了 - push: 发布了 - - version: - draft: 草稿 - - journal_detail: - branch_name: 分支 - close_pr: 合并 - merge: 合并 - issue_tags_value: 标记 - lock_issue: 锁定工单 - unlock_issue: 解锁工单 - destroy_issue_depend: 删除依赖 - issue_depend: 增加依赖 - work_time: 开始工作 - cancel_time: 取消时间跟踪 - end_time: 停止工作 - subject: 主题 - description: 描述 - is_private: 私有 - assigned_to_id: 指派给 - tracker_id: 类型 - status_id: 状态 - priority_id: 优先级 - fixed_version_id: 里程碑 - start_date: 开始日期 - due_date: 结束日期 - estimated_hours: 添加耗时 - done_ratio: 完成度 - t: 是 - f: 否 - true: 是 - false: 否 - issue_tag_ids: 标记 - issue_type: 分类 - token: 悬赏金额 - close_issue: 工单 - activerecord: - attributes: - organization: - login: '组织名称' - user: - login: '登录名' - lastname: '姓名' - nickname: '昵称' - discuss: - content: '内容' - journals_for_message: - notes: '内容' - subject: - name: '课程名称' - description: '课程简介' - learning_notes: '学习须知' - stage: - name: '章节名称' - description: '章节描述' - shixun_info: - description: '简介' - fork_reason: 'fork原因' - challenge: - task_pass: '过关任务' - test_set: - input: '输入' - output: '输出' - challenge_question: - option_name: '选项' - challenge_choose: - subject: '题干' - challenge_answer: - contents: '答案内容' - memo: - content: '帖子内容' - course: - name: '课堂名称' - course_group: - name: '分班名称' - course_module: - module_name: '目录名称' - course_second_category: - name: '目录名称' - inform: - name: '标题' - description: '内容' - course_stage: - name: '章节名称' - description: '章节描述' - attachment: - description: '资源描述' - message: - subject: '标题' - message_detail: - content: '内容' - homework_common: - name: '标题' - description: '内容' - explanation: '内容' - reference_answer: '参考答案' - student_work: - description: '内容' - student_works_score: - comment: '评语' - challenge_work_score: - comment: '评语' - shixun_work_comment: - comment: '评语' - hidden_comment: '隐藏评语' - graduation_topic: - name: '选题名称' - description: '选题简介' - graduation_task: - name: '任务标题' - description: '内容' - graduation_work: - description: '作品内容' - graduation_work_score: - comment: '评语' - poll: - polls_name: '问卷标题' - polls_description: '问卷须知' - poll_question: - question_title: '题干' - poll_answer: - answer_text: '选项' - poll_vote: - vote_text: '内容' - exercise: - exercise_name: '试卷标题' - exercise_description: '试卷须知' - exercise_question: - question_title: '题干' - exercise_choice: - choice_text: '选项' - exercise_answer: - answer_text: '答案' - exercise_standard_answer: - answer_text: '参考答案' - exercise_answer_comment: - comment: '评语' - homework_bank: - name: '标题' - description: '内容' - reference_answer: '参考答案' - gtask_bank: - name: '任务标题' - description: '内容' - gtopic_bank: - name: '选题名称' - description: '选题简介' - exercise_bank: - name: '试卷标题' - description: '试卷须知' - exercise_bank_question: - question_title: '题干' - exerise_bank_choice: - choice_text: '选项' - exercise_bank_standard_answer: - answer_text: '参考答案' - library: - title: '标题' - content: '内容' - author_name: '作者姓名' - author_school_name: '作者单位名称' - competition: - introduction: '简介' - competition_module_md_content: - content: '内容' - chart_rule: - content: '内容' - project_package: - title: '标题' - examination_bank: - name: '试卷名称' - item_bank: - name: '题干' - item_analysis: - analysis: '解析' - item_choice: - choice_text: '选项' - hack: - name: '任务名称' - description: '描述' - hack_set: - input: '测试集输入' - output: '测试集输出' - hack_user_lastest_code: - notes: '笔记' - trustie_hack: - description: '描述' - discipline: - name: '名称' - sub_discipline: - name: '名称' - tag_discipline: - name: '名称' - live_link: - description: '说明' - url: '链接' - course_name: '课程名称' - platform: '直播平台' - live_time: '开播时间' - duration: '直播时长' - project_language: - name: '项目语言' - license: - name: '许可证名称' - content: '许可证内容' - ignore: - name: 'git忽略文件名称' - content: 'git忽略文件内容' - feedback_message_history: - title: '' - close_pr: 合并请求 - roles: - Developer: 开发者 - Reporter: 报告者 +zh-CN: + error: + record_not_found: 您访问的页面不存在或已被删除 + forbidden: 您没有权限进行该操作 + unauthorized: 未登录 + + button_test: 测试 + button_edit: 编辑 + button_delete: 删除 + + admins_apply_status: + status: + 'pending': '待审批' + 'processed': '已审批' + 'refused': '已拒绝' + 'agreed': '已同意' + trend: + Issue: 疑修(Issue) + PullRequest: 合并请求(PR) + VersionRelease: 版本发布 + CommitLog: 代码(Commit) + create: 创建了 + journal: 回复了 + close: 关闭了 + merge: 合并了 + push: 发布了 + + version: + draft: 草稿 + + journal_detail: + branch_name: 分支 + close_pr: 合并 + merge: 合并 + issue_tags_value: 标记 + lock_issue: 锁定工单 + unlock_issue: 解锁工单 + destroy_issue_depend: 删除依赖 + issue_depend: 增加依赖 + work_time: 开始工作 + cancel_time: 取消时间跟踪 + end_time: 停止工作 + subject: 主题 + description: 描述 + is_private: 私有 + assigned_to_id: 指派给 + tracker_id: 类型 + status_id: 状态 + priority_id: 优先级 + fixed_version_id: 里程碑 + start_date: 开始日期 + due_date: 结束日期 + estimated_hours: 添加耗时 + done_ratio: 完成度 + t: 是 + f: 否 + true: 是 + false: 否 + issue_tag_ids: 标记 + issue_type: 分类 + token: 悬赏金额 + close_issue: 工单 + activerecord: + attributes: + organization: + login: '组织名称' + user: + login: '登录名' + lastname: '姓名' + nickname: '昵称' + discuss: + content: '内容' + journals_for_message: + notes: '内容' + subject: + name: '课程名称' + description: '课程简介' + learning_notes: '学习须知' + stage: + name: '章节名称' + description: '章节描述' + shixun_info: + description: '简介' + fork_reason: 'fork原因' + challenge: + task_pass: '过关任务' + test_set: + input: '输入' + output: '输出' + challenge_question: + option_name: '选项' + challenge_choose: + subject: '题干' + challenge_answer: + contents: '答案内容' + memo: + content: '帖子内容' + course: + name: '课堂名称' + course_group: + name: '分班名称' + course_module: + module_name: '目录名称' + course_second_category: + name: '目录名称' + inform: + name: '标题' + description: '内容' + course_stage: + name: '章节名称' + description: '章节描述' + attachment: + description: '资源描述' + message: + subject: '标题' + message_detail: + content: '内容' + homework_common: + name: '标题' + description: '内容' + explanation: '内容' + reference_answer: '参考答案' + student_work: + description: '内容' + student_works_score: + comment: '评语' + challenge_work_score: + comment: '评语' + shixun_work_comment: + comment: '评语' + hidden_comment: '隐藏评语' + graduation_topic: + name: '选题名称' + description: '选题简介' + graduation_task: + name: '任务标题' + description: '内容' + graduation_work: + description: '作品内容' + graduation_work_score: + comment: '评语' + poll: + polls_name: '问卷标题' + polls_description: '问卷须知' + poll_question: + question_title: '题干' + poll_answer: + answer_text: '选项' + poll_vote: + vote_text: '内容' + exercise: + exercise_name: '试卷标题' + exercise_description: '试卷须知' + exercise_question: + question_title: '题干' + exercise_choice: + choice_text: '选项' + exercise_answer: + answer_text: '答案' + exercise_standard_answer: + answer_text: '参考答案' + exercise_answer_comment: + comment: '评语' + homework_bank: + name: '标题' + description: '内容' + reference_answer: '参考答案' + gtask_bank: + name: '任务标题' + description: '内容' + gtopic_bank: + name: '选题名称' + description: '选题简介' + exercise_bank: + name: '试卷标题' + description: '试卷须知' + exercise_bank_question: + question_title: '题干' + exerise_bank_choice: + choice_text: '选项' + exercise_bank_standard_answer: + answer_text: '参考答案' + library: + title: '标题' + content: '内容' + author_name: '作者姓名' + author_school_name: '作者单位名称' + competition: + introduction: '简介' + competition_module_md_content: + content: '内容' + chart_rule: + content: '内容' + project_package: + title: '标题' + examination_bank: + name: '试卷名称' + item_bank: + name: '题干' + item_analysis: + analysis: '解析' + item_choice: + choice_text: '选项' + hack: + name: '任务名称' + description: '描述' + hack_set: + input: '测试集输入' + output: '测试集输出' + hack_user_lastest_code: + notes: '笔记' + trustie_hack: + description: '描述' + discipline: + name: '名称' + sub_discipline: + name: '名称' + tag_discipline: + name: '名称' + live_link: + description: '说明' + url: '链接' + course_name: '课程名称' + platform: '直播平台' + live_time: '开播时间' + duration: '直播时长' + project_language: + name: '项目语言' + license: + name: '许可证名称' + content: '许可证内容' + ignore: + name: 'git忽略文件名称' + content: 'git忽略文件内容' + feedback_message_history: + title: '' + close_pr: 合并请求 + roles: + Developer: 开发者 + Reporter: 报告者 Manager: 管理员 \ No newline at end of file From 5922c8800fde43e597c8eca7d11085596f8cd738 Mon Sep 17 00:00:00 2001 From: xxq250 Date: Mon, 17 Apr 2023 10:40:58 +0800 Subject: [PATCH 10/13] =?UTF-8?q?commit=E5=8A=A0=E5=85=A5=E5=88=B0?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=8A=A8=E6=80=81=EF=BC=8C=E5=B9=B6=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/project_trends/_detail.json.jbuilder | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/views/project_trends/_detail.json.jbuilder b/app/views/project_trends/_detail.json.jbuilder index 29609bd28..f8d1006dd 100644 --- a/app/views/project_trends/_detail.json.jbuilder +++ b/app/views/project_trends/_detail.json.jbuilder @@ -19,12 +19,14 @@ if trend.trend_type == "Issue" elsif trend.trend_type == "VersionRelease" json.partial! "version_releases/simple_version_release", locals: {version: trend.trend} elsif trend.trend_type == "CommitLog" - commit_log = trend.trend - json.user do - json.partial! 'users/user_simple', locals: {user: commit_log.user} + json.commit_log do + commit_log = trend.trend + json.user do + json.partial! 'users/user_simple', locals: {user: commit_log.user} + end + json.ref commit_log.ref.to_s.gsub("refs/heads/", "") + json.extract! commit_log, :id,:name,:full_name,:message, :commit_id,:created_at,:updated_at end - json.ref commit_log.ref.to_s.gsub("refs/heads/", "") - json.extract! commit_log, :id,:name,:full_name,:message, :commit_id,:created_at,:updated_at else json.name trend.trend&.title json.created_at format_time(trend.trend&.created_at) From 1baee3efb6c8b73628cc60ccf19c1d9b2bd5f19b Mon Sep 17 00:00:00 2001 From: xxq250 Date: Mon, 17 Apr 2023 10:44:50 +0800 Subject: [PATCH 11/13] =?UTF-8?q?commit=E5=8A=A0=E5=85=A5=E5=88=B0?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=8A=A8=E6=80=81=EF=BC=8C=E8=B7=AF=E7=94=B1?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/routes.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/routes.rb b/config/routes.rb index 36f056c2a..517614efd 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -763,6 +763,8 @@ Rails.application.routes.draw do end end end + + get 'activity/last', to: 'project_trends#last' # Project Area END scope module: :helps do @@ -1074,7 +1076,6 @@ Rails.application.routes.draw do get 'oauth/get_token_callback', to: 'oauth#get_token_callback' resources :commit_logs, :only => [:create] - get 'activity/last', to: 'project_trends#last' scope '/app' do get '/', to: 'installations#app' From 0a50da33a9badb89b1c69dab2bc79db04f00cffc Mon Sep 17 00:00:00 2001 From: xxq250 Date: Mon, 17 Apr 2023 10:49:17 +0800 Subject: [PATCH 12/13] =?UTF-8?q?commit=E5=8A=A0=E5=85=A5=E5=88=B0?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=8A=A8=E6=80=81=EF=BC=8C=E8=B7=AF=E7=94=B1?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/routes.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/config/routes.rb b/config/routes.rb index 517614efd..0c04bf1db 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -117,6 +117,7 @@ Rails.application.routes.draw do get 'home/index' get 'home/search' get 'main/first_stamp' + get 'activity/last', to: 'project_trends#last' get 'search', to: 'searchs#index' put 'commons/hidden', to: 'commons#hidden' From 1be61f97cfdb59538853c6f51591959f9e8db2e4 Mon Sep 17 00:00:00 2001 From: xxq250 Date: Mon, 17 Apr 2023 10:49:30 +0800 Subject: [PATCH 13/13] =?UTF-8?q?commit=E5=8A=A0=E5=85=A5=E5=88=B0?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=8A=A8=E6=80=81=EF=BC=8C=E8=B7=AF=E7=94=B1?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/routes.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/config/routes.rb b/config/routes.rb index 0c04bf1db..0e760fbe9 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -765,7 +765,6 @@ Rails.application.routes.draw do end end - get 'activity/last', to: 'project_trends#last' # Project Area END scope module: :helps do