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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6ab1df6f025d446075d7ea0ff8e6f5e6267e5048
4
- data.tar.gz: e01b485202b100b31014c57680fe99ded5017518
3
+ metadata.gz: b93f665bacdbc2c0a768cfda4c575cc8fd22e285
4
+ data.tar.gz: 2cae0cf0381bfc451dff4f32101da5571a36493d
5
5
  SHA512:
6
- metadata.gz: 221c1f51318638636bbafbd2c7dd135cd21f69f0cf4df6edbd97be4eda02ee07e2b3013a041aa9138b4c106eaf296747f0139ee7df80d6ff1e7392260cbd944e
7
- data.tar.gz: cbc7767909e0b85ff93f7fa6ee6a08d4d03d57ac4ad0db975b35f9d8b79fd17bc487f290313c25f8e3f712aadb0fc4f588583f572631cb081984632b6f7926ef
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.2-blue.png)](https://github.com/barcoo/kadmin/releases/tag/0.2.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.resource_name.downcase %>
4
- <%= finder.pager.page_start %> - <%= finder.pager.page_end %>
5
- <small>out of <%= finder.pager.total %> <%= finder.applied_filters %></small>
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>
@@ -1,3 +1,3 @@
1
1
  module Kadmin
2
- VERSION = '0.2.2'.freeze
2
+ VERSION = '0.2.3'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kadmin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicolas Pepin-Perreault