From feb002de1a6e7af8779991b23f8be1b225efe403 Mon Sep 17 00:00:00 2001 From: Ana Date: Sun, 3 Jul 2016 00:02:14 +0200 Subject: [PATCH] Text color of event types and difficulty levels Changing the text color of event types and difficulty levels taking the background color into account. Similar to what it is done with tracks. See issue https://github.com/openSUSE/osem/issues/1033 Closes https://github.com/openSUSE/osem/issues/1078 --- app/views/admin/difficulty_levels/index.html.haml | 2 +- app/views/admin/event_types/index.html.haml | 3 +-- app/views/proposal/show.html.haml | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/views/admin/difficulty_levels/index.html.haml b/app/views/admin/difficulty_levels/index.html.haml index 70d6e2d8..85b598b5 100644 --- a/app/views/admin/difficulty_levels/index.html.haml +++ b/app/views/admin/difficulty_levels/index.html.haml @@ -20,7 +20,7 @@ %td = difficulty_level.description %td - %span.label{style: "background-color: #{difficulty_level.color};"} + %span.label{style: "background-color: #{difficulty_level.color}; color: #{ contrast_color(difficulty_level.color) };"} = difficulty_level.color %td .btn-group{role: "group"} diff --git a/app/views/admin/event_types/index.html.haml b/app/views/admin/event_types/index.html.haml index 3187282f..5fb82b3c 100644 --- a/app/views/admin/event_types/index.html.haml +++ b/app/views/admin/event_types/index.html.haml @@ -28,7 +28,7 @@ = "#{event_type.minimum_abstract_length} - #{event_type.maximum_abstract_length}" Words %td - %span.label{style: "background-color: #{event_type.color};"} + %span.label{style: "background-color: #{event_type.color}; color: #{ contrast_color(event_type.color) };"} = event_type.color %td .btn-group{role: "group"} @@ -39,4 +39,3 @@ .row .col-md-12.text-right = link_to 'Add Event Type', new_admin_conference_program_event_type_path(@conference.short_title), class: 'btn btn-primary' - diff --git a/app/views/proposal/show.html.haml b/app/views/proposal/show.html.haml index 07e7bc2b..1d592439 100644 --- a/app/views/proposal/show.html.haml +++ b/app/views/proposal/show.html.haml @@ -76,7 +76,7 @@ %dt Difficulty: %dd - if @event.difficulty_level - %span.label{:style =>"background-color: #{@event.difficulty_level.color};"} + %span.label{:style =>"background-color: #{@event.difficulty_level.color}; color: #{ contrast_color(@event.difficulty_level.color) };"} = @event.difficulty_level.title - if @event.require_registration