tramway 0.5.1.2 → 0.5.1.5

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: f2716febb35463e08d23262e008c607f0114f5cc49d1734ecbed30c3133e9e06
4
- data.tar.gz: 408cfb199f328e21f03f2d99eb04c6a16d5eb875709dede6c2a71292ebb7647b
3
+ metadata.gz: 838aba970de3f300933609c6072917a9583fa49a2609d10597146d8fe6c70812
4
+ data.tar.gz: 3d95247267309c650eee9ceb5168a04c809f723f35700214831e4df6b167c543
5
5
  SHA512:
6
- metadata.gz: bf77038d704285581baf87b69900c4af9ecf06c6cf5b158c68062ce92c7c8414f3b3e9a1bc77eafe730dfe709b432ba4c5633ba162873d67ec8e7e26004aac7e
7
- data.tar.gz: 3ea8c39ac64b9571779c8684d209188c5255c9820967eddfd528f0f5d4d3d66ff0645fd2e62d3906501b432d48393d1cfa7a99a23bda9bdf3382fa8aa3293ff7
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 cursor-pointer hover:bg-purple-100 grid-cols-[#{cols}]" do
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
- = component 'tailwinds/table/row', cells: decorator.list_attributes.reduce({}) { |hash, attribute| hash.merge! attribute => entity.public_send(attribute) }, href: decorator.decorate(entity).show_path
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
- - decorator = Tramway::Decorators::NameBuilder.default_decorator_class_name(@model_class)
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'
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tramway
4
- VERSION = '0.5.1.2'
4
+ VERSION = '0.5.1.5'
5
5
  end
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.2
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-20 00:00:00.000000000 Z
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