tramway 0.5.4 → 0.5.4.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 +4 -4
- data/README.md +13 -1
- data/app/controllers/tramway/entities_controller.rb +2 -1
- data/lib/tramway/decorators/class_helper.rb +7 -1
- data/lib/tramway/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b3a940800b0be153a5c1eb7655a1f4203ac977accf41579e43221766843c0e8
|
4
|
+
data.tar.gz: ead462e416c64538748b393652233a4fb755f6c874dcf2d618e027ff4cfa77dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 835993aedeccd2cd7873c3cb12416d5c7c90f45d0cb234926e544a251e6bbc7a889a4a68db36f9adec55b360d246f146701a37307875ad7729f2f029f0e829fe
|
7
|
+
data.tar.gz: b78685a91ce1adbb6da37659972a5206b891cccde030a3fb18ee8ba559f49bc73144b5db0636fedc22ed2f9466cab67e74afe0192f0c162283f1009e85ed4886
|
data/README.md
CHANGED
@@ -40,7 +40,7 @@ Tramway.configure do |config|
|
|
40
40
|
config.entities = [
|
41
41
|
{
|
42
42
|
name: :user,
|
43
|
-
pages: [:index],
|
43
|
+
pages: [{ action: :index }],
|
44
44
|
}
|
45
45
|
]
|
46
46
|
end
|
@@ -465,10 +465,22 @@ title_link: Link on Tramway Navbar title. Default: '/'
|
|
465
465
|
background:
|
466
466
|
color: Css-color. Supports all named CSS colors and HEX colors
|
467
467
|
intensity: Color intensity. Range: **100..950**. Used by Tailwind. Not supported in case of using HEX color in the background.color
|
468
|
+
with_entities: Show Tramway Entities index page links to navbar. Default: true
|
468
469
|
```
|
469
470
|
|
470
471
|
**NOTE:** `tramway_navbar` method called without arguments and block of code will render only [Tramway Entities](https://github.com/Purple-Magic/tramway#tramway-entities) links on the left.
|
471
472
|
|
473
|
+
In case you want to hide entity links you can pass `with_entities: false`.
|
474
|
+
|
475
|
+
```haml
|
476
|
+
- if current_user.present?
|
477
|
+
= tramway_navbar title: 'WaiWai' do |nav|
|
478
|
+
- nav.left do
|
479
|
+
- nav.item 'Board', admin_board_path
|
480
|
+
- else
|
481
|
+
= tramway_navbar title: 'WaiWai', with_entities: false
|
482
|
+
```
|
483
|
+
|
472
484
|
#### nav.left and nav.right
|
473
485
|
|
474
486
|
Tramway navbar provides `left` and `right` methods that puts items to left and right part of navbar.
|
@@ -30,7 +30,13 @@ module Tramway
|
|
30
30
|
|
31
31
|
base_class_name = Tramway::Decorators::NameBuilder.default_decorator_class_name(klass)
|
32
32
|
|
33
|
-
namespace.present? ? "#{namespace.to_s.camelize}::#{base_class_name}" : base_class_name
|
33
|
+
klass_name = namespace.present? ? "#{namespace.to_s.camelize}::#{base_class_name}" : base_class_name
|
34
|
+
|
35
|
+
if klass_name.safe_constantize
|
36
|
+
klass_name
|
37
|
+
else
|
38
|
+
raise NameError, "You should define #{klass_name} decorator class in app/decorators/ folder."
|
39
|
+
end
|
34
40
|
end
|
35
41
|
|
36
42
|
# :reek:NilCheck { enabled: false }
|
data/lib/tramway/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tramway
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.4
|
4
|
+
version: 0.5.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kalashnikovisme
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2025-
|
12
|
+
date: 2025-07-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: anyway_config
|