tybo 0.3.20 → 0.3.22
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 21a067a8c25ed4f8b9c31d26fa293cfdac168ce166fae0de0478bd402ab4c66d
|
4
|
+
data.tar.gz: 9fdaffaab9c6081fbadb2c5a20ec514bee9b5d310fad5021feef284a743299df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 00e0196ca9fba976da0ac461996368f15e375bde02e4acca66c6f60213a78ad48e2ec35fa07f14561fa2844039d2a80521febb980a37a49da083baf4703d2638
|
7
|
+
data.tar.gz: 44c7b62d0b79f2d332eee6f9a5cfc0a1a8125d0d326d2046d6799f4542e8e8b6ef1540b5978690d43d1e3b4bebc321395767802f1ff3884281efac2ffbe775c3
|
@@ -1,3 +1,8 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
<% if @column_name %>
|
2
|
+
<th class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900 hover:cursor-pointer">
|
3
|
+
<%= sort_link(@q, @column_name, @label, default_order: :asc) %>
|
4
|
+
</th>
|
5
|
+
<% else %>
|
6
|
+
<th class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">
|
7
|
+
</th>
|
8
|
+
<% end %>
|
@@ -1,17 +1,20 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
require 'ransack/helpers/form_helper'
|
3
4
|
|
4
5
|
module Tables
|
5
6
|
class ActiveRecordThComponent < ViewComponent::Base
|
6
7
|
include Ransack::Helpers::FormHelper
|
7
8
|
|
8
|
-
def initialize(
|
9
|
+
def initialize(ransack_object: nil, column_name: nil)
|
9
10
|
@column_name = column_name
|
10
11
|
@q = ransack_object
|
11
12
|
@label = label
|
12
13
|
end
|
13
14
|
|
14
15
|
def label
|
16
|
+
return unless @column_name
|
17
|
+
|
15
18
|
I18n.t("bo.#{@q.object.klass.to_s.underscore}.attributes.#{@column_name}")
|
16
19
|
end
|
17
20
|
end
|
@@ -3,8 +3,8 @@
|
|
3
3
|
<%- bo_model.column_names.each do |column| -%>
|
4
4
|
<%%= thead.with_active_record_th(column_name: '<%= column %>', ransack_object: @q) %>
|
5
5
|
<%- end -%>
|
6
|
-
<%%= thead.with_active_record_th
|
7
|
-
<%%= thead.with_active_record_th
|
6
|
+
<%%= thead.with_active_record_th %>
|
7
|
+
<%%= thead.with_active_record_th %>
|
8
8
|
<%% end %>
|
9
9
|
|
10
10
|
<%% table.with_tbody do |tbody| %>
|
data/lib/tybo/version.rb
CHANGED