bootstrap-cells 0.1.5
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 +7 -0
- data/.gitignore +16 -0
- data/.gitlab-ci.yml +13 -0
- data/.rspec +2 -0
- data/.rubocop.yml +27 -0
- data/CHANGELOG +29 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +200 -0
- data/Rakefile +8 -0
- data/app/assets/javascripts/bootstrap-cells/add_many_event_listeners.js +11 -0
- data/app/assets/javascripts/bootstrap-cells/index.js +3 -0
- data/app/assets/stylesheets/_bootstrap-cells.scss +7 -0
- data/app/views/kaminari/bootstrap/_first_page.html.erb +15 -0
- data/app/views/kaminari/bootstrap/_gap.html.erb +12 -0
- data/app/views/kaminari/bootstrap/_last_page.html.erb +16 -0
- data/app/views/kaminari/bootstrap/_next_page.html.erb +16 -0
- data/app/views/kaminari/bootstrap/_page.html.erb +17 -0
- data/app/views/kaminari/bootstrap/_paginator.html.erb +32 -0
- data/app/views/kaminari/bootstrap/_prev_page.html.erb +16 -0
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/bootstrap-cells.gemspec +36 -0
- data/lib/bootstrap-cells.rb +16 -0
- data/lib/bootstrap-cells/cells/alert/body.erb +7 -0
- data/lib/bootstrap-cells/cells/alert/show.erb +7 -0
- data/lib/bootstrap-cells/cells/alert/title.erb +9 -0
- data/lib/bootstrap-cells/cells/alert_cell.rb +39 -0
- data/lib/bootstrap-cells/cells/base_cell.rb +43 -0
- data/lib/bootstrap-cells/cells/button/show.erb +17 -0
- data/lib/bootstrap-cells/cells/button_cell.rb +41 -0
- data/lib/bootstrap-cells/cells/card/block.erb +14 -0
- data/lib/bootstrap-cells/cells/card/block_body.erb +5 -0
- data/lib/bootstrap-cells/cells/card/block_subtitle.erb +5 -0
- data/lib/bootstrap-cells/cells/card/block_text.erb +5 -0
- data/lib/bootstrap-cells/cells/card/block_title.erb +5 -0
- data/lib/bootstrap-cells/cells/card/footer.erb +9 -0
- data/lib/bootstrap-cells/cells/card/header.erb +9 -0
- data/lib/bootstrap-cells/cells/card/img_bottom.erb +9 -0
- data/lib/bootstrap-cells/cells/card/img_top.erb +9 -0
- data/lib/bootstrap-cells/cells/card/list_group.erb +9 -0
- data/lib/bootstrap-cells/cells/card/show.erb +9 -0
- data/lib/bootstrap-cells/cells/card/table.erb +9 -0
- data/lib/bootstrap-cells/cells/card_cell.rb +152 -0
- data/lib/bootstrap-cells/cells/column/td.erb +1 -0
- data/lib/bootstrap-cells/cells/column/th.erb +9 -0
- data/lib/bootstrap-cells/cells/column_cell.rb +49 -0
- data/lib/bootstrap-cells/cells/field/required_field.scss +5 -0
- data/lib/bootstrap-cells/cells/field/show.erb +15 -0
- data/lib/bootstrap-cells/cells/field_cell.rb +96 -0
- data/lib/bootstrap-cells/cells/fields_for/form.scss +12 -0
- data/lib/bootstrap-cells/cells/fields_for/form_horizontal.scss +33 -0
- data/lib/bootstrap-cells/cells/fields_for/show.erb +3 -0
- data/lib/bootstrap-cells/cells/fields_for_cell.rb +15 -0
- data/lib/bootstrap-cells/cells/kv_horizontal/show.erb +17 -0
- data/lib/bootstrap-cells/cells/kv_horizontal_cell.rb +34 -0
- data/lib/bootstrap-cells/cells/kv_vertical/show.erb +17 -0
- data/lib/bootstrap-cells/cells/kv_vertical_cell.rb +32 -0
- data/lib/bootstrap-cells/cells/modal/body.erb +9 -0
- data/lib/bootstrap-cells/cells/modal/button.erb +9 -0
- data/lib/bootstrap-cells/cells/modal/content.erb +12 -0
- data/lib/bootstrap-cells/cells/modal/footer.erb +10 -0
- data/lib/bootstrap-cells/cells/modal/header.erb +12 -0
- data/lib/bootstrap-cells/cells/modal/modal.js +15 -0
- data/lib/bootstrap-cells/cells/modal/show.erb +9 -0
- data/lib/bootstrap-cells/cells/modal_cell.rb +64 -0
- data/lib/bootstrap-cells/cells/pages/pages.scss +4 -0
- data/lib/bootstrap-cells/cells/pages/show.erb +3 -0
- data/lib/bootstrap-cells/cells/pages_cell.rb +16 -0
- data/lib/bootstrap-cells/cells/table/nubbin.scss +40 -0
- data/lib/bootstrap-cells/cells/table/show.erb +7 -0
- data/lib/bootstrap-cells/cells/table/table_sort.scss +17 -0
- data/lib/bootstrap-cells/cells/table/table_striped_nested.scss +8 -0
- data/lib/bootstrap-cells/cells/table/tbody.erb +3 -0
- data/lib/bootstrap-cells/cells/table/tbody_button_for_nested_row.erb +9 -0
- data/lib/bootstrap-cells/cells/table/tbody_final_row.erb +9 -0
- data/lib/bootstrap-cells/cells/table/tbody_first_row.erb +9 -0
- data/lib/bootstrap-cells/cells/table/tbody_nested_row.erb +6 -0
- data/lib/bootstrap-cells/cells/table/tbody_rows.erb +35 -0
- data/lib/bootstrap-cells/cells/table/thead.erb +11 -0
- data/lib/bootstrap-cells/cells/table_cell.rb +68 -0
- data/lib/bootstrap-cells/cells/tabs/show.erb +19 -0
- data/lib/bootstrap-cells/cells/tabs_cell.rb +40 -0
- data/lib/bootstrap-cells/engine.rb +9 -0
- metadata +307 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: b42c4d64ec3ea10052e487cdd29c72ca19ee4be4
|
4
|
+
data.tar.gz: 32a7944ebdec8e1477f31e1755af2481d2cf800d
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 5927d0e5401c79924328dfd73c6a35c6703d717652a90fa5f0dc93f64f0eada8b322b3fb5d68620ec7e6f1be11b514694f7fbb19c1fc2f48c2b322df7fff2fc4
|
7
|
+
data.tar.gz: a4ea0c1a8a2bd69fb4c5246fb89a8de2b9fdf83e937e52726472b7620fc28660e5faade5040ebae3af8acf4ba854b18a2d2fb3f8b0aaffbb883379ab38090ef3
|
data/.gitignore
ADDED
data/.gitlab-ci.yml
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
AllCops:
|
2
|
+
TargetRubyVersion: 2.3
|
3
|
+
Include:
|
4
|
+
- Rakefile
|
5
|
+
Exclude:
|
6
|
+
- bin/*
|
7
|
+
- db/**/*
|
8
|
+
- spec/*_helper.rb
|
9
|
+
Metrics/LineLength:
|
10
|
+
Max: 120
|
11
|
+
# To make it possible to copy or click on URIs in the code, we allow lines
|
12
|
+
# contaning a URI to be longer than Max.
|
13
|
+
AllowURI: true
|
14
|
+
URISchemes:
|
15
|
+
- http
|
16
|
+
- https
|
17
|
+
Style/Documentation:
|
18
|
+
Enabled: false
|
19
|
+
Style/SignalException:
|
20
|
+
EnforcedStyle: semantic
|
21
|
+
Rails:
|
22
|
+
Enabled: true
|
23
|
+
Metrics/BlockLength:
|
24
|
+
Exclude:
|
25
|
+
- 'acts_on_resource.gemspec'
|
26
|
+
- 'spec/**/*_spec.rb'
|
27
|
+
- '**/schema.rb'
|
data/CHANGELOG
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
v0.1.5
|
2
|
+
- Allow callers to put a table caption at the head of the table
|
3
|
+
- Ensure that the `type` attribute is put on the buttons used for nested rows in the table cell
|
4
|
+
- Ensure that the hashes merged in the `merge_props` method have the same kind of keys by deep symbolizing each hash
|
5
|
+
v0.1.4
|
6
|
+
- Ensure that the Kaminari gem is explicitly required
|
7
|
+
v0.1.3
|
8
|
+
- Allow custom output to be set for hidden fields
|
9
|
+
- Allow for fields_for collections with nils
|
10
|
+
v0.1.2
|
11
|
+
- Don't put the HTML for the alert title into the DOM is the title text is nil
|
12
|
+
v0.1.1
|
13
|
+
- Ensure that our patch of Kaminari#paginate passes the updated options
|
14
|
+
- Don't include coverage report files in the gem build
|
15
|
+
v0.1.0
|
16
|
+
- Make this a fully fledged gem, with a test suite and everything
|
17
|
+
v0.0.6
|
18
|
+
- Add a component for Bootstrap-style Kaminari pagination
|
19
|
+
v0.0.5
|
20
|
+
- Fix a bug in the pure JS `modal.js`
|
21
|
+
v0.0.4
|
22
|
+
- Fix a bug in `tabs` rendering
|
23
|
+
- Use pure JS in modal.js
|
24
|
+
v0.0.3
|
25
|
+
- Add CSS for table column sorting
|
26
|
+
+ https://gitlab.med.upenn.edu/infrastructure/bootstrap-cells/merge_requests/2
|
27
|
+
v0.0.2
|
28
|
+
- Allow non-ActiveRecord::Relations to be passed to the table cell
|
29
|
+
+ https://gitlab.med.upenn.edu/infrastructure/bootstrap-cells/merge_requests/1
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,200 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
bootstrap-cells (0.1.4)
|
5
|
+
cells (~> 4.0)
|
6
|
+
cells-erb (>= 0.1.0)
|
7
|
+
cells-rails (>= 0.0.8)
|
8
|
+
kaminari (~> 1.0)
|
9
|
+
|
10
|
+
GEM
|
11
|
+
remote: http://rubygems.org/
|
12
|
+
specs:
|
13
|
+
actionmailer (4.2.10)
|
14
|
+
actionpack (= 4.2.10)
|
15
|
+
actionview (= 4.2.10)
|
16
|
+
activejob (= 4.2.10)
|
17
|
+
mail (~> 2.5, >= 2.5.4)
|
18
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
19
|
+
actionpack (4.2.10)
|
20
|
+
actionview (= 4.2.10)
|
21
|
+
activesupport (= 4.2.10)
|
22
|
+
rack (~> 1.6)
|
23
|
+
rack-test (~> 0.6.2)
|
24
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
25
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
26
|
+
actionview (4.2.10)
|
27
|
+
activesupport (= 4.2.10)
|
28
|
+
builder (~> 3.1)
|
29
|
+
erubis (~> 2.7.0)
|
30
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
31
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
32
|
+
activejob (4.2.10)
|
33
|
+
activesupport (= 4.2.10)
|
34
|
+
globalid (>= 0.3.0)
|
35
|
+
activemodel (4.2.10)
|
36
|
+
activesupport (= 4.2.10)
|
37
|
+
builder (~> 3.1)
|
38
|
+
activerecord (4.2.10)
|
39
|
+
activemodel (= 4.2.10)
|
40
|
+
activesupport (= 4.2.10)
|
41
|
+
arel (~> 6.0)
|
42
|
+
activesupport (4.2.10)
|
43
|
+
i18n (~> 0.7)
|
44
|
+
minitest (~> 5.1)
|
45
|
+
thread_safe (~> 0.3, >= 0.3.4)
|
46
|
+
tzinfo (~> 1.1)
|
47
|
+
addressable (2.5.2)
|
48
|
+
public_suffix (>= 2.0.2, < 4.0)
|
49
|
+
ansi (1.5.0)
|
50
|
+
arel (6.0.4)
|
51
|
+
builder (3.2.3)
|
52
|
+
capybara (2.16.0)
|
53
|
+
addressable
|
54
|
+
mini_mime (>= 0.1.3)
|
55
|
+
nokogiri (>= 1.3.3)
|
56
|
+
rack (>= 1.0.0)
|
57
|
+
rack-test (>= 0.5.4)
|
58
|
+
xpath (~> 2.0)
|
59
|
+
cells (4.1.7)
|
60
|
+
declarative-builder (< 0.2.0)
|
61
|
+
declarative-option (< 0.2.0)
|
62
|
+
tilt (>= 1.4, < 3)
|
63
|
+
uber (< 0.2.0)
|
64
|
+
cells-erb (0.1.0)
|
65
|
+
cells (~> 4.0)
|
66
|
+
erbse (>= 0.1.1)
|
67
|
+
cells-rails (0.0.8)
|
68
|
+
actionpack (>= 3.0)
|
69
|
+
cells (>= 4.1.6, < 5.0.0)
|
70
|
+
concurrent-ruby (1.0.5)
|
71
|
+
crass (1.0.3)
|
72
|
+
declarative-builder (0.1.0)
|
73
|
+
declarative-option (< 0.2.0)
|
74
|
+
declarative-option (0.1.0)
|
75
|
+
diff-lcs (1.3)
|
76
|
+
docile (1.1.5)
|
77
|
+
erbse (0.1.1)
|
78
|
+
temple
|
79
|
+
erubis (2.7.0)
|
80
|
+
globalid (0.4.1)
|
81
|
+
activesupport (>= 4.2.0)
|
82
|
+
hirb (0.7.3)
|
83
|
+
i18n (0.9.1)
|
84
|
+
concurrent-ruby (~> 1.0)
|
85
|
+
json (2.1.0)
|
86
|
+
kaminari (1.1.1)
|
87
|
+
activesupport (>= 4.1.0)
|
88
|
+
kaminari-actionview (= 1.1.1)
|
89
|
+
kaminari-activerecord (= 1.1.1)
|
90
|
+
kaminari-core (= 1.1.1)
|
91
|
+
kaminari-actionview (1.1.1)
|
92
|
+
actionview
|
93
|
+
kaminari-core (= 1.1.1)
|
94
|
+
kaminari-activerecord (1.1.1)
|
95
|
+
activerecord
|
96
|
+
kaminari-core (= 1.1.1)
|
97
|
+
kaminari-core (1.1.1)
|
98
|
+
loofah (2.1.1)
|
99
|
+
crass (~> 1.0.2)
|
100
|
+
nokogiri (>= 1.5.9)
|
101
|
+
mail (2.7.0)
|
102
|
+
mini_mime (>= 0.1.1)
|
103
|
+
mini_mime (1.0.0)
|
104
|
+
mini_portile2 (2.3.0)
|
105
|
+
minitest (5.10.3)
|
106
|
+
nokogiri (1.8.1)
|
107
|
+
mini_portile2 (~> 2.3.0)
|
108
|
+
public_suffix (3.0.1)
|
109
|
+
rack (1.6.8)
|
110
|
+
rack-test (0.6.3)
|
111
|
+
rack (>= 1.0)
|
112
|
+
rails (4.2.10)
|
113
|
+
actionmailer (= 4.2.10)
|
114
|
+
actionpack (= 4.2.10)
|
115
|
+
actionview (= 4.2.10)
|
116
|
+
activejob (= 4.2.10)
|
117
|
+
activemodel (= 4.2.10)
|
118
|
+
activerecord (= 4.2.10)
|
119
|
+
activesupport (= 4.2.10)
|
120
|
+
bundler (>= 1.3.0, < 2.0)
|
121
|
+
railties (= 4.2.10)
|
122
|
+
sprockets-rails
|
123
|
+
rails-deprecated_sanitizer (1.0.3)
|
124
|
+
activesupport (>= 4.2.0.alpha)
|
125
|
+
rails-dom-testing (1.0.8)
|
126
|
+
activesupport (>= 4.2.0.beta, < 5.0)
|
127
|
+
nokogiri (~> 1.6)
|
128
|
+
rails-deprecated_sanitizer (>= 1.0.1)
|
129
|
+
rails-html-sanitizer (1.0.3)
|
130
|
+
loofah (~> 2.0)
|
131
|
+
railties (4.2.10)
|
132
|
+
actionpack (= 4.2.10)
|
133
|
+
activesupport (= 4.2.10)
|
134
|
+
rake (>= 0.8.7)
|
135
|
+
thor (>= 0.18.1, < 2.0)
|
136
|
+
rake (12.2.1)
|
137
|
+
rspec-cells (0.3.4)
|
138
|
+
cells (>= 4.0.0, < 6.0.0)
|
139
|
+
rspec-rails (~> 3.2)
|
140
|
+
rspec-core (3.7.0)
|
141
|
+
rspec-support (~> 3.7.0)
|
142
|
+
rspec-expectations (3.7.0)
|
143
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
144
|
+
rspec-support (~> 3.7.0)
|
145
|
+
rspec-mocks (3.7.0)
|
146
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
147
|
+
rspec-support (~> 3.7.0)
|
148
|
+
rspec-rails (3.7.1)
|
149
|
+
actionpack (>= 3.0)
|
150
|
+
activesupport (>= 3.0)
|
151
|
+
railties (>= 3.0)
|
152
|
+
rspec-core (~> 3.7.0)
|
153
|
+
rspec-expectations (~> 3.7.0)
|
154
|
+
rspec-mocks (~> 3.7.0)
|
155
|
+
rspec-support (~> 3.7.0)
|
156
|
+
rspec-support (3.7.0)
|
157
|
+
simplecov (0.15.1)
|
158
|
+
docile (~> 1.1.0)
|
159
|
+
json (>= 1.8, < 3)
|
160
|
+
simplecov-html (~> 0.10.0)
|
161
|
+
simplecov-console (0.4.2)
|
162
|
+
ansi
|
163
|
+
hirb
|
164
|
+
simplecov
|
165
|
+
simplecov-html (0.10.2)
|
166
|
+
sprockets (3.7.1)
|
167
|
+
concurrent-ruby (~> 1.0)
|
168
|
+
rack (> 1, < 3)
|
169
|
+
sprockets-rails (3.2.1)
|
170
|
+
actionpack (>= 4.0)
|
171
|
+
activesupport (>= 4.0)
|
172
|
+
sprockets (>= 3.0.0)
|
173
|
+
sqlite3 (1.3.13)
|
174
|
+
temple (0.8.0)
|
175
|
+
thor (0.20.0)
|
176
|
+
thread_safe (0.3.6)
|
177
|
+
tilt (2.0.8)
|
178
|
+
tzinfo (1.2.4)
|
179
|
+
thread_safe (~> 0.1)
|
180
|
+
uber (0.1.0)
|
181
|
+
xpath (2.1.0)
|
182
|
+
nokogiri (~> 1.3)
|
183
|
+
|
184
|
+
PLATFORMS
|
185
|
+
ruby
|
186
|
+
|
187
|
+
DEPENDENCIES
|
188
|
+
bootstrap-cells!
|
189
|
+
bundler
|
190
|
+
capybara
|
191
|
+
rails (~> 4.2)
|
192
|
+
rake
|
193
|
+
rspec-cells
|
194
|
+
rspec-rails
|
195
|
+
simplecov
|
196
|
+
simplecov-console
|
197
|
+
sqlite3
|
198
|
+
|
199
|
+
BUNDLED WITH
|
200
|
+
1.15.4
|
data/Rakefile
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
/* Add one or more listeners to an element
|
2
|
+
** @param {DOMElement} element - DOM element to add listeners to
|
3
|
+
** @param {string} eventNames - space separated list of event names, e.g. 'click change'
|
4
|
+
** @param {Function} listener - function to attach for each event as a listener
|
5
|
+
*/
|
6
|
+
function addManyEventListeners(element, eventNames, listener) {
|
7
|
+
var events = eventNames.split(' ');
|
8
|
+
for (var i=0, iLen=events.length; i<iLen; i++) {
|
9
|
+
element.addEventListener(events[i], listener, false);
|
10
|
+
}
|
11
|
+
}
|
@@ -0,0 +1,15 @@
|
|
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="first">
|
11
|
+
<%= link_to raw(t 'views.pagination.first'),
|
12
|
+
url,
|
13
|
+
remote: remote %>
|
14
|
+
</li>
|
15
|
+
<% end %>
|
@@ -0,0 +1,12 @@
|
|
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 gap disabled">
|
9
|
+
<a href="#" onclick="return false;">
|
10
|
+
<%= raw(t 'views.pagination.truncate') %>
|
11
|
+
</a>
|
12
|
+
</li>
|
@@ -0,0 +1,16 @@
|
|
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
|
+
<%# "next" class present for border styling in twitter bootstrap %>
|
11
|
+
<li class="last next">
|
12
|
+
<%= link_to raw(t 'views.pagination.last'),
|
13
|
+
url,
|
14
|
+
remote: remote %>
|
15
|
+
</li>
|
16
|
+
<% end %>
|
@@ -0,0 +1,16 @@
|
|
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="next_page">
|
11
|
+
<%= link_to raw(t 'views.pagination.next'),
|
12
|
+
url,
|
13
|
+
rel: 'next',
|
14
|
+
remote: remote %>
|
15
|
+
</li>
|
16
|
+
<% end %>
|
@@ -0,0 +1,17 @@
|
|
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.current? ? 'page active' : 'page' %>
|
11
|
+
|
12
|
+
<li class="<%= li_class %>">
|
13
|
+
<%= link_to page,
|
14
|
+
url,
|
15
|
+
remote: remote,
|
16
|
+
rel: (page.next? ? 'next' : (page.prev? ? 'prev' : nil)) %>
|
17
|
+
</li>
|
@@ -0,0 +1,32 @@
|
|
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
|
+
<% pagination_class ||= '' %>
|
9
|
+
|
10
|
+
<% if paginator.each_page.count > 1 %>
|
11
|
+
<nav>
|
12
|
+
<ul class="pagination <%= pagination_class %>">
|
13
|
+
<% unless current_page.first? %>
|
14
|
+
<%= paginator.first_page_tag %>
|
15
|
+
<%= paginator.prev_page_tag %>
|
16
|
+
<% end %>
|
17
|
+
|
18
|
+
<% paginator.each_page do |page| %>
|
19
|
+
<% if page.display_tag? %>
|
20
|
+
<%= paginator.page_tag page %>
|
21
|
+
<% elsif !page.was_truncated? %>
|
22
|
+
<%= paginator.gap_tag %>
|
23
|
+
<% end %>
|
24
|
+
<% end %>
|
25
|
+
|
26
|
+
<% unless current_page.last? %>
|
27
|
+
<%= paginator.next_page_tag %>
|
28
|
+
<%= paginator.last_page_tag %>
|
29
|
+
<% end %>
|
30
|
+
</ul>
|
31
|
+
</nav>
|
32
|
+
<% end %>
|