Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
c6c7552e
Commit
c6c7552e
authored
9 years ago
by
Marin Jankovski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Build the urls inside of the service.
parent
537cd66d
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
17 deletions
+21
-17
app/helpers/issues_helper.rb
app/helpers/issues_helper.rb
+3
-16
app/models/project_services/gitlab_issue_tracker_service.rb
app/models/project_services/gitlab_issue_tracker_service.rb
+13
-1
app/models/project_services/issue_tracker_service.rb
app/models/project_services/issue_tracker_service.rb
+4
-0
spec/helpers/gitlab_markdown_helper_spec.rb
spec/helpers/gitlab_markdown_helper_spec.rb
+1
-0
No files found.
app/helpers/issues_helper.rb
View file @
c6c7552e
...
...
@@ -16,32 +16,19 @@ module IssuesHelper
def
url_for_project_issues
(
project
=
@project
)
return
''
if
project
.
nil?
if
project
.
default_issues_tracker?
project_issues_path
(
project
)
else
project
.
external_issue_tracker
.
project_url
end
project
.
issues_tracker
.
project_url
end
def
url_for_new_issue
(
project
=
@project
)
return
''
if
project
.
nil?
if
project
.
default_issues_tracker?
url
=
new_project_issue_path
project_id:
project
else
project
.
external_issue_tracker
.
new_issue_url
end
project
.
issues_tracker
.
new_issue_url
end
def
url_for_issue
(
issue_iid
,
project
=
@project
)
return
''
if
project
.
nil?
if
project
.
default_issues_tracker?
url
=
project_issue_url
project_id:
project
,
id:
issue_iid
else
url
=
project
.
external_issue_tracker
.
issues_url
url
.
gsub
(
':id'
,
issue_iid
.
to_s
)
end
project
.
issues_tracker
.
issue_url
(
issue_iid
)
end
def
title_for_issue
(
issue_iid
,
project
=
@project
)
...
...
This diff is collapsed.
Click to expand it.
app/models/project_services/gitlab_issue_tracker_service.rb
View file @
c6c7552e
class
GitlabIssueTrackerService
<
IssueTrackerService
include
Rails
.
application
.
routes
.
url_helpers
prop_accessor
:title
,
:description
,
:project_url
,
:issues_url
,
:new_issue_url
...
...
@@ -10,4 +10,16 @@ class GitlabIssueTrackerService < IssueTrackerService
def
to_param
'gitlab'
end
def
project_url
project_issues_path
(
project
)
end
def
new_issue_url
new_project_issue_path
project_id:
project
end
def
issue_url
(
iid
)
"
#{
Gitlab
.
config
.
gitlab
.
url
}#{
project_issue_path
project_id:
project
,
id:
iid
}
"
end
end
This diff is collapsed.
Click to expand it.
app/models/project_services/issue_tracker_service.rb
View file @
c6c7552e
...
...
@@ -22,6 +22,10 @@ class IssueTrackerService < Service
# implement inside child
end
def
issue_url
(
iid
)
self
.
issues_url
.
gsub
(
':id'
,
iid
.
to_s
)
end
def
fields
[
{
type:
'text'
,
name:
'description'
,
placeholder:
description
},
...
...
This diff is collapsed.
Click to expand it.
spec/helpers/gitlab_markdown_helper_spec.rb
View file @
c6c7552e
...
...
@@ -23,6 +23,7 @@ describe GitlabMarkdownHelper do
@project
=
project
@ref
=
'markdown'
@repository
=
project
.
repository
@request
.
host
=
Gitlab
.
config
.
gitlab
.
host
end
describe
"#gfm"
do
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment