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.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 )

View file

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

View file

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