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 +4 -4
- data/app/views/kaminari/_first_page.html.erb +13 -0
- data/app/views/kaminari/_gap.html.erb +8 -0
- data/app/views/kaminari/_last_page.html.erb +13 -0
- data/app/views/kaminari/_next_page.html.erb +13 -0
- data/app/views/kaminari/_page.html.erb +12 -0
- data/app/views/kaminari/_paginator.html.erb +26 -0
- data/app/views/kaminari/_prev_page.html.erb +13 -0
- data/lib/tranzito_utils/concerns/set_period.rb +1 -1
- data/lib/tranzito_utils/helpers/admin_helper.rb +1 -1
- data/lib/tranzito_utils/helpers/helpers.rb +1 -1
- data/lib/tranzito_utils/helpers/sortable_helper.rb +2 -2
- data/lib/tranzito_utils/services/time_parser.rb +1 -1
- data/lib/tranzito_utils/version.rb +1 -1
- metadata +23 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 33842391f9a99c66cde758d8f8326ea654d0712a640c04892d493fd5378e5120
|
4
|
+
data.tar.gz: 55b4331dbf82a5fd674ff0966b4ebf2780cfb775ab7aef94b51d3e5d8d31c0f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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?, '«'.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?, '»'.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?, '›'.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?, '‹'.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
|
@@ -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
|
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.
|
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-
|
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
|