tramway 0.2.0 → 0.2.1.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 +1 -0
- data/app/components/tailwinds/navbar_component.html.haml +5 -4
- data/app/components/tailwinds/navbar_component.rb +1 -1
- data/lib/tramway/base_decorator.rb +5 -1
- data/lib/tramway/decorators/collection_decorator.rb +2 -2
- 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: f21d3c15fcbad670039714c4661be3546849982618662fec4de88d5fa7f46ce3
|
4
|
+
data.tar.gz: ed77adc5f2247c5db97e23b0c6706219689afcbbedd02db3597d2e31f1adde23
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 58c2ce7f3f93ae17fd399d1fff01e0abce89f0a687aba960d5431be777f2ec2ae0078d68d9f9bdffadedce5b67004a4a487a30ad29e09e7927fb1b808a83843c
|
7
|
+
data.tar.gz: 2b1ff7fa17dfb4e8eed897bdaab83b32a58f0230a12a24d2bf37f9334779d7abf180949d50444b0e75623efd9db10a9b116d231a923b16efbb6af507d218a17b
|
data/README.md
CHANGED
@@ -91,6 +91,7 @@ This helper provides several options. Here is YAML view of `tramway_navbar` opti
|
|
91
91
|
|
92
92
|
```yaml
|
93
93
|
title: String that will be added to the left side of the navbar
|
94
|
+
title_link: Link on Tramway Navbar title. Default: '/'
|
94
95
|
background:
|
95
96
|
color: Css-color. Supports all named CSS colors and HEX colors
|
96
97
|
intensity: Color intensity. Range: **100..950**. Used by Tailwind. Not supported in case of using HEX color in the background.color
|
@@ -1,9 +1,10 @@
|
|
1
1
|
%nav.py-4.px-8.flex.justify-between.items-center{ class: "bg-#{@color}" }
|
2
|
-
- if @title.present? || @left_items.present?
|
2
|
+
- if @title[:text].present? || @left_items.present?
|
3
3
|
.flex
|
4
|
-
- if @title.present?
|
5
|
-
|
6
|
-
|
4
|
+
- if @title[:text].present?
|
5
|
+
= link_to @title[:link] do
|
6
|
+
.text-xl.text-white.font-bold
|
7
|
+
= @title[:text]
|
7
8
|
- if @left_items.present?
|
8
9
|
%ul.flex.items-center.space-x-4
|
9
10
|
- @left_items.each do |item|
|
@@ -33,7 +33,7 @@ module Tailwinds
|
|
33
33
|
include Tailwinds::BackgroundHelper
|
34
34
|
|
35
35
|
def initialize(**options)
|
36
|
-
@title = options[:title]
|
36
|
+
@title = { text: options[:title], link: options[:title_link] || '/' }
|
37
37
|
@left_items = options[:left_items]
|
38
38
|
@right_items = options[:right_items]
|
39
39
|
@color = BackgroundHelper.background(options)
|
@@ -22,7 +22,11 @@ module Tramway
|
|
22
22
|
class << self
|
23
23
|
def decorate(object_or_array, context)
|
24
24
|
if Tramway::Decorators::CollectionDecorators.collection?(object_or_array)
|
25
|
-
Tramway::Decorators::CollectionDecorators.decorate_collection(
|
25
|
+
Tramway::Decorators::CollectionDecorators.decorate_collection(
|
26
|
+
collection: object_or_array,
|
27
|
+
context:,
|
28
|
+
decorator: self
|
29
|
+
)
|
26
30
|
else
|
27
31
|
new(object_or_array, context)
|
28
32
|
end
|
@@ -7,9 +7,9 @@ module Tramway
|
|
7
7
|
module CollectionDecorators
|
8
8
|
module_function
|
9
9
|
|
10
|
-
def decorate_collection(collection:, context:)
|
10
|
+
def decorate_collection(collection:, context:, decorator:)
|
11
11
|
collection.map do |item|
|
12
|
-
|
12
|
+
decorator.decorate item, context
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
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.2.
|
4
|
+
version: 0.2.1.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: 2023-
|
12
|
+
date: 2023-07-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: haml-rails
|