debian-mirror-gitlab/app/models/project_services/gitlab_issue_tracker_service.rb

38 lines
726 B
Ruby
Raw Normal View History

2015-04-26 12:48:37 +05:30
class GitlabIssueTrackerService < IssueTrackerService
2017-09-10 17:25:29 +05:30
include Gitlab::Routing
2015-04-26 12:48:37 +05:30
2017-08-17 22:00:37 +05:30
validates :project_url, :issues_url, :new_issue_url, presence: true, url: true, if: :activated?
2015-04-26 12:48:37 +05:30
prop_accessor :title, :description, :project_url, :issues_url, :new_issue_url
2016-01-29 22:53:50 +05:30
default_value_for :default, true
2015-04-26 12:48:37 +05:30
2017-08-17 22:00:37 +05:30
def self.to_param
2015-04-26 12:48:37 +05:30
'gitlab'
end
def project_url
2017-09-10 17:25:29 +05:30
project_issues_url(project)
2015-04-26 12:48:37 +05:30
end
def new_issue_url
2017-09-10 17:25:29 +05:30
new_project_issue_url(project)
2015-04-26 12:48:37 +05:30
end
def issue_url(iid)
2017-09-10 17:25:29 +05:30
project_issue_url(project, id: iid)
2015-04-26 12:48:37 +05:30
end
2017-09-10 17:25:29 +05:30
def issue_tracker_path
project_issues_path(project)
2015-04-26 12:48:37 +05:30
end
def new_issue_path
2017-09-10 17:25:29 +05:30
new_project_issue_path(project)
2015-04-26 12:48:37 +05:30
end
def issue_path(iid)
2017-09-10 17:25:29 +05:30
project_issue_path(project, id: iid)
2015-04-26 12:48:37 +05:30
end
end