Commit edf41005b2c6cf3d429b8ca10f41fe64306b044a
1 parent
880cb8aa
Exists in
master
and in
4 other branches
Add project labels support
Showing
3 changed files
with
16 additions
and
1 deletions
Show diff stats
app/models/project.rb
| @@ -28,12 +28,14 @@ class Project < ActiveRecord::Base | @@ -28,12 +28,14 @@ class Project < ActiveRecord::Base | ||
| 28 | include Gitlab::ShellAdapter | 28 | include Gitlab::ShellAdapter |
| 29 | extend Enumerize | 29 | extend Enumerize |
| 30 | 30 | ||
| 31 | - attr_accessible :name, :path, :description, :default_branch, :issues_tracker, | 31 | + attr_accessible :name, :path, :description, :default_branch, :issues_tracker, :label_list, |
| 32 | :issues_enabled, :wall_enabled, :merge_requests_enabled, :snippets_enabled, :issues_tracker_id, | 32 | :issues_enabled, :wall_enabled, :merge_requests_enabled, :snippets_enabled, :issues_tracker_id, |
| 33 | :wiki_enabled, :public, :import_url, :last_activity_at, as: [:default, :admin] | 33 | :wiki_enabled, :public, :import_url, :last_activity_at, as: [:default, :admin] |
| 34 | 34 | ||
| 35 | attr_accessible :namespace_id, :creator_id, as: :admin | 35 | attr_accessible :namespace_id, :creator_id, as: :admin |
| 36 | 36 | ||
| 37 | + acts_as_taggable_on :labels | ||
| 38 | + | ||
| 37 | attr_accessor :import_url | 39 | attr_accessor :import_url |
| 38 | 40 | ||
| 39 | # Relations | 41 | # Relations |
app/views/dashboard/projects.html.haml
| @@ -49,6 +49,10 @@ | @@ -49,6 +49,10 @@ | ||
| 49 | .left | 49 | .left |
| 50 | - if project.description.present? | 50 | - if project.description.present? |
| 51 | %span.light= project.description | 51 | %span.light= project.description |
| 52 | + - project.labels.each do |label| | ||
| 53 | + %span.label.label-info | ||
| 54 | + %i.icon-tag | ||
| 55 | + = label.name | ||
| 52 | 56 | ||
| 53 | .pull-right.light | 57 | .pull-right.light |
| 54 | %small.light | 58 | %small.light |
app/views/projects/_form.html.haml
| @@ -59,6 +59,15 @@ | @@ -59,6 +59,15 @@ | ||
| 59 | 59 | ||
| 60 | %fieldset.features | 60 | %fieldset.features |
| 61 | %legend | 61 | %legend |
| 62 | + Labels: | ||
| 63 | + .control-group | ||
| 64 | + = f.label :label_list, "Labels", class: 'control-label' | ||
| 65 | + .controls | ||
| 66 | + = f.text_field :label_list, maxlength: 2000, class: "xxlarge" | ||
| 67 | + %p.hint Separate with comma. | ||
| 68 | + | ||
| 69 | + %fieldset.features | ||
| 70 | + %legend | ||
| 62 | Features: | 71 | Features: |
| 63 | .control-group | 72 | .control-group |
| 64 | = f.label :issues_enabled, "Issues", class: 'control-label' | 73 | = f.label :issues_enabled, "Issues", class: 'control-label' |