mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-17 02:05:58 +08:00
添加children_journals
This commit is contained in:
@@ -447,7 +447,7 @@ class IssuesController < ApplicationController
|
||||
status_id: params[:status_id],
|
||||
priority_id: params[:priority_id],
|
||||
fixed_version_id: params[:fixed_version_id],
|
||||
start_date: params[:start_date].to_s.to_date,
|
||||
start_date: params[:start_date].to_s.to_date || Time.current.to_date,
|
||||
due_date: params[:due_date].to_s.to_date,
|
||||
estimated_hours: params[:estimated_hours],
|
||||
done_ratio: params[:done_ratio],
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
class JournalsController < ApplicationController
|
||||
before_action :require_login, except: :index
|
||||
before_action :set_issue
|
||||
before_action :set_issue, except: :get_children_journals
|
||||
before_action :check_issue_permission
|
||||
before_action :set_journal, only: [:destroy, :edit, :update]
|
||||
|
||||
@@ -73,6 +73,14 @@ class JournalsController < ApplicationController
|
||||
|
||||
end
|
||||
|
||||
def get_children_journals
|
||||
@page = params[:page] || 1
|
||||
@limit = params[:limit] || 10
|
||||
journals = Journal.children_journals(params[:parent_id]).journal_includes.order("created_on desc")
|
||||
@journals_size = journals.size
|
||||
@children_journals = journals.page(@page).per(@limit)
|
||||
end
|
||||
|
||||
|
||||
private
|
||||
|
||||
|
||||
Reference in New Issue
Block a user