更改:继承模板

This commit is contained in:
yystopf 2025-06-21 15:42:57 +08:00
parent f97ad21af5
commit 880f547b3b
3 changed files with 61 additions and 15 deletions

View File

@ -0,0 +1,55 @@
json.(issue, :id, :subject, :project_issues_index)
json.blockchain_token_num (Site.has_blockchain? && issue.project&.use_blockchain) ? issue.blockchain_token_num : nil
json.created_at issue.created_on.strftime("%Y-%m-%d %H:%M")
json.updated_at issue.updated_on.strftime("%Y-%m-%d %H:%M")
json.tags issue.show_issue_tags.each do |tag|
json.partial! "api/v1/issues/issue_tags/simple_detail", locals: {tag: tag}
end
json.status_name issue.issue_status&.name
json.status_id issue.status_id
json.status do
if issue.issue_status.present?
json.partial! "api/v1/issues/statues/simple_detail", locals: {status: issue.issue_status}
else
json.nil!
end
end
json.priority_name issue.priority&.name
json.priority_id issue.priority_id
json.priority do
if issue.priority.present?
json.partial! "api/v1/issues/issue_priorities/simple_detail", locals: {priority: issue.priority}
else
json.nil!
end
end
json.milestone_name issue.version&.name
json.milestone_id issue.fixed_version_id
json.root_id issue.root_id
json.pm_issue_type issue.pm_issue_type
json.pm_sprint_id issue.pm_sprint_id
json.pm_project_id issue.pm_project_id
json.time_scale issue.time_scale
if weekly_begin_date.present? && weekly_end_date.present?
if params[:pm_issue_types].present?
json.child_count issue.children_issues.where(pm_issue_type: 4).where("due_date >=? and start_date <=?", weekly_begin_date, weekly_end_date).count
else
json.child_count issue.children_issues.where("due_date >=? and start_date <=?", weekly_begin_date, weekly_end_date).count
end
else
if params[:pm_issue_types].present?
json.child_count issue.children_issues.where(pm_issue_type: 4).count
else
json.child_count issue.child_count
end
end
json.author do
json.partial! "api/v1/users/simple_user", locals: {user: issue.user}
end
json.assigners issue.show_assigners.each do |assigner|
json.partial! "api/v1/users/simple_user", locals: {user: assigner}
end
json.comment_journals_count issue.comment_journals.size
json.start_date issue.start_date
json.due_date issue.due_date

View File

@ -1,8 +1,8 @@
json.this_week_all_issues @this_week_all_issues.each do |issue|
json.partial! "api/v1/issues/simple_detail", locals: {issue: issue, weekly_begin_date: @weekly_begin_date, weekly_end_date: @weekly_end_date}
json.partial! "api/pm/weekly_issues/simple_detail", locals: {issue: issue, weekly_begin_date: @weekly_begin_date, weekly_end_date: @weekly_end_date}
end
json.this_week_total_count @this_week_all_issues.total_count
json.next_week_all_issues @next_week_all_issues.each do |issue|
json.partial! "api/v1/issues/simple_detail", locals: {issue: issue, weekly_begin_date: @weekly_begin_date+1.week, weekly_end_date: @weekly_end_date+1.week}
json.partial! "api/pm/weekly_issues/simple_detail", locals: {issue: issue, weekly_begin_date: @weekly_begin_date+1.week, weekly_end_date: @weekly_end_date+1.week}
end
json.next_week_total_count @next_week_all_issues.total_count

View File

@ -30,20 +30,11 @@ json.pm_issue_type issue.pm_issue_type
json.pm_sprint_id issue.pm_sprint_id
json.pm_project_id issue.pm_project_id
json.time_scale issue.time_scale
if weekly_begin_date.present? && weekly_end_date.present?
if params[:pm_issue_types].present?
json.child_count issue.children_issues.where(pm_issue_type: 4).where("due_date >=? and start_date <=?", weekly_begin_date, weekly_end_date).count
else
json.child_count issue.children_issues.where("due_date >=? and start_date <=?", weekly_begin_date, weekly_end_date).count
end
else
if params[:pm_issue_types].present?
json.child_count issue.children_issues.where(pm_issue_type: 4).count
else
json.child_count issue.child_count
end
end
json.author do
json.partial! "api/v1/users/simple_user", locals: {user: issue.user}
end