diff options
author | Imre Farkas <ifarkas@gitlab.com> | 2018-05-31 17:01:04 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2018-05-31 17:01:04 +0300 |
commit | 20dfe25c151cc883ce0d38b67125b5ca41e6d422 (patch) | |
tree | 9a29f05a241713f3488e6bc2e5df03c07300ef45 /app/controllers/projects/issues_controller.rb | |
parent | 2fdd8982f8204340e6413a57f46e6c41d8ecb429 (diff) |
Export assigned issues in iCalendar feed
Diffstat (limited to 'app/controllers/projects/issues_controller.rb')
-rw-r--r-- | app/controllers/projects/issues_controller.rb | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/app/controllers/projects/issues_controller.rb b/app/controllers/projects/issues_controller.rb index d69015c8665..35c36c725e2 100644 --- a/app/controllers/projects/issues_controller.rb +++ b/app/controllers/projects/issues_controller.rb @@ -10,8 +10,8 @@ class Projects::IssuesController < Projects::ApplicationController before_action :whitelist_query_limiting, only: [:create, :create_merge_request, :move, :bulk_update] before_action :check_issues_available! - before_action :issue, except: [:index, :new, :create, :bulk_update] - before_action :set_issuables_index, only: [:index] + before_action :issue, except: [:index, :calendar, :new, :create, :bulk_update] + before_action :set_issuables_index, only: [:index, :calendar] # Allow write(create) issue before_action :authorize_create_issue!, only: [:new, :create] @@ -39,6 +39,17 @@ class Projects::IssuesController < Projects::ApplicationController end end + def calendar + @issues = @issuables + .non_archived + .with_due_date + .limit(100) + + respond_to do |format| + format.ics { response.headers['Content-Disposition'] = 'inline' } + end + end + def new params[:issue] ||= ActionController::Parameters.new( assignee_ids: "" |