kadmin 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/app/decorators/kadmin/finder_decorator.rb +13 -0
- data/app/views/kadmin/components/finder/_header.html.erb +4 -3
- data/lib/kadmin/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b93f665bacdbc2c0a768cfda4c575cc8fd22e285
|
4
|
+
data.tar.gz: 2cae0cf0381bfc451dff4f32101da5571a36493d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7bc685b2ae780f63ed879dbff8e13c1796c7995bfdacce8fe7ebcdc59daa55627b595d258a878692f4fc93a6909cc2288d58277752c29431ca9745f077b304a
|
7
|
+
data.tar.gz: 561fe7ece08f9fd708d446bff09a8227041d87e8baa2b779f69d1493dbb397ca3f3f987155b889b78fd4c5a3f4d20d17f763bd20f8b0ffc8f78b44567d680808
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Kadmin
|
2
2
|
|
3
|
-
[![GitHub release](https://img.shields.io/badge/release-0.2.
|
3
|
+
[![GitHub release](https://img.shields.io/badge/release-0.2.3-blue.png)](https://github.com/barcoo/kadmin/releases/tag/0.2.3)
|
4
4
|
|
5
5
|
Collection of utility, configuration, etc., for admin areas in different projects.
|
6
6
|
|
@@ -9,6 +9,19 @@ module Kadmin
|
|
9
9
|
@finder = finder
|
10
10
|
end
|
11
11
|
|
12
|
+
def currently_showing
|
13
|
+
resource = resource_name.downcase
|
14
|
+
currently_showing_phrase = if finder.results.count.positive?
|
15
|
+
phrase = "#{pager.displayed_items} #{resource}"
|
16
|
+
phrase = "#{phrase} (#{pager.page_start} - #{pager.page_end})" if finder.results.count > 1
|
17
|
+
phrase
|
18
|
+
else
|
19
|
+
"no #{resource}"
|
20
|
+
end
|
21
|
+
|
22
|
+
return currently_showing_phrase
|
23
|
+
end
|
24
|
+
|
12
25
|
# @return [String] human readable, singular/plural form of the finder's model
|
13
26
|
def resource_name
|
14
27
|
return @finder.scope.model_name.human(count: pager.displayed_items)
|
@@ -1,7 +1,8 @@
|
|
1
1
|
<div class="page-header">
|
2
2
|
<h2>
|
3
|
-
Showing <%= finder.
|
4
|
-
|
5
|
-
|
3
|
+
Showing <%= finder.currently_showing %>
|
4
|
+
<% if finder.results.count.positive? %>
|
5
|
+
<small>out of <%= finder.pager.total %> <%= finder.applied_filters %></small>
|
6
|
+
<% end %>
|
6
7
|
</h2>
|
7
8
|
</div>
|
data/lib/kadmin/version.rb
CHANGED