Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use navigation partial instead of inheritance
The styling should be determined by the package view
- Loading branch information
Showing
5 changed files
with
115 additions
and
148 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
105 changes: 42 additions & 63 deletions
105
client/jqadm/templates/common/partials/navigation-default.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,45 @@ | ||
<?php | ||
|
||
/** | ||
* @license LGPLv3, http://opensource.org/licenses/LGPL-3.0 | ||
* @copyright Aimeos (aimeos.org), 2015 | ||
*/ | ||
|
||
$enc = $this->encoder(); | ||
|
||
$target = $this->config( 'client/jqadm/url/search/target' ); | ||
$controller = $this->config( 'client/jqadm/url/search/controller', 'jqadm' ); | ||
$action = $this->config( 'client/jqadm/url/search/action', 'search' ); | ||
$config = $this->config( 'client/jqadm/url/search/config', array() ); | ||
|
||
$params = $this->param(); | ||
|
||
$total = $this->get( 'total', 0 ); | ||
$offset = max( $this->param( 'page/offset', 0 ), 0 ); | ||
$limit = max( $this->param( 'page/limit', 100 ), 1 ); | ||
|
||
$first = ( $offset > 0 ? 0 : null ); | ||
$prev = ( $offset - $limit >= 0 ? $offset - $limit : null ); | ||
$next = ( $offset + $limit < $total ? $offset + $limit : null ); | ||
$last = ( ((int) ($total / $limit)) * $limit > $offset ? ((int) ($total / $limit)) * $limit : null ); | ||
|
||
$pageCurrent = floor( $offset / $limit ) + 1; | ||
$pageTotal = ( $total != 0 ? ceil( $total / $limit ) : 1 ); | ||
|
||
?> | ||
<nav class="search-navigation"> | ||
<ul class="pagination"> | ||
<li> | ||
<a href="<?php $params['page']['offset'] = $first; echo $enc->attr( $this->url( $target, $controller, $action, $params, array(), $config ) ); ?>" aria-label="<?php echo $enc->attr( $this->translate( 'client/jqadm', 'First' ) ); ?>"> | ||
<span class="glyphicon glyphicon-backward" aria-hidden="true"></span> | ||
</a> | ||
</li> | ||
<li> | ||
<a href="<?php $params['page']['offset'] = $prev; echo $enc->attr( $this->url( $target, $controller, $action, $params, array(), $config ) ); ?>" aria-label="<?php echo $enc->attr( $this->translate( 'client/jqadm', 'Previous' ) ); ?>"> | ||
<span class="glyphicon glyphicon-triangle-left" aria-hidden="true"></span> | ||
</a> | ||
</li> | ||
<li class="disabled"><?php echo $enc->html( sprintf( $this->translate( 'client/jqadm', 'Page %1$d of %2$d' ), $pageCurrent, $pageTotal ) ); ?></li> | ||
<li> | ||
<a href="<?php $params['page']['offset'] = $next; echo $enc->attr( $this->url( $target, $controller, $action, $params, array(), $config ) ); ?>" aria-label="<?php echo $enc->attr( $this->translate( 'client/jqadm', 'Next' ) ); ?>"> | ||
<span class="glyphicon glyphicon-triangle-right" aria-hidden="true"></span> | ||
</a> | ||
</li> | ||
<li> | ||
<a href="<?php $params['page']['offset'] = $last; echo $enc->attr( $this->url( $target, $controller, $action, $params, array(), $config ) ); ?>" aria-label="<?php echo $enc->attr( $this->translate( 'client/jqadm', 'Last' ) ); ?>"> | ||
<span class="glyphicon glyphicon-forward" aria-hidden="true"></span> | ||
<nav class="navbar navbar-default"> | ||
<div class="container-fluid"> | ||
<!-- Brand and toggle get grouped for better mobile display --> | ||
<div class="navbar-header"> | ||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false"> | ||
<span class="sr-only">Toggle navigation</span> | ||
<span class="icon-bar"></span> | ||
<span class="icon-bar"></span> | ||
<span class="icon-bar"></span> | ||
</button> | ||
<a class="navbar-brand" href="https://aimeos.org/update?type=<?php echo $this->get( 'type' ); ?>&version=<?php echo $this->get( 'version' ); ?>"> | ||
<img src="https://aimeos.org/check?type=<?php echo $this->get( 'type' ); ?>&version=<?php echo $this->get( 'version' ); ?>" title="Aimeos logo" /> | ||
</a> | ||
</li> | ||
</ul> | ||
<ul class="size"> | ||
<li class="dropdown"> | ||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><?php echo $limit; ?> <span class="caret"></span></a> | ||
<ul class="dropdown-menu"> | ||
<li><a href="<?php $params['page']['limit'] = 25; echo $enc->attr( $this->url( $target, $controller, $action, $params, array(), $config ) ); ?>">25</a></li> | ||
<li><a href="<?php $params['page']['limit'] = 50; echo $enc->attr( $this->url( $target, $controller, $action, $params, array(), $config ) ); ?>">50</a></li> | ||
<li><a href="<?php $params['page']['limit'] = 100; echo $enc->attr( $this->url( $target, $controller, $action, $params, array(), $config ) ); ?>">100</a></li> | ||
<li><a href="<?php $params['page']['limit'] = 200; echo $enc->attr( $this->url( $target, $controller, $action, $params, array(), $config ) ); ?>">200</a></li> | ||
<li><a href="<?php $params['page']['limit'] = 500; echo $enc->attr( $this->url( $target, $controller, $action, $params, array(), $config ) ); ?>">500</a></li> | ||
</div> | ||
|
||
<!-- Collect the nav links, forms, and other content for toggling --> | ||
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> | ||
<ul class="nav navbar-nav navbar-right"> | ||
<li class="dropdown"> | ||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Default <span class="caret"></span></a> | ||
<ul class="dropdown-menu"> | ||
<li><a href="#">Default</a></li> | ||
<li><a href="#">Unit test</a></li> | ||
<li><a href="#">Performance</a></li> | ||
</ul> | ||
</li> | ||
</ul> | ||
</li> | ||
</ul> | ||
<ul class="nav navbar-nav navbar-right"> | ||
<li class="dropdown"> | ||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">English <span class="caret"></span></a> | ||
<ul class="dropdown-menu"> | ||
<li><a href="#">English</a></li> | ||
<li><a href="#">French</a></li> | ||
<li><a href="#">German</a></li> | ||
</ul> | ||
</li> | ||
</ul> | ||
<ul class="nav navbar-nav navbar-right"> | ||
<li><a href="#">Expert mode</a></li> | ||
</ul> | ||
</div><!-- /.navbar-collapse --> | ||
</div><!-- /.container-fluid --> | ||
</nav> | ||
|
||
<?php echo $this->block()->get( 'jqadm_content' ); ?> |
66 changes: 66 additions & 0 deletions
66
client/jqadm/templates/common/partials/pagination-default.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<?php | ||
|
||
/** | ||
* @license LGPLv3, http://opensource.org/licenses/LGPL-3.0 | ||
* @copyright Aimeos (aimeos.org), 2015 | ||
*/ | ||
|
||
$enc = $this->encoder(); | ||
|
||
$target = $this->config( 'client/jqadm/url/search/target' ); | ||
$controller = $this->config( 'client/jqadm/url/search/controller', 'jqadm' ); | ||
$action = $this->config( 'client/jqadm/url/search/action', 'search' ); | ||
$config = $this->config( 'client/jqadm/url/search/config', array() ); | ||
|
||
$params = $this->param(); | ||
|
||
$total = $this->get( 'total', 0 ); | ||
$offset = max( $this->param( 'page/offset', 0 ), 0 ); | ||
$limit = max( $this->param( 'page/limit', 100 ), 1 ); | ||
|
||
$first = ( $offset > 0 ? 0 : null ); | ||
$prev = ( $offset - $limit >= 0 ? $offset - $limit : null ); | ||
$next = ( $offset + $limit < $total ? $offset + $limit : null ); | ||
$last = ( ((int) ($total / $limit)) * $limit > $offset ? ((int) ($total / $limit)) * $limit : null ); | ||
|
||
$pageCurrent = floor( $offset / $limit ) + 1; | ||
$pageTotal = ( $total != 0 ? ceil( $total / $limit ) : 1 ); | ||
|
||
?> | ||
<nav class="search-navigation"> | ||
<ul class="pagination"> | ||
<li> | ||
<a href="<?php $params['page']['offset'] = $first; echo $enc->attr( $this->url( $target, $controller, $action, $params, array(), $config ) ); ?>" aria-label="<?php echo $enc->attr( $this->translate( 'client/jqadm', 'First' ) ); ?>"> | ||
<span class="glyphicon glyphicon-backward" aria-hidden="true"></span> | ||
</a> | ||
</li> | ||
<li> | ||
<a href="<?php $params['page']['offset'] = $prev; echo $enc->attr( $this->url( $target, $controller, $action, $params, array(), $config ) ); ?>" aria-label="<?php echo $enc->attr( $this->translate( 'client/jqadm', 'Previous' ) ); ?>"> | ||
<span class="glyphicon glyphicon-triangle-left" aria-hidden="true"></span> | ||
</a> | ||
</li> | ||
<li class="disabled"><?php echo $enc->html( sprintf( $this->translate( 'client/jqadm', 'Page %1$d of %2$d' ), $pageCurrent, $pageTotal ) ); ?></li> | ||
<li> | ||
<a href="<?php $params['page']['offset'] = $next; echo $enc->attr( $this->url( $target, $controller, $action, $params, array(), $config ) ); ?>" aria-label="<?php echo $enc->attr( $this->translate( 'client/jqadm', 'Next' ) ); ?>"> | ||
<span class="glyphicon glyphicon-triangle-right" aria-hidden="true"></span> | ||
</a> | ||
</li> | ||
<li> | ||
<a href="<?php $params['page']['offset'] = $last; echo $enc->attr( $this->url( $target, $controller, $action, $params, array(), $config ) ); ?>" aria-label="<?php echo $enc->attr( $this->translate( 'client/jqadm', 'Last' ) ); ?>"> | ||
<span class="glyphicon glyphicon-forward" aria-hidden="true"></span> | ||
</a> | ||
</li> | ||
</ul> | ||
<ul class="size"> | ||
<li class="dropdown"> | ||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><?php echo $limit; ?> <span class="caret"></span></a> | ||
<ul class="dropdown-menu"> | ||
<li><a href="<?php $params['page']['limit'] = 25; echo $enc->attr( $this->url( $target, $controller, $action, $params, array(), $config ) ); ?>">25</a></li> | ||
<li><a href="<?php $params['page']['limit'] = 50; echo $enc->attr( $this->url( $target, $controller, $action, $params, array(), $config ) ); ?>">50</a></li> | ||
<li><a href="<?php $params['page']['limit'] = 100; echo $enc->attr( $this->url( $target, $controller, $action, $params, array(), $config ) ); ?>">100</a></li> | ||
<li><a href="<?php $params['page']['limit'] = 200; echo $enc->attr( $this->url( $target, $controller, $action, $params, array(), $config ) ); ?>">200</a></li> | ||
<li><a href="<?php $params['page']['limit'] = 500; echo $enc->attr( $this->url( $target, $controller, $action, $params, array(), $config ) ); ?>">500</a></li> | ||
</ul> | ||
</li> | ||
</ul> | ||
</nav> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters