gitlab-org--gitlab-foss/app/controllers/concerns/issues_action.rb
Imre Farkas 6954ebbe55
Render calendar feed inline when accessed from GitLab
With text/calendar as Content-Type, the browser always downloads the
content as a file (even ignoring the Content-Disposition header). We
want to display the content inline when accessed from GitLab, similarly
to the RSS feed.
2018-06-18 10:53:52 +02:00

31 lines
733 B
Ruby

module IssuesAction
extend ActiveSupport::Concern
include IssuableCollections
include IssuesCalendar
# rubocop:disable Gitlab/ModuleWithInstanceVariables
def issues
@issues = issuables_collection
.non_archived
.page(params[:page])
@issuable_meta_data = issuable_meta_data(@issues, collection_type)
respond_to do |format|
format.html
format.atom { render layout: 'xml.atom' }
end
end
# rubocop:enable Gitlab/ModuleWithInstanceVariables
def issues_calendar
render_issues_calendar(issuables_collection)
end
private
def finder_type
(super if defined?(super)) ||
(IssuesFinder if %w(issues issues_calendar).include?(action_name))
end
end