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
9d668750
Commit
9d668750
authored
May 07, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add generate action to labels controller which allow creation of default labels set for project
parent
af5d0e9e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
4 deletions
+17
-4
app/controllers/labels_controller.rb
app/controllers/labels_controller.rb
+6
-0
app/views/labels/index.html.haml
app/views/labels/index.html.haml
+4
-3
config/routes.rb
config/routes.rb
+7
-1
No files found.
app/controllers/labels_controller.rb
View file @
9d668750
...
@@ -10,6 +10,12 @@ class LabelsController < ProjectResourceController
...
@@ -10,6 +10,12 @@ class LabelsController < ProjectResourceController
@labels
=
@project
.
issues_labels
.
order
(
'count DESC'
)
@labels
=
@project
.
issues_labels
.
order
(
'count DESC'
)
end
end
def
generate
Gitlab
::
Labels
.
generate
(
@project
)
redirect_to
project_labels_path
(
@project
)
end
protected
protected
def
module_enabled
def
module_enabled
...
...
app/views/labels/index.html.haml
View file @
9d668750
...
@@ -3,12 +3,13 @@
...
@@ -3,12 +3,13 @@
%h3
.page_title
%h3
.page_title
Labels
Labels
%br
%br
%div
.ui-box
%ul
.well-list.labels-table
.light-well
%ul
.bordered-list.labels-table
-
@labels
.
each
do
|
label
|
-
@labels
.
each
do
|
label
|
=
render
'label'
,
label:
label
=
render
'label'
,
label:
label
-
unless
@labels
.
present?
-
unless
@labels
.
present?
%li
%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 @
9d668750
...
@@ -269,7 +269,13 @@ Gitlab::Application.routes.draw do
...
@@ -269,7 +269,13 @@ Gitlab::Application.routes.draw do
resources
:team
,
controller:
'team_members'
,
only:
[
:index
]
resources
:team
,
controller:
'team_members'
,
only:
[
:index
]
resources
:milestones
,
except:
[
:destroy
]
resources
:milestones
,
except:
[
:destroy
]
resources
:labels
,
only:
[
:index
]
resources
:labels
,
only:
[
:index
]
do
collection
do
post
:generate
end
end
resources
:issues
,
except:
[
:destroy
]
do
resources
:issues
,
except:
[
:destroy
]
do
collection
do
collection
do
post
:bulk_update
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