Commit 7f23e0b8 authored by Phil Hughes's avatar Phil Hughes

Fixes text color on labels in sidebar

parent b4ed6efd
...@@ -34,8 +34,8 @@ class @LabelsSelect ...@@ -34,8 +34,8 @@ class @LabelsSelect
if issueUpdateURL if issueUpdateURL
labelHTMLTemplate = _.template( labelHTMLTemplate = _.template(
'<% _.each(labels, function(label){ %> '<% _.each(labels, function(label){ %>
<a href="<%= ["",issueURLSplit[1], issueURLSplit[2],""].join("/") %>issues?label_name=<%= _.escape(label.title) %>"> <a href="<%= ["",issueURLSplit[1], issueURLSplit[2],""].join("/") %>issues?label_name[]=<%= _.escape(label.title) %>">
<span class="label has-tooltip color-label" title="<%= _.escape(label.description) %>" style="background-color: <%= label.color %>;"> <span class="label has-tooltip color-label" title="<%= _.escape(label.description) %>" style="background-color: <%= label.color %>; color: <%= label.text_color %>;">
<%= _.escape(label.title) %> <%= _.escape(label.title) %>
</span> </span>
</a> </a>
...@@ -157,6 +157,7 @@ class @LabelsSelect ...@@ -157,6 +157,7 @@ class @LabelsSelect
data.issueURLSplit = issueURLSplit data.issueURLSplit = issueURLSplit
labelCount = 0 labelCount = 0
if data.labels.length if data.labels.length
console.log data.labels
template = labelHTMLTemplate(data) template = labelHTMLTemplate(data)
labelCount = data.labels.length labelCount = data.labels.length
else else
......
...@@ -110,7 +110,7 @@ class Projects::IssuesController < Projects::ApplicationController ...@@ -110,7 +110,7 @@ class Projects::IssuesController < Projects::ApplicationController
end end
end end
format.json do format.json do
render json: @issue.to_json(include: [:milestone, :labels, assignee: { methods: :avatar_url }]) render json: @issue.to_json(include: [:milestone, labels: { methods: :text_color }, assignee: { methods: :avatar_url }])
end end
end end
end end
......
...@@ -155,7 +155,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController ...@@ -155,7 +155,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController
@merge_request.target_project, @merge_request]) @merge_request.target_project, @merge_request])
end end
format.json do format.json do
render json: @merge_request.to_json(include: [:milestone, :labels, assignee: { methods: :avatar_url }]) render json: @merge_request.to_json(include: [:milestone, labels: { methods: :text_color }, assignee: { methods: :avatar_url }])
end end
end end
else else
......
...@@ -37,7 +37,7 @@ module LabelsHelper ...@@ -37,7 +37,7 @@ module LabelsHelper
link = send("namespace_project_#{type.to_s.pluralize}_path", link = send("namespace_project_#{type.to_s.pluralize}_path",
project.namespace, project.namespace,
project, project,
label_name: label.name) label_name: [label.name])
if block_given? if block_given?
link_to link, &block link_to link, &block
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment