tramway 0.5.1.2 → 0.5.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/components/tailwinds/table/row_component.html.haml +1 -1
- data/app/views/tramway/entities/_entity.html.haml +2 -1
- data/app/views/tramway/entities/_list.html.haml +25 -0
- data/app/views/tramway/entities/index.html.haml +1 -25
- data/lib/tramway/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 838aba970de3f300933609c6072917a9583fa49a2609d10597146d8fe6c70812
|
4
|
+
data.tar.gz: 3d95247267309c650eee9ceb5168a04c809f723f35700214831e4df6b167c543
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c57384901f20fead3a987b16d302ca328fcdd3ac2a4d431dba709bcc110bc4d8665a435f705437e01f3fd983583e471f52e4b7627ebd13c5bd1900e76f096ea3
|
7
|
+
data.tar.gz: c6b3ac59a4f1d02eac8bbdf4bafa5c289e563d3955a169410df6ca12f245df5c3513145bb1f9c375110464265972e4256b3936a947e77996b139851c47f1d40f
|
@@ -3,7 +3,7 @@
|
|
3
3
|
- cols = cells.count.times.map { |item| "1fr" }.join(",")
|
4
4
|
|
5
5
|
-# desktop view
|
6
|
-
= row_tag class: "div-table-row block grid gap-4 bg-white border-b dark:bg-gray-800 dark:border-gray-700
|
6
|
+
= row_tag class: "div-table-row block grid gap-4 bg-white border-b dark:bg-gray-800 dark:border-gray-700 grid-cols-[#{cols}]" do
|
7
7
|
- cells.each do |(_, value)|
|
8
8
|
.div-table-cell.px-6.py-4.font-medium.text-gray-900.whitespace-nowrap.dark:text-white.sm:text-xs.text-base
|
9
9
|
= value
|
@@ -1,2 +1,3 @@
|
|
1
1
|
- decorator = decorator_class(entity)
|
2
|
-
|
2
|
+
- decorated_object = decorator.decorate(entity)
|
3
|
+
= component 'tailwinds/table/row', cells: decorator.list_attributes.reduce({}) { |hash, attribute| hash.merge! attribute => decorated_object.public_send(attribute) }, href: decorated_object.show_path
|
@@ -0,0 +1,25 @@
|
|
1
|
+
- decorator = Tramway::Decorators::NameBuilder.default_decorator_class_name(@model_class)
|
2
|
+
- list_attributes = decorator.constantize.list_attributes
|
3
|
+
|
4
|
+
.mt-8.w-full
|
5
|
+
- content_for :title, page_title
|
6
|
+
|
7
|
+
.flex.justify-between.items-center.md:mt-4.mt-2
|
8
|
+
%h1.font-bold.text-4xl.dark:text-white
|
9
|
+
= content_for(:title)
|
10
|
+
|
11
|
+
- if Tramway.config.pagination[:enabled]
|
12
|
+
= paginate @entities
|
13
|
+
|
14
|
+
- if list_attributes.empty?
|
15
|
+
%p.text-center.mt-10
|
16
|
+
You should fill class-level method `self.list_attributes` inside your
|
17
|
+
= decorator
|
18
|
+
|
19
|
+
= component 'tailwinds/table' do
|
20
|
+
= component 'tailwinds/table/header', headers: list_attributes.map { |attribute| @model_class.human_attribute_name(attribute) }
|
21
|
+
- @entities.each do |item|
|
22
|
+
= render 'tramway/entities/entity', entity: item
|
23
|
+
|
24
|
+
.flex.mt-4
|
25
|
+
= paginate @entities
|
@@ -1,25 +1 @@
|
|
1
|
-
|
2
|
-
- list_attributes = decorator.constantize.list_attributes
|
3
|
-
|
4
|
-
.mt-8{ class: 'w-2/3' }
|
5
|
-
- content_for :title, page_title
|
6
|
-
|
7
|
-
.flex.justify-between.items-center.md:mt-4.mt-2
|
8
|
-
%h1.font-bold.text-4xl.dark:text-white
|
9
|
-
= page_title
|
10
|
-
|
11
|
-
- if Tramway.config.pagination[:enabled]
|
12
|
-
= paginate @entities
|
13
|
-
|
14
|
-
- if list_attributes.empty?
|
15
|
-
%p.text-center.mt-10
|
16
|
-
You should fill class-level method `self.list_attributes` inside your
|
17
|
-
= decorator
|
18
|
-
|
19
|
-
= component 'tailwinds/table' do
|
20
|
-
= component 'tailwinds/table/header', headers: list_attributes.map { |attribute| @model_class.human_attribute_name(attribute) }
|
21
|
-
- @entities.each do |item|
|
22
|
-
= render 'entity', entity: item
|
23
|
-
|
24
|
-
.flex.mt-4
|
25
|
-
= paginate @entities
|
1
|
+
= render 'tramway/entities/list'
|
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.1.
|
4
|
+
version: 0.5.1.5
|
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-01-
|
12
|
+
date: 2025-01-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: anyway_config
|
@@ -190,6 +190,7 @@ files:
|
|
190
190
|
- app/views/kaminari/_paginator.html.haml
|
191
191
|
- app/views/kaminari/_prev_page.html.haml
|
192
192
|
- app/views/tramway/entities/_entity.html.haml
|
193
|
+
- app/views/tramway/entities/_list.html.haml
|
193
194
|
- app/views/tramway/entities/index.html.haml
|
194
195
|
- app/views/tramway/layouts/application.html.haml
|
195
196
|
- config/routes.rb
|