Welcome to mirror list, hosted at ThFree Co, Russian Federation.

color_themes.rb « initializers « config - github.com/diaspora/diaspora.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7cabdba6459e313fe1f458cba86db8a507c1eca3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

# Generate the path to the .yml file with the available color themes.
color_themes_file = Rails.root.join("config/color_themes.yml")
# Check in case config/color_themes.yml does not exist.
if color_themes_file.exist?
  # Load the file specified by the generated path.
  color_themes = YAML.load_file(color_themes_file)
  # If the file contains one or more color themes, include them in AVAILABLE_COLOR_THEMES,
  # else include the original theme.
  AVAILABLE_COLOR_THEMES =
    if color_themes["available"].length > 0
      color_themes["available"].freeze
    else
      ["original"].freeze
    end
else
  AVAILABLE_COLOR_THEMES = ["original"].freeze
end