Improved pagination.

This commit is contained in:
Martin Edenhofer 2012-04-28 04:03:17 +02:00
parent 08d3d907f4
commit 2baa0dc10b
3 changed files with 34 additions and 18 deletions

View file

@ -67,7 +67,7 @@ class App.DashboardTicket extends App.Controller
) )
html = $(html) html = $(html)
html.find('li').removeClass('active') html.find('li').removeClass('active')
html.find("[data-id=\"#{@start_page}\"]").parents('li').addClass('active') html.find(".page [data-id=\"#{@start_page}\"]").parents('li').addClass('active')
shown_all_attributes = @ticketTableAttributes( App.Overview.find(@overview.id).view.d.overview ) shown_all_attributes = @ticketTableAttributes( App.Overview.find(@overview.id).view.d.overview )

View file

@ -1,21 +1,34 @@
<div class="row"> <div class="row">
<div class="span9"> <div class="span9">
<h2><%= @overview.meta.name %> <small><a href="#" data-type="settings" class="icon-edit"></a> <div class="row">
</small></h2> <div class="span4">
<div class="pagination"> <h2><%= @overview.meta.name %> <small><a href="#" data-type="settings" class="icon-edit"></a></small></h2>
<ul> </div>
<% if @start_page != 1: %> <div class="span5">
<li><a href="#" data-id="<%= @start_page - 1 %>" data-type="page">«</a></li> <div class="pagination">
<% end %> <ul>
<% for item in [1..@pages_total]: %> <li>
<li> <% if @start_page != 1: %>
<a href="#" data-id="<%= item %>" data-type="page"><%= item %></a> <a href="#" data-id="<%= @start_page - 1 %>" data-type="page">«</a>
</li> <% else: %>
<% end %> <a href="#" data-id="<%= @start_page %>" data-type="page">«</a>
<% if @start_page != @pages_total: %> <% end %>
<li><a href="#" data-id="<%= @start_page + 1 %>" data-type="page">»</a></li> </li>
<% end %> <% for item in [1..@pages_total]: %>
</ul> <li class="page">
<a href="#" data-id="<%= item %>" data-type="page"><%= item %></a>
</li>
<% end %>
<li>
<% if @start_page != @pages_total: %>
<a href="#" data-id="<%= @start_page + 1 %>" data-type="page">»</a>
<% else: %>
<a href="#" data-id="<%= @start_page %>" data-type="page">»</a>
</li>
<% end %>
</ul>
</div>
</div>
</div> </div>
<div class="table-overview"></div> <div class="table-overview"></div>
</div> </div>

View file

@ -24,7 +24,10 @@ body {
} }
/* improved spacing */ /* improved spacing */
.pagination { .pagination {
margin: 0px 0px; padding-top: 2px;
margin: 0px 4px;
height: 30px;
float: right;
} }
.pagination a { .pagination a {
padding: 0px 10px; padding: 0px 10px;