tybo 0.3.20 → 0.3.21
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: 46c7ccf81962eadc08fc8ce5fbe0262a4f72a8d6e8fd404ab164a9d886ac9c1f
|
4
|
+
data.tar.gz: 3f24d05f562105a4702dde1fcddc89a5b52838b3ee51d6fbd68f6f3cf804cc71
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f7e133c1ecd51dc506093844eedb6afa1f65e8b8c6c63e04b915f552fa85c779ab66e3939703848b522d7d19f21de7561e61a6392c5eb9a238f930f09b7e79d
|
7
|
+
data.tar.gz: 5d7fa0ad9cf593d03c6b64bd3809c1daf4d91f7021b4280ce3fc2720b42a59c22ef7b499f27eb3aa1633bfb069480b1945b1ecfc6363ed2375596801601cb580
|
@@ -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: @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