debian-mirror-gitlab/app/presenters/issue_presenter.rb

34 lines
816 B
Ruby
Raw Normal View History

2019-02-15 15:39:39 +05:30
# frozen_string_literal: true
class IssuePresenter < Gitlab::View::Presenter::Delegated
2021-11-18 22:05:49 +05:30
presents ::Issue, as: :issue
2019-02-15 15:39:39 +05:30
2019-09-04 21:01:54 +05:30
def issue_path
2022-07-16 23:28:13 +05:30
web_path
2019-09-04 21:01:54 +05:30
end
2021-11-18 22:05:49 +05:30
delegator_override :subscribed?
2019-12-21 20:55:43 +05:30
def subscribed?
issue.subscribed?(current_user, issue.project)
end
2021-01-29 00:20:46 +05:30
def project_emails_disabled?
issue.project.emails_disabled?
end
2023-04-23 21:23:45 +05:30
delegator_override :service_desk_reply_to
def service_desk_reply_to
return unless super.present?
return super if Ability.allowed?(current_user, :read_external_emails, issue.project)
Gitlab::Utils::Email.obfuscated_email(super, deform: true)
end
delegator_override :issue_email_participants
def issue_email_participants
issue.issue_email_participants.present(current_user: current_user)
end
2019-02-15 15:39:39 +05:30
end
2021-01-03 14:25:43 +05:30
2021-06-08 01:23:25 +05:30
IssuePresenter.prepend_mod_with('IssuePresenter')