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
Tatuya Kamada
gitlab-ce
Commits
a88f0a1f
Commit
a88f0a1f
authored
Apr 05, 2016
by
Sebastian Klier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add wiki_page helper to url_builder
parent
559ef41d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
app/services/wiki_pages/base_service.rb
app/services/wiki_pages/base_service.rb
+2
-1
lib/gitlab/url_builder.rb
lib/gitlab/url_builder.rb
+6
-0
No files found.
app/services/wiki_pages/base_service.rb
View file @
a88f0a1f
...
...
@@ -10,7 +10,8 @@ module WikiPages
# DEPRECATED
repository:
@project
.
hook_attrs
.
slice
(
:name
,
:url
,
:description
,
:homepage
)
}
page_url
=
"
#{
Gitlab
.
config
.
gitlab
.
url
}#{
@project
.
wiki
.
wiki_base_path
}
/
#{
page
.
slug
}
"
page_url
=
Gitlab
::
UrlBuilder
.
new
(
:wiki_page
).
build
(
page
)
hook_data
[
:object_attributes
].
merge!
(
url:
page_url
,
action:
action
)
hook_data
end
...
...
lib/gitlab/url_builder.rb
View file @
a88f0a1f
...
...
@@ -20,6 +20,8 @@ module Gitlab
merge_request_url
(
object
)
when
Note
note_url
when
WikiPage
wiki_page_url
else
raise
NotImplementedError
.
new
(
"No URL builder defined for
#{
object
.
class
}
"
)
end
...
...
@@ -58,5 +60,9 @@ module Gitlab
project_snippet_url
(
snippet
,
anchor:
dom_id
(
object
))
end
end
def
wiki_page_url
"
#{
Gitlab
.
config
.
gitlab
.
url
}#{
object
.
wiki
.
wiki_base_path
}
/
#{
object
.
slug
}
"
end
end
end
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