administration-zero 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.documentation/screenshot.png +0 -0
- data/Gemfile.lock +1 -1
- data/lib/administration_zero/version.rb +1 -1
- data/lib/generators/admin/install/templates/erb/admin/application/_flash_messages.html.erb +12 -4
- data/lib/generators/admin/install/templates/erb/admin/application/_footer.html.erb +1 -1
- data/lib/generators/admin/install/templates/erb/admin/application/_javascript_tags.html.erb +7 -16
- data/lib/generators/admin/install/templates/erb/admin/application/_page_header.html.erb +1 -2
- data/lib/generators/admin/install/templates/erb/admin/application/_primary_navbar.html.erb +1 -1
- data/lib/generators/admin/install/templates/erb/admin/application/_secondary_navbar.html.erb +1 -1
- data/lib/generators/admin/install/templates/erb/admin/home/index.html.erb +1 -1
- data/lib/generators/admin/install/templates/erb/admin/users/edit.html.erb +1 -1
- data/lib/generators/admin/install/templates/erb/admin/users/index.html.erb +53 -58
- data/lib/generators/admin/install/templates/erb/admin/users/new.html.erb +1 -1
- data/lib/generators/admin/install/templates/erb/admin/users/show.html.erb +1 -1
- data/lib/generators/admin/install/templates/erb/layouts/admin/application.html.erb +1 -0
- data/lib/generators/admin/install/templates/erb/layouts/admin/authentication.html.erb +1 -3
- data/lib/generators/admin/scaffold/templates/erb/edit.html.erb.tt +1 -1
- data/lib/generators/admin/scaffold/templates/erb/index.html.erb.tt +48 -53
- data/lib/generators/admin/scaffold/templates/erb/new.html.erb.tt +1 -1
- data/lib/generators/admin/scaffold/templates/erb/show.html.erb.tt +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5aa731f98bd95da0a453681a5eea61541db6265488bed953764f558df6aa0e11
|
4
|
+
data.tar.gz: 8c7ca12710788cd5916d86fd70f2dd868825e82fc38ca451b794cd82203611c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 86c34f86a87f38bc83ddf4900e81cf87c811b6736176799a7cc18198de257c2705a0e5a3ddedd394c85cd8f731e8bd0e9d0315549d59fb46ce159c47c566a8a9
|
7
|
+
data.tar.gz: f32f2ac7bf7e2042969226eeae8d35956b161bb39f79f0b1b9a2611b59e33a40a7ca661ffe1332833972ec9c80c5b6041189d456ef255d7f0c43631f26e50703
|
Binary file
|
data/Gemfile.lock
CHANGED
@@ -1,11 +1,19 @@
|
|
1
1
|
<% if flash[:notice] %>
|
2
|
-
<div class="
|
3
|
-
<div class="text-
|
2
|
+
<div class="position-fixed start-50 translate-middle-x" style="z-index: 1030; top: 8rem;">
|
3
|
+
<div class="toast hide text-center text-white bg-success border-0" data-controller="flash-message">
|
4
|
+
<div class="toast-body">
|
5
|
+
<%= flash[:notice] %>
|
6
|
+
</div>
|
7
|
+
</div>
|
4
8
|
</div>
|
5
9
|
<% end %>
|
6
10
|
|
7
11
|
<% if flash[:alert] %>
|
8
|
-
<div class="
|
9
|
-
<div class="text-
|
12
|
+
<div class="position-fixed start-50 translate-middle-x" style="z-index: 1030; top: 8rem;">
|
13
|
+
<div class="toast hide text-center text-white bg-danger border-0" data-controller="flash-message">
|
14
|
+
<div class="toast-body">
|
15
|
+
<%= flash[:alert] %>
|
16
|
+
</div>
|
17
|
+
</div>
|
10
18
|
</div>
|
11
19
|
<% end %>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<footer class="footer footer-transparent d-print-none">
|
2
|
-
<div class="container-
|
2
|
+
<div class="container-xl">
|
3
3
|
<div class="row text-center align-items-center flex-row-reverse">
|
4
4
|
<div class="col-lg-auto ms-lg-auto">
|
5
5
|
<ul class="list-inline list-inline-dots mb-0">
|
@@ -21,22 +21,13 @@
|
|
21
21
|
});
|
22
22
|
</script>
|
23
23
|
|
24
|
-
<!--
|
25
|
-
###########################################################################################################################
|
26
|
-
Old school stimulus example
|
27
|
-
<div data-controller="toasts" data-toats-type="notice" data-toasts-message="User created successfully"></div>
|
28
|
-
###########################################################################################################################
|
29
|
-
-->
|
30
|
-
<!--
|
24
|
+
<!-- flash message -->
|
31
25
|
<script>
|
32
26
|
document.addEventListener("DOMContentLoaded", () => {
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
})
|
40
|
-
})
|
27
|
+
const selector = "[data-controller='flash-message']";
|
28
|
+
|
29
|
+
document.querySelectorAll(selector).forEach((thiz) => {
|
30
|
+
new bootstrap.Toast(thiz).show();
|
31
|
+
});
|
32
|
+
});
|
41
33
|
</script>
|
42
|
-
-->
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<header class="navbar navbar-expand-md navbar-light d-print-none">
|
2
|
-
<div class="container-
|
2
|
+
<div class="container-xl">
|
3
3
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar-menu">
|
4
4
|
<span class="navbar-toggler-icon"></span>
|
5
5
|
</button>
|
data/lib/generators/admin/install/templates/erb/admin/application/_secondary_navbar.html.erb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
<div class="navbar-expand-md">
|
2
2
|
<div class="collapse navbar-collapse" id="navbar-menu">
|
3
3
|
<div class="navbar navbar-light">
|
4
|
-
<div class="container-
|
4
|
+
<div class="container-xl">
|
5
5
|
<ul class="navbar-nav">
|
6
6
|
<li class="nav-item <%= active_nav_item 'admin/home' %>">
|
7
7
|
<%= link_to admin_path, class: "nav-link" do %>
|
@@ -4,72 +4,67 @@
|
|
4
4
|
<% end %>
|
5
5
|
|
6
6
|
<%= render "page_header_actions" do %>
|
7
|
+
<%= link_to "Filters", "#offcanvasFilters", "data-bs-toggle": "offcanvas", class: "btn btn-light" %>
|
7
8
|
<%= link_to "New admin user", new_admin_user_path, class: "btn btn-primary" %>
|
8
9
|
<% end %>
|
9
10
|
<% end %>
|
10
11
|
|
11
12
|
<div class="page-body">
|
12
|
-
<div class="container-
|
13
|
-
<div class="
|
14
|
-
<div class="
|
15
|
-
<
|
16
|
-
<
|
17
|
-
<
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
13
|
+
<div class="container-xl">
|
14
|
+
<div class="card">
|
15
|
+
<div class="table-responsive">
|
16
|
+
<table class="table table-vcenter table-nowrap card-table table-striped">
|
17
|
+
<thead>
|
18
|
+
<tr>
|
19
|
+
<th><%= sort_link @search, :id %></th>
|
20
|
+
<th><%= sort_link @search, :email %></th>
|
21
|
+
<th><%= sort_link @search, :created_at %></th>
|
22
|
+
<th></th>
|
23
|
+
</tr>
|
24
|
+
</thead>
|
25
|
+
<tbody>
|
26
|
+
<% @admin_users.each do |admin_user| %>
|
27
|
+
<tr>
|
28
|
+
<td><%= link_to admin_user.id, admin_user %></td>
|
29
|
+
<td><%= admin_user.email %></td>
|
30
|
+
<td><%= l(admin_user.created_at, format: :long) %></td>
|
31
|
+
<td>
|
32
|
+
<%= link_to "View", admin_user, class: "btn btn-light btn-sm" %>
|
33
|
+
<%= link_to "Edit", edit_admin_user_path(admin_user), class: "btn btn-light btn-sm" %>
|
34
|
+
<%= button_to "Delete", admin_user, method: :delete, data: { confirm: "Are you sure ?" }, form_class: "d-inline", class: "btn btn-light btn-sm" %>
|
35
|
+
</td>
|
36
|
+
</tr>
|
37
|
+
<% end %>
|
38
|
+
</tbody>
|
39
|
+
</table>
|
33
40
|
</div>
|
34
|
-
<div class="
|
35
|
-
<div
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
<tr>
|
40
|
-
<th><%= sort_link @search, :id %></th>
|
41
|
-
<th><%= sort_link @search, :email %></th>
|
42
|
-
<th><%= sort_link @search, :created_at %></th>
|
43
|
-
<th></th>
|
44
|
-
</tr>
|
45
|
-
</thead>
|
46
|
-
<tbody>
|
47
|
-
<% @admin_users.each do |admin_user| %>
|
48
|
-
<tr>
|
49
|
-
<td><%= link_to admin_user.id, admin_user %></td>
|
50
|
-
<td><%= admin_user.email %></td>
|
51
|
-
<td><%= l(admin_user.created_at, format: :long) %></td>
|
52
|
-
<td>
|
53
|
-
<%= link_to "View", admin_user, class: "btn btn-light btn-sm" %>
|
54
|
-
<%= link_to "Edit", edit_admin_user_path(admin_user), class: "btn btn-light btn-sm" %>
|
55
|
-
<%= button_to "Delete", admin_user, method: :delete, data: { confirm: "Are you sure ?" }, form_class: "d-inline", class: "btn btn-light btn-sm" %>
|
56
|
-
</td>
|
57
|
-
</tr>
|
58
|
-
<% end %>
|
59
|
-
</tbody>
|
60
|
-
</table>
|
61
|
-
</div>
|
62
|
-
<div class="card-footer d-flex align-items-center fs-5">
|
63
|
-
<div>
|
64
|
-
Download: <%= link_to "CSV", admin_users_path(format: :csv, q: request.params[:q]) %>
|
65
|
-
</div>
|
66
|
-
<div class="ms-auto d-flex align-items-center gap-2">
|
67
|
-
<%== pagy_info @pagy %>
|
68
|
-
<%= render "pagination", pagy: @pagy %>
|
69
|
-
</div>
|
70
|
-
</div>
|
41
|
+
<div class="card-footer d-flex align-items-center fs-5">
|
42
|
+
<div>Download: <%= link_to "CSV", admin_users_path(format: :csv, q: request.params[:q]) %></div>
|
43
|
+
<div class="ms-auto d-flex align-items-center gap-2">
|
44
|
+
<div class="d-none d-md-flex"><%== pagy_info @pagy %></div>
|
45
|
+
<%= render "pagination", pagy: @pagy %>
|
71
46
|
</div>
|
72
47
|
</div>
|
73
48
|
</div>
|
74
49
|
</div>
|
75
50
|
</div>
|
51
|
+
|
52
|
+
<div id="offcanvasFilters" tabindex="-1" class="offcanvas offcanvas-end">
|
53
|
+
<div class="offcanvas-header">
|
54
|
+
<h2 class="offcanvas-title">Filters</h2>
|
55
|
+
<button type="button" class="btn-close text-reset" data-bs-dismiss="offcanvas"></button>
|
56
|
+
</div>
|
57
|
+
<%= search_form_for @search, class: "offcanvas-body" do |f| %>
|
58
|
+
<%= f.label :email_cont, class: "form-label" %>
|
59
|
+
<%= f.text_field :email_cont, class: "form-control mb-3" %>
|
60
|
+
|
61
|
+
<%= f.label :created_at, class: "form-label" %>
|
62
|
+
<div class="d-flex gap-1 mb-3">
|
63
|
+
<%= f.date_field :created_at_gteq, class: "form-control" %>
|
64
|
+
<%= f.date_field :created_at_lteq, class: "form-control" %>
|
65
|
+
</div>
|
66
|
+
|
67
|
+
<%= f.submit "Filter", class: "btn btn-primary" %>
|
68
|
+
<%= link_to "Clear Filter", admin_users_path, class: "btn btn-light" %>
|
69
|
+
<% end %>
|
70
|
+
</div>
|
@@ -21,14 +21,12 @@
|
|
21
21
|
<%= image_tag "admin/logo.svg", height: 36 %>
|
22
22
|
<% end %>
|
23
23
|
</div>
|
24
|
-
<div class="text-center mb-2">
|
25
|
-
<%= render "flash_messages" %>
|
26
|
-
</div>
|
27
24
|
<%= yield %>
|
28
25
|
</div>
|
29
26
|
</div>
|
30
27
|
</div>
|
31
28
|
|
29
|
+
<%= render "flash_messages" %>
|
32
30
|
<%= render "javascript_tags" %>
|
33
31
|
</body>
|
34
32
|
</html>
|
@@ -4,74 +4,69 @@
|
|
4
4
|
<%% end %>
|
5
5
|
|
6
6
|
<%%= render "page_header_actions" do %>
|
7
|
+
<%%= link_to "Filters", "#offcanvasFilters", "data-bs-toggle": "offcanvas", class: "btn btn-light" %>
|
7
8
|
<%%= link_to "New <%= human_name.downcase %>", <%= new_helper(type: :path) %>, class: "btn btn-primary" %>
|
8
9
|
<%% end %>
|
9
10
|
<%% end %>
|
10
11
|
|
11
12
|
<div class="page-body">
|
12
|
-
<div class="container-
|
13
|
-
<div class="
|
14
|
-
<div class="
|
15
|
-
<
|
16
|
-
<
|
17
|
-
<
|
18
|
-
</div>
|
19
|
-
<%%= search_form_for [:admin, @search], class: "card-body" do |f| %>
|
20
|
-
<%%# f.label :name_cont, class: "form-label" %>
|
21
|
-
<%%# f.text_field :name_cont, class: "form-control mb-3" %>
|
22
|
-
|
23
|
-
<%%= f.submit "Filter", class: "btn btn-primary" %>
|
24
|
-
<%%= link_to "Clear Filter", <%= index_helper(type: :path) %>, class: "btn btn-light" %>
|
25
|
-
<%% end %>
|
26
|
-
</div>
|
27
|
-
</div>
|
28
|
-
<div class="col-md-8 col-lg-9 order-md-first">
|
29
|
-
<div class="card">
|
30
|
-
<div class="table-responsive">
|
31
|
-
<table class="table table-vcenter card-table table-striped">
|
32
|
-
<thead>
|
33
|
-
<tr>
|
13
|
+
<div class="container-xl">
|
14
|
+
<div class="card">
|
15
|
+
<div class="table-responsive">
|
16
|
+
<table class="table table-vcenter table-nowrap card-table table-striped">
|
17
|
+
<thead>
|
18
|
+
<tr>
|
34
19
|
<% attributes.each do |attribute| -%>
|
35
|
-
|
20
|
+
<th><%%= sort_link @search, :<%= attribute.column_name %> %></th>
|
36
21
|
<% end -%>
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
22
|
+
<th></th>
|
23
|
+
</tr>
|
24
|
+
</thead>
|
25
|
+
<tbody>
|
26
|
+
<%% @<%= plural_table_name %>.each do |<%= singular_table_name %>| %>
|
27
|
+
<tr>
|
43
28
|
<% attributes.reject(&:password_digest?).each do |attribute| -%>
|
44
29
|
<% if attribute.attachment? -%>
|
45
|
-
|
30
|
+
<td><%%= link_to <%= singular_name %>.<%= attribute.column_name %>.filename, <%= singular_name %>.<%= attribute.column_name %> if <%= singular_name %>.<%= attribute.column_name %>.attached? %></td>
|
46
31
|
<% elsif attribute.attachments? -%>
|
47
|
-
|
48
|
-
|
49
|
-
|
32
|
+
<%% <%= singular_name %>.<%= attribute.column_name %>.each do |<%= attribute.singular_name %>| %>
|
33
|
+
<td><%%= link_to <%= attribute.singular_name %>.filename, <%= attribute.singular_name %> %></td>
|
34
|
+
<%% end %>
|
50
35
|
<% else -%>
|
51
|
-
|
36
|
+
<td><%%= <%= singular_name %>.<%= attribute.column_name %> %></td>
|
52
37
|
<% end -%>
|
53
38
|
<% end -%>
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
<%%== pagy_info @pagy %>
|
70
|
-
<%%= render "pagination", pagy: @pagy %>
|
71
|
-
</div>
|
72
|
-
</div>
|
39
|
+
<td>
|
40
|
+
<%%= link_to "View", <%= model_resource_name %>, class: "btn btn-light btn-sm" %>
|
41
|
+
<%%= link_to "Edit", <%= edit_helper(singular_table_name, type: :path) %>, class: "btn btn-light btn-sm" %>
|
42
|
+
<%%= button_to "Delete", <%= model_resource_name %>, method: :delete, form_class: "d-inline", class: "btn btn-light btn-sm", data: { confirm: "Are you sure ?" } %>
|
43
|
+
</td>
|
44
|
+
</tr>
|
45
|
+
<%% end %>
|
46
|
+
</tbody>
|
47
|
+
</table>
|
48
|
+
</div>
|
49
|
+
<div class="card-footer d-flex align-items-center fs-5">
|
50
|
+
<div>Download: <%%= link_to "CSV", <%= index_helper(type: :path) %>(format: :csv, q: request.params[:q]) %></div>
|
51
|
+
<div class="ms-auto d-flex align-items-center gap-2">
|
52
|
+
<div class="d-none d-md-flex"><%%== pagy_info @pagy %></div>
|
53
|
+
<%%= render "pagination", pagy: @pagy %>
|
73
54
|
</div>
|
74
55
|
</div>
|
75
56
|
</div>
|
76
57
|
</div>
|
77
58
|
</div>
|
59
|
+
|
60
|
+
<div id="offcanvasFilters" tabindex="-1" class="offcanvas offcanvas-end">
|
61
|
+
<div class="offcanvas-header">
|
62
|
+
<h2 class="offcanvas-title">Filters</h2>
|
63
|
+
<button type="button" class="btn-close text-reset" data-bs-dismiss="offcanvas"></button>
|
64
|
+
</div>
|
65
|
+
<%%= search_form_for [:admin, @search], class: "offcanvas-body" do |f| %>
|
66
|
+
<%%# f.label :name_cont, class: "form-label" %>
|
67
|
+
<%%# f.text_field :name_cont, class: "form-control mb-3" %>
|
68
|
+
|
69
|
+
<%%= f.submit "Filter", class: "btn btn-primary" %>
|
70
|
+
<%%= link_to "Clear Filter", <%= index_helper(type: :path) %>, class: "btn btn-light" %>
|
71
|
+
<%% end %>
|
72
|
+
</div>
|