2021-12-11 22:18:48 +05:30
|
|
|
# rubocop:disable Naming/FileName
|
2021-03-11 19:13:27 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-11-08 19:23:39 +05:30
|
|
|
cal = Icalendar::Calendar.new
|
|
|
|
cal.prodid = '-//GitLab//NONSGML GitLab//EN'
|
|
|
|
cal.x_wr_calname = 'GitLab Issues'
|
|
|
|
|
2018-12-05 23:21:45 +05:30
|
|
|
# rubocop: disable CodeReuse/ActiveRecord
|
2019-02-15 15:39:39 +05:30
|
|
|
@issues.preload(project: :namespace).each do |issue|
|
2018-11-08 19:23:39 +05:30
|
|
|
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-12-05 23:21:45 +05:30
|
|
|
# rubocop: enable CodeReuse/ActiveRecord
|
2018-11-08 19:23:39 +05:30
|
|
|
|
|
|
|
cal.to_ical
|
2021-12-11 22:18:48 +05:30
|
|
|
|
|
|
|
# rubocop:enable Naming/FileName
|