mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-16 07:10:12 +01:00
Add theme selector to preferences and return the previous black theme as an alternative
This commit is contained in:
parent
2e9a0d2b4c
commit
9982217ee9
18 changed files with 64 additions and 22 deletions
12
app/assets/stylesheets/black.scss
Normal file
12
app/assets/stylesheets/black.scss
Normal file
|
|
@ -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';
|
||||
|
|
@ -75,11 +75,17 @@ p {
|
|||
}
|
||||
|
||||
a, a:link, a:active, a:visited {
|
||||
color: $link-color;
|
||||
text-decoration: none;
|
||||
padding-left: 1px;
|
||||
padding-right: 1px;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color: $link-hover-color;
|
||||
background-color: $link-bgcolor;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 304%;
|
||||
font-weight: bold;
|
||||
|
|
@ -816,11 +822,11 @@ form {
|
|||
#todo_new_action_container, #project_new_project_container, #context_new_container, #recurring_new_container {
|
||||
width: 270px;
|
||||
padding: 5px 10px;
|
||||
background-color: #3C6997;
|
||||
color: lighten(#000, 93.5%);
|
||||
background-color: $brand-primary;
|
||||
color: $gray-lighter;
|
||||
border-radius: 5px;
|
||||
a {
|
||||
color: lighten(#000, 85%);
|
||||
color: $box-tablink-color;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,4 +3,10 @@ $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';
|
||||
|
|
@ -28,8 +28,6 @@
|
|||
}
|
||||
|
||||
.bootstrap {
|
||||
@import "colors";
|
||||
|
||||
@import "bootstrap-sprockets";
|
||||
@import "bootstrap";
|
||||
@import "tracks-logo";
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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]
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
module ApplicationHelper
|
||||
|
||||
def group_view_by_menu_entry
|
||||
# not set, no menu entry
|
||||
return "" if @group_view_by.nil?
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<%= 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 %>
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
<%= favicon_link_tag 'favicon.ico' %>
|
||||
<%= favicon_link_tag 'apple-touch-icon.png', :rel => 'apple-touch-icon', :type => 'image/png' %>
|
||||
<title><%= @page_title -%></title>
|
||||
<%= stylesheet_link_tag "application" %>
|
||||
<%= stylesheet_link_tag @user_theme %>
|
||||
</head>
|
||||
<body class="bootstrap">
|
||||
<%= yield %>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
<div class="form-group">
|
||||
<%= pref_with_select_field('prefs', "due_style", [[t('models.preference.due_styles')[0],Preference.due_styles[:due_in_n_days]],[t('models.preference.due_styles')[1],Preference.due_styles[:due_on]]]) %>
|
||||
</div>
|
||||
|
|
@ -38,3 +37,6 @@
|
|||
<div class="form-group">
|
||||
<%= pref('prefs', "sms_context") { select('prefs', 'sms_context_id', current_user.contexts.map{|c| [c.name, c.id]}, {}, class: "form-control") } %>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%= pref_with_select_field('prefs', 'theme', [[t('models.preference.themes.black'), Preference.themes[:black]], [t('models.preference.themes.light_blue'), Preference.themes[:light_blue]]]) %>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue