diff --git a/app/assets/stylesheets/black.scss b/app/assets/stylesheets/black.scss new file mode 100644 index 00000000..edff8b5c --- /dev/null +++ b/app/assets/stylesheets/black.scss @@ -0,0 +1,12 @@ +$gray-lighter: #EEE; +$brand-primary: rgba(0, 0, 0, 0.75); +$navbar-inverse-bg: $brand_primary; +$navbar-inverse-color: $gray-lighter; +$navbar-inverse-link-color: $gray-lighter; +$link-color: #CC3334; +$link-hover-color: #FFF; +$link-bgcolor: $link-color; +$box-tablink-color: unset; + +// Import all components +@import 'manifest'; diff --git a/app/assets/stylesheets/legacy.scss b/app/assets/stylesheets/legacy.scss index 9b043021..c3a8bf9c 100644 --- a/app/assets/stylesheets/legacy.scss +++ b/app/assets/stylesheets/legacy.scss @@ -75,15 +75,15 @@ p { } a, a:link, a:active, a:visited { - color: #cc3334; + color: $link-color; text-decoration: none; padding-left: 1px; padding-right: 1px; } a:hover { - color: #fff; - background-color: #cc3334; + color: $link-hover-color; + background-color: $link-bgcolor; } h1 { @@ -820,12 +820,14 @@ form { } #todo_new_action_container, #project_new_project_container, #context_new_container, #recurring_new_container { - background: #ddd; width: 270px; padding: 5px 10px; - background-color: #000; - color: #eee; + background-color: $brand-primary; + color: $gray-lighter; border-radius: 5px; + a { + color: $box-tablink-color; + } } #recurring_new_container img { diff --git a/app/assets/stylesheets/light_blue.scss b/app/assets/stylesheets/light_blue.scss new file mode 100644 index 00000000..ae2972c1 --- /dev/null +++ b/app/assets/stylesheets/light_blue.scss @@ -0,0 +1,12 @@ +$gray-lighter: lighten(#000, 93.5%); +$brand-primary: #3C6997; +$navbar-inverse-bg: $brand_primary; +$navbar-inverse-color: $gray-lighter; +$navbar-inverse-link-color: $gray-lighter; +$link-color: unset; +$link-hover-color: unset; +$link-bgcolor: unset; +$box-tablink-color: lighten(#000, 85%); + +// Import all components +@import 'manifest'; diff --git a/app/assets/stylesheets/login.scss b/app/assets/stylesheets/login.scss index ee2fa703..49d5d00e 100644 --- a/app/assets/stylesheets/login.scss +++ b/app/assets/stylesheets/login.scss @@ -21,7 +21,7 @@ body { @include make-sm-column(6); @include make-sm-column-offset(3); margin: 2em auto 1em; - background-color: rgba(0, 0, 0, 0.75); + background-color: $brand-primary; padding: 0 0 1em 0; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5), 0 2px 3px rgba(0, 0, 0, 0.3); color: #eaeaea; diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/manifest.scss similarity index 100% rename from app/assets/stylesheets/application.scss rename to app/assets/stylesheets/manifest.scss diff --git a/app/assets/stylesheets/tracks.scss b/app/assets/stylesheets/tracks.scss index 2cb3e440..efafa78d 100644 --- a/app/assets/stylesheets/tracks.scss +++ b/app/assets/stylesheets/tracks.scss @@ -1,5 +1,5 @@ .navbar { - /* Shows the number of undone next action */ + /* Shows the count of undone next actions */ .badge { color: #fff; background: #f00; diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 9a010552..1f2d62ad 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -7,6 +7,7 @@ class ApplicationController < ActionController::Base protect_from_forgery with: :exception include LoginSystem + include Common helper_method :current_user, :prefs, :format_date layout proc{ |controller| controller.mobile? ? "mobile" : "application" } @@ -16,6 +17,7 @@ class ApplicationController < ActionController::Base before_action :set_time_zone before_action :set_zindex_counter before_action :set_locale + before_action :set_theme append_before_action :set_group_view_by prepend_before_action :login_required prepend_before_action :enable_mobile_content_negotiation diff --git a/app/controllers/login_controller.rb b/app/controllers/login_controller.rb index 2ca0b1cb..e0a97b8d 100644 --- a/app/controllers/login_controller.rb +++ b/app/controllers/login_controller.rb @@ -1,10 +1,12 @@ class LoginController < ApplicationController + include Common layout 'login' skip_before_action :set_session_expiration skip_before_action :login_required before_action :login_optional before_action :get_current_user + before_action :set_theme protect_from_forgery :except => [:check_expiry, :login] diff --git a/app/controllers/preferences_controller.rb b/app/controllers/preferences_controller.rb index 3becc7d0..9e6db06d 100644 --- a/app/controllers/preferences_controller.rb +++ b/app/controllers/preferences_controller.rb @@ -40,7 +40,7 @@ private :staleness_starts, :due_style, :locale, :title_date_format, :time_zone, :show_hidden_projects_in_sidebar, :show_project_on_todo_done, :review_period, :refresh, :verbose_action_descriptors, - :mobile_todos_per_page, :sms_email, :sms_context_id) + :mobile_todos_per_page, :sms_email, :sms_context_id, :theme) end def user_params diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 16ff38f0..bdbb831f 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1,5 +1,4 @@ module ApplicationHelper - def group_view_by_menu_entry # not set, no menu entry return "" if @group_view_by.nil? diff --git a/app/models/preference.rb b/app/models/preference.rb index df5e7d18..2666a13a 100644 --- a/app/models/preference.rb +++ b/app/models/preference.rb @@ -2,6 +2,10 @@ class Preference < ApplicationRecord belongs_to :user belongs_to :sms_context, :class_name => 'Context' + def self.themes + { :black => 'black', :light_blue => 'light_blue'} + end + def self.due_styles { :due_in_n_days => 0, :due_on => 1} end diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 2c2e2b96..31e5808e 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -2,7 +2,7 @@
- <%= stylesheet_link_tag "application", :media => "all" %> + <%= stylesheet_link_tag @user_theme, :media => "all" %> <%= stylesheet_link_tag "print", :media => "print" %> <%= javascript_include_tag "application" %> <%= csrf_meta_tags %> diff --git a/app/views/layouts/login.html.erb b/app/views/layouts/login.html.erb index 3e726051..ae1e43e7 100644 --- a/app/views/layouts/login.html.erb +++ b/app/views/layouts/login.html.erb @@ -6,7 +6,7 @@ <%= favicon_link_tag 'favicon.ico' %> <%= favicon_link_tag 'apple-touch-icon.png', :rel => 'apple-touch-icon', :type => 'image/png' %>