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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
d65e31ab
Commit
d65e31ab
authored
Sep 05, 2018
by
Nick Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Backport changes to Gitlab::Tempalte::BaseTemplate
parent
803bf517
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
lib/gitlab/template/base_template.rb
lib/gitlab/template/base_template.rb
+6
-2
No files found.
lib/gitlab/template/base_template.rb
View file @
d65e31ab
module
Gitlab
module
Template
class
BaseTemplate
def
initialize
(
path
,
project
=
nil
)
attr_reader
:category
def
initialize
(
path
,
project
=
nil
,
category:
nil
)
@path
=
path
@category
=
category
@finder
=
self
.
class
.
finder
(
project
)
end
def
name
File
.
basename
(
@path
,
self
.
class
.
extension
)
end
alias_method
:id
,
:name
def
content
@finder
.
read
(
@path
)
...
...
@@ -62,7 +66,7 @@ module Gitlab
directory
=
category_directory
(
category
)
files
=
finder
(
project
).
list_files_for
(
directory
)
files
.
map
{
|
f
|
new
(
f
,
project
)
}.
sort
files
.
map
{
|
f
|
new
(
f
,
project
,
category:
category
)
}.
sort
end
def
category_directory
(
category
)
...
...
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