foreman_theme_custom 0.1.4 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: edc768ba68cf8045c76b3debedb6d65565b2575148daae9923419724a6872d7a
4
- data.tar.gz: b8da8f9514993802de6ae9181508b52615ab83b54955cacdfb8c5b93f1092519
3
+ metadata.gz: 684e45dc75d9acbc416f05df95a439b0cfa70d25844e29f73eeb5e2f413c8db7
4
+ data.tar.gz: 8c332d235fb2a19466058570de38de099045a25aaeb7733773c123f7d97a9f66
5
5
  SHA512:
6
- metadata.gz: '0193d0827f71c049752225cfaaa5bfaa80428972fa1a9a4ce3e40b1799d7f436fb55862c47cfa57942f2ba32941048b17418b31d3cd17ac80fb53fa5372fdead'
7
- data.tar.gz: 579c90591da52549bbad8be658e5ceef1a499e8de1cf671c9ceea23abe383e0a6be42ca77a17d92714db3accbc8e4a9e823c74ac4ffea9a99382089cf189ddd3
6
+ metadata.gz: 45bccd7900254f7159e04df24940016999dc07202bc16fa668f0be1919019fd1517a27f22369d8c256d5fb8b9091825371eaebef6e95041c3c49c93223c8499e
7
+ data.tar.gz: 840abe36a5f3309d8770c92c5634aa2dea84506b755c8d318f2ba1c11647c621afed70fdff9cc0978430b92eec7a83a1cf1fcbee557418e3ddfa9713af745bfb
data/README.md CHANGED
@@ -8,24 +8,23 @@ Bu plugin, Foreman arayüzünde renkleri ve logoları override etmek için basit
8
8
 
9
9
  ```ruby
10
10
  # /etc/foreman/plugins/foreman_theme_custom.rb veya bundler.d/*.rb icine
11
- gem 'foreman_theme_custom', path: '/opt/foreman_theme_custom' # ya da git: 'https://...'
11
+ gem 'foreman_theme_custom', '>= 0.2.0' # veya git/path
12
12
  ```
13
13
 
14
- 2. Üretim için assetleri derleyin ve servisi yeniden başlatın:
14
+ 2. Üretim için servisleri yeniden başlatın (precompile gerektirmez):
15
15
 
16
16
  ```bash
17
- foreman-rake assets:precompile RAILS_ENV=production
18
17
  systemctl restart httpd || systemctl restart foreman
19
18
  ```
20
19
 
21
20
  ## Özelleştirme
22
21
 
23
- - Renkler: `app/assets/stylesheets/foreman_theme_custom.scss` içindeki `:root` değişkenlerini güncelleyin.
24
- - Logolar: `app/assets/images/logo_header.svg` ve `app/assets/images/logo_login.svg` dosyalarını kendi logolarınızla değiştirin.
22
+ - Renkler: `app/assets/stylesheets/foreman_theme_custom.scss` içindeki kuralları düzenleyin. Paket yayınlarken bu dosya `public/foreman_theme_custom/custom.css` olarak statik servis edilir.
23
+ - Logolar: `app/assets/images/logo_header.svg` ve `app/assets/images/logo_login.svg` dosyalarını değiştirin veya `custom.css` içinde farklı yollar kullanın.
25
24
 
26
- ## Notlar
25
+ ## Teknik Notlar
27
26
 
28
- - Stil dosyası varsayılanlardan sonra yüklenecek şekilde kayıtlıdır; gerektiğinde `!important` kullanılmıştır.
29
- - Foreman/PF sürümüne göre sınıf seçicileri değişebilir. Gerekirse `.navbar-brand img`, `.login-pf-brand` gibi seçicileri uyarlayın.
27
+ - Plugin, precompile gereksinimini ortadan kaldırmak için `public/foreman_theme_custom/custom.css` statik dosyasını doğrudan kaydeder. `register_assets { |a| a.stylesheets << '/foreman_theme_custom/custom.css' }` kullanılır.
28
+ - JS eklemediği için terser/execjs gibi bağımlılıklar gerekmez.
30
29
 
31
30
 
@@ -4,20 +4,17 @@ module ForemanThemeCustom
4
4
  class Engine < ::Rails::Engine
5
5
  engine_name 'foreman_theme_custom'
6
6
 
7
- initializer 'foreman_theme_custom.assets.precompile' do |app|
8
- app.config.assets.precompile += %w[
9
- foreman_theme_custom.css
10
- logo_header.svg
11
- logo_login.svg
12
- ]
7
+ # Engine public/ klasorunden statik dosyalari servis et
8
+ initializer 'foreman_theme_custom.static_assets' do |app|
9
+ app.middleware.use(::ActionDispatch::Static, File.expand_path('../../../public', __dir__))
13
10
  end
14
11
 
12
+ # Precompile bagimliligi olmadan dogrudan public yolundan CSS ekle
13
+
15
14
  initializer 'foreman_theme_custom.assets' do
16
15
  # Foreman asset pipeline icine SCSS'imizi dahil et
17
16
  Foreman::Plugin.register :foreman_theme_custom do
18
- register_assets do |assets|
19
- assets.stylesheets << 'foreman_theme_custom'
20
- end
17
+ register_assets { |assets| assets.stylesheets << '/foreman_theme_custom/custom.css' }
21
18
  end
22
19
  end
23
20
  end
@@ -0,0 +1,63 @@
1
+ /* Foreman Theme Custom - static CSS (no precompile) */
2
+
3
+ :root {
4
+ /* Primary/link/danger colors */
5
+ --pf-global--primary-color--100: #0052cc;
6
+ --pf-global--link--Color: #0052cc;
7
+ --pf-global--danger-color--100: #d04141;
8
+ }
9
+
10
+ /* Navbar and primary buttons */
11
+ .navbar-pf {
12
+ background-color: var(--pf-global--primary-color--100) !important;
13
+ }
14
+
15
+ .btn-primary {
16
+ background-color: var(--pf-global--primary-color--100) !important;
17
+ border-color: var(--pf-global--primary-color--100) !important;
18
+ }
19
+
20
+ /* Login page brand */
21
+ .login-pf-page .login-pf-brand {
22
+ background-image: url('/foreman_theme_custom/logo_login.svg') !important;
23
+ background-size: contain;
24
+ }
25
+
26
+ /* Header brand/logo */
27
+ .navbar-brand img, .branding .brand {
28
+ content: url('/foreman_theme_custom/logo_header.svg');
29
+ height: 24px;
30
+ }
31
+ /* built as plain CSS for static serve */
32
+ // Foreman tema override'lari
33
+ // Ornek renk degiskenleri (PatternFly/Bootstrap uzerine gelir)
34
+
35
+ :root {
36
+ --pf-global--primary-color--100: #0052cc; // primary
37
+ --pf-global--link--Color: #0052cc;
38
+ --pf-global--danger-color--100: #d04141;
39
+ }
40
+
41
+ // Navbar ve butonlar
42
+ .navbar-pf {
43
+ background-color: var(--pf-global--primary-color--100) !important;
44
+ }
45
+
46
+ .btn-primary {
47
+ background-color: var(--pf-global--primary-color--100) !important;
48
+ border-color: var(--pf-global--primary-color--100) !important;
49
+ }
50
+
51
+ // Login sayfasi logo ve arka plan
52
+ .login-pf-page .login-pf-brand {
53
+ background-image: image-url('logo_login.svg') !important;
54
+ background-size: contain;
55
+ }
56
+
57
+ // Header icin logo
58
+ .navbar-brand img, .branding .brand {
59
+ content: url(asset-path('logo_header.svg'));
60
+ height: 24px;
61
+ }
62
+
63
+
@@ -0,0 +1,4 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="160" height="32" viewBox="0 0 160 32" fill="none">
2
+ <rect width="160" height="32" rx="4" fill="#0052CC"/>
3
+ <text x="12" y="22" font-family="Arial, Helvetica, sans-serif" font-size="16" fill="#FFFFFF">YourBrand</text>
4
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="220" height="60" viewBox="0 0 220 60" fill="none">
2
+ <rect width="220" height="60" rx="8" fill="#0052CC"/>
3
+ <text x="20" y="38" font-family="Arial, Helvetica, sans-serif" font-size="28" fill="#FFFFFF">YourBrand</text>
4
+ </svg>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_theme_custom
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ender K
@@ -25,6 +25,9 @@ files:
25
25
  - config/initializers/assets.rb
26
26
  - lib/foreman_theme_custom.rb
27
27
  - lib/foreman_theme_custom/engine.rb
28
+ - public/foreman_theme_custom/custom.css
29
+ - public/foreman_theme_custom/logo_header.svg
30
+ - public/foreman_theme_custom/logo_login.svg
28
31
  homepage: https://github.com/enderk/foreman_theme_custom
29
32
  licenses:
30
33
  - MIT