administration-zero 1.0.1 → 1.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5535d5c246174e4d3f6db561d68f9e89466752094029e9cfdc45735b220bce78
4
- data.tar.gz: b93e1c1793e35aae39e5b8d127c9253524ca3a022a5692fce47a7c342b766209
3
+ metadata.gz: aa39d6d22acd4f9867c2d99ef1811c6e4af5fb5f6b2d5493ce0b2f46d0938f55
4
+ data.tar.gz: 84b1054f1761cb63cd0a24ac090bf1a7ec4e4d55a31a1fc499b7071382573a69
5
5
  SHA512:
6
- metadata.gz: f3f3660673d5698081315d20630b4d72835bab63c3aa038b05b355d80df5a6522e1208ab8c179e5b6cf5014b9bb2e73ef20872f8a9ed2f99e3dd5f1fefdefcac
7
- data.tar.gz: e1ba7313c918f5b294ec59fe4211c1a5a3e059d44cbb3812deb48818bc803f5aed11da75f2f146aa3a0dffbc7306e29da522937e6f81a23f3a507ae899addceb
6
+ metadata.gz: 9a96b3868db1d2a9e9e623f178dd6713e391175742cc4d5fc8ff53d2a30b245acfd20064819263c2dfb35aa207ed199e0114dd938854d3f0b063dba045756d54
7
+ data.tar.gz: 0e741a0886344c600ddc340a933ae897ab63f3efaf5065d781bae9c06522a705a95d7b1bd52b321f90da4fa2d5a9431c25e2d9cfcffb7e8014ca676d8e78d304
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- administration-zero (1.0.1)
4
+ administration-zero (1.0.3)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,3 +1,3 @@
1
1
  module AdministrationZero
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.3"
3
3
  end
@@ -1,12 +1,12 @@
1
1
  class Admin::BaseController < ActionController::Base
2
2
  include Pagy::Backend
3
3
 
4
- before_action :set_time_zone
4
+ around_action :set_time_zone
5
5
  before_action :authenticate
6
6
 
7
7
  private
8
8
  def set_time_zone
9
- Time.zone = cookies[:time_zone]
9
+ Time.use_zone(cookies[:time_zone]) { yield }
10
10
  end
11
11
 
12
12
  def authenticate
@@ -31,7 +31,7 @@
31
31
  <td>
32
32
  <%= link_to "View", user, class: "btn btn-white btn-sm" %>
33
33
  <%= link_to "Edit", edit_admin_user_path(user), class: "btn btn-white btn-sm" %>
34
- <%= button_to "Delete", user, method: :delete, "data-confirm": "Are you sure?", form_class: "d-inline", class: "btn btn-white btn-sm" %>
34
+ <%= link_to "Delete", user, class: "btn btn-white btn-sm", data: { method: :delete, confirm: "Are you sure?" } %>
35
35
  </td>
36
36
  </tr>
37
37
  <% end %>
@@ -41,10 +41,10 @@
41
41
  <div class="card-footer d-flex align-items-center fs-5">
42
42
  <div class="d-none d-md-block">
43
43
  <div>Download: <%= link_to "CSV", admin_users_path(format: :csv, q: request.params[:q]) %></div>
44
- <%= raw pagy_info(@pagy) %>
44
+ <%== pagy_info(@pagy) %>
45
45
  </div>
46
46
  <div class="ms-auto">
47
- <%= render "pagination", pagy: @pagy %>
47
+ <%== pagy_bootstrap_nav(@pagy) %>
48
48
  </div>
49
49
  </div>
50
50
  </div>
@@ -6,7 +6,7 @@
6
6
 
7
7
  <%= render "page_header_actions" do %>
8
8
  <%= link_to "Edit user", edit_admin_user_path(@user), class: "btn btn-primary" %>
9
- <%= button_to "Delete user", @user, method: :delete, "data-confirm": "Are you sure?", form_class: "d-inline", class: "btn btn-white" %>
9
+ <%= link_to "Delete user", @user, class: "btn btn-white", data: { method: :delete, confirm: "Are you sure?" } %>
10
10
  <% end %>
11
11
  <% end %>
12
12
 
@@ -1,3 +1,5 @@
1
+ require "pagy/extras/bootstrap"
2
+
1
3
  module Admin::ApplicationHelper
2
4
  include Pagy::Frontend
3
5
 
@@ -1,3 +1,3 @@
1
1
  class Admin::Current < ActiveSupport::CurrentAttributes
2
- attribute :user; resets { Time.zone = nil }
2
+ attribute :user
3
3
  end
@@ -39,7 +39,7 @@
39
39
  <td>
40
40
  <%%= link_to "View", <%= model_resource_name %>, class: "btn btn-white btn-sm" %>
41
41
  <%%= link_to "Edit", <%= edit_helper(singular_table_name, type: :path) %>, class: "btn btn-white btn-sm" %>
42
- <%%= button_to "Delete", <%= model_resource_name %>, method: :delete, "data-confirm": "Are you sure?", form_class: "d-inline", class: "btn btn-white btn-sm" %>
42
+ <%%= link_to "Delete", <%= model_resource_name %>, class: "btn btn-white btn-sm", data: { method: :delete, confirm: "Are you sure?" } %>
43
43
  </td>
44
44
  </tr>
45
45
  <%% end %>
@@ -49,10 +49,10 @@
49
49
  <div class="card-footer d-flex align-items-center fs-5">
50
50
  <div class="d-none d-md-block">
51
51
  <div>Download: <%%= link_to "CSV", url_for(format: :csv, q: request.params[:q]) %></div>
52
- <%%= raw pagy_info(@pagy) %>
52
+ <%%== pagy_info(@pagy) %>
53
53
  </div>
54
54
  <div class="ms-auto">
55
- <%%= render "pagination", pagy: @pagy %>
55
+ <%%== pagy_bootstrap_nav(@pagy) %>
56
56
  </div>
57
57
  </div>
58
58
  </div>
@@ -6,7 +6,7 @@
6
6
 
7
7
  <%%= render "page_header_actions" do %>
8
8
  <%%= link_to "Edit <%= human_name.downcase %>", <%= edit_helper(type: :path) %>, class: "btn btn-primary" %>
9
- <%%= button_to "Delete <%= human_name.downcase %>", <%= model_resource_name(prefix: "@") %>, method: :delete, "data-confirm": "Are you sure?", form_class: "d-inline", class: "btn btn-white" %>
9
+ <%%= link_to "Delete <%= human_name.downcase %>", <%= model_resource_name(prefix: "@") %>, class: "btn btn-white", data: { method: :delete, confirm: "Are you sure?" } %>
10
10
  <%% end %>
11
11
  <%% end %>
12
12
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: administration-zero
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nixon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-03-03 00:00:00.000000000 Z
11
+ date: 2023-07-15 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email:
@@ -44,7 +44,6 @@ files:
44
44
  - lib/generators/admin/install/templates/erb/admin/base/_page_header.html.erb
45
45
  - lib/generators/admin/install/templates/erb/admin/base/_page_header_actions.html.erb
46
46
  - lib/generators/admin/install/templates/erb/admin/base/_page_header_breadcrumb.html.erb
47
- - lib/generators/admin/install/templates/erb/admin/base/_pagination.html.erb
48
47
  - lib/generators/admin/install/templates/erb/admin/base/_primary_navbar.html.erb
49
48
  - lib/generators/admin/install/templates/erb/admin/base/_secondary_navbar.html.erb
50
49
  - lib/generators/admin/install/templates/erb/admin/base/_stylesheet_link_tags.html.erb
@@ -1,24 +0,0 @@
1
- <%#
2
- This template is i18n-ready: if you don't use i18n, then you can replace the pagy_t
3
- calls with the actual strings ("&lsaquo; Prev", "Next &rsaquo;", "&hellip;").
4
-
5
- The link variable is set to a proc that returns the link tag.
6
- Usage: link.call( page_number [, text [, extra_attributes_string ]])
7
- -%>
8
- <% link = pagy_link_proc(pagy, link_extra: 'class="page-link"') -%>
9
- <%# -%><nav aria-label="pager" class="pagy-bootstrap-nav d-inline-block" role="navigation">
10
- <%# -%> <ul class="pagination m-0">
11
- <% if pagy.prev -%> <li class="page-item prev"><%== link.call(pagy.prev, pagy_t('pagy.nav.prev'), 'aria-label="previous"') %></li>
12
- <% else -%> <li class="page-item prev disabled"><a href="#" class="page-link"><%== pagy_t('pagy.nav.prev') %></a></li>
13
- <% end -%>
14
- <% pagy.series.each do |item| # series example: [1, :gap, 7, 8, "9", 10, 11, :gap, 36] -%>
15
- <% if item.is_a?(Integer) -%> <li class="page-item"><%== link.call(item) %></li>
16
- <% elsif item.is_a?(String) -%> <li class="page-item active"><%== link.call(item) %></li>
17
- <% elsif item == :gap -%> <li class="page-item disabled gap"><a href="#" class="page-link"><%== pagy_t('pagy.nav.gap') %></a></li>
18
- <% end -%>
19
- <% end -%>
20
- <% if pagy.next -%> <li class="page-item next"><%== link.call(pagy.next, pagy_t('pagy.nav.next'), 'aria-label="next"') %></li>
21
- <% else -%> <li class="page-item next disabled"><a href="#" class="page-link"><%== pagy_t('pagy.nav.next') %></a></li>
22
- <% end -%>
23
- <%# -%> </ul>
24
- <%# -%></nav>