Meilleur affichage de la pagination

This commit is contained in:
Michael RICOIS 2012-04-16 12:48:49 +00:00
parent 2f83bc9bef
commit 561ea4c851
2 changed files with 40 additions and 22 deletions

View File

@ -67,19 +67,20 @@ par
<h2>Liste des surveillances</h2>
<div class="paragraph">
<?php if ($this->curPage>=1) { ?>
<a href="<?=$this->url(array(
'action' => 'liste',
'page' => $this->curPage-1))
?>" title="Page précédente..."> << </a>
<a class="pagination" href="<?=$this->url(array('action' => 'liste', 'page' => $this->curPage-1))?>"
title="Page précédente..."> &lt;&lt; </a>
<?php } ?>
<?php if ($this->curPage!=$this->totPage) { ?>
<span>Page <?=$this->curPage+1?>/<?=$this->totPage?></span>
<span>Page <select name="page">
<?php for ($i=1;$i<$this->totPage+1;$i++) {?>
<option value="<?=$this->url(array('action' => 'liste', 'page' => $i-1))?>"
<?=($i==$this->curPage+1)? ' selected' : ''?>><?=$i?></option>
<?php }?></select> / <?=$this->totPage?>
</span>
<?php } ?>
<?php if ($this->curPage+1<$this->totPage) { ?>
<a href="<?=$this->url(array(
'action' => 'liste',
'page' => $this->curPage+1))
?>" title="Page suivante..."> >> </a>
<a class="pagination" href="<?=$this->url(array('action' => 'liste', 'page' => $this->curPage+1))?>"
title="Page suivante..."> &gt;&gt; </a>
<?php } ?>
</div>
@ -229,23 +230,22 @@ par
</table>
</div>
<pre><?php //print_r($this->surveillances) ?></pre>
<div class="paragraph">
<?php if ($this->curPage>1) { ?>
<a href="<?=$this->url(array(
'action' => 'liste',
'page' => $this->curPage-1))
?>" title="Page précédente..."> << </a>
<?php if ($this->curPage>=1) { ?>
<a class="pagination" href="<?=$this->url(array('action' => 'liste', 'page' => $this->curPage-1))?>"
title="Page précédente..."> &lt;&lt; </a>
<?php } ?>
<?php if ($this->curPage!=$this->totPage) { ?>
<span>Page <?=$this->curPage+1?>/<?=$this->totPage?></span>
<span>Page <select name="page">
<?php for ($i=1;$i<$this->totPage+1;$i++) {?>
<option value="<?=$this->url(array('action' => 'liste', 'page' => $i-1))?>"
<?=($i==$this->curPage+1)? ' selected' : ''?>><?=$i?></option>
<?php }?></select> / <?=$this->totPage?>
</span>
<?php } ?>
<?php if ($this->curPage+1<$this->totPage) { ?>
<a href="<?=$this->url(array(
'action' => 'liste',
'page' => $this->curPage+1))
?>" title="Page suivante..."> >> </a>
<a class="pagination" href="<?=$this->url(array('action' => 'liste', 'page' => $this->curPage+1))?>"
title="Page suivante..."> &gt;&gt; </a>
<?php } ?>
</div>
@ -263,6 +263,10 @@ function submitTri() {
}
$(document).ready(function() {
$('select[name=page]').change(function(){
window.location.href = $(this).val();
});
$('select[name=type]').change(function() {
submitTri();
});

View File

@ -97,4 +97,18 @@
background-color:#4D90FE;
border:1px solid #3079ED;
color:#ffffff;
}
}
.pagination {
background: none repeat scroll 0 0 transparent;
border: 0 none;
font-weight: bold;
margin: 0;
min-width: 1.5em;
padding: 0.3em 0.5em;
}
.pagination:hover {
background: black repeat scroll 0 0;
color:white;
}