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
Léo-Paul Géneau
gitlab-ce
Commits
40d1fc1c
Commit
40d1fc1c
authored
Aug 14, 2018
by
Nick Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert BlobHelper#licenses_for_select to use the new LicenseTemplateFinder
parent
d3490f69
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
app/helpers/blob_helper.rb
app/helpers/blob_helper.rb
+7
-5
No files found.
app/helpers/blob_helper.rb
View file @
40d1fc1c
...
...
@@ -182,12 +182,14 @@ module BlobHelper
def
licenses_for_select
return
@licenses_for_select
if
defined?
(
@licenses_for_select
)
licenses
=
Licensee
::
License
.
all
grouped_licenses
=
LicenseTemplateFinder
.
new
.
execute
.
group_by
(
&
:category
)
categories
=
grouped_licenses
.
keys
@licenses_for_select
=
{
Popular
:
licenses
.
select
(
&
:featured
).
map
{
|
license
|
{
name:
license
.
name
,
id:
license
.
key
}
},
Other
:
licenses
.
reject
(
&
:featured
).
map
{
|
license
|
{
name:
license
.
name
,
id:
license
.
key
}
}
}
@licenses_for_select
=
categories
.
each_with_object
({})
do
|
category
,
hash
|
hash
[
category
]
=
grouped_licenses
[
category
].
map
do
|
license
|
{
name:
license
.
name
,
id:
license
.
id
}
end
end
end
def
ref_project
...
...
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