2021-10-26 14:09:19 -04:00
|
|
|
# rubocop:disable Naming/FileName
|
2021-02-12 07:09:02 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-05-31 10:01:04 -04:00
|
|
|
cal = Icalendar::Calendar.new
|
|
|
|
cal.prodid = '-//GitLab//NONSGML GitLab//EN'
|
|
|
|
cal.x_wr_calname = 'GitLab Issues'
|
|
|
|
|
2018-08-27 11:31:01 -04:00
|
|
|
# rubocop: disable CodeReuse/ActiveRecord
|
2018-12-17 05:27:10 -05:00
|
|
|
@issues.preload(project: :namespace).each do |issue|
|
2018-05-31 10:01:04 -04:00
|
|
|
cal.event do |event|
|
|
|
|
event.dtstart = Icalendar::Values::Date.new(issue.due_date)
|
|
|
|
event.summary = "#{issue.title} (in #{issue.project.full_path})"
|
|
|
|
event.description = "Find out more at #{issue_url(issue)}"
|
|
|
|
event.url = issue_url(issue)
|
|
|
|
event.transp = 'TRANSPARENT'
|
|
|
|
end
|
|
|
|
end
|
2018-08-27 11:31:01 -04:00
|
|
|
# rubocop: enable CodeReuse/ActiveRecord
|
2018-05-31 10:01:04 -04:00
|
|
|
|
|
|
|
cal.to_ical
|
2021-10-26 14:09:19 -04:00
|
|
|
|
|
|
|
# rubocop:enable Naming/FileName
|