public
Description: Simple Ruby 1.8/1.9 code comparison app
Homepage: http://codefluency.com
Clone URL: git://github.com/bruce/compare-1-9.git
Search Repo:
Pagination links
bruce (author)
Tue Jan 15 17:11:56 -0800 2008
commit  d2b27538bf025feccf4840cb7fd636c20aadd28d
tree    fc4e521d58082653c5d68202ffea53ecb10513c2
parent  27faf30f8bccf541432a49aa5950ec9bdb02982c
...
7
8
9
 
 
 
 
 
 
 
 
10
11
12
...
7
8
9
10
11
12
13
14
15
16
17
18
19
20
0
@@ -7,6 +7,14 @@
0
       Comparison.find(:all, :include => :results, :limit => per_page, :offset => offset)
0
     end
0
     @page = @pager.page(params[:page])
0
+ respond_to do |format|
0
+ format.html
0
+ format.js do
0
+ render :update do |page|
0
+ page[:comparisons].reload
0
+ end
0
+ end
0
+ end
0
   end
0
   
0
   def new
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
0
@@ -1 +1,18 @@
0
+<div id='comparisons'>
0
+ <% if @page.items.any? %>
0
+ <%= render :partial => 'pagination.html.erb' %>
0
+ <table id='comparisons'>
0
+ <thead>
0
+ <tr>
0
+ <th>Name</th>
0
+ <th>Performance</th>
0
+ </tr>
0
+ </thead>
0
+ <tbody>
0
+ <%= render :partial => @page.items %>
0
+ </tbody>
0
+ </table>
0
+ <%= render :partial => 'pagination.html.erb' %>
0
+ <% end %>
0
+</div>
...
 
 
 
 
...
1
2
3
4
0
@@ -1 +1,5 @@
0
+<ul class='pagination'>
0
+ <li><%= link_to("Previous Page", comparisons_path(:page => @page.prev.number), :class => 'icon prev') if @page.prev? %></li>
0
+ <li><%= link_to("Next Page", comparisons_path(:page => @page.next.number), :class => 'icon-right next') if @page.next? %></li>
0
+</ul>
...
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
 
...
2
3
4
 
 
 
 
 
 
 
 
 
 
 
 
 
5
0
@@ -2,17 +2,5 @@
0
 
0
 <ul class='actions'><li><%= link_to "Add Comparison", new_comparison_path, :class => 'add' %></li></ul>
0
 
0
-<% if @page.items.any? %>
0
- <table id='comparisons'>
0
- <thead>
0
- <tr>
0
- <th>Name</th>
0
- <th>Performance</th>
0
- </tr>
0
- </thead>
0
- <tbody>
0
- <%= render :partial => @page.items %>
0
- </tbody>
0
- </table>
0
-<% end %>
0
+<%= render :partial => 'comparisons' %>
...
175
176
177
 
178
 
 
 
 
 
 
 
179
180
181
...
186
187
188
189
190
191
192
193
194
...
201
202
203
 
 
 
 
 
 
204
205
206
...
280
281
282
 
 
 
 
 
 
 
 
 
 
283
...
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
...
194
195
196
 
 
 
197
198
199
...
206
207
208
209
210
211
212
213
214
215
216
217
...
291
292
293
294
295
296
297
298
299
300
301
302
303
304
0
@@ -175,7 +175,15 @@
0
   height: 20px;
0
   line-height: 20px;
0
   vertical-align: middle;
0
+ color: #c6ffb2;
0
 }
0
+.icon-right {
0
+ padding-right: 20px;
0
+ font-size: 0.9em;
0
+ height: 20px;
0
+ line-height: 20px;
0
+ vertical-align: middle;
0
+}
0
 ul.actions {
0
   list-style: none;
0
   margin: 0;
0
@@ -186,9 +194,6 @@
0
   float: left;
0
   margin-right: 1em;
0
 }
0
-a.icon {
0
- color: #c6ffb2;
0
-}
0
 a.show {
0
   background: url(/images/icons/magnifier.png) center left no-repeat;
0
 }
0
@@ -201,6 +206,12 @@
0
 a.edit {
0
   background: url(/images/icons/script_edit.png) center left no-repeat;
0
 }
0
+a.next {
0
+ background: url(/images/icons/arrow_right.png) center right no-repeat;
0
+}
0
+a.prev {
0
+ background: url(/images/icons/arrow_left.png) center left no-repeat;
0
+}
0
 a.delete {
0
   color: red;
0
   background: url(/images/icons/bin_closed.png) center left no-repeat;
0
@@ -280,5 +291,15 @@
0
 }
0
 td[class="version failure"] {
0
   background: #c26161 url(/images/version_failure.png) top left repeat-x;
0
+}
0
+.pagination {
0
+ padding: 0;
0
+ margin: 0;
0
+ list-style: none;
0
+ height: 40px;
0
+}
0
+.pagination li {
0
+ float: left;
0
+ margin-right: 1em;
0
 }

Comments

    No one has commented yet.