Skip to content

Commit cb2f74a

Browse files
committed
FEATURE: import horizon
1 parent c2ae2e2 commit cb2f74a

File tree

73 files changed

+8325
-6
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+8325
-6
lines changed

app/models/remote_theme.rb

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,12 @@ def self.update_zipped_theme(
8282
)
8383
end
8484

85-
# This is only used in the development and test environment and is currently not supported for other environments
86-
if Rails.env.test? || Rails.env.development?
87-
def self.import_theme_from_directory(directory)
88-
update_theme(ThemeStore::DirectoryImporter.new(directory), update_components: "none")
89-
end
85+
def self.import_theme_from_directory(directory, theme_id:)
86+
update_theme(
87+
ThemeStore::DirectoryImporter.new(directory),
88+
update_components: "none",
89+
theme_id: theme_id,
90+
)
9091
end
9192

9293
def self.update_theme(
@@ -103,7 +104,13 @@ def self.update_theme(
103104

104105
existing = true
105106
if theme.blank?
106-
theme = Theme.new(user_id: user&.id || -1, name: theme_info["name"], auto_update: false)
107+
theme =
108+
Theme.new(
109+
id: theme_id,
110+
user_id: user&.id || -1,
111+
name: theme_info["name"],
112+
auto_update: false,
113+
)
107114
existing = false
108115
end
109116

config/initializers/999-themes.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# frozen_string_literal: true
2+
3+
CORE_THEMES = { "Horizon" => -1 }
4+
5+
Rails.application.config.to_prepare do |config|
6+
CORE_THEMES.each do |theme_name, theme_id|
7+
RemoteTheme.import_theme_from_directory(
8+
"#{Rails.root}/themes/#{theme_name}",
9+
theme_id: theme_id,
10+
)
11+
end
12+
if Rails.env == "development"
13+
Rails.application.config.watchable_dirs["themes"] = %w[rb scss css js gjs yml]
14+
end
15+
end

themes/horizon/.discourse-compatibility

Whitespace-only changes.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Discourse Theme
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
ci:
11+
uses: discourse/.github/.github/workflows/discourse-theme.yml@v1

themes/horizon/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
.discourse-site

themes/horizon/.npmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
engine-strict = true
2+
auto-install-peers = false

themes/horizon/.prettierrc.cjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require("@discourse/lint-configs/prettier");

themes/horizon/.rubocop.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
inherit_gem:
2+
rubocop-discourse: stree-compat.yml

themes/horizon/.streerc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
--print-width=100
2+
--plugins=plugin/trailing_comma,plugin/disable_auto_ternary

themes/horizon/.template-lintrc.cjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require("@discourse/lint-configs/template-lint");

themes/horizon/Gemfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# frozen_string_literal: true
2+
3+
source "https://rubygems.org"
4+
5+
group :development do
6+
gem "rubocop-discourse"
7+
gem "syntax_tree"
8+
end

themes/horizon/Gemfile.lock

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
activesupport (8.0.2)
5+
base64
6+
benchmark (>= 0.3)
7+
bigdecimal
8+
concurrent-ruby (~> 1.0, >= 1.3.1)
9+
connection_pool (>= 2.2.5)
10+
drb
11+
i18n (>= 1.6, < 2)
12+
logger (>= 1.4.2)
13+
minitest (>= 5.1)
14+
securerandom (>= 0.3)
15+
tzinfo (~> 2.0, >= 2.0.5)
16+
uri (>= 0.13.1)
17+
ast (2.4.3)
18+
base64 (0.2.0)
19+
benchmark (0.4.0)
20+
bigdecimal (3.1.9)
21+
concurrent-ruby (1.3.5)
22+
connection_pool (2.5.3)
23+
drb (2.2.1)
24+
i18n (1.14.7)
25+
concurrent-ruby (~> 1.0)
26+
json (2.11.3)
27+
language_server-protocol (3.17.0.4)
28+
lint_roller (1.1.0)
29+
logger (1.7.0)
30+
minitest (5.25.5)
31+
parallel (1.27.0)
32+
parser (3.3.8.0)
33+
ast (~> 2.4.1)
34+
racc
35+
prettier_print (1.2.1)
36+
prism (1.4.0)
37+
racc (1.8.1)
38+
rack (3.1.13)
39+
rainbow (3.1.1)
40+
regexp_parser (2.10.0)
41+
rubocop (1.75.4)
42+
json (~> 2.3)
43+
language_server-protocol (~> 3.17.0.2)
44+
lint_roller (~> 1.1.0)
45+
parallel (~> 1.10)
46+
parser (>= 3.3.0.2)
47+
rainbow (>= 2.2.2, < 4.0)
48+
regexp_parser (>= 2.9.3, < 3.0)
49+
rubocop-ast (>= 1.44.0, < 2.0)
50+
ruby-progressbar (~> 1.7)
51+
unicode-display_width (>= 2.4.0, < 4.0)
52+
rubocop-ast (1.44.1)
53+
parser (>= 3.3.7.2)
54+
prism (~> 1.4)
55+
rubocop-capybara (2.22.1)
56+
lint_roller (~> 1.1)
57+
rubocop (~> 1.72, >= 1.72.1)
58+
rubocop-discourse (3.12.1)
59+
activesupport (>= 6.1)
60+
lint_roller (>= 1.1.0)
61+
rubocop (>= 1.73.2)
62+
rubocop-capybara (>= 2.22.0)
63+
rubocop-factory_bot (>= 2.27.0)
64+
rubocop-rails (>= 2.30.3)
65+
rubocop-rspec (>= 3.0.1)
66+
rubocop-rspec_rails (>= 2.31.0)
67+
rubocop-factory_bot (2.27.1)
68+
lint_roller (~> 1.1)
69+
rubocop (~> 1.72, >= 1.72.1)
70+
rubocop-rails (2.31.0)
71+
activesupport (>= 4.2.0)
72+
lint_roller (~> 1.1)
73+
rack (>= 1.1)
74+
rubocop (>= 1.75.0, < 2.0)
75+
rubocop-ast (>= 1.38.0, < 2.0)
76+
rubocop-rspec (3.6.0)
77+
lint_roller (~> 1.1)
78+
rubocop (~> 1.72, >= 1.72.1)
79+
rubocop-rspec_rails (2.31.0)
80+
lint_roller (~> 1.1)
81+
rubocop (~> 1.72, >= 1.72.1)
82+
rubocop-rspec (~> 3.5)
83+
ruby-progressbar (1.13.0)
84+
securerandom (0.4.1)
85+
syntax_tree (6.2.0)
86+
prettier_print (>= 1.2.0)
87+
tzinfo (2.0.6)
88+
concurrent-ruby (~> 1.0)
89+
unicode-display_width (3.1.4)
90+
unicode-emoji (~> 4.0, >= 4.0.4)
91+
unicode-emoji (4.0.4)
92+
uri (1.0.3)
93+
94+
PLATFORMS
95+
ruby
96+
97+
DEPENDENCIES
98+
rubocop-discourse
99+
syntax_tree
100+
101+
BUNDLED WITH
102+
2.6.8

themes/horizon/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) Design Team
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

themes/horizon/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Horizon is a simple, beautiful theme that improves the out-of-the-box experience for Discourse sites.
2+
3+
https://meta.discourse.org/t/horizon-theme/360486

themes/horizon/about.json

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
{
2+
"name": "Horizon",
3+
"authors": "Design Team",
4+
"about_url": "https://meta.discourse.org/t/horizon-theme/360486",
5+
"license_url": "https://github.com/discourse/horizon/blob/main/LICENSE",
6+
"learn_more": "https://meta.discourse.org/t/installing-a-theme-or-theme-component/63682",
7+
"theme_version": "0.0.1",
8+
"modifiers": {
9+
"svg_icons": [
10+
"fire"
11+
],
12+
"serialize_topic_is_hot": true
13+
},
14+
"color_schemes": {
15+
"Horizon": {
16+
"primary": "1A1A1A",
17+
"secondary": "ffffff",
18+
"tertiary": "595bca",
19+
"tertiary-med-or-tertiary": "595bca",
20+
"selected": "d7dfff",
21+
"header_background": "ffffff",
22+
"header_primary": "1A1A1A",
23+
"hover": "E1E8FF"
24+
},
25+
"Horizon Dark": {
26+
"primary": "ffffff",
27+
"secondary": "1A1A1A",
28+
"tertiary": "595bca",
29+
"tertiary-med-or-tertiary": "595bca",
30+
"selected": "3b3e56",
31+
"header_background": "1A1A1A",
32+
"header_primary": "ffffff",
33+
"hover": "333548"
34+
},
35+
"Royal": {
36+
"primary": "1A1A1A",
37+
"secondary": "ffffff",
38+
"tertiary": "1F7BC1",
39+
"tertiary-med-or-tertiary": "1F7BC1",
40+
"selected": "c7e3ff",
41+
"header_background": "ffffff",
42+
"header_primary": "1A1A1A",
43+
"hover": "D6EBFF"
44+
},
45+
"Royal Dark": {
46+
"primary": "ffffff",
47+
"secondary": "1A1A1A",
48+
"tertiary": "1F7BC1",
49+
"tertiary-med-or-tertiary": "1F7BC1",
50+
"selected": "3a455f",
51+
"header_background": "1A1A1A",
52+
"header_primary": "ffffff",
53+
"hover": "323B4E"
54+
},
55+
"Clover": {
56+
"primary": "1A1A1A",
57+
"secondary": "ffffff",
58+
"tertiary": "39845B",
59+
"tertiary-med-or-tertiary": "39845B",
60+
"selected": "c6f1d5",
61+
"header_background": "ffffff",
62+
"header_primary": "1A1A1A",
63+
"hover": "D5F5E0"
64+
},
65+
"Clover Dark": {
66+
"primary": "ffffff",
67+
"secondary": "1A1A1A",
68+
"tertiary": "39845B",
69+
"tertiary-med-or-tertiary": "39845B",
70+
"selected": "47594e",
71+
"header_background": "1A1A1A",
72+
"header_primary": "ffffff",
73+
"hover": "3C4A40"
74+
},
75+
"Lily": {
76+
"primary": "1A1A1A",
77+
"secondary": "ffffff",
78+
"tertiary": "cc338c",
79+
"tertiary-med-or-tertiary": "cc338c",
80+
"selected": "ffc8ee",
81+
"header_background": "ffffff",
82+
"header_primary": "1A1A1A",
83+
"hover": "FFD7F3"
84+
},
85+
"Lily Dark": {
86+
"primary": "ffffff",
87+
"secondary": "1A1A1A",
88+
"tertiary": "cc338c",
89+
"tertiary-med-or-tertiary": "cc338c",
90+
"selected": "5f3e4e",
91+
"header_background": "1A1A1A",
92+
"header_primary": "ffffff",
93+
"hover": "4E3640"
94+
},
95+
"Violet": {
96+
"primary": "1A1A1A",
97+
"secondary": "ffffff",
98+
"tertiary": "9b15de",
99+
"tertiary-med-or-tertiary": "9b15de",
100+
"selected": "feccff",
101+
"header_background": "ffffff",
102+
"header_primary": "1A1A1A",
103+
"hover": "FFD9FF"
104+
},
105+
"Violet Dark": {
106+
"primary": "ffffff",
107+
"secondary": "1A1A1A",
108+
"tertiary": "9b15de",
109+
"tertiary-med-or-tertiary": "9b15de",
110+
"selected": "4c385c",
111+
"header_background": "1A1A1A",
112+
"header_primary": "ffffff",
113+
"hover": "40314C"
114+
},
115+
"Marigold": {
116+
"primary": "1A1A1A",
117+
"secondary": "ffffff",
118+
"tertiary": "d3881f",
119+
"tertiary-med-or-tertiary": "d3881f",
120+
"selected": "ffdcb2",
121+
"header_background": "ffffff",
122+
"header_primary": "1A1A1A",
123+
"hover": "FFE6C6"
124+
},
125+
"Marigold Dark": {
126+
"primary": "ffffff",
127+
"secondary": "1A1A1A",
128+
"tertiary": "d3881f",
129+
"tertiary-med-or-tertiary": "d3881f",
130+
"selected": "6c5b49",
131+
"header_background": "1A1A1A",
132+
"header_primary": "ffffff",
133+
"hover": "584B3E"
134+
}
135+
}
136+
}

themes/horizon/assets/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)