Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
151b28c31cdb
Commit
9d668750
authored
May 07, 2013
by
Dmitriy Zaporozhets
Browse files
Add generate action to labels controller which allow creation of default labels set for project
parent
073cda1f0187
Changes
3
Hide whitespace changes
Inline
Side-by-side
app/controllers/labels_controller.rb
View file @
151b28c3
...
...
@@ -10,6 +10,12 @@ def index
@labels
=
@project
.
issues_labels
.
order
(
'count DESC'
)
end
def
generate
Gitlab
::
Labels
.
generate
(
@project
)
redirect_to
project_labels_path
(
@project
)
end
protected
def
module_enabled
...
...
app/views/labels/index.html.haml
View file @
151b28c3
...
...
@@ -3,12 +3,13 @@
%h3
.page_title
Labels
%br
%div
.ui-box
%ul
.well-list.labels-table
.light-well
%ul
.bordered-list.labels-table
-
@labels
.
each
do
|
label
|
=
render
'label'
,
label:
label
-
unless
@labels
.
present?
%li
%h3
.nothing_here_message
Nothing to show here
%h3
.nothing_here_message
Add first label to your issues or
#{
link_to
'generate'
,
generate_project_labels_path
(
@project
),
method: :post
}
default set of labels
config/routes.rb
View file @
151b28c3
...
...
@@ -269,7 +269,13 @@
resources
:team
,
controller:
'team_members'
,
only:
[
:index
]
resources
:milestones
,
except:
[
:destroy
]
resources
:labels
,
only:
[
:index
]
resources
:labels
,
only:
[
:index
]
do
collection
do
post
:generate
end
end
resources
:issues
,
except:
[
:destroy
]
do
collection
do
post
:bulk_update
...
...
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