headmin 0.5.2 → 0.5.3
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 +4 -4
- data/.lock-487e157d270f3062a98b7b2a012753708-1272821827 +0 -0
- data/Gemfile.lock +2 -2
- data/app/helpers/headmin/form_helper.rb +2 -2
- data/app/models/concerns/headmin/field.rb +2 -1
- data/app/models/concerns/headmin/fieldable.rb +10 -10
- data/app/views/examples/admin.html.erb +18 -18
- data/app/views/examples/auth.html.erb +3 -3
- data/app/views/headmin/_blocks.html.erb +2 -2
- data/app/views/headmin/_breadcrumbs.html.erb +3 -3
- data/app/views/headmin/_dropdown.html.erb +2 -2
- data/app/views/headmin/_filters.html.erb +7 -7
- data/app/views/headmin/_form.html.erb +2 -2
- data/app/views/headmin/_heading.html.erb +1 -1
- data/app/views/headmin/_index.html.erb +1 -1
- data/app/views/headmin/_notifications.html.erb +1 -1
- data/app/views/headmin/_pagination.html.erb +3 -3
- data/app/views/headmin/_popup.html.erb +4 -4
- data/app/views/headmin/_table.html.erb +2 -2
- data/app/views/headmin/_thumbnail.html.erb +1 -1
- data/app/views/headmin/dropdown/_button.html.erb +2 -2
- data/app/views/headmin/dropdown/_devise.html.erb +8 -8
- data/app/views/headmin/dropdown/_item.html.erb +2 -2
- data/app/views/headmin/dropdown/_list.html.erb +3 -3
- data/app/views/headmin/dropdown/_locale.html.erb +6 -6
- data/app/views/headmin/filters/_base.html.erb +20 -20
- data/app/views/headmin/filters/_boolean.html.erb +4 -4
- data/app/views/headmin/filters/_date.html.erb +4 -4
- data/app/views/headmin/filters/_flatpickr.html.erb +4 -4
- data/app/views/headmin/filters/_number.html.erb +4 -4
- data/app/views/headmin/filters/_options.html.erb +4 -4
- data/app/views/headmin/filters/_search.html.erb +3 -3
- data/app/views/headmin/filters/_text.html.erb +4 -4
- data/app/views/headmin/filters/filter/_button.html.erb +2 -2
- data/app/views/headmin/filters/filter/_null_select.html.erb +2 -2
- data/app/views/headmin/forms/_autocomplete.html.erb +2 -2
- data/app/views/headmin/forms/_blocks.html.erb +4 -4
- data/app/views/headmin/forms/_checkbox.html.erb +5 -5
- data/app/views/headmin/forms/_color.html.erb +5 -5
- data/app/views/headmin/forms/_date.html.erb +8 -8
- data/app/views/headmin/forms/_date_range.html.erb +3 -3
- data/app/views/headmin/forms/_datetime.html.erb +8 -8
- data/app/views/headmin/forms/_datetime_range.html.erb +3 -3
- data/app/views/headmin/forms/_email.html.erb +9 -9
- data/app/views/headmin/forms/_errors.html.erb +1 -1
- data/app/views/headmin/forms/_file.html.erb +16 -16
- data/app/views/headmin/forms/_flatpickr.html.erb +2 -2
- data/app/views/headmin/forms/_flatpickr_range.html.erb +8 -8
- data/app/views/headmin/forms/_hidden.html.erb +1 -1
- data/app/views/headmin/forms/_hint.html.erb +1 -1
- data/app/views/headmin/forms/_label.html.erb +1 -1
- data/app/views/headmin/forms/_media.html.erb +11 -11
- data/app/views/headmin/forms/_number.html.erb +8 -8
- data/app/views/headmin/forms/_password.html.erb +7 -7
- data/app/views/headmin/forms/_redactorx.html.erb +2 -2
- data/app/views/headmin/forms/_repeater.html.erb +20 -20
- data/app/views/headmin/forms/_search.html.erb +9 -9
- data/app/views/headmin/forms/_select.html.erb +8 -8
- data/app/views/headmin/forms/_switch.html.erb +2 -2
- data/app/views/headmin/forms/_text.html.erb +9 -9
- data/app/views/headmin/forms/_textarea.html.erb +7 -7
- data/app/views/headmin/forms/_url.html.erb +9 -9
- data/app/views/headmin/forms/_validation.html.erb +1 -1
- data/app/views/headmin/forms/_wysiwyg.html.erb +2 -2
- data/app/views/headmin/forms/fields/_base.html.erb +2 -2
- data/app/views/headmin/forms/fields/_file.html.erb +3 -3
- data/app/views/headmin/forms/fields/_files.html.erb +3 -3
- data/app/views/headmin/forms/fields/_group.html.erb +7 -7
- data/app/views/headmin/forms/fields/_list.html.erb +5 -5
- data/app/views/headmin/forms/fields/_text.html.erb +3 -3
- data/app/views/headmin/forms/media/_item.html.erb +4 -4
- data/app/views/headmin/forms/media/_validation.html.erb +4 -4
- data/app/views/headmin/forms/repeater/_row.html.erb +5 -5
- data/app/views/headmin/heading/_title.html.erb +2 -2
- data/app/views/headmin/layout/_main.html.erb +1 -1
- data/app/views/headmin/media/_item.html.erb +1 -1
- data/app/views/headmin/media/_media_item_modal.html.erb +12 -12
- data/app/views/headmin/media/_modal.html.erb +10 -10
- data/app/views/headmin/media/create.turbo_stream.erb +2 -2
- data/app/views/headmin/media/index.html.erb +1 -1
- data/app/views/headmin/media/update.turbo_stream.erb +1 -1
- data/app/views/headmin/nav/_dropdown.html.erb +7 -7
- data/app/views/headmin/nav/_item.html.erb +5 -5
- data/app/views/headmin/nav/item/_devise.html.erb +6 -6
- data/app/views/headmin/nav/item/_locale.html.erb +6 -6
- data/app/views/headmin/pagination/_per_page.html.erb +7 -7
- data/app/views/headmin/pagination/kaminari/_first_page.html.erb +2 -2
- data/app/views/headmin/pagination/kaminari/_gap.html.erb +1 -1
- data/app/views/headmin/pagination/kaminari/_last_page.html.erb +2 -2
- data/app/views/headmin/pagination/kaminari/_next_page.html.erb +3 -3
- data/app/views/headmin/pagination/kaminari/_page.html.erb +2 -2
- data/app/views/headmin/pagination/kaminari/_paginator.html.erb +1 -1
- data/app/views/headmin/pagination/kaminari/_prev_page.html.erb +2 -2
- data/app/views/headmin/table/_actions.html.erb +11 -11
- data/app/views/headmin/table/_body.html.erb +1 -1
- data/app/views/headmin/table/actions/_action.html.erb +4 -4
- data/app/views/headmin/table/actions/_delete.html.erb +2 -2
- data/app/views/headmin/table/actions/_export.html.erb +2 -2
- data/app/views/headmin/table/body/_association.html.erb +1 -1
- data/app/views/headmin/table/body/_boolean.erb +4 -4
- data/app/views/headmin/table/body/_date.html.erb +2 -2
- data/app/views/headmin/table/body/_row.html.erb +3 -3
- data/app/views/headmin/table/body/_string.html.erb +1 -1
- data/app/views/headmin/table/foot/_cell.html.erb +1 -1
- data/app/views/headmin/table/head/_cell.html.erb +1 -1
- data/app/views/headmin/table/head/cell/_asc.html.erb +2 -2
- data/app/views/headmin/table/head/cell/_default.html.erb +1 -1
- data/app/views/headmin/table/head/cell/_desc.html.erb +1 -1
- data/app/views/headmin/views/devise/confirmations/_new.html.erb +4 -4
- data/app/views/headmin/views/devise/passwords/_edit.html.erb +5 -5
- data/app/views/headmin/views/devise/passwords/_new.html.erb +4 -4
- data/app/views/headmin/views/devise/registrations/_edit.html.erb +10 -10
- data/app/views/headmin/views/devise/registrations/_new.html.erb +6 -6
- data/app/views/headmin/views/devise/sessions/_new.html.erb +5 -5
- data/app/views/headmin/views/devise/shared/_links.html.erb +11 -11
- data/app/views/headmin/views/devise/unlocks/_new.html.erb +4 -4
- data/lib/generators/templates/views/auth/confirmations/new.html.erb +1 -1
- data/lib/generators/templates/views/auth/mailer/confirmation_instructions.html.erb +1 -1
- data/lib/generators/templates/views/auth/mailer/email_changed.html.erb +1 -1
- data/lib/generators/templates/views/auth/mailer/password_change.html.erb +1 -1
- data/lib/generators/templates/views/auth/mailer/reset_password_instructions.html.erb +1 -1
- data/lib/generators/templates/views/auth/mailer/unlock_instructions.html.erb +1 -1
- data/lib/generators/templates/views/auth/passwords/edit.html.erb +1 -1
- data/lib/generators/templates/views/auth/passwords/new.html.erb +1 -1
- data/lib/generators/templates/views/auth/registrations/edit.html.erb +1 -1
- data/lib/generators/templates/views/auth/registrations/new.html.erb +1 -1
- data/lib/generators/templates/views/auth/sessions/new.html.erb +1 -1
- data/lib/generators/templates/views/auth/unlocks/new.html.erb +1 -1
- data/lib/generators/templates/views/layouts/auth.html.erb +3 -3
- data/lib/headmin/version.rb +1 -1
- data/package.json +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: '085821452a1ab6c16440f422dd5db566a3bb78a230496c15251d273264870c2f'
|
4
|
+
data.tar.gz: 0e826df821082477c7f4a5d975f22e621abf55cdf19670cac74e005f8bab8913
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4697f00acea6b4b874168997aedee42032154deb32fdec90c61e676b22f4902337867651880c31c02fa1fbff673dbd7eddf4e0cb4bbc80b0b0f4f5ff565fdae
|
7
|
+
data.tar.gz: bcb2d2c203bf82f642cb65c5444b8bd412a30072f7a78b90b2416fbc00b244eed4864b539fcd506eec5a28177aa3684b851b4210633eb90131c784b36b947147
|
File without changes
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
headmin (0.5.
|
4
|
+
headmin (0.5.2)
|
5
5
|
closure_tree (~> 7.4)
|
6
6
|
inline_svg (~> 1.7)
|
7
7
|
redcarpet (~> 3.5)
|
@@ -226,7 +226,7 @@ GEM
|
|
226
226
|
actionpack (>= 5.0)
|
227
227
|
railties (>= 5.0)
|
228
228
|
rexml (3.2.5)
|
229
|
-
rouge (3.
|
229
|
+
rouge (3.29.0)
|
230
230
|
route_translator (12.1.0)
|
231
231
|
actionpack (>= 5.2, < 7.1)
|
232
232
|
activesupport (>= 5.2, < 7.1)
|
@@ -16,8 +16,8 @@ module Headmin
|
|
16
16
|
# https://example.com/products?amount=1&type[]=food&type[]=beverage
|
17
17
|
#
|
18
18
|
# <%= form.hidden_input :amount, value: 1 %>
|
19
|
-
# <%= form.hidden_input :
|
20
|
-
# <%= form.hidden_input :
|
19
|
+
# <%= form.hidden_input :"type[]", value: "food" %>
|
20
|
+
# <%= form.hidden_input :"type[]", value: "beverage" %>
|
21
21
|
def query_parameter_fields(form)
|
22
22
|
test = request.query_parameters.map do |name, value|
|
23
23
|
if value.is_a?(Array)
|
@@ -4,7 +4,8 @@ module Headmin
|
|
4
4
|
|
5
5
|
included do
|
6
6
|
# Configuration
|
7
|
-
has_closure_tree
|
7
|
+
has_closure_tree order: "position", numeric_order: true
|
8
|
+
|
8
9
|
# Associations
|
9
10
|
belongs_to :fieldable, polymorphic: true, optional: true, touch: true
|
10
11
|
belongs_to :field, optional: true, touch: true
|
@@ -28,7 +28,7 @@ module Headmin
|
|
28
28
|
private
|
29
29
|
|
30
30
|
def parse_fields
|
31
|
-
hash_tree = fields.includes(default_include_tables | include_tables).
|
31
|
+
hash_tree = fields.includes(default_include_tables | include_tables).hash_tree
|
32
32
|
parse_hash_tree(hash_tree)
|
33
33
|
end
|
34
34
|
|
@@ -104,10 +104,11 @@ module Headmin
|
|
104
104
|
name: name,
|
105
105
|
field_type: "file",
|
106
106
|
value: nil,
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
107
|
+
files_attachments_attributes: [
|
108
|
+
{
|
109
|
+
blob: ActiveStorage::Blob.create_and_upload!(io: file, filename: File.basename(file.path))
|
110
|
+
}
|
111
|
+
]
|
111
112
|
)
|
112
113
|
end
|
113
114
|
|
@@ -117,11 +118,10 @@ module Headmin
|
|
117
118
|
name: name,
|
118
119
|
field_type: "files",
|
119
120
|
value: nil,
|
120
|
-
|
121
|
-
|
122
|
-
io: file,
|
123
|
-
|
124
|
-
)
|
121
|
+
files_attachments_attributes: files.map { |file|
|
122
|
+
{
|
123
|
+
blob: ActiveStorage::Blob.create_and_upload!(io: file, filename: File.basename(file.path))
|
124
|
+
}
|
125
125
|
}
|
126
126
|
)
|
127
127
|
end
|
@@ -6,34 +6,34 @@
|
|
6
6
|
<%= csrf_meta_tags %>
|
7
7
|
<%= csp_meta_tag %>
|
8
8
|
|
9
|
-
<%= stylesheet_pack_tag
|
10
|
-
<%= javascript_pack_tag
|
9
|
+
<%= stylesheet_pack_tag "admin", media: "all", "data-turbo-track": "reload" %>
|
10
|
+
<%= javascript_pack_tag "admin", "data-turbo-track": "reload" %>
|
11
11
|
</head>
|
12
12
|
|
13
13
|
<body>
|
14
|
-
<%= render
|
15
|
-
<%= render
|
16
|
-
<%= render
|
17
|
-
<%= render
|
14
|
+
<%= render "headmin/layout/main" do %>
|
15
|
+
<%= render "headmin/layout/sidebar", logo: inline_svg_tag("logo.svg") do %>
|
16
|
+
<%= render "headmin/layout/sidebar/menu" do %>
|
17
|
+
<%= render "headmin/layout/sidebar/menu/item", name: t(".dashboard"), link: admin_root_path, icon: "speedometer" %>
|
18
18
|
<div class="d-block d-md-none">
|
19
|
-
<%= render
|
20
|
-
<%= render
|
19
|
+
<%= render "headmin/layout/sidebar/menu/locale" do end %>
|
20
|
+
<%= render "headmin/layout/sidebar/menu/account" do end %>
|
21
21
|
</div>
|
22
22
|
<% end %>
|
23
23
|
<% end %>
|
24
|
-
<%= render
|
25
|
-
<%= render
|
26
|
-
<%= render
|
27
|
-
<%= render
|
24
|
+
<%= render "headmin/layout/body" do %>
|
25
|
+
<%= render "headmin/layout/header" do %>
|
26
|
+
<%= render "headmin/layout/header/locale" do end %>
|
27
|
+
<%= render "headmin/layout/header/account" do end %>
|
28
28
|
<% end %>
|
29
|
-
<%= render
|
30
|
-
<%= render
|
29
|
+
<%= render "headmin/layout/content" do %>
|
30
|
+
<%= render "headmin/notifications" %>
|
31
31
|
<%= yield %>
|
32
32
|
<% end %>
|
33
|
-
<%= render
|
34
|
-
<%= bootstrap_icon(
|
35
|
-
<a class="text-secondary" href="mailto:info@insiting.com" title="<%= t(
|
36
|
-
<%= t(
|
33
|
+
<%= render "headmin/layout/footer", class: "text-secondary" do %>
|
34
|
+
<%= bootstrap_icon("question-circle") %>
|
35
|
+
<a class="text-secondary" href="mailto:info@insiting.com" title="<%= t(".help") %>">
|
36
|
+
<%= t(".help") %>
|
37
37
|
</a>
|
38
38
|
<% end %>
|
39
39
|
<% end %>
|
@@ -5,12 +5,12 @@
|
|
5
5
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
6
6
|
<%= csrf_meta_tags %>
|
7
7
|
<%= csp_meta_tag %>
|
8
|
-
<%= stylesheet_pack_tag
|
9
|
-
<%= javascript_pack_tag
|
8
|
+
<%= stylesheet_pack_tag "admin", media: "all", "data-turbolinks-track": "reload" %>
|
9
|
+
<%= javascript_pack_tag "admin", "data-turbolinks-track": "reload" %>
|
10
10
|
</head>
|
11
11
|
<body class="bg-light w-100 vh-100">
|
12
12
|
|
13
|
-
<%= render
|
13
|
+
<%= render "headmin/notifications" %>
|
14
14
|
|
15
15
|
<main class="d-flex justify-content-center align-items-center w-100 vh-100 p-3">
|
16
16
|
<%= yield %>
|
@@ -9,10 +9,10 @@
|
|
9
9
|
#
|
10
10
|
# ==== Examples
|
11
11
|
# Basic version. (looks in views/website/blocks, views/blocks or views directory )
|
12
|
-
# <%= render
|
12
|
+
# <%= render "headmin/blocks", blockable: @page %#>
|
13
13
|
#
|
14
14
|
# Define one ore more path where the templates could be located:
|
15
|
-
# <%= render
|
15
|
+
# <%= render "headmin/blocks", blockable: @page, paths: %w(website/pages/blocks) %#>
|
16
16
|
|
17
17
|
blocks = Headmin::BlocksView.new(local_assigns)
|
18
18
|
@lookup_context.prefixes = blocks.prefixes + @lookup_context.prefixes
|
@@ -6,7 +6,7 @@
|
|
6
6
|
#
|
7
7
|
# ==== Examples
|
8
8
|
# Basic version. This will use the publicly available `breadcrumbs` variable
|
9
|
-
# <%= render
|
9
|
+
# <%= render "headmin/breadcrumbs" %#>
|
10
10
|
%>
|
11
11
|
|
12
12
|
<nav aria-label="breadcrumb">
|
@@ -14,11 +14,11 @@
|
|
14
14
|
<% breadcrumb_count = breadcrumbs.count %>
|
15
15
|
<% breadcrumbs.each_with_index do |breadcrumb, index| %>
|
16
16
|
<% last = (index == breadcrumb_count - 1) %>
|
17
|
-
<li class="breadcrumb-item text-muted" aria-current="<%= last ?
|
17
|
+
<li class="breadcrumb-item text-muted" aria-current="<%= last ? "page" : nil %>">
|
18
18
|
<% if last %>
|
19
19
|
<%= breadcrumb.name %>
|
20
20
|
<% else %>
|
21
|
-
<%= link_to_unless_current(breadcrumb.name, breadcrumb.path, class:
|
21
|
+
<%= link_to_unless_current(breadcrumb.name, breadcrumb.path, class: "text-muted text-decoration-none") %>
|
22
22
|
<% end %>
|
23
23
|
</li>
|
24
24
|
<% end %>
|
@@ -6,11 +6,11 @@
|
|
6
6
|
#
|
7
7
|
# ==== Examples
|
8
8
|
# Basic version
|
9
|
-
# <%= render
|
9
|
+
# <%= render "headmin/dropdown" do %#>
|
10
10
|
# Your content
|
11
11
|
# <% end %#>
|
12
12
|
|
13
|
-
class_names = local_assigns.has_key?(:class) ? local_assigns[:class] :
|
13
|
+
class_names = local_assigns.has_key?(:class) ? local_assigns[:class] : "btn-group"
|
14
14
|
%>
|
15
15
|
|
16
16
|
<div class="dropdown <%= class_names %>">
|
@@ -6,12 +6,12 @@
|
|
6
6
|
#
|
7
7
|
# ==== Examples
|
8
8
|
# Basic version
|
9
|
-
# <%= render
|
10
|
-
# <%= render
|
9
|
+
# <%= render "headmin/filters" do %#>
|
10
|
+
# <%= render "headmin/filters/select", name: "color", options: ["red", "green", "blue"] %#>
|
11
11
|
# <% end %#>
|
12
12
|
#
|
13
13
|
# With custom URL
|
14
|
-
# <%= render
|
14
|
+
# <%= render "headmin/filters", url: admin_polls_path %#>
|
15
15
|
|
16
16
|
action = local_assigns.has_key?(:url) ? url : request.path
|
17
17
|
%>
|
@@ -22,7 +22,7 @@
|
|
22
22
|
<%= yield(form) %>
|
23
23
|
|
24
24
|
<!-- Default parameters (e.g. sorting, pagination) -->
|
25
|
-
<% default_params.except(
|
25
|
+
<% default_params.except("page").each do |name, value| %>
|
26
26
|
<%= form.hidden_field name.to_sym, value: value %>
|
27
27
|
<% end %>
|
28
28
|
|
@@ -44,8 +44,8 @@
|
|
44
44
|
<% if content_for?(:filters_menu) %>
|
45
45
|
<div class="btn-group">
|
46
46
|
<button type="button" class="btn h-btn-outline-light dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
|
47
|
-
<%= bootstrap_icon(
|
48
|
-
<%= t(
|
47
|
+
<%= bootstrap_icon("funnel") %>
|
48
|
+
<%= t(".button") %>
|
49
49
|
</button>
|
50
50
|
<ul class="dropdown-menu">
|
51
51
|
<%= content_for :filters_menu %>
|
@@ -53,7 +53,7 @@
|
|
53
53
|
<hr class="dropdown-divider">
|
54
54
|
</li>
|
55
55
|
<li>
|
56
|
-
<a class="dropdown-item text-danger" href="#" data-action="click->filters#removeAll"><%= t(
|
56
|
+
<a class="dropdown-item text-danger" href="#" data-action="click->filters#removeAll"><%= t(".remove_all") %></a>
|
57
57
|
</li>
|
58
58
|
</ul>
|
59
59
|
</div>
|
@@ -19,12 +19,12 @@
|
|
19
19
|
#
|
20
20
|
# === Examples
|
21
21
|
# Basic version
|
22
|
-
# <%= render
|
22
|
+
# <%= render "headmin/form", model: @product do |form| %#>
|
23
23
|
# Form content
|
24
24
|
# <% end %#>
|
25
25
|
#
|
26
26
|
# Specify URL to post to
|
27
|
-
# <%= render
|
27
|
+
# <%= render "headmin/form", model: @product, url: admin_products_path do |form| %#>
|
28
28
|
# Form content
|
29
29
|
# <% end %#>
|
30
30
|
|
@@ -6,13 +6,13 @@
|
|
6
6
|
#
|
7
7
|
# ==== Examples
|
8
8
|
# Basic version
|
9
|
-
# <%= render
|
9
|
+
# <%= render "headmin/pagination, collection: @pages" %#>
|
10
10
|
%>
|
11
11
|
|
12
12
|
<div class="d-flex flex-row-reverse flex-md-row align-items-center justify-content-between justify-content-md-end my-1">
|
13
13
|
<% content_for :collection_total_count, collection.total_count.to_s unless content_for?(:collection_total_count) %>
|
14
14
|
<div class="ms-2 me-md-2 text-secondary flex-grow-1 flex-shrink-0">
|
15
|
-
<%= t(
|
15
|
+
<%= t(".items", count: content_for(:collection_total_count).to_i) %>
|
16
16
|
</div>
|
17
|
-
<%= paginate collection, views_prefix:
|
17
|
+
<%= paginate collection, views_prefix: "headmin/pagination" %>
|
18
18
|
</div>
|
@@ -8,7 +8,7 @@
|
|
8
8
|
# To trigger this popup create an element with a data attribute like this
|
9
9
|
#
|
10
10
|
# <button data-popup-id="popupId">open Popup</button>
|
11
|
-
# <%= render
|
11
|
+
# <%= render "headmin/popup", id: "popupId" do %#>
|
12
12
|
# popup Content
|
13
13
|
# <% end %#>
|
14
14
|
#
|
@@ -16,14 +16,14 @@
|
|
16
16
|
# "data-popup-pass-thru" attribute.
|
17
17
|
#
|
18
18
|
# <button data-popup-id="popupId" data-popup-pass-thru="#link">open Popup</button>
|
19
|
-
# <%= render
|
19
|
+
# <%= render "headmin/popup", id: "popupId" do %#>
|
20
20
|
# <a href="https://example.com" id="link">
|
21
21
|
# <% end %#>
|
22
22
|
data = local_assigns.has_key?(:data) ? data : {}
|
23
23
|
|
24
24
|
options = {
|
25
|
-
class: [
|
26
|
-
data: data.merge(
|
25
|
+
class: ["h-popup", "closed"],
|
26
|
+
data: data.merge("popup-target": "popup", "popup-id": id)
|
27
27
|
}
|
28
28
|
%>
|
29
29
|
|
@@ -5,7 +5,7 @@
|
|
5
5
|
# * +sort_url</tt> - Url to post object ids to in the order of positions
|
6
6
|
#
|
7
7
|
# ==== Examples
|
8
|
-
# <%= render
|
8
|
+
# <%= render "headmin/table", sort_url: positions_admin_categories_path do %#>
|
9
9
|
# table content here
|
10
10
|
# <% end %#>
|
11
11
|
|
@@ -13,7 +13,7 @@
|
|
13
13
|
total_count = content_for(:collection_total_count).to_i || nil
|
14
14
|
%>
|
15
15
|
|
16
|
-
<div class="h-table card my-2 shadow-sm <%=
|
16
|
+
<div class="h-table card my-2 shadow-sm <%= "table-drag-sort" if sort_url %>" data-sort-url="<%= sort_url %>">
|
17
17
|
<div class="table-responsive">
|
18
18
|
<table class="table table-hover m-0"
|
19
19
|
data-controller="table"
|
@@ -5,7 +5,7 @@
|
|
5
5
|
<div class="h-thumbnail-bg" style="background-image: url('<%= thumbnail.src %>');"></div>
|
6
6
|
<% else %>
|
7
7
|
<div class="h-thumbnail-bg">
|
8
|
-
<%= bootstrap_icon(thumbnail.icon_name, class:
|
8
|
+
<%= bootstrap_icon(thumbnail.icon_name, class: "h-thumbnail-icon") %>
|
9
9
|
</div>
|
10
10
|
<% end %>
|
11
11
|
</div>
|
@@ -5,8 +5,8 @@
|
|
5
5
|
id: unique identifier for the dropdown
|
6
6
|
class: css class names as string
|
7
7
|
%>
|
8
|
-
<% id = local_assigns.has_key?(:id) ? id :
|
9
|
-
<% class_names = local_assigns.has_key?(:class) ? local_assigns[:class] :
|
8
|
+
<% id = local_assigns.has_key?(:id) ? id : "dropdown-1" %>
|
9
|
+
<% class_names = local_assigns.has_key?(:class) ? local_assigns[:class] : "btn" %>
|
10
10
|
|
11
11
|
<a class="dropdown-toggle d-flex align-items-center <%= class_names %>" type="button" id="<%= id %>" data-bs-toggle="dropdown" aria-expanded="false">
|
12
12
|
<%= yield %>
|
@@ -7,10 +7,10 @@
|
|
7
7
|
#
|
8
8
|
# ==== Examples
|
9
9
|
# Basic version
|
10
|
-
# <%= render
|
10
|
+
# <%= render "headmin/dropdown/devise" %#>
|
11
11
|
#
|
12
12
|
# Custom scope
|
13
|
-
# <%= render
|
13
|
+
# <%= render "headmin/dropdown/devise", scope: :admins %#>
|
14
14
|
|
15
15
|
class_names = local_assigns.has_key?(:class) ? local_assigns[:class] : ""
|
16
16
|
scope = local_assigns.has_key?(:scope) ? scope : :users
|
@@ -19,13 +19,13 @@
|
|
19
19
|
%>
|
20
20
|
|
21
21
|
|
22
|
-
<%= render
|
23
|
-
<%= render
|
22
|
+
<%= render "headmin/dropdown", class: class_names do %>
|
23
|
+
<%= render "headmin/dropdown/button" do %>
|
24
24
|
<%= user.to_s %>
|
25
25
|
<% end %>
|
26
|
-
<%= render
|
27
|
-
<%= render
|
28
|
-
<%= render
|
29
|
-
<%= render
|
26
|
+
<%= render "headmin/dropdown/list", class: "dropdown-menu-end" do %>
|
27
|
+
<%= render "headmin/dropdown/item", name: t("headmin.dropdown.devise.edit_profile"), url: polymorphic_path([:edit, :admin, user]) %>
|
28
|
+
<%= render "headmin/dropdown/divider" %>
|
29
|
+
<%= render "headmin/dropdown/item", name: t("headmin.dropdown.devise.log_out"), url: polymorphic_path([:destroy, singular, :session]), method: :delete %>
|
30
30
|
<% end %>
|
31
31
|
<% end %>
|
@@ -8,8 +8,8 @@
|
|
8
8
|
%>
|
9
9
|
|
10
10
|
<% method = local_assigns.has_key?(:method) ? method : nil %>
|
11
|
-
<% url = local_assigns.has_key?(:url) ? url :
|
12
|
-
<% name = local_assigns.has_key?(:name) ? name :
|
11
|
+
<% url = local_assigns.has_key?(:url) ? url : "" %>
|
12
|
+
<% name = local_assigns.has_key?(:name) ? name : "" %>
|
13
13
|
|
14
14
|
<li>
|
15
15
|
<a class="dropdown-item" href="<%= url %>" <%= "data-turbo-method=#{method}" if method %>>
|
@@ -7,10 +7,10 @@
|
|
7
7
|
#
|
8
8
|
# ==== Examples
|
9
9
|
# Basic version
|
10
|
-
# <%= render
|
10
|
+
# <%= render "headmin/dropdown/list", id: "dropdown-1" %#>
|
11
11
|
|
12
|
-
class_names = local_assigns.has_key?(:class) ? local_assigns[:class] :
|
13
|
-
id = local_assigns.has_key?(:id) ? id :
|
12
|
+
class_names = local_assigns.has_key?(:class) ? local_assigns[:class] : ""
|
13
|
+
id = local_assigns.has_key?(:id) ? id : "dropdown-1"
|
14
14
|
%>
|
15
15
|
|
16
16
|
<ul class="dropdown-menu <%= class_names %>" aria-labelledby="<%= id %>">
|
@@ -4,14 +4,14 @@
|
|
4
4
|
parameters: none
|
5
5
|
%>
|
6
6
|
|
7
|
-
<%= render
|
8
|
-
<%= render
|
9
|
-
<%= bootstrap_icon(
|
10
|
-
<%= t(
|
7
|
+
<%= render "headmin/dropdown" do %>
|
8
|
+
<%= render "headmin/dropdown/button", id: "locale-dropdown" do %>
|
9
|
+
<%= bootstrap_icon("globe", class: "me-2") %>
|
10
|
+
<%= t("language_name", locale: ::I18n.locale) %>
|
11
11
|
<% end %>
|
12
|
-
<%= render
|
12
|
+
<%= render "headmin/dropdown/list", id: "locale-dropdown" do %>
|
13
13
|
<% I18n.available_locales.each do |locale| %>
|
14
|
-
<%= render
|
14
|
+
<%= render "headmin/dropdown/item", name: t("language_name", locale: locale), url: url_for({locale: locale.to_s}) %>
|
15
15
|
<% end %>
|
16
16
|
<% end %>
|
17
17
|
<% end %>
|
@@ -11,8 +11,8 @@
|
|
11
11
|
# ==== Examples
|
12
12
|
# Basic version
|
13
13
|
#
|
14
|
-
# <%= render
|
15
|
-
# <%= render
|
14
|
+
# <%= render "headmin/filters/base", name: :title do |value| %#>
|
15
|
+
# <%= render "headmin/forms/text", value: value %#>
|
16
16
|
# <% end %#>
|
17
17
|
#
|
18
18
|
|
@@ -21,17 +21,17 @@
|
|
21
21
|
%>
|
22
22
|
|
23
23
|
<%= content_for :filters_menu do %>
|
24
|
-
<%= render
|
24
|
+
<%= render "headmin/filters/filter/menu_item", base.menu_item_options %>
|
25
25
|
<% end %>
|
26
26
|
|
27
27
|
<%= content_for :filters_templates do %>
|
28
28
|
<template data-filter-name="<%= name %>" data-filters-target="template">
|
29
|
-
<%= render
|
29
|
+
<%= render "headmin/filters/filter/button", name: name, label: label, filter: nil, value: nil, id: "template_id" do %>
|
30
30
|
<div class="h-filter-rows mb-3" data-filter-target="wrapper">
|
31
|
-
<%= render
|
32
|
-
<%= render
|
31
|
+
<%= render "headmin/filters/filter/row" do %>
|
32
|
+
<%= render "headmin/filters/filter/operator", base.filter_operator_options.merge({selected: nil}) %>
|
33
33
|
<%= yield(nil) %>
|
34
|
-
<%= render
|
34
|
+
<%= render "headmin/filters/filter/null_select", value: nil %>
|
35
35
|
<% end %>
|
36
36
|
</div>
|
37
37
|
|
@@ -45,11 +45,11 @@
|
|
45
45
|
|
46
46
|
<!-- Filter template -->
|
47
47
|
<template data-filter-target="template">
|
48
|
-
<%= render
|
49
|
-
<%= render
|
50
|
-
<%= render
|
48
|
+
<%= render "headmin/filters/filter/conditional" %>
|
49
|
+
<%= render "headmin/filters/filter/row" do %>
|
50
|
+
<%= render "headmin/filters/filter/operator", base.filter_operator_options.merge({selected: nil}) %>
|
51
51
|
<%= yield(nil) %>
|
52
|
-
<%= render
|
52
|
+
<%= render "headmin/filters/filter/null_select", value: nil %>
|
53
53
|
<% end %>
|
54
54
|
</template>
|
55
55
|
<% end %>
|
@@ -58,17 +58,17 @@
|
|
58
58
|
|
59
59
|
<%= content_for :filters_buttons do %>
|
60
60
|
<% if filter_param_exists?(name) %>
|
61
|
-
<%= render
|
61
|
+
<%= render "headmin/filters/filter/button", base.filter_button_options.merge({id: "#{name}_#{SecureRandom.hex}"}) do %>
|
62
62
|
<div class="h-filter-rows mb-3" data-filter-target="wrapper">
|
63
63
|
<% filter.values.each_with_index do |value, index| %>
|
64
64
|
<% if index > 0 %>
|
65
|
-
<%= render
|
65
|
+
<%= render "headmin/filters/filter/conditional", selected: filter.conditionals[index - 1] %>
|
66
66
|
<% end %>
|
67
67
|
|
68
|
-
<%= render
|
69
|
-
<%= render
|
68
|
+
<%= render "headmin/filters/filter/row" do %>
|
69
|
+
<%= render "headmin/filters/filter/operator", base.filter_operator_options.merge({selected: filter.operators[index]}) %>
|
70
70
|
<%= yield(value) %>
|
71
|
-
<%= render
|
71
|
+
<%= render "headmin/filters/filter/null_select", value: value %>
|
72
72
|
<% end %>
|
73
73
|
<% end %>
|
74
74
|
</div>
|
@@ -83,11 +83,11 @@
|
|
83
83
|
|
84
84
|
<!-- Filter template -->
|
85
85
|
<template data-filter-target="template">
|
86
|
-
<%= render
|
87
|
-
<%= render
|
88
|
-
<%= render
|
86
|
+
<%= render "headmin/filters/filter/conditional" %>
|
87
|
+
<%= render "headmin/filters/filter/row" do %>
|
88
|
+
<%= render "headmin/filters/filter/operator", base.filter_operator_options.merge({selected: nil}) %>
|
89
89
|
<%= yield(nil) %>
|
90
|
-
<%= render
|
90
|
+
<%= render "headmin/filters/filter/null_select", value: nil %>
|
91
91
|
<% end %>
|
92
92
|
</template>
|
93
93
|
<% end %>
|
@@ -11,13 +11,13 @@
|
|
11
11
|
#
|
12
12
|
# ==== Examples
|
13
13
|
# Basic version
|
14
|
-
# <%= render
|
15
|
-
# <%= render
|
14
|
+
# <%= render "headmin/filters", url: admin_orders_path do |form| %#>
|
15
|
+
# <%= render "headmin/filters/boolean", form: form, attribute: :published %#>
|
16
16
|
# <% end %#>
|
17
17
|
|
18
18
|
boolean = Headmin::Filter::BooleanView.new(local_assigns.merge(params: params))
|
19
19
|
%>
|
20
20
|
|
21
|
-
<%= render
|
22
|
-
<%= render
|
21
|
+
<%= render "headmin/filters/base", boolean.base_options do |value| %>
|
22
|
+
<%= render "headmin/forms/select", boolean.input_options.merge(selected: value) %>
|
23
23
|
<% end %>
|
@@ -11,13 +11,13 @@
|
|
11
11
|
#
|
12
12
|
# ==== Examples
|
13
13
|
# Basic version
|
14
|
-
# <%= render
|
15
|
-
# <%= render
|
14
|
+
# <%= render "headmin/filters", url: admin_orders_path do |form| %#>
|
15
|
+
# <%= render "headmin/filters/date", form: form, attribute: :created_at %#>
|
16
16
|
# <% end %#>
|
17
17
|
|
18
18
|
date = Headmin::Filter::DateView.new(local_assigns.merge(params: params))
|
19
19
|
%>
|
20
20
|
|
21
|
-
<%= render
|
22
|
-
<%= render
|
21
|
+
<%= render "headmin/filters/base", date.base_options do |value| %>
|
22
|
+
<%= render "headmin/forms/date", date.input_options.merge({value: value}) %>
|
23
23
|
<% end %>
|