headmin 0.1.1
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 +7 -0
- data/.gitignore +13 -0
- data/.nvmrc +1 -0
- data/.rubocop.yml +13 -0
- data/.ruby-version +1 -0
- data/CHANGELOG.md +5 -0
- data/CODE_OF_CONDUCT.md +84 -0
- data/Gemfile +12 -0
- data/Gemfile.lock +43 -0
- data/LICENSE.txt +21 -0
- data/README.md +166 -0
- data/Rakefile +16 -0
- data/app/assets/images/avatar.jpg +0 -0
- data/app/controllers/admin/users/confirmations_controller.rb +31 -0
- data/app/controllers/admin/users/omniauth_callbacks_controller.rb +31 -0
- data/app/controllers/admin/users/passwords_controller.rb +35 -0
- data/app/controllers/admin/users/registrations_controller.rb +63 -0
- data/app/controllers/admin/users/sessions_controller.rb +28 -0
- data/app/controllers/admin/users/unlocks_controller.rb +31 -0
- data/app/controllers/concerns/headmin/acts_as_list.rb +16 -0
- data/app/controllers/concerns/headmin/authentication.rb +17 -0
- data/app/controllers/concerns/headmin/ckeditor.rb +27 -0
- data/app/controllers/concerns/headmin/filter.rb +5 -0
- data/app/controllers/concerns/headmin/pagination.rb +23 -0
- data/app/controllers/concerns/headmin/searchable.rb +15 -0
- data/app/controllers/concerns/headmin/sortable.rb +44 -0
- data/app/helpers/headmin/admin_helper.rb +65 -0
- data/app/helpers/headmin/filter_helper.rb +12 -0
- data/app/helpers/headmin/notification_helper.rb +31 -0
- data/app/views/admin/users/confirmations/new.html.erb +9 -0
- data/app/views/admin/users/mailer/confirmation_instructions.html.erb +5 -0
- data/app/views/admin/users/mailer/email_changed.html.erb +7 -0
- data/app/views/admin/users/mailer/password_change.html.erb +3 -0
- data/app/views/admin/users/mailer/reset_password_instructions.html.erb +8 -0
- data/app/views/admin/users/mailer/unlock_instructions.html.erb +7 -0
- data/app/views/admin/users/passwords/edit.html.erb +12 -0
- data/app/views/admin/users/passwords/new.html.erb +9 -0
- data/app/views/admin/users/registrations/edit.html.erb +24 -0
- data/app/views/admin/users/registrations/new.html.erb +11 -0
- data/app/views/admin/users/sessions/new.html.erb +13 -0
- data/app/views/admin/users/shared/_error_messages.html.erb +7 -0
- data/app/views/admin/users/shared/_links.html.erb +27 -0
- data/app/views/admin/users/unlocks/new.html.erb +10 -0
- data/app/views/headmin/_breadcrumbs.html.erb +23 -0
- data/app/views/headmin/_filters.html.erb +47 -0
- data/app/views/headmin/_form.html.erb +11 -0
- data/app/views/headmin/_heading.html.erb +9 -0
- data/app/views/headmin/_index.html.erb +12 -0
- data/app/views/headmin/_notifications.html.erb +12 -0
- data/app/views/headmin/_pagination.html.erb +13 -0
- data/app/views/headmin/_table.html.erb +13 -0
- data/app/views/headmin/filters/_date.html.erb +46 -0
- data/app/views/headmin/filters/_search.html.erb +22 -0
- data/app/views/headmin/filters/_select.html.erb +39 -0
- data/app/views/headmin/filters/filter/_button.html.erb +22 -0
- data/app/views/headmin/filters/filter/_menu_item.html.erb +12 -0
- data/app/views/headmin/filters/filter/_template.html.erb +13 -0
- data/app/views/headmin/forms/_actions.html.erb +32 -0
- data/app/views/headmin/forms/_errors.html.erb +20 -0
- data/app/views/headmin/forms/_group.html.erb +36 -0
- data/app/views/headmin/forms/fields/_checkbox.html.erb +23 -0
- data/app/views/headmin/forms/fields/_ckeditor.html.erb +28 -0
- data/app/views/headmin/forms/fields/_currency.html.erb +24 -0
- data/app/views/headmin/forms/fields/_date.html.erb +36 -0
- data/app/views/headmin/forms/fields/_email.html.erb +39 -0
- data/app/views/headmin/forms/fields/_file.html.erb +24 -0
- data/app/views/headmin/forms/fields/_image.html.erb +37 -0
- data/app/views/headmin/forms/fields/_label.html.erb +9 -0
- data/app/views/headmin/forms/fields/_multiple_select.html.erb +37 -0
- data/app/views/headmin/forms/fields/_password.html.erb +39 -0
- data/app/views/headmin/forms/fields/_repeater.html.erb +48 -0
- data/app/views/headmin/forms/fields/_select.html.erb +36 -0
- data/app/views/headmin/forms/fields/_select_tags.html.erb +32 -0
- data/app/views/headmin/forms/fields/_text.html.erb +39 -0
- data/app/views/headmin/forms/fields/_textarea.html.erb +29 -0
- data/app/views/headmin/forms/fields/_url.html.erb +38 -0
- data/app/views/headmin/forms/fields/_validation.html.erb +12 -0
- data/app/views/headmin/forms/fields/repeater/_row.html.erb +16 -0
- data/app/views/headmin/heading/_title.html.erb +24 -0
- data/app/views/headmin/kaminari/_first_page.html.erb +11 -0
- data/app/views/headmin/kaminari/_gap.html.erb +12 -0
- data/app/views/headmin/kaminari/_last_page.html.erb +12 -0
- data/app/views/headmin/kaminari/_next_page.html.erb +13 -0
- data/app/views/headmin/kaminari/_page.html.erb +12 -0
- data/app/views/headmin/kaminari/_paginator.html.erb +25 -0
- data/app/views/headmin/kaminari/_prev_page.html.erb +11 -0
- data/app/views/headmin/layout/_body.html.erb +9 -0
- data/app/views/headmin/layout/_content.html.erb +9 -0
- data/app/views/headmin/layout/_footer.html.erb +17 -0
- data/app/views/headmin/layout/_header.html.erb +13 -0
- data/app/views/headmin/layout/_main.html.erb +13 -0
- data/app/views/headmin/layout/_sidebar.html.erb +20 -0
- data/app/views/headmin/layout/dropdown/_divider.html.erb +9 -0
- data/app/views/headmin/layout/dropdown/_item.html.erb +17 -0
- data/app/views/headmin/layout/header/_account.html.erb +25 -0
- data/app/views/headmin/layout/header/_locale.html.erb +19 -0
- data/app/views/headmin/layout/sidebar/_bottom.html.erb +4 -0
- data/app/views/headmin/layout/sidebar/_menu.html.erb +9 -0
- data/app/views/headmin/layout/sidebar/menu/_account.html.erb +25 -0
- data/app/views/headmin/layout/sidebar/menu/_item.html.erb +16 -0
- data/app/views/headmin/layout/sidebar/menu/_locale.html.erb +18 -0
- data/app/views/headmin/table/_actions.html.erb +19 -0
- data/app/views/headmin/table/_body.html.erb +19 -0
- data/app/views/headmin/table/_foot.html.erb +15 -0
- data/app/views/headmin/table/_footer.html.erb +13 -0
- data/app/views/headmin/table/_head.html.erb +15 -0
- data/app/views/headmin/table/_header.html.erb +13 -0
- data/app/views/headmin/table/actions/_action.html.erb +10 -0
- data/app/views/headmin/table/actions/_delete.html.erb +8 -0
- data/app/views/headmin/table/actions/_export.html.erb +8 -0
- data/app/views/headmin/table/body/_association.html.erb +11 -0
- data/app/views/headmin/table/body/_boolean.erb +16 -0
- data/app/views/headmin/table/body/_currency.html.erb +10 -0
- data/app/views/headmin/table/body/_date.html.erb +11 -0
- data/app/views/headmin/table/body/_id.html.erb +3 -0
- data/app/views/headmin/table/body/_row.html.erb +9 -0
- data/app/views/headmin/table/body/_sort.html.erb +3 -0
- data/app/views/headmin/table/body/_string.html.erb +16 -0
- data/app/views/headmin/table/body/_text.html.erb +10 -0
- data/app/views/headmin/table/foot/_cell.html.erb +10 -0
- data/app/views/headmin/table/foot/_id.html.erb +9 -0
- data/app/views/headmin/table/head/_cell.html.erb +13 -0
- data/app/views/headmin/table/head/_empty.html.erb +1 -0
- data/app/views/headmin/table/head/_id.html.erb +9 -0
- data/app/views/headmin/table/head/_sort.html.erb +3 -0
- data/app/views/headmin/table/head/cell/_asc.html.erb +4 -0
- data/app/views/headmin/table/head/cell/_default.html.erb +7 -0
- data/app/views/headmin/table/head/cell/_desc.html.erb +4 -0
- data/app/views/layouts/admin/auth.html.erb +20 -0
- data/app/views/layouts/admin.html.erb +42 -0
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/config/locales/defaults/en.yml +215 -0
- data/config/locales/defaults/nl.yml +213 -0
- data/config/locales/devise/nl.yml +85 -0
- data/config/locales/en.yml +137 -0
- data/config/locales/nl.yml +138 -0
- data/dist/css/headmin.css +9874 -0
- data/dist/js/headmin.js +852 -0
- data/docs/README.md +4 -0
- data/docs/blocks.md +116 -0
- data/docs/devise.md +62 -0
- data/headmin.gemspec +35 -0
- data/lib/headmin/engine.rb +10 -0
- data/lib/headmin/version.rb +5 -0
- data/lib/headmin.rb +4 -0
- data/package.json +62 -0
- data/src/js/headmin/controllers/filter_controller.js +47 -0
- data/src/js/headmin/controllers/filters_controller.js +53 -0
- data/src/js/headmin/controllers/index_controller.js +79 -0
- data/src/js/headmin/controllers/repeater_controller.js +35 -0
- data/src/js/headmin/controllers/repeater_row_controller.js +54 -0
- data/src/js/headmin/controllers/table_actions_controller.js +22 -0
- data/src/js/headmin/controllers/table_controller.js +36 -0
- data/src/js/headmin/headmin.js +168 -0
- data/src/js/headmin.js +1 -0
- data/src/scss/headmin/filter.scss +33 -0
- data/src/scss/headmin/filters.scss +14 -0
- data/src/scss/headmin/form.scss +39 -0
- data/src/scss/headmin/general.scss +3 -0
- data/src/scss/headmin/layout/body.scss +6 -0
- data/src/scss/headmin/layout/sidebar.scss +22 -0
- data/src/scss/headmin/layout.scss +2 -0
- data/src/scss/headmin/login.scss +35 -0
- data/src/scss/headmin/table.scss +32 -0
- data/src/scss/headmin/utilities.scss +19 -0
- data/src/scss/headmin.scss +58 -0
- data/src/scss/vendor/bootstrap/variables.scss +71 -0
- data/src/scss/vendor/choices/cross-inverse.svg +6 -0
- data/src/scss/vendor/choices/cross.svg +6 -0
- data/src/scss/vendor/choices/custom.scss +28 -0
- data/src/scss/vendor/choices/variables.scss +16 -0
- data/webpack.config.js +30 -0
- data/yarn.lock +7512 -0
- metadata +220 -0
@@ -0,0 +1,38 @@
|
|
1
|
+
<%#
|
2
|
+
name: headmin/fields/url
|
3
|
+
accepts block: no
|
4
|
+
parameters:
|
5
|
+
form: Form object
|
6
|
+
attribute: (string) Name of the attribute of the form model
|
7
|
+
label: (bool) Label will not be displayed if value is false
|
8
|
+
%>
|
9
|
+
|
10
|
+
<% label = local_assigns.has_key?(:label) ? label : true %>
|
11
|
+
<% disabled = local_assigns.has_key?(:disabled) ? disabled : false %>
|
12
|
+
<% required = local_assigns.has_key?(:required) ? required : false %>
|
13
|
+
<% readonly = local_assigns.has_key?(:readonly) ? readonly : false %>
|
14
|
+
<% class_names = local_assigns.has_key?(:class) ? local_assigns[:class] : false %>
|
15
|
+
<% has_list = local_assigns.has_key?(:collection) %>
|
16
|
+
<div class="<%= ('mb-3' if label) %>">
|
17
|
+
<%= render 'headmin/forms/fields/label', form: form, attribute: attribute, required: required if label %>
|
18
|
+
<div class="input-group">
|
19
|
+
<span class="input-group-text"><%= bootstrap_icon('globe') %></span>
|
20
|
+
<%= form.url_field(
|
21
|
+
attribute,
|
22
|
+
class: "form-control #{form_field_validation_class(form, attribute)} #{class_names}",
|
23
|
+
list: has_list ? attribute : nil,
|
24
|
+
disabled: disabled,
|
25
|
+
required: required,
|
26
|
+
readonly: readonly,
|
27
|
+
'aria-describedby': form_field_validation_id(form, attribute))
|
28
|
+
%>
|
29
|
+
<% if has_list %>
|
30
|
+
<datalist id="<%= attribute %>">
|
31
|
+
<% collection.each do |key, value| %>
|
32
|
+
<option value="<%= value %>"><%= key %></option>
|
33
|
+
<% end %>
|
34
|
+
</datalist>
|
35
|
+
<% end %>
|
36
|
+
<%= render 'headmin/forms/fields/validation', form: form, attribute: attribute %>
|
37
|
+
</div>
|
38
|
+
</div>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<%#
|
2
|
+
name: headmin/fields/validation
|
3
|
+
accepts block: no
|
4
|
+
parameters:
|
5
|
+
form: Form object
|
6
|
+
%>
|
7
|
+
|
8
|
+
<% if form.object && !form_field_valid?(form, attribute) %>
|
9
|
+
<div class="invalid-feedback" id="<%= form_field_validation_id(form, attribute) %>">
|
10
|
+
<%= form.object.errors[attribute].join(', ') %>
|
11
|
+
</div>
|
12
|
+
<% end %>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<%#
|
2
|
+
name: headmin/fields/repeater/row
|
3
|
+
accepts block: no
|
4
|
+
parameters:
|
5
|
+
form: Form object
|
6
|
+
%>
|
7
|
+
|
8
|
+
<div class="repeater-row list-group-item pe-3" data-new-record="<%= form.object.new_record? %>" data-repeater-row-target="row" data-controller="repeater-row">
|
9
|
+
<%= yield if block_given? %>
|
10
|
+
<a href="#" class="repeater-row-remove btn btn-link" data-action="click->repeater-row#remove_association" title="<%= t('.remove') %>">
|
11
|
+
<%= bootstrap_icon('dash-circle') %>
|
12
|
+
</a>
|
13
|
+
<a href="#" class="repeater-row-add btn btn-link" data-action="click->repeater-row#add_association" title="<%= t('.add') %>">
|
14
|
+
<%= bootstrap_icon('plus-circle') %>
|
15
|
+
</a>
|
16
|
+
</div>
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<%#
|
2
|
+
name: headmin/heading/title
|
3
|
+
accepts block: no
|
4
|
+
parameters:
|
5
|
+
title: (string) Title to be displayed
|
6
|
+
new_link: (string) URL to be used a anchor for the new button
|
7
|
+
breadcrumbs: (boolean) Whether to render breadcrumbs or not
|
8
|
+
%>
|
9
|
+
|
10
|
+
<% title = local_assigns.has_key?(:title) ? title : nil %>
|
11
|
+
<% new_link = local_assigns.has_key?(:new_link) ? new_link : nil %>
|
12
|
+
|
13
|
+
<div class="h-heading-title">
|
14
|
+
<div class="d-flex align-items-center">
|
15
|
+
<h1 class="me-2">
|
16
|
+
<%= title ? title : t('.new') %>
|
17
|
+
</h1>
|
18
|
+
<% if new_link %>
|
19
|
+
<a href="<%= new_link %>" class="btn btn-outline-primary btn-sm">
|
20
|
+
<%= t('.new') %>
|
21
|
+
</a>
|
22
|
+
<% end %>
|
23
|
+
</div>
|
24
|
+
</div>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<%# Link to the "First" page
|
2
|
+
- available local variables
|
3
|
+
url: url to the first page
|
4
|
+
current_page: a page object for the currently displayed page
|
5
|
+
num_pages: total number of pages
|
6
|
+
per_page: number of items to fetch per page
|
7
|
+
remote: data-remote
|
8
|
+
-%>
|
9
|
+
<li class="page-item <%= ('disabled' if current_page.first?) %>">
|
10
|
+
<%= link_to raw(t '.button'), url, class: 'page-link', remote: remote %>
|
11
|
+
</li>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<%# Non-link tag that stands for skipped pages...
|
2
|
+
- available local variables
|
3
|
+
current_page: a page object for the currently displayed page
|
4
|
+
num_pages: total number of pages
|
5
|
+
per_page: number of items to fetch per page
|
6
|
+
remote: data-remote
|
7
|
+
-%>
|
8
|
+
<li class="page-item disabled">
|
9
|
+
<a href="#" onclick="return false;" class="page-link">
|
10
|
+
<%= raw(t '.button') %>
|
11
|
+
</a>
|
12
|
+
</li>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<%# Link to the "Last" page
|
2
|
+
- available local variables
|
3
|
+
url: url to the last page
|
4
|
+
current_page: a page object for the currently displayed page
|
5
|
+
num_pages: total number of pages
|
6
|
+
per_page: number of items to fetch per page
|
7
|
+
remote: data-remote
|
8
|
+
-%>
|
9
|
+
<li class="page-item
|
10
|
+
<%= ('disabled' if current_page.last?) %>">
|
11
|
+
<%= link_to raw(t '.button'), url, class: 'page-link', remote: remote %>
|
12
|
+
</li>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<%# Link to the "Next" page
|
2
|
+
- available local variables
|
3
|
+
url: url to the next page
|
4
|
+
current_page: a page object for the currently displayed page
|
5
|
+
num_pages: total number of pages
|
6
|
+
per_page: number of items to fetch per page
|
7
|
+
remote: data-remote
|
8
|
+
-%>
|
9
|
+
<li class="page-item <%= ('disabled' if current_page.last?) %>">
|
10
|
+
<%= link_to url, class: 'page-link', rel: 'next', remote: remote do %>
|
11
|
+
<%= raw(t '.button') %>
|
12
|
+
<% end %>
|
13
|
+
</li>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<%# Link showing page number
|
2
|
+
- available local variables
|
3
|
+
page: a page object for "this" page
|
4
|
+
url: url to this page
|
5
|
+
current_page: a page object for the currently displayed page
|
6
|
+
num_pages: total number of pages
|
7
|
+
per_page: number of items to fetch per page
|
8
|
+
remote: data-remote
|
9
|
+
-%>
|
10
|
+
<li class="page-item<%= ' active' if page.current? %>">
|
11
|
+
<%= link_to page, url, opts = {remote: remote, class: 'page-link', rel: page.next? ? 'next' : page.prev? ? 'prev' : nil} %>
|
12
|
+
</li>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<%# The container tag
|
2
|
+
- available local variables
|
3
|
+
current_page: a page object for the currently displayed page
|
4
|
+
num_pages: total number of pages
|
5
|
+
per_page: number of items to fetch per page
|
6
|
+
remote: data-remote
|
7
|
+
paginator: the paginator that renders the pagination tags inside
|
8
|
+
-%>
|
9
|
+
<%= paginator.render do %>
|
10
|
+
<nav aria-label="<%= t('.title') %>">
|
11
|
+
<ul class="pagination pagination-sm m-0">
|
12
|
+
<%= first_page_tag %>
|
13
|
+
<%= prev_page_tag %>
|
14
|
+
<% each_page do |page| -%>
|
15
|
+
<% if page.left_outer? || page.right_outer? || page.inside_window? -%>
|
16
|
+
<%= page_tag page %>
|
17
|
+
<% elsif !page.was_truncated? -%>
|
18
|
+
<%= gap_tag %>
|
19
|
+
<% end -%>
|
20
|
+
<% end -%>
|
21
|
+
<%= next_page_tag %>
|
22
|
+
<%= last_page_tag %>
|
23
|
+
</ul>
|
24
|
+
</nav>
|
25
|
+
<% end %>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<%# Link to the "Previous" page
|
2
|
+
- available local variables
|
3
|
+
url: url to the previous page
|
4
|
+
current_page: a page object for the currently displayed page
|
5
|
+
num_pages: total number of pages
|
6
|
+
per_page: number of items to fetch per page
|
7
|
+
remote: data-remote
|
8
|
+
-%>
|
9
|
+
<li class="page-item <%= ('disabled' if current_page.first?) %>">
|
10
|
+
<%= link_to raw(t '.button'), url, rel: 'prev', remote: remote, class: 'page-link' %>
|
11
|
+
</li>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<%#
|
2
|
+
name: headmin/layout/footer
|
3
|
+
accepts block: yes
|
4
|
+
parameters: none
|
5
|
+
%>
|
6
|
+
|
7
|
+
<div class="footer py-4">
|
8
|
+
<div class="container-fluid">
|
9
|
+
<hr>
|
10
|
+
<div class="text-secondary">
|
11
|
+
Headmin v.<%= Headmin::VERSION %>
|
12
|
+
<span class="float-end">
|
13
|
+
<%= yield if block_given? %>
|
14
|
+
</span>
|
15
|
+
</div>
|
16
|
+
</div>
|
17
|
+
</div>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<%#
|
2
|
+
name: headmin/layout/header
|
3
|
+
accepts block: yes
|
4
|
+
parameters: none
|
5
|
+
%>
|
6
|
+
|
7
|
+
<header class="border-bottom d-print-none d-none d-md-block">
|
8
|
+
<nav class="navbar navbar-light bg-white">
|
9
|
+
<div class="container-fluid">
|
10
|
+
<%= yield if block_given? %>
|
11
|
+
</div>
|
12
|
+
</nav>
|
13
|
+
</header>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<%#
|
2
|
+
name: headmin/layout/sidebar
|
3
|
+
accepts block: yes
|
4
|
+
parameters:
|
5
|
+
logo: image path to logo
|
6
|
+
%>
|
7
|
+
|
8
|
+
<div class="sidebar col-sm-12 col-md-1 col-lg-2 bg-dark overflow-y d-print-none">
|
9
|
+
<nav class="navbar navbar-expand-md navbar-dark bg-dark w-100 h-100 flex-md-column">
|
10
|
+
<a href="<%= admin_root_path %>" class="nav-brand mb-lg-4 ms-lg-3 me-lg-auto">
|
11
|
+
<%= logo %>
|
12
|
+
</a>
|
13
|
+
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#sidebar-nav" aria-controls="sidebar-nav" aria-expanded="false" aria-label="Toggle navigation">
|
14
|
+
<span class="navbar-toggler-icon"></span>
|
15
|
+
</button>
|
16
|
+
<div class="navbar-nav navbar-collapse collapse flex-column align-items-start justify-content-start w-100 h-100" id="sidebar-nav">
|
17
|
+
<%= yield if block_given? %>
|
18
|
+
</div>
|
19
|
+
</nav>
|
20
|
+
</div>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<%#
|
2
|
+
name: headmin/dropdown/item
|
3
|
+
accepts block: no
|
4
|
+
parameters:
|
5
|
+
name: Name of the link in the dropdown menu
|
6
|
+
url: Url of the link in the dropdown menu
|
7
|
+
method: Sets data-method of url
|
8
|
+
%>
|
9
|
+
|
10
|
+
<%
|
11
|
+
method = defined?(method) ? method : false
|
12
|
+
%>
|
13
|
+
<li>
|
14
|
+
<a class="dropdown-item" href="<%= url %>" <%= method ? "data-method=#{method}" : "" %>>
|
15
|
+
<%= name %>
|
16
|
+
</a>
|
17
|
+
</li>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<%#
|
2
|
+
name: headmin/layout/header/account
|
3
|
+
accepts block: yes
|
4
|
+
parameters: none
|
5
|
+
%>
|
6
|
+
|
7
|
+
<div class="btn-group dropdown">
|
8
|
+
<button class="btn dropdown-toggle d-flex align-items-center" type="button" id="dropdownMenuButton1" data-bs-toggle="dropdown" aria-expanded="false">
|
9
|
+
<% if current_user.avatar.attached? %>
|
10
|
+
<img src="<%= url_for(current_user.avatar.variant(resize_to_limit: [30, 30], quality: 70)) %>" height="30" width="30" class="rounded-circle border border-2 me-2">
|
11
|
+
<% else %>
|
12
|
+
<div class="header-account-avatar rounded-circle border border-2 me-2"></div>
|
13
|
+
<% end %>
|
14
|
+
<%= current_user %>
|
15
|
+
</button>
|
16
|
+
<ul class="dropdown-menu" aria-labelledby="dropdownMenuButton1">
|
17
|
+
<% if block_given? && yield.present? %>
|
18
|
+
<%= yield %>
|
19
|
+
<% else %>
|
20
|
+
<%= render 'headmin/layout/dropdown/item', name: t('.edit_profile'), url: edit_admin_registration_path %>
|
21
|
+
<% end %>
|
22
|
+
<%= render 'headmin/layout/dropdown/divider' %>
|
23
|
+
<%= render 'headmin/layout/dropdown/item', name: t('.log_out'), url: destroy_user_session_path, method: :delete %>
|
24
|
+
</ul>
|
25
|
+
</div>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<%#
|
2
|
+
name: headmin/layout/header/locale
|
3
|
+
accepts block: yes
|
4
|
+
parameters: none
|
5
|
+
%>
|
6
|
+
|
7
|
+
<div class="btn-group dropdown">
|
8
|
+
<button class="btn dropdown-toggle d-flex align-items-center" type="button" id="locale-dropdown" data-bs-toggle="dropdown" aria-expanded="false">
|
9
|
+
<%= bootstrap_icon('globe', class: 'me-2') %>
|
10
|
+
<%= t('language_name', locale: ::I18n.locale) %>
|
11
|
+
</button>
|
12
|
+
<ul class="dropdown-menu" aria-labelledby="locale-dropdown">
|
13
|
+
<% I18n.available_locales.each do |locale| %>
|
14
|
+
<li>
|
15
|
+
<%= link_to t('language_name', locale: locale), { locale: locale.to_s }, class: 'dropdown-item' %>
|
16
|
+
<li>
|
17
|
+
<% end %>
|
18
|
+
</ul>
|
19
|
+
</div>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<%#
|
2
|
+
name: headmin/layout/sidebar/menu/account
|
3
|
+
accepts block: yes
|
4
|
+
parameters: none
|
5
|
+
%>
|
6
|
+
|
7
|
+
<li class="nav-item dropdown">
|
8
|
+
<a class="nav-link dropdown-toggle d-flex align-items-center" href="#" id="dropdownSidebarMenuAccount" role="button" data-bs-toggle="dropdown" aria-expanded="false">
|
9
|
+
<% if current_user.avatar.attached? %>
|
10
|
+
<img src="<%= url_for(current_user.avatar.variant(resize_to_limit: [20, 20], quality: 70)) %>" height="20" width="20" class="rounded-circle border border-2 me-2">
|
11
|
+
<% else %>
|
12
|
+
<div class="header-account-avatar rounded-circle border border-2 me-2"></div>
|
13
|
+
<% end %>
|
14
|
+
<%= current_user %>
|
15
|
+
</a>
|
16
|
+
<ul class="dropdown-menu" aria-labelledby="dropdownSidebarMenuAccount">
|
17
|
+
<% if block_given? && yield.present? %>
|
18
|
+
<%= yield %>
|
19
|
+
<% else %>
|
20
|
+
<%= render 'headmin/layout/dropdown/item', name: t('.edit_profile'), url: edit_admin_registration_path %>
|
21
|
+
<% end %>
|
22
|
+
<%= render 'headmin/layout/dropdown/divider' %>
|
23
|
+
<%= render 'headmin/layout/dropdown/item', name: t('.log_out'), url: destroy_user_session_path, method: :delete %>
|
24
|
+
</ul>
|
25
|
+
</li>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<%#
|
2
|
+
name: headmin/layout/sidebar/menu/item
|
3
|
+
accepts block: yes
|
4
|
+
parameters:
|
5
|
+
link: (string) Url to be used as anchor in link tag
|
6
|
+
name: (string) Name to be displayed inside link
|
7
|
+
%>
|
8
|
+
|
9
|
+
<li class="nav-item">
|
10
|
+
<a class="nav-link d-flex align-items-center <%= 'active' if menu_item_active?(link) %>" aria-current="page" href="<%= link %>">
|
11
|
+
<%= bootstrap_icon(icon, class: 'me-2') %>
|
12
|
+
<span class="d-block d-md-none d-lg-block">
|
13
|
+
<%= name %>
|
14
|
+
</span>
|
15
|
+
</a>
|
16
|
+
</li>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<%#
|
2
|
+
name: headmin/layout/sidebar/menu/locale
|
3
|
+
accepts block: no
|
4
|
+
parameters: none
|
5
|
+
%>
|
6
|
+
<li class="nav-item dropdown">
|
7
|
+
<a class="nav-link dropdown-toggle" href="#" id="dropdownSidebarMenuLocale" role="button" data-bs-toggle="dropdown" aria-expanded="false">
|
8
|
+
<%= bootstrap_icon('globe', class: 'me-2') %>
|
9
|
+
<%= t('language_name', locale: ::I18n.locale) %>
|
10
|
+
</a>
|
11
|
+
<ul class="dropdown-menu" aria-labelledby="dropdownSidebarMenuLocale">
|
12
|
+
<% I18n.available_locales.each do |locale| %>
|
13
|
+
<li>
|
14
|
+
<%= link_to t('language_name', locale: locale), {locale: locale.to_s}, class: 'dropdown-item' %>
|
15
|
+
<li>
|
16
|
+
<% end %>
|
17
|
+
</ul>
|
18
|
+
</li>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<div class="h-table-actions d-none d-md-block">
|
2
|
+
<form class="d-flex me-0 me-md-2" data-controller="table-actions" data-table-actions-target="form" data-index-target="actions" method="post">
|
3
|
+
<%= hidden_field_tag :_method, :post, 'data-table-actions-target': 'method' %>
|
4
|
+
<%= hidden_field_tag :authenticity_token, form_authenticity_token %>
|
5
|
+
|
6
|
+
<template data-index-target="idFieldTemplate">
|
7
|
+
<%= hidden_field_tag('ids[]', 'ID', multiple: true, id: 'ids_ID') %>
|
8
|
+
</template>
|
9
|
+
|
10
|
+
<select class="form-select me-1 mw-100" data-table-actions-target="select" data-action="change->table-actions#update">
|
11
|
+
<option disabled selected="selected"><%= t('.selection') %></option>
|
12
|
+
<%= yield if block_given? %>
|
13
|
+
</select>
|
14
|
+
|
15
|
+
<button class="btn h-btn-outline-light" type="submit">
|
16
|
+
<%= t('.apply') %>
|
17
|
+
</button>
|
18
|
+
</form>
|
19
|
+
</div>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<%#
|
2
|
+
name: headmin/table/body
|
3
|
+
accepts block: true
|
4
|
+
parameters: none
|
5
|
+
%>
|
6
|
+
|
7
|
+
<tbody data-table-target="body">
|
8
|
+
<% if block_given? %>
|
9
|
+
<% if yield.present? %>
|
10
|
+
<%= yield %>
|
11
|
+
<% else %>
|
12
|
+
<tr>
|
13
|
+
<td colspan="100%">
|
14
|
+
<%= t('.empty') %>
|
15
|
+
</td>
|
16
|
+
</tr>
|
17
|
+
<% end %>
|
18
|
+
<% end %>
|
19
|
+
</tbody>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<%#
|
2
|
+
name: headmin/table/foot
|
3
|
+
accepts block: true
|
4
|
+
parameters: none
|
5
|
+
%>
|
6
|
+
|
7
|
+
<tfoot class="table-light">
|
8
|
+
<tr>
|
9
|
+
<% if block_given? && yield.present? %>
|
10
|
+
<%= yield %>
|
11
|
+
<% else %>
|
12
|
+
<%= yield :table_head if content_for(:table_head) %>
|
13
|
+
<% end %>
|
14
|
+
</tr>
|
15
|
+
</tfoot>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<%#
|
2
|
+
name: headmin/table/footer
|
3
|
+
accepts block: true
|
4
|
+
parameters: none
|
5
|
+
%>
|
6
|
+
|
7
|
+
<div class="h-table-footer d-flex flex-column flex-md-row align-items-start align-items-md-start justify-content-between">
|
8
|
+
<% if block_given? && yield.present? %>
|
9
|
+
<%= yield %>
|
10
|
+
<% elsif content_for :table_header %>
|
11
|
+
<%= content_for :table_header %>
|
12
|
+
<% end %>
|
13
|
+
</div>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<%#
|
2
|
+
name: headmin/table/head
|
3
|
+
accepts block: true
|
4
|
+
parameters: none
|
5
|
+
%>
|
6
|
+
|
7
|
+
<thead class="table-light fw-light">
|
8
|
+
<tr>
|
9
|
+
<% content_for :table_head do %>
|
10
|
+
<%= yield if block_given? %>
|
11
|
+
<% end %>
|
12
|
+
|
13
|
+
<%= yield :table_head %>
|
14
|
+
</tr>
|
15
|
+
</thead>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<%#
|
2
|
+
name: headmin/table/header
|
3
|
+
accepts block: true
|
4
|
+
parameters: none
|
5
|
+
%>
|
6
|
+
|
7
|
+
<div class="h-table-header d-flex flex-column flex-md-row align-items-start align-items-md-end justify-content-between">
|
8
|
+
<% content_for :table_header do %>
|
9
|
+
<%= yield if block_given? %>
|
10
|
+
<% end %>
|
11
|
+
|
12
|
+
<%= content_for :table_header %>
|
13
|
+
</div>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<%#
|
2
|
+
name: headmin/table/actions/action
|
3
|
+
accepts block: no
|
4
|
+
parameters:
|
5
|
+
path: (string) url to send request to
|
6
|
+
method: (string) HTTP method for the request
|
7
|
+
%>
|
8
|
+
<% path = local_assigns.has_key?(:url) ? local_assigns[:url] : request.path %>
|
9
|
+
<% method = local_assigns.has_key?(:method) ? local_assigns[:method] : 'GET' %>
|
10
|
+
<option value="<%= path %>" data-method="<%= method %>"><%= name %></option>
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<%#
|
2
|
+
name: headmin/table/actions/delete
|
3
|
+
accepts block: no
|
4
|
+
parameters:
|
5
|
+
path: (string) url to send request to
|
6
|
+
%>
|
7
|
+
<% path = local_assigns.has_key?(:url) ? local_assigns[:url] : request.path %>
|
8
|
+
<%= render 'headmin/table/actions/action', name: t('.button'), url: path, method: :delete %>
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<%#
|
2
|
+
name: headmin/table/actions/export
|
3
|
+
accepts block: no
|
4
|
+
parameters:
|
5
|
+
path: (string) url to send request to
|
6
|
+
%>
|
7
|
+
<% path = local_assigns.has_key?(:url) ? local_assigns[:url] : request.path %>
|
8
|
+
<%= render 'headmin/table/actions/action', name: t('.button'), url: path, method: :delete %>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<%#
|
2
|
+
name: headmin/table/body/association
|
3
|
+
accepts block: no
|
4
|
+
parameters:
|
5
|
+
object: (ActiveRecord::Base) Model resource for which an association needs to be called
|
6
|
+
attribute: (string) Name of the association
|
7
|
+
%>
|
8
|
+
|
9
|
+
<td>
|
10
|
+
<%= t('.items', count: object.send(attribute).count) %>
|
11
|
+
</td>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<%#
|
2
|
+
name: headmin/table/body/boolean
|
3
|
+
accepts block: no
|
4
|
+
parameters:
|
5
|
+
value: (boolean) Displays value
|
6
|
+
%>
|
7
|
+
|
8
|
+
<td>
|
9
|
+
<% if value %>
|
10
|
+
<%= bootstrap_icon('check-circle-fill', class: 'text-success') %>
|
11
|
+
<%= t('.true') %>
|
12
|
+
<% else %>
|
13
|
+
<%= bootstrap_icon('x-circle-fill', class: 'text-secondary') %>
|
14
|
+
<%= t('.false') %>
|
15
|
+
<% end %>
|
16
|
+
</td>
|