Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added top navigation

added ability to *also* have a top pagination (useful when you have a looong list of items)
  • Loading branch information...
commit 53366ac68c58264c4df7edcea13b2efdc33bfc25 1 parent c45089c
Jeremy j0k3r authored
2  README.md
View
@@ -78,6 +78,8 @@ all:
site: Your project name
# if you want top links to fieldset legend in new/edit page (like "Admin & Content" in the edit screenshot)
top_link_to_fieldset: true
+ # if you *also* want to display the pagination on top of the list
+ display_top_pagination: true
```
In ``apps/backend/config/settings.yml``
1  config/app.yml
View
@@ -14,3 +14,4 @@ all:
logout: true
logout_route: @sf_guard_signout
top_link_to_fieldset: true
+ display_top_pagination: true
18 data/generator/sfDoctrineModule/twitter/template/templates/_list.php
View
@@ -7,6 +7,10 @@
<?php endif; ?>
<div class="sf_admin_list">
+ <?php if(sfTwitterBootstrap::getProperty('display_top_pagination', false)): ?>
+ [?php include_partial('<?php echo $this->getModuleName() ?>/pagination', array('pager' => $pager)) ?]
+ <?php endif; ?>
+
<table class="sortTable bordered-table zebra-striped mbn">
<thead>
<tr>
@@ -44,19 +48,7 @@
</tbody>
</table>
- [?php if ($pager->getNbResults()): ?]
- <div class="cf">
- <div class="table-result fLeft">
- [?php echo format_number_choice('[0] no result|[1] 1 result|(1,+Inf] %1% results', array('%1%' => $pager->getNbResults()), $pager->getNbResults(), 'sf_admin') ?]
- [?php if ($pager->haveToPaginate()): ?]
- [?php echo __('(page %%page%%/%%nb_pages%%)', array('%%page%%' => $pager->getPage(), '%%nb_pages%%' => $pager->getLastPage()), 'sf_admin') ?]
- [?php endif; ?]
- </div>
- [?php if ($pager->haveToPaginate()): ?]
- [?php include_partial('<?php echo $this->getModuleName() ?>/pagination', array('pager' => $pager)) ?]
- [?php endif; ?]
- </div>
- [?php endif; ?]
+ [?php include_partial('<?php echo $this->getModuleName() ?>/pagination', array('pager' => $pager)) ?]
</div>
<script type="text/javascript">
67 data/generator/sfDoctrineModule/twitter/template/templates/_pagination.php
View
@@ -1,27 +1,46 @@
+ [?php if ($pager->getNbResults()): ?]
+
+ <div class="cf">
+ <div class="table-result fLeft">
+ [?php echo format_number_choice('[0] no result|[1] 1 result|(1,+Inf] %1% results', array('%1%' => $pager->getNbResults()), $pager->getNbResults(), 'sf_admin') ?]
+ [?php if ($pager->haveToPaginate()): ?]
+ [?php echo __('(page %%page%%/%%nb_pages%%)', array('%%page%%' => $pager->getPage(), '%%nb_pages%%' => $pager->getLastPage()), 'sf_admin') ?]
+ [?php endif; ?]
+ </div>
+
+ [?php if ($pager->haveToPaginate()): ?]
+
+ <div class="pagination fRight mts">
+ <ul>
+ <li class="first [?php if (1 == $pager->getPage()): ?]disabled[?php endif; ?]">
+ <a title="[?php echo __('First page', array(), 'sf_admin') ?]" href="[?php echo url_for('@<?php echo $this->getUrlForAction('list') ?>') ?]?page=1">&lArr;</a>
+ </li>
+ <li class="prev [?php if (1 == $pager->getPage()): ?]disabled[?php endif; ?]">
+ <a title="[?php echo __('Previous page', array(), 'sf_admin') ?]" href="[?php echo url_for('@<?php echo $this->getUrlForAction('list') ?>') ?]?page=[?php echo $pager->getPreviousPage() ?]">&larr;</a>
+ </li>
+
+ [?php foreach ($pager->getLinks() as $page): ?]
+ [?php if ($page == $pager->getPage()): ?]
+ <li class="active"><a href="#">[?php echo $page ?]</a></li>
+ [?php else: ?]
+ <li><a href="[?php echo url_for('@<?php echo $this->getUrlForAction('list') ?>') ?]?page=[?php echo $page ?]">[?php echo $page ?]</a></li>
+ [?php endif; ?]
+ [?php endforeach; ?]
+
+ <li class="next [?php if ($pager->getLastPage() == $pager->getPage()): ?]disabled[?php endif; ?]">
+ <a title="[?php echo __('Next page', array(), 'sf_admin') ?]" href="[?php echo url_for('@<?php echo $this->getUrlForAction('list') ?>') ?]?page=[?php echo $pager->getNextPage() ?]">&rarr;</a>
+ </li>
+ <li class="last [?php if ($pager->getLastPage() == $pager->getPage()): ?]disabled[?php endif; ?]">
+ <a title="[?php echo __('Last page', array(), 'sf_admin') ?]" href="[?php echo url_for('@<?php echo $this->getUrlForAction('list') ?>') ?]?page=[?php echo $pager->getLastPage() ?]">&rArr;</a>
+ </li>
+ </ul>
+ </div>
-<div class="pagination fRight mts">
- <ul>
- <li class="first [?php if (1 == $pager->getPage()): ?]disabled[?php endif; ?]">
- <a title="[?php echo __('First page', array(), 'sf_admin') ?]" href="[?php echo url_for('@<?php echo $this->getUrlForAction('list') ?>') ?]?page=1">&lArr;</a>
- </li>
- <li class="prev [?php if (1 == $pager->getPage()): ?]disabled[?php endif; ?]">
- <a title="[?php echo __('Previous page', array(), 'sf_admin') ?]" href="[?php echo url_for('@<?php echo $this->getUrlForAction('list') ?>') ?]?page=[?php echo $pager->getPreviousPage() ?]">&larr;</a>
- </li>
-
- [?php foreach ($pager->getLinks() as $page): ?]
- [?php if ($page == $pager->getPage()): ?]
- <li class="active"><a href="#">[?php echo $page ?]</a></li>
- [?php else: ?]
- <li><a href="[?php echo url_for('@<?php echo $this->getUrlForAction('list') ?>') ?]?page=[?php echo $page ?]">[?php echo $page ?]</a></li>
[?php endif; ?]
- [?php endforeach; ?]
-
- <li class="next [?php if ($pager->getLastPage() == $pager->getPage()): ?]disabled[?php endif; ?]">
- <a title="[?php echo __('Next page', array(), 'sf_admin') ?]" href="[?php echo url_for('@<?php echo $this->getUrlForAction('list') ?>') ?]?page=[?php echo $pager->getNextPage() ?]">&rarr;</a>
- </li>
- <li class="last [?php if ($pager->getLastPage() == $pager->getPage()): ?]disabled[?php endif; ?]">
- <a title="[?php echo __('Last page', array(), 'sf_admin') ?]" href="[?php echo url_for('@<?php echo $this->getUrlForAction('list') ?>') ?]?page=[?php echo $pager->getLastPage() ?]">&rArr;</a>
- </li>
- </ul>
-</div>
+
+ </div>
+
+ [?php endif; ?]
+
+
18 data/generator/sfPropelModule/twitter/template/templates/_list.php
View
@@ -7,6 +7,10 @@
<?php endif; ?>
<div class="sf_admin_list">
+ <?php if(sfTwitterBootstrap::getProperty('display_top_pagination', false)): ?>
+ [?php include_partial('<?php echo $this->getModuleName() ?>/pagination', array('pager' => $pager)) ?]
+ <?php endif; ?>
+
<table class="sortTable bordered-table zebra-striped mbn">
<thead>
<tr>
@@ -44,19 +48,7 @@
</tbody>
</table>
- [?php if ($pager->getNbResults()): ?]
- <div class="cf">
- <div class="table-result fLeft">
- [?php echo format_number_choice('[0] no result|[1] 1 result|(1,+Inf] %1% results', array('%1%' => $pager->getNbResults()), $pager->getNbResults(), 'sf_admin') ?]
- [?php if ($pager->haveToPaginate()): ?]
- [?php echo __('(page %%page%%/%%nb_pages%%)', array('%%page%%' => $pager->getPage(), '%%nb_pages%%' => $pager->getLastPage()), 'sf_admin') ?]
- [?php endif; ?]
- </div>
- [?php if ($pager->haveToPaginate()): ?]
- [?php include_partial('<?php echo $this->getModuleName() ?>/pagination', array('pager' => $pager)) ?]
- [?php endif; ?]
- </div>
- [?php endif; ?]
+ [?php include_partial('<?php echo $this->getModuleName() ?>/pagination', array('pager' => $pager)) ?]
</div>
<script type="text/javascript">
67 data/generator/sfPropelModule/twitter/template/templates/_pagination.php
View
@@ -1,27 +1,46 @@
+ [?php if ($pager->getNbResults()): ?]
+
+ <div class="cf">
+ <div class="table-result fLeft">
+ [?php echo format_number_choice('[0] no result|[1] 1 result|(1,+Inf] %1% results', array('%1%' => $pager->getNbResults()), $pager->getNbResults(), 'sf_admin') ?]
+ [?php if ($pager->haveToPaginate()): ?]
+ [?php echo __('(page %%page%%/%%nb_pages%%)', array('%%page%%' => $pager->getPage(), '%%nb_pages%%' => $pager->getLastPage()), 'sf_admin') ?]
+ [?php endif; ?]
+ </div>
+
+ [?php if ($pager->haveToPaginate()): ?]
+
+ <div class="pagination fRight mts">
+ <ul>
+ <li class="first [?php if (1 == $pager->getPage()): ?]disabled[?php endif; ?]">
+ <a title="[?php echo __('First page', array(), 'sf_admin') ?]" href="[?php echo url_for('@<?php echo $this->getUrlForAction('list') ?>') ?]?page=1">&lArr;</a>
+ </li>
+ <li class="prev [?php if (1 == $pager->getPage()): ?]disabled[?php endif; ?]">
+ <a title="[?php echo __('Previous page', array(), 'sf_admin') ?]" href="[?php echo url_for('@<?php echo $this->getUrlForAction('list') ?>') ?]?page=[?php echo $pager->getPreviousPage() ?]">&larr;</a>
+ </li>
+
+ [?php foreach ($pager->getLinks() as $page): ?]
+ [?php if ($page == $pager->getPage()): ?]
+ <li class="active"><a href="#">[?php echo $page ?]</a></li>
+ [?php else: ?]
+ <li><a href="[?php echo url_for('@<?php echo $this->getUrlForAction('list') ?>') ?]?page=[?php echo $page ?]">[?php echo $page ?]</a></li>
+ [?php endif; ?]
+ [?php endforeach; ?]
+
+ <li class="next [?php if ($pager->getLastPage() == $pager->getPage()): ?]disabled[?php endif; ?]">
+ <a title="[?php echo __('Next page', array(), 'sf_admin') ?]" href="[?php echo url_for('@<?php echo $this->getUrlForAction('list') ?>') ?]?page=[?php echo $pager->getNextPage() ?]">&rarr;</a>
+ </li>
+ <li class="last [?php if ($pager->getLastPage() == $pager->getPage()): ?]disabled[?php endif; ?]">
+ <a title="[?php echo __('Last page', array(), 'sf_admin') ?]" href="[?php echo url_for('@<?php echo $this->getUrlForAction('list') ?>') ?]?page=[?php echo $pager->getLastPage() ?]">&rArr;</a>
+ </li>
+ </ul>
+ </div>
-<div class="pagination fRight mts">
- <ul>
- <li class="first [?php if (1 == $pager->getPage()): ?]disabled[?php endif; ?]">
- <a title="[?php echo __('First page', array(), 'sf_admin') ?]" href="[?php echo url_for('@<?php echo $this->getUrlForAction('list') ?>') ?]?page=1">&lArr;</a>
- </li>
- <li class="prev [?php if (1 == $pager->getPage()): ?]disabled[?php endif; ?]">
- <a title="[?php echo __('Previous page', array(), 'sf_admin') ?]" href="[?php echo url_for('@<?php echo $this->getUrlForAction('list') ?>') ?]?page=[?php echo $pager->getPreviousPage() ?]">&larr;</a>
- </li>
-
- [?php foreach ($pager->getLinks() as $page): ?]
- [?php if ($page == $pager->getPage()): ?]
- <li class="active"><a href="#">[?php echo $page ?]</a></li>
- [?php else: ?]
- <li><a href="[?php echo url_for('@<?php echo $this->getUrlForAction('list') ?>') ?]?page=[?php echo $page ?]">[?php echo $page ?]</a></li>
[?php endif; ?]
- [?php endforeach; ?]
-
- <li class="next [?php if ($pager->getLastPage() == $pager->getPage()): ?]disabled[?php endif; ?]">
- <a title="[?php echo __('Next page', array(), 'sf_admin') ?]" href="[?php echo url_for('@<?php echo $this->getUrlForAction('list') ?>') ?]?page=[?php echo $pager->getNextPage() ?]">&rarr;</a>
- </li>
- <li class="last [?php if ($pager->getLastPage() == $pager->getPage()): ?]disabled[?php endif; ?]">
- <a title="[?php echo __('Last page', array(), 'sf_admin') ?]" href="[?php echo url_for('@<?php echo $this->getUrlForAction('list') ?>') ?]?page=[?php echo $pager->getLastPage() ?]">&rArr;</a>
- </li>
- </ul>
-</div>
+
+ </div>
+
+ [?php endif; ?]
+
+
Please sign in to comment.
Something went wrong with that request. Please try again.