tramway 1.0.1 → 1.0.1.2

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: e80ee744d6bfbcc4a55b9cbccc19b9d2c755830c8641009198d86553961cc0ed
4
- data.tar.gz: 58f0e9d547c6d209800c02e9ac6774b910366ead27c3f2306c5cc5bf379e7f38
3
+ metadata.gz: 06d72139ce4ef1d004a083a2d357eff4eff402e4a2af7a11a39458865e6f974b
4
+ data.tar.gz: 8179263c08e93124cb3d70aa1aa3071cc9e84970dc5d53dfbd07be33fdfba4a8
5
5
  SHA512:
6
- metadata.gz: 37b4d134de11d33b1dbbf1dd08818934a02c1d4de126d07bd15ad9b763fb8ec7b355ec9f05913e72a2b2133e2ef0679651b620ea29bb658cb8859e999bd35f66
7
- data.tar.gz: 4537dd751d10550a4cf9176b969195200caeabc2f74556a96dc72afd73e5c9d8b3238b71c48c59d751550d2ae9faddac98991a95222db19114d1f93b7d624ace
6
+ metadata.gz: 9c46d6168bff31a3e03687654e6a0ef5c1f5120988913f29cec1f93886277e654dfbfbe01aaedf066c100975383975c32407263dd527ddd532c0c7c25d358741
7
+ data.tar.gz: e13043a072b1572757e91e3beea6ca2c4dec3fa497096f6e4319ce65471703f51570315ba9d0037b489a6c6b32a88de994f1be7c2d95b5bd898b225562cde35c
data/README.md CHANGED
@@ -73,6 +73,8 @@ end
73
73
 
74
74
  ```ruby
75
75
  class UserDecorator < Tramway::BaseDecorator
76
+ delegate_attributes :email, :created_at
77
+
76
78
  def self.index_attributes
77
79
  [:id, :email, :created_at]
78
80
  end
@@ -137,12 +139,11 @@ Tramway.configure do |config|
137
139
  config.entities = [
138
140
  {
139
141
  name: :user,
140
- route: { namespace: :admin }
142
+ namespace: :admin
141
143
  }, # `/admin/users` link in the Tramway Navbar
142
144
  {
143
145
  name: :episodes,
144
146
  route: {
145
- namespace: :podcasts,
146
147
  route_method: :episodes
147
148
  }
148
149
  }, # `/podcasts/episodes` link in the Tramway Navbar
@@ -161,7 +162,7 @@ Tramway.configure do |config|
161
162
  config.entities = [
162
163
  {
163
164
  name: :campaign,
164
- route: { namespace: :admin },
165
+ namespace: :admin,
165
166
  pages: [
166
167
  {
167
168
  action: :index,
@@ -180,7 +181,7 @@ other pages continue to show every record unless another scope is specified.
180
181
 
181
182
  To render a show page for an entity, declare a `:show` action inside the `pages` array in
182
183
  `config/initializers/tramway.rb`. Tramway will generate the route and render a table using the attributes returned by the
183
- decorator's `self.show_attributes` method.
184
+ decorator's 'show_attributes` method.
184
185
 
185
186
  ```ruby
186
187
  Tramway.configure do |config|
@@ -198,7 +199,7 @@ end
198
199
 
199
200
  ```ruby
200
201
  class CampaignDecorator < Tramway::BaseDecorator
201
- def self.show_attributes
202
+ def show_attributes
202
203
  %i[name status starts_at]
203
204
  end
204
205
  end
@@ -11,7 +11,7 @@ module Tailwinds
11
11
  def classes
12
12
  [
13
13
  'flex', 'px-3', 'py-1', 'text-sm', 'font-semibold', 'text-white', "bg-#{resolved_color}-500",
14
- "dark:bg-#{resolved_color}-600", 'rounded-full', 'w-fit'
14
+ "dark:bg-#{resolved_color}-600", 'rounded-full', 'w-fit', 'h-fit'
15
15
  ]
16
16
  end
17
17
  end
@@ -94,7 +94,7 @@ module Tailwinds
94
94
  end
95
95
 
96
96
  def get_value(attribute, options)
97
- options[:value] || (object.present? ? object.public_send(attribute) : nil)
97
+ options[:value] || object.presence&.public_send(attribute)
98
98
  end
99
99
 
100
100
  def default_options(attribute, options)
@@ -1,2 +1,3 @@
1
- %span.page.gap.px-3.py-2.text-sm.font-medium.text-purple-700.dark:text-white.sm:flex.hidden
2
- = helpers.t('views.pagination.truncate').html_safe
1
+ %div.flex.justify-end.mt-2
2
+ %span.page.gap.px-3.py-2.text-sm.font-medium.text-purple-700.dark:text-white.sm:flex.hidden
3
+ = helpers.t('views.pagination.truncate').html_safe
@@ -18,7 +18,7 @@
18
18
  You should fill class-level method `self.index_attributes` inside your
19
19
  = decorator
20
20
  - else
21
- = tramway_table do
21
+ = tramway_table class: 'mt-4' do
22
22
  = tramway_header headers: index_attributes.map { |attribute| @model_class.human_attribute_name(attribute) }
23
23
  - @entities.each do |item|
24
24
  = component 'tramway/entity', entity: @entity, item: item
@@ -1,5 +1,5 @@
1
1
  = tramway_container do
2
- %h1.text-2xl.font-bold.mb-4
2
+ %h1.text-4xl.font-bold.mb-4
3
3
  = @entity.title
4
4
 
5
5
  - if @entity.show_attributes.empty?
@@ -104,6 +104,7 @@ module.exports = {
104
104
  'font-normal',
105
105
  'text-xs',
106
106
  'whitespace-nowrap',
107
+ 'h-fit',
107
108
 
108
109
  // === Button color presets ===
109
110
  'bg-gray-500',
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tramway
4
- VERSION = '1.0.1'
4
+ VERSION = '1.0.1.2'
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: 1.0.1
4
+ version: 1.0.1.2
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-11-05 00:00:00.000000000 Z
12
+ date: 2025-11-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: anyway_config