Skip to content

Commit a3c5635

Browse files
authored
Merge pull request #366 from aha-oida/enhance_stylesheet_default_config
Enable stylesheet in config for custom and test
2 parents ffe830c + fe00133 commit a3c5635

File tree

5 files changed

+9
-7
lines changed

5 files changed

+9
-7
lines changed

app/views/layout.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010

1111
<title><%= html_title(custom:AppConfig.custom['html_title'], content: AppConfig.custom['html_title_string']) %></title>
1212
<link rel="stylesheet" type="text/css" href="<%= stylesheet_path 'application' %>" />
13-
<%# if AppConfig.custom['stylesheet'] %>
13+
<% if AppConfig.custom['stylesheet'] %>
1414
<link rel="stylesheet" type="text/css" href="<%= stylesheet_path 'custom' %>" />
15-
<%# end %>
15+
<% end %>
1616

1717
<%#= csp_meta_tag %>
1818

config/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ production:
3131
# base_url: "https://example.com" # set to your production URL
3232
cleanup_schedule: "10m"
3333
custom:
34-
stylesheet: false
34+
stylesheet: true
3535
html_title: false # possible values: false, replace, append
3636
html_title_string: custom-title
3737
meta_description: false # possible values: false, replace, append
@@ -46,7 +46,7 @@ development:
4646
test:
4747
<<: *common_settings
4848
custom:
49-
stylesheet: false
49+
stylesheet: true
5050
html_title: false
5151
html_title_string: test-title
5252
meta_description: false

db/structure.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CREATE TABLE IF NOT EXISTS "bins" ("payload" text, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, "id" varchar, "expire_date" datetime(6) DEFAULT (datetime('now','+7 day','localtime')), "has_password" boolean DEFAULT 0);
1+
CREATE TABLE IF NOT EXISTS "bins" ("payload" text, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL, "id" varchar, "expire_date" datetime(6) DEFAULT (datetime('now','+7 day','localtime')), "has_password" boolean DEFAULT FALSE);
22
CREATE UNIQUE INDEX "index_bins_on_id" ON "bins" ("id");
33
CREATE TABLE IF NOT EXISTS "schema_migrations" ("version" varchar NOT NULL PRIMARY KEY);
44
CREATE TABLE IF NOT EXISTS "ar_internal_metadata" ("key" varchar NOT NULL PRIMARY KEY, "value" varchar, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL);

public/stylesheets/custom.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/*
12
#titlebar {
23
background: red;
34
}
5+
*/

spec/lib/app_config_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ def stub_config(overrides = {})
3333
it 'loads the test environment config with fallback to default' do
3434
AppConfig.load!
3535
expect(AppConfig.cleanup_schedule).to eq(AppConfig::Accessors::DEFAULT_CLEANUP_SCHEDULE)
36-
expect(AppConfig.custom['stylesheet']).to eq(false)
36+
expect(AppConfig.custom['stylesheet']).to eq(true)
3737
end
3838

3939
it 'loads custom config available as a hash' do
4040
AppConfig.load!
4141
expect(AppConfig.custom).to be_a(Hash)
42-
expect(AppConfig.custom['stylesheet']).to eq(false)
42+
expect(AppConfig.custom['stylesheet']).to eq(true)
4343
end
4444

4545
it 'responds to known config keys' do

0 commit comments

Comments
 (0)