BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
6fb9badc
Unverified
Commit
6fb9badc
authored
Jul 29, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace project labels with tags to prevent name conflict with GitLab labels
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
03654a6a
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
26 additions
and
17 deletions
+26
-17
dashboard_controller.rb
app/controllers/dashboard_controller.rb
+2
-2
projects_controller.rb
app/controllers/projects_controller.rb
+1
-1
project.rb
app/models/project.rb
+1
-1
_projects_filter.html.haml
app/views/dashboard/_projects_filter.html.haml
+6
-6
projects.html.haml
app/views/dashboard/projects.html.haml
+2
-2
edit.html.haml
app/views/projects/edit.html.haml
+4
-4
20140729145339_migrate_project_tags.rb
db/migrate/20140729145339_migrate_project_tags.rb
+9
-0
schema.rb
db/schema.rb
+1
-1
No files found.
app/controllers/dashboard_controller.rb
View file @
6fb9badc
...
@@ -46,11 +46,11 @@ class DashboardController < ApplicationController
...
@@ -46,11 +46,11 @@ class DashboardController < ApplicationController
@projects
=
@projects
.
where
(
namespace_id:
Group
.
find_by
(
name:
params
[
:group
]))
if
params
[
:group
].
present?
@projects
=
@projects
.
where
(
namespace_id:
Group
.
find_by
(
name:
params
[
:group
]))
if
params
[
:group
].
present?
@projects
=
@projects
.
where
(
visibility_level:
params
[
:visibility_level
])
if
params
[
:visibility_level
].
present?
@projects
=
@projects
.
where
(
visibility_level:
params
[
:visibility_level
])
if
params
[
:visibility_level
].
present?
@projects
=
@projects
.
includes
(
:namespace
)
@projects
=
@projects
.
includes
(
:namespace
)
@projects
=
@projects
.
tagged_with
(
params
[
:
label
])
if
params
[
:label
].
present?
@projects
=
@projects
.
tagged_with
(
params
[
:
tag
])
if
params
[
:tag
].
present?
@projects
=
@projects
.
sort
(
@sort
=
params
[
:sort
])
@projects
=
@projects
.
sort
(
@sort
=
params
[
:sort
])
@projects
=
@projects
.
page
(
params
[
:page
]).
per
(
30
)
@projects
=
@projects
.
page
(
params
[
:page
]).
per
(
30
)
@
labels
=
current_user
.
authorized_projects
.
tags_on
(
:label
s
)
@
tags
=
current_user
.
authorized_projects
.
tags_on
(
:tag
s
)
@groups
=
current_user
.
authorized_groups
@groups
=
current_user
.
authorized_groups
end
end
...
...
app/controllers/projects_controller.rb
View file @
6fb9badc
...
@@ -196,7 +196,7 @@ class ProjectsController < ApplicationController
...
@@ -196,7 +196,7 @@ class ProjectsController < ApplicationController
def
project_params
def
project_params
params
.
require
(
:project
).
permit
(
params
.
require
(
:project
).
permit
(
:name
,
:path
,
:description
,
:issues_tracker
,
:
label
_list
,
:name
,
:path
,
:description
,
:issues_tracker
,
:
tag
_list
,
:issues_enabled
,
:merge_requests_enabled
,
:snippets_enabled
,
:issues_tracker_id
,
:default_branch
,
:issues_enabled
,
:merge_requests_enabled
,
:snippets_enabled
,
:issues_tracker_id
,
:default_branch
,
:wiki_enabled
,
:visibility_level
,
:import_url
,
:last_activity_at
,
:namespace_id
:wiki_enabled
,
:visibility_level
,
:import_url
,
:last_activity_at
,
:namespace_id
)
)
...
...
app/models/project.rb
View file @
6fb9badc
...
@@ -42,7 +42,7 @@ class Project < ActiveRecord::Base
...
@@ -42,7 +42,7 @@ class Project < ActiveRecord::Base
ActsAsTaggableOn
.
strict_case_match
=
true
ActsAsTaggableOn
.
strict_case_match
=
true
acts_as_taggable_on
:
label
s
,
:issues_default_labels
acts_as_taggable_on
:
tag
s
,
:issues_default_labels
attr_accessor
:new_default_branch
attr_accessor
:new_default_branch
...
...
app/views/dashboard/_projects_filter.html.haml
View file @
6fb9badc
...
@@ -44,12 +44,12 @@
...
@@ -44,12 +44,12 @@
-
if
@
label
s
.
present?
-
if
@
tag
s
.
present?
%fieldset
%fieldset
%legend
Label
s
%legend
Tag
s
%ul
.nav.nav-pills.nav-stacked.nav-small
%ul
.nav.nav-pills.nav-stacked.nav-small
-
@
labels
.
each
do
|
label
|
-
@
tags
.
each
do
|
tag
|
%li
{
class:
(
label
.
name
==
params
[
:label
])
?
'active'
:
'light'
}
%li
{
class:
(
tag
.
name
==
params
[
:tag
])
?
'active'
:
'light'
}
=
link_to
projects_dashboard_filter_path
(
scope:
params
[
:scope
],
label:
label
.
name
)
do
=
link_to
projects_dashboard_filter_path
(
scope:
params
[
:scope
],
tag:
tag
.
name
)
do
%i
.icon-tag
%i
.icon-tag
=
label
.
name
=
tag
.
name
app/views/dashboard/projects.html.haml
View file @
6fb9badc
...
@@ -54,10 +54,10 @@
...
@@ -54,10 +54,10 @@
%span
.label
%span
.label
%i
.icon-archive
%i
.icon-archive
Archived
Archived
-
project
.
labels
.
each
do
|
label
|
-
project
.
tags
.
each
do
|
tag
|
%span
.label.label-info
%span
.label.label-info
%i
.icon-tag
%i
.icon-tag
=
label
.
name
=
tag
.
name
-
if
project
.
description
.
present?
-
if
project
.
description
.
present?
%p
=
truncate
project
.
description
,
length:
100
%p
=
truncate
project
.
description
,
length:
100
.last-activity
.last-activity
...
...
app/views/projects/edit.html.haml
View file @
6fb9badc
...
@@ -33,12 +33,12 @@
...
@@ -33,12 +33,12 @@
%fieldset
.features
%fieldset
.features
%legend
%legend
Label
s:
Tag
s:
.form-group
.form-group
=
f
.
label
:
label_list
,
"Label
s"
,
class:
'control-label'
=
f
.
label
:
tag_list
,
"Tag
s"
,
class:
'control-label'
.col-sm-10
.col-sm-10
=
f
.
text_field
:
label
_list
,
maxlength:
2000
,
class:
"form-control"
=
f
.
text_field
:
tag
_list
,
maxlength:
2000
,
class:
"form-control"
%p
.hint
Separate
label
s with commas.
%p
.hint
Separate
tag
s with commas.
%fieldset
.features
%fieldset
.features
%legend
%legend
...
...
db/migrate/20140729145339_migrate_project_tags.rb
0 → 100644
View file @
6fb9badc
class
MigrateProjectTags
<
ActiveRecord
::
Migration
def
up
ActsAsTaggableOn
::
Tagging
.
where
(
taggable_type:
'Project'
,
context:
'labels'
).
update_all
(
context:
'tags'
)
end
def
down
ActsAsTaggableOn
::
Tagging
.
where
(
taggable_type:
'Project'
,
context:
'tags'
).
update_all
(
context:
'labels'
)
end
end
db/schema.rb
View file @
6fb9badc
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
#
#
# It's strongly recommended that you check this file into your version control system.
# It's strongly recommended that you check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
version:
2014072914
0420
)
do
ActiveRecord
::
Schema
.
define
(
version:
2014072914
5339
)
do
# These are extensions that must be enabled in order to support this database
# These are extensions that must be enabled in order to support this database
enable_extension
"plpgsql"
enable_extension
"plpgsql"
...
...
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