Loading Changelog.md +1 −0 Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ * Simplify mentions in the publisher [#7302](https://github.com/diaspora/diaspora/pull/7302) * Remove chartbeat and mixpanel support [#7280](https://github.com/diaspora/diaspora/pull/7280) * Upgrade to jQuery 3 [#7303](https://github.com/diaspora/diaspora/pull/7303) * Add i18n for color themes [#7369](https://github.com/diaspora/diaspora/pull/7369) ## Bug fixes Loading app/helpers/users_helper.rb +4 −4 Original line number Diff line number Diff line Loading @@ -31,13 +31,13 @@ module UsersHelper # specified from AVAILABLE_COLOR_THEMES in # config/initializers/color_themes.rb. # # @example if AVAILABLE_COLOR_THEMES = {"original"=>"Original dark", "dark_green" => "Dark green"} # @example if AVAILABLE_COLOR_THEMES = ["original", "dark_green"] # available_color_themes # #=> [["Original dark", "original"], ["Dark green", "dark_green"]] # #=> [["Original gray", "original"], ["Dark green", "dark_green"]] def available_color_themes opts = [] AVAILABLE_COLOR_THEMES.map do |theme_code, theme_name| opts << [theme_name, theme_code] AVAILABLE_COLOR_THEMES.map do |theme_code| opts << [I18n.t("color_themes.#{theme_code}"), theme_code] end opts end Loading app/models/user.rb +1 −1 Original line number Diff line number Diff line Loading @@ -30,7 +30,7 @@ class User < ActiveRecord::Base validates_length_of :username, :maximum => 32 validates_exclusion_of :username, :in => AppConfig.settings.username_blacklist validates_inclusion_of :language, :in => AVAILABLE_LANGUAGE_CODES validates :color_theme, inclusion: {in: AVAILABLE_COLOR_THEME_CODES}, allow_blank: true validates :color_theme, inclusion: {in: AVAILABLE_COLOR_THEMES}, allow_blank: true validates_format_of :unconfirmed_email, :with => Devise.email_regexp, :allow_blank => true validate :unconfirmed_email_quasiuniqueness Loading config/color_themes.yml +6 −6 Original line number Diff line number Diff line available: original: "Original Gray" original_white: "Original White Background" dark_green: "Dark Green" magenta: "Magenta" egyptian_blue: "Egyptian Blue" dark: "Dark" - original - original_white - dark_green - magenta - egyptian_blue - dark config/initializers/color_themes.rb +3 −5 Original line number Diff line number Diff line Loading @@ -8,12 +8,10 @@ if color_themes_file.exist? # else include the original theme. AVAILABLE_COLOR_THEMES = if color_themes["available"].length > 0 color_themes["available"] color_themes["available"].freeze else {"original" => "Original Gray"} ["original"].freeze end else AVAILABLE_COLOR_THEMES = {"original" => "Original Gray"}.freeze AVAILABLE_COLOR_THEMES = ["original"].freeze end # Get all codes from available themes into a separate variable, so that they can be called easier. AVAILABLE_COLOR_THEME_CODES = AVAILABLE_COLOR_THEMES.keys Loading
Changelog.md +1 −0 Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ * Simplify mentions in the publisher [#7302](https://github.com/diaspora/diaspora/pull/7302) * Remove chartbeat and mixpanel support [#7280](https://github.com/diaspora/diaspora/pull/7280) * Upgrade to jQuery 3 [#7303](https://github.com/diaspora/diaspora/pull/7303) * Add i18n for color themes [#7369](https://github.com/diaspora/diaspora/pull/7369) ## Bug fixes Loading
app/helpers/users_helper.rb +4 −4 Original line number Diff line number Diff line Loading @@ -31,13 +31,13 @@ module UsersHelper # specified from AVAILABLE_COLOR_THEMES in # config/initializers/color_themes.rb. # # @example if AVAILABLE_COLOR_THEMES = {"original"=>"Original dark", "dark_green" => "Dark green"} # @example if AVAILABLE_COLOR_THEMES = ["original", "dark_green"] # available_color_themes # #=> [["Original dark", "original"], ["Dark green", "dark_green"]] # #=> [["Original gray", "original"], ["Dark green", "dark_green"]] def available_color_themes opts = [] AVAILABLE_COLOR_THEMES.map do |theme_code, theme_name| opts << [theme_name, theme_code] AVAILABLE_COLOR_THEMES.map do |theme_code| opts << [I18n.t("color_themes.#{theme_code}"), theme_code] end opts end Loading
app/models/user.rb +1 −1 Original line number Diff line number Diff line Loading @@ -30,7 +30,7 @@ class User < ActiveRecord::Base validates_length_of :username, :maximum => 32 validates_exclusion_of :username, :in => AppConfig.settings.username_blacklist validates_inclusion_of :language, :in => AVAILABLE_LANGUAGE_CODES validates :color_theme, inclusion: {in: AVAILABLE_COLOR_THEME_CODES}, allow_blank: true validates :color_theme, inclusion: {in: AVAILABLE_COLOR_THEMES}, allow_blank: true validates_format_of :unconfirmed_email, :with => Devise.email_regexp, :allow_blank => true validate :unconfirmed_email_quasiuniqueness Loading
config/color_themes.yml +6 −6 Original line number Diff line number Diff line available: original: "Original Gray" original_white: "Original White Background" dark_green: "Dark Green" magenta: "Magenta" egyptian_blue: "Egyptian Blue" dark: "Dark" - original - original_white - dark_green - magenta - egyptian_blue - dark
config/initializers/color_themes.rb +3 −5 Original line number Diff line number Diff line Loading @@ -8,12 +8,10 @@ if color_themes_file.exist? # else include the original theme. AVAILABLE_COLOR_THEMES = if color_themes["available"].length > 0 color_themes["available"] color_themes["available"].freeze else {"original" => "Original Gray"} ["original"].freeze end else AVAILABLE_COLOR_THEMES = {"original" => "Original Gray"}.freeze AVAILABLE_COLOR_THEMES = ["original"].freeze end # Get all codes from available themes into a separate variable, so that they can be called easier. AVAILABLE_COLOR_THEME_CODES = AVAILABLE_COLOR_THEMES.keys