aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuc Donnet2012-04-27 17:29:16 +0200
committerLuc Donnet2012-04-27 17:29:16 +0200
commitd59e99401695d12b28f917bdc6cdf09922fd488c (patch)
tree6b2e8f97ee9dbef44ecbf60ac505976f96b95e19
parent1419f9623556da9f3e805a62ba13a4c428352316 (diff)
downloadchouette-core-d59e99401695d12b28f917bdc6cdf09922fd488c.tar.bz2
Add counter to list objects for index
-rw-r--r--app/assets/stylesheets/pagination.css.scss88
-rw-r--r--app/views/companies/index.html.erb12
-rw-r--r--app/views/connection_links/index.html.erb11
-rw-r--r--app/views/lines/index.html.erb12
-rw-r--r--app/views/networks/index.html.erb12
-rw-r--r--app/views/stop_areas/index.html.erb11
-rw-r--r--app/views/time_tables/index.html.erb11
7 files changed, 99 insertions, 58 deletions
diff --git a/app/assets/stylesheets/pagination.css.scss b/app/assets/stylesheets/pagination.css.scss
index 76ff3cb8f..222ab861b 100644
--- a/app/assets/stylesheets/pagination.css.scss
+++ b/app/assets/stylesheets/pagination.css.scss
@@ -1,52 +1,50 @@
.pagination {
+ background: white;
cursor: default;
-
- margin: 10px 0;
-
- > a, > span, > em {
- padding: 0.2em 0.5em;
- display: block;
- float: left;
- margin-right: 1px;
- }
-
- > .disabled{
- color: #999999;
- /* border: 1px solid #dddddd; */
- }
-
- > .current{
- font-style: normal;
- font-weight: bold;
- background: #61970b;
- color: white;
- border: 1px solid #61970b;
- }
-
- > a{
- text-decoration: none;
- color: #61970b;
- border: 1px solid #ddd;
- &:hover, &:focus{
+ margin-top: 20px;
+
+ /* self-clearing method: */
+ a, span, em {
+ padding: 0.2em 0.5em;
+ display: block;
+ float: left;
+ margin-right: 1px; }
+ .disabled {
+ color: #999999;
+ border: 1px solid #dddddd; }
+ .current {
+ font-style: normal;
+ font-weight: bold;
+ background: #61970b;
+ color: white;
+ border: 1px solid #61970b; }
+ a {
+ text-decoration: none;
color: #86b41d;
- border-color: #86b41d;
- }
- }
-
- .paginated_content {
- padding: 0.4em 0.6em
- }
-
- &:after{
+ border: 1px solid #86b41d; }
+ a:hover, a:focus {
+ color: #000033;
+ border-color: #000033; }
+ .page_info {
+ background: #61970b;
+ color: white;
+ padding: 0.4em 0.6em;
+ width: 22em;
+ margin-bottom: 0.3em;
+ text-align: center; }
+ .page_info b {
+ color: #000033;
+ background: #86b41d;
+ padding: 0.1em 0.25em; }
+}
+
+.pagination:after {
content: ".";
display: block;
height: 0;
clear: both;
- visibility: hidden;}
-
- * html & {
- height: 1%;}
-
- *:first-child+html & {
- overflow: hidden;}
-} \ No newline at end of file
+ visibility: hidden; }
+* html .pagination{
+ height: 1%; }
+*:first-child + html .pagination {
+ overflow: hidden; } \ No newline at end of file
diff --git a/app/views/companies/index.html.erb b/app/views/companies/index.html.erb
index b6ed91aff..257e1a945 100644
--- a/app/views/companies/index.html.erb
+++ b/app/views/companies/index.html.erb
@@ -8,11 +8,19 @@
<%= link_to t("cancel"), referential_companies_path(@referential) %>
<% end %>
-<%= will_paginate @companies %>
+<div class="pagination">
+ <div class="page_info">
+ <%= page_entries_info @companies %>
+ </div>
+ <%= will_paginate @companies, :container => false %>
+</div>
<div class="companies paginated_content">
<%= render :partial => "company", :collection => @companies %>
</div>
-<%= will_paginate @companies %>
+<div class="pagination">
+ <%= will_paginate @companies, :container => false %>
+</div>
+
<% content_for :sidebar do %>
diff --git a/app/views/connection_links/index.html.erb b/app/views/connection_links/index.html.erb
index fdbd28021..2b8bdfe5b 100644
--- a/app/views/connection_links/index.html.erb
+++ b/app/views/connection_links/index.html.erb
@@ -8,11 +8,18 @@
<%= link_to t("cancel"), referential_connection_links_path(@referential) %>
<% end %>
-<%= will_paginate @connection_links %>
+<div class="pagination">
+ <div class="page_info">
+ <%= page_entries_info @connection_links %>
+ </div>
+ <%= will_paginate @connection_links, :container => false %>
+</div>
<div class="connection_links paginated_content">
<%= render :partial => "connection_link", :collection => @connection_links %>
</div>
-<%= will_paginate @connection_links %>
+<div class="pagination">
+ <%= will_paginate @connection_links, :container => false %>
+</div>
<% content_for :sidebar do %>
<ul class="actions">
diff --git a/app/views/lines/index.html.erb b/app/views/lines/index.html.erb
index 49c6de226..26b97e0b3 100644
--- a/app/views/lines/index.html.erb
+++ b/app/views/lines/index.html.erb
@@ -23,11 +23,19 @@
</p>
<% end %>
-<%= will_paginate @lines %>
+
+<div class="pagination">
+ <div class="page_info">
+ <%= page_entries_info @lines %>
+ </div>
+ <%= will_paginate @lines, :container => false %>
+</div>
<div class="lines paginated_content">
<%= render :partial => "line", :collection => @lines %>
</div>
-<%= will_paginate @lines %>
+<div class="pagination">
+ <%= will_paginate @lines, :container => false %>
+</div>
<% content_for :sidebar do %>
<ul class="actions">
diff --git a/app/views/networks/index.html.erb b/app/views/networks/index.html.erb
index 4514939f1..825bb3dcb 100644
--- a/app/views/networks/index.html.erb
+++ b/app/views/networks/index.html.erb
@@ -8,12 +8,18 @@
<%= link_to t("cancel"), referential_networks_path(@referential) %>
<% end %>
-<%= will_paginate @networks %>
+<div class="pagination">
+ <div class="page_info">
+ <%= page_entries_info @networks %>
+ </div>
+ <%= will_paginate @networks, :container => false %>
+</div>
<div class="networks paginated_content">
<%= render :partial => "network", :collection => @networks %>
</div>
-<%= will_paginate @networks %>
-
+<div class="pagination">
+ <%= will_paginate @networks, :container => false %>
+</div>
<% content_for :sidebar do %>
<ul class="actions">
diff --git a/app/views/stop_areas/index.html.erb b/app/views/stop_areas/index.html.erb
index deb5b1643..57617f559 100644
--- a/app/views/stop_areas/index.html.erb
+++ b/app/views/stop_areas/index.html.erb
@@ -8,11 +8,18 @@
<%= link_to t("cancel"), referential_stop_areas_path(@referential) %>
<% end %>
-<%= will_paginate @stop_areas %>
+<div class="pagination">
+ <div class="page_info">
+ <%= page_entries_info @stop_areas %>
+ </div>
+ <%= will_paginate @stop_areas, :container => false %>
+</div>
<div class="stop_areas paginated_content">
<%= render :partial => "stop_area", :collection => @stop_areas %>
</div>
-<%= will_paginate @stop_areas %>
+<div class="pagination">
+ <%= will_paginate @stop_areas, :container => false %>
+</div>
<% content_for :sidebar do %>
<ul class="actions">
diff --git a/app/views/time_tables/index.html.erb b/app/views/time_tables/index.html.erb
index 90225446a..26e484554 100644
--- a/app/views/time_tables/index.html.erb
+++ b/app/views/time_tables/index.html.erb
@@ -8,11 +8,18 @@
<%= link_to t("cancel"), referential_time_tables_path(@referential) %>
<% end %>
-<%= will_paginate @time_tables %>
+<div class="pagination">
+ <div class="page_info">
+ <%= page_entries_info @time_tables %>
+ </div>
+ <%= will_paginate @time_tables, :container => false %>
+</div>
<div class="time_tables paginated_content">
<%= render :partial => "time_table", :collection => @time_tables %>
</div>
-<%= will_paginate @time_tables %>
+<div class="pagination">
+ <%= will_paginate @time_tables, :container => false %>
+</div>
<% content_for :sidebar do %>