forked from Wavyzz/dolibarr
Merge pull request #2774 from aspangaro/develop-pagination
NEW Use larger button for navigation
This commit is contained in:
@@ -2831,21 +2831,22 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so
|
|||||||
$nbpages=ceil($totalnboflines/$conf->liste_limit);
|
$nbpages=ceil($totalnboflines/$conf->liste_limit);
|
||||||
$cpt=($page-$maxnbofpage);
|
$cpt=($page-$maxnbofpage);
|
||||||
if ($cpt < 0) { $cpt=0; }
|
if ($cpt < 0) { $cpt=0; }
|
||||||
$pagelist.=$langs->trans('Page');
|
$pagelist.='<div class="pagination"><ul>';
|
||||||
|
|
||||||
if ($cpt>=1)
|
if ($cpt>=1)
|
||||||
{
|
{
|
||||||
$pagelist.=' <a href="'.$file.'?page=0'.$options.'&sortfield='.$sortfield.'&sortorder='.$sortorder.'">1</a>';
|
$pagelist.='<li><a href="'.$file.'?page=0'.$options.'&sortfield='.$sortfield.'&sortorder='.$sortorder.'">1</a></li>';
|
||||||
if ($cpt >= 2) $pagelist.=' ...';
|
if ($cpt >= 2) $pagelist.=' ...';
|
||||||
}
|
}
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
if ($cpt==$page)
|
if ($cpt==$page)
|
||||||
{
|
{
|
||||||
$pagelist.= ' <u>'.($page+1).'</u>';
|
$pagelist.= '<li><span class="active">'.($page+1).'</span></li>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$pagelist.= ' <a href="'.$file.'?page='.$cpt.$options.'&sortfield='.$sortfield.'&sortorder='.$sortorder.'">'.($cpt+1).'</a>';
|
$pagelist.= '<li><a href="'.$file.'?page='.$cpt.$options.'&sortfield='.$sortfield.'&sortorder='.$sortorder.'">'.($cpt+1).'</a></li>';
|
||||||
}
|
}
|
||||||
$cpt++;
|
$cpt++;
|
||||||
}
|
}
|
||||||
@@ -2853,12 +2854,12 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so
|
|||||||
if ($cpt<$nbpages)
|
if ($cpt<$nbpages)
|
||||||
{
|
{
|
||||||
if ($cpt<$nbpages-1) $pagelist.= ' ...';
|
if ($cpt<$nbpages-1) $pagelist.= ' ...';
|
||||||
$pagelist.= ' <a href="'.$file.'?page='.($nbpages-1).$options.'&sortfield='.$sortfield.'&sortorder='.$sortorder.'">'.$nbpages.'</a>';
|
$pagelist.= '<li><a href="'.$file.'?page='.($nbpages-1).$options.'&sortfield='.$sortfield.'&sortorder='.$sortorder.'">'.$nbpages.'</a></li>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$pagelist.= $langs->trans('Page').' '.($page+1);
|
$pagelist.= ($page+1).'</ul></div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print_fleche_navigation($page,$file,$options,$nextpage,$pagelist);
|
print_fleche_navigation($page,$file,$options,$nextpage,$pagelist);
|
||||||
@@ -2883,17 +2884,19 @@ function print_fleche_navigation($page,$file,$options='',$nextpage=0,$betweenarr
|
|||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
|
print '<div class="pagination"><ul>';
|
||||||
if ($page > 0)
|
if ($page > 0)
|
||||||
{
|
{
|
||||||
if (empty($conf->dol_use_jmobile)) print '<a href="'.$file.'?page='.($page-1).$options.'">'.img_previous($langs->trans("Previous")).'</a>';
|
if (empty($conf->dol_use_jmobile)) print '<li><a href="'.$file.'?page='.($page-1).$options.'"><</a></li>';
|
||||||
else print '<a data-role="button" data-icon="arrow-l" data-iconpos="left" href="'.$file.'?page='.($page-1).$options.'">'.$langs->trans("Previous").'</a>';
|
else print '<li><a data-role="button" data-icon="arrow-l" data-iconpos="left" href="'.$file.'?page='.($page-1).$options.'">'.$langs->trans("Previous").'</a></li>';
|
||||||
}
|
}
|
||||||
if ($betweenarrows) print ($page > 0?' ':'').$betweenarrows.($nextpage>0?' ':'');
|
if ($betweenarrows) print ($page > 0?' ':'').$betweenarrows.($nextpage>0?' ':'');
|
||||||
if ($nextpage > 0)
|
if ($nextpage > 0)
|
||||||
{
|
{
|
||||||
if (empty($conf->dol_use_jmobile)) print '<a href="'.$file.'?page='.($page+1).$options.'">'.img_next($langs->trans("Next")).'</a>';
|
if (empty($conf->dol_use_jmobile)) print '<li><a href="'.$file.'?page='.($page+1).$options.'">></a></li>';
|
||||||
else print '<a data-role="button" data-icon="arrow-r" data-iconpos="right" href="'.$file.'?page='.($page+1).$options.'">'.$langs->trans("Next").'</a>';
|
else print '<li><a data-role="button" data-icon="arrow-r" data-iconpos="right" href="'.$file.'?page='.($page+1).$options.'">'.$langs->trans("Next").'</a></li>';
|
||||||
}
|
}
|
||||||
|
print '</ul></div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1559,7 +1559,7 @@ span.butAction, span.butActionDelete {
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Preapre for bootstrap look
|
/* Prepare for bootstrap look
|
||||||
.butAction, .butActionDelete, .butActionRefused {
|
.butAction, .butActionDelete, .butActionRefused {
|
||||||
border-color: #c5c5c5;
|
border-color: #c5c5c5;
|
||||||
border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25);
|
border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25);
|
||||||
@@ -1835,6 +1835,78 @@ table.liste td {
|
|||||||
.tagtr, .table-border-row { display: table-row; }
|
.tagtr, .table-border-row { display: table-row; }
|
||||||
.tagtd, .table-border-col, .table-key-border-col, .table-val-border-col { display: table-cell; }
|
.tagtd, .table-border-col, .table-key-border-col, .table-val-border-col { display: table-cell; }
|
||||||
|
|
||||||
|
/* Pagination */
|
||||||
|
div.pagination ul, div.pagination li
|
||||||
|
{
|
||||||
|
list-style: none;
|
||||||
|
display: inline-block;
|
||||||
|
padding-left: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.pagination li {
|
||||||
|
display: inline;
|
||||||
|
}
|
||||||
|
.pagination {
|
||||||
|
display: inline-block;
|
||||||
|
padding-left: 0;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.pagination li a,
|
||||||
|
div.pagination li span {
|
||||||
|
position: relative;
|
||||||
|
float: left;
|
||||||
|
padding: 6px 12px;
|
||||||
|
margin-left: -1px;
|
||||||
|
line-height: 1.42857143;
|
||||||
|
color: #337ab7;
|
||||||
|
text-decoration: none;
|
||||||
|
background-color: #fff;
|
||||||
|
border: 1px solid #ddd;
|
||||||
|
}
|
||||||
|
div.pagination li:first-child a,
|
||||||
|
div.pagination li:first-child span {
|
||||||
|
margin-left: 0;
|
||||||
|
border-top-left-radius: 4px;
|
||||||
|
border-bottom-left-radius: 4px;
|
||||||
|
}
|
||||||
|
div.pagination li:last-child a,
|
||||||
|
div.pagination li:last-child span {
|
||||||
|
border-top-right-radius: 4px;
|
||||||
|
border-bottom-right-radius: 4px;
|
||||||
|
}
|
||||||
|
div.pagination li a:hover,
|
||||||
|
div.pagination li span:hover,
|
||||||
|
div.pagination li a:focus,
|
||||||
|
div.pagination li span:focus {
|
||||||
|
color: #23527c;
|
||||||
|
background-color: #eee;
|
||||||
|
border-color: #ddd;
|
||||||
|
}
|
||||||
|
div.pagination li .active a,
|
||||||
|
div.pagination li .active span,
|
||||||
|
div.pagination li .active a:hover,
|
||||||
|
div.pagination li .active span:hover,
|
||||||
|
div.pagination li .active a:focus,
|
||||||
|
div.pagination li .active span:focus {
|
||||||
|
z-index: 2;
|
||||||
|
color: #fff;
|
||||||
|
cursor: default;
|
||||||
|
background-color: <?php $colorbackhmenu1 ?>;
|
||||||
|
border-color: #337ab7;
|
||||||
|
}
|
||||||
|
div.pagination .disabled span,
|
||||||
|
div.pagination .disabled span:hover,
|
||||||
|
div.pagination .disabled span:focus,
|
||||||
|
div.pagination .disabled a,
|
||||||
|
div.pagination .disabled a:hover,
|
||||||
|
div.pagination .disabled a:focus {
|
||||||
|
color: #777;
|
||||||
|
cursor: not-allowed;
|
||||||
|
background-color: #fff;
|
||||||
|
border-color: #ddd;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Prepare to remove class pair - impair
|
/* Prepare to remove class pair - impair
|
||||||
.noborder > tbody > tr:nth-child(even) td {
|
.noborder > tbody > tr:nth-child(even) td {
|
||||||
|
|||||||
Reference in New Issue
Block a user