tranzito_utils 1.1.7 → 1.1.9

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: c14aa414b13b803a8098d4664827129745a29770efe2eb968c7e14da6eb6f1d9
4
- data.tar.gz: e12e0f60e7dd446a968ea5c176c0638b8840ba7c8157b4722d63c0423fbe095a
3
+ metadata.gz: 33842391f9a99c66cde758d8f8326ea654d0712a640c04892d493fd5378e5120
4
+ data.tar.gz: 55b4331dbf82a5fd674ff0966b4ebf2780cfb775ab7aef94b51d3e5d8d31c0f3
5
5
  SHA512:
6
- metadata.gz: 95998f588a239a9e27bad0eb9cef44a233dce7a381ec34289f7d4438e203c5be1e6da5dfe39540e814557f7fb19613f377e7716ecf0d2a765afefcc43ee79da0
7
- data.tar.gz: 557bd906a23a87a32bc23a5dc73d7e1d5c0b73a7194669a3d17e0779edcaff813abc23ebfd5b7e5d8d5e14c2e02d35080426058984038d65af26d7289c2a8ab3
6
+ metadata.gz: 4b9c52e87fb6f5227d56209a5aaaf336343d516f79cb20d54caf0c4560dc596b39ea43c1fa4965687155f2e7caf1ff4ab9f565d6e875700156bc66fcc6750745
7
+ data.tar.gz: c280024f35fe14f1b302c00722dd1cd7b77b770445a4b2314e46144d0960db0879e1ef06f0ed0d01e0a7daf4a4750d9e5123d28eeb0fd3b96a0dc7fe42685529
@@ -0,0 +1,13 @@
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
+ <% unless current_page.first? %>
10
+ <li class="page-item">
11
+ <%= link_to_unless current_page.first?, '&laquo;'.html_safe, url, :class => 'page-link', :remote => remote %>
12
+ </li>
13
+ <% end %>
@@ -0,0 +1,8 @@
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"><a href="#" onclick="return false;" class="page-link"><%= raw(t 'views.pagination.truncate') %></a></li>
@@ -0,0 +1,13 @@
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
+ <% unless current_page.last? %>
10
+ <li class="page-item">
11
+ <%= link_to_unless current_page.last?, '&raquo;'.html_safe, url, :class => 'page-link', :remote => remote %>
12
+ </li>
13
+ <% end %>
@@ -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
+ <% unless current_page.last? %>
10
+ <li class="page-item">
11
+ <%= link_to_unless current_page.last?, '&rsaquo;'.html_safe, url, :class => 'page-link', :rel => 'next', :remote => remote %>
12
+ </li>
13
+ <% end %>
@@ -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,26 @@
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
+ <%- pagination_class ||= '' %>
10
+ <%= paginator.render do -%>
11
+ <nav>
12
+ <ul class="pagination <%= pagination_class %>">
13
+ <%= first_page_tag unless current_page.first? %>
14
+ <%= prev_page_tag unless current_page.first? %>
15
+ <% each_page do |page| -%>
16
+ <% if page.left_outer? || page.right_outer? || page.inside_window? -%>
17
+ <%= page_tag page %>
18
+ <% elsif !page.was_truncated? -%>
19
+ <%= gap_tag %>
20
+ <% end -%>
21
+ <% end -%>
22
+ <%= next_page_tag unless current_page.last? %>
23
+ <%= last_page_tag unless current_page.last? %>
24
+ </ul>
25
+ </nav>
26
+ <% end -%>
@@ -0,0 +1,13 @@
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
+ <% unless current_page.first? %>
10
+ <li class="page-item">
11
+ <%= link_to_unless current_page.first?, '&lsaquo;'.html_safe, url, :rel => 'prev', :remote => remote, :class => 'page-link' %>
12
+ </li>
13
+ <% end %>
@@ -10,7 +10,7 @@ module TranzitoUtils
10
10
  end
11
11
 
12
12
  def controller_namespace
13
- @controller_namespace ||= self.class.module_parent.name != "Object" ? self.class.module_parent.name.downcase : nil
13
+ @controller_namespace ||= (self.class.module_parent.name != "Object") ? self.class.module_parent.name.downcase : nil
14
14
  end
15
15
 
16
16
  # For setting periods, particularly for graphing
@@ -3,7 +3,7 @@
3
3
  module TranzitoUtils
4
4
  module AdminHelper
5
5
  def admin_number_display(number)
6
- content_tag(:span, number_with_delimiter(number), class: (number == 0 ? "less-less-strong" : ""))
6
+ content_tag(:span, number_with_delimiter(number), class: ((number == 0) ? "less-less-strong" : ""))
7
7
  end
8
8
  end
9
9
  end
@@ -72,7 +72,7 @@ module TranzitoUtils
72
72
  # Take up less space for admin
73
73
  return in_admin? ? nil : "Display"
74
74
  end
75
- action_name == "index" ? nil : action_name.titleize
75
+ (action_name == "index") ? nil : action_name.titleize
76
76
  end
77
77
 
78
78
  def controller_title_for_action
@@ -16,10 +16,10 @@ module TranzitoUtils
16
16
  return title unless render_sortable
17
17
 
18
18
  html_options[:class] = "#{html_options[:class]} sortable-link"
19
- direction = column == sort_column && sort_direction == "desc" ? "asc" : "desc"
19
+ direction = (column == sort_column && sort_direction == "desc") ? "asc" : "desc"
20
20
  if column == sort_column
21
21
  html_options[:class] += " active"
22
- span_content = direction == "asc" ? "\u2193" : "\u2191"
22
+ span_content = (direction == "asc") ? "\u2193" : "\u2191"
23
23
  end
24
24
 
25
25
  link_to(sortable_search_params.merge(sort: column, direction: direction), html_options) do
@@ -54,7 +54,7 @@ module TranzitoUtils
54
54
 
55
55
  # Accepts a time object, rounds to minutes
56
56
  def self.round(time, unit = "minute")
57
- unit == "second" ? time.change(usec: 0, sec: 0) : time.change(min: 0, usec: 0, sec: 0)
57
+ (unit == "second") ? time.change(usec: 0, sec: 0) : time.change(min: 0, usec: 0, sec: 0)
58
58
  end
59
59
  end
60
60
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TranzitoUtils
4
- VERSION = "1.1.7"
4
+ VERSION = "1.1.9"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tranzito_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.7
4
+ version: 1.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - willbarrettdev
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2022-11-09 00:00:00.000000000 Z
13
+ date: 2022-11-17 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
@@ -40,6 +40,20 @@ dependencies:
40
40
  - - ">="
41
41
  - !ruby/object:Gem::Version
42
42
  version: '0'
43
+ - !ruby/object:Gem::Dependency
44
+ name: kaminari
45
+ requirement: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ version: '0'
50
+ type: :runtime
51
+ prerelease: false
52
+ version_requirements: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: '0'
43
57
  description: Ruby gem contain several modules mainly containing the helpers, concerns
44
58
  and services for personal use by Tranzito
45
59
  email:
@@ -59,6 +73,13 @@ files:
59
73
  - app/assets/stylesheets/tranzito_utils/_period_selection.scss
60
74
  - app/assets/stylesheets/tranzito_utils/_table_extensions.scss
61
75
  - app/assets/stylesheets/tranzito_utils/_utilities.scss
76
+ - app/views/kaminari/_first_page.html.erb
77
+ - app/views/kaminari/_gap.html.erb
78
+ - app/views/kaminari/_last_page.html.erb
79
+ - app/views/kaminari/_next_page.html.erb
80
+ - app/views/kaminari/_page.html.erb
81
+ - app/views/kaminari/_paginator.html.erb
82
+ - app/views/kaminari/_prev_page.html.erb
62
83
  - app/views/tranzito_utils/_flash_messages.html.haml
63
84
  - app/views/tranzito_utils/_pagination.html.haml
64
85
  - app/views/tranzito_utils/_period_select.html.haml