summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-04-17 17:38:31 +0200
committerDouwe Maan <douwe@gitlab.com>2015-04-17 17:38:31 +0200
commitda89ebbe483e1efc7d1eb4fde1a987d958a78ffd (patch)
treec9fbc1d62c1d5582fed7abe8df1abe8809069fa1
parenta66953b16bab5ecf874958d1acb3520ed7490559 (diff)
downloadgitlab-ce-fix-label-color-input.tar.gz
Fix label color input.fix-label-color-input
-rw-r--r--app/models/label.rb2
-rw-r--r--app/views/projects/labels/_form.html.haml2
2 files changed, 3 insertions, 1 deletions
diff --git a/app/models/label.rb b/app/models/label.rb
index 9d7099c5652..1f22ed23d42 100644
--- a/app/models/label.rb
+++ b/app/models/label.rb
@@ -13,6 +13,8 @@
class Label < ActiveRecord::Base
DEFAULT_COLOR = '#428BCA'
+ default_value_for :color, DEFAULT_COLOR
+
belongs_to :project
has_many :label_links, dependent: :destroy
has_many :issues, through: :label_links, source: :target, source_type: 'Issue'
diff --git a/app/views/projects/labels/_form.html.haml b/app/views/projects/labels/_form.html.haml
index ad993db6c0b..261d52dedc1 100644
--- a/app/views/projects/labels/_form.html.haml
+++ b/app/views/projects/labels/_form.html.haml
@@ -16,7 +16,7 @@
.col-sm-10
.input-group
.input-group-addon.label-color-preview &nbsp;
- = f.color_field :color, value: "#AA33EE", class: "form-control"
+ = f.color_field :color, class: "form-control"
.help-block
Choose any color.
%br