|
1
|
|
|
# frozen_string_literal: true |
|
2
|
|
|
|
|
3
|
|
|
# BigBlueButton open source conferencing system - http://www.bigbluebutton.org/. |
|
4
|
|
|
# |
|
5
|
|
|
# Copyright (c) 2018 BigBlueButton Inc. and by respective authors (see below). |
|
6
|
|
|
# |
|
7
|
|
|
# This program is free software; you can redistribute it and/or modify it under the |
|
8
|
|
|
# terms of the GNU Lesser General Public License as published by the Free Software |
|
9
|
|
|
# Foundation; either version 3.0 of the License, or (at your option) any later |
|
10
|
|
|
# version. |
|
11
|
|
|
# |
|
12
|
|
|
# BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY |
|
13
|
|
|
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A |
|
14
|
|
|
# PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. |
|
15
|
|
|
# |
|
16
|
|
|
# You should have received a copy of the GNU Lesser General Public License along |
|
17
|
|
|
# with BigBlueButton; if not, see <http://www.gnu.org/licenses/>. |
|
18
|
|
|
|
|
19
|
|
|
class ThemesController < ApplicationController |
|
20
|
|
|
skip_before_action :maintenance_mode? |
|
21
|
|
|
|
|
22
|
|
|
# GET /primary |
|
23
|
|
|
def index |
|
24
|
|
|
color = @settings.get_value("Primary Color") || Rails.configuration.primary_color_default |
|
25
|
|
|
lighten_color = @settings.get_value("Primary Color Lighten") || Rails.configuration.primary_color_lighten_default |
|
26
|
|
|
darken_color = @settings.get_value("Primary Color Darken") || Rails.configuration.primary_color_darken_default |
|
27
|
|
|
|
|
28
|
|
|
file_name = Rails.root.join('app', 'assets', 'stylesheets', 'utilities', '_primary_themes.scss') |
|
29
|
|
|
@file_contents = File.read(file_name) |
|
30
|
|
|
|
|
31
|
|
|
# Include the variables and covert scss file to css |
|
32
|
|
|
@compiled = SassC::Engine.new("$primary-color:#{color};" \ |
|
33
|
|
|
"$primary-color-lighten:#{lighten_color};" \ |
|
34
|
|
|
"$primary-color-darken:#{darken_color};" + |
|
35
|
|
|
@file_contents, syntax: :scss).render |
|
36
|
|
|
|
|
37
|
|
|
respond_to do |format| |
|
38
|
|
|
format.css { render body: @compiled } |
|
39
|
|
|
end |
|
40
|
|
|
end |
|
41
|
|
|
end |
|
42
|
|
|
|