Skip to content

Commit

Permalink
Merge pull request #1134 from akvo/1120_sorting
Browse files Browse the repository at this point in the history
[#1120] Removed from updates and orgs lists
  • Loading branch information
kardan committed Feb 19, 2015
2 parents 7c32689 + 46b82c5 commit f72b25e
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 24 deletions.
6 changes: 2 additions & 4 deletions akvo/templates/myrsr/my_projects.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,9 @@ <h4 class="media-heading">{{ project.title }}</h4>
{% endfor %}
</table>
</div>
<div class="container">
<div class="row center-text">
<div class="">
<p>Viewing {{ page.start_index }} - {{ page.end_index }} of {{ paginator.count }} projects</p>
{% include 'navigation/pagination.html' %}
</div>
{% include 'navigation/pagination-sort.html' %}
{% else %}
<p class="noItem text-center col-sm-6 col-sm-offset-3">{% trans "You can't see any projects yet." %}</p>
{% if not organisations %}
Expand Down
41 changes: 41 additions & 0 deletions akvo/templates/navigation/pagination-sort.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{% load i18n %}

<div class="row center-text paginationWrap">
<div class="col-md-8">
<ul class="pagination">
{% if page.has_previous %}
<li><a href="?page={{ page.previous_page_number }}{{ q }}">&laquo;</a></li>
{% else %}
<li class="disabled"><span>&laquo;</span></li>
{% endif %}
{% for page_number in page_range %}
{% if not page_number == '...' %}
<li {% if page_number == page.number %}class="active"{% endif %}><a href="?page={{ page_number }}{{ q }}">{{ page_number }}</a></li>
{% else %}
<li class="disabled"><span>{{ page_number }}</span></li>
{% endif %}
{% endfor %}
{% if page.has_next %}
<li><a href="?page={{ page.next_page_number }}{{ q }} ">&raquo;</a></li>
{% else %}
<li class="disabled"><span>&raquo;</span></li>
{% endif %}
</ul>
</div>
<div class="sortList col-md-4">
<div class="dropdown">
<button class="btn btn-primary dropdown-toggle" type="button" id="sortByButton" data-toggle="dropdown" aria-expanded="true">
{% trans "Sort by" %}
<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1" id="sortByDropdown">
<li role="presentation"{% if sorting = "-last_modified_at" %} class="disabled"{% endif %}><a role="menuitem" tabindex="-1" param="-last_modified_at">{% trans "Latest updated" %}</a></li>
<li role="presentation"{% if sorting = "last_modified_at" %} class="disabled"{% endif %}><a role="menuitem" tabindex="-1" param="last_modified_at">{% trans "Oldest updated" %}</a></li>
<li role="presentation"{% if sorting = "title" %} class="disabled"{% endif %}><a role="menuitem" tabindex="-1" param="title">{% trans "Title (A-Z)" %}</a></li>
<li role="presentation"{% if sorting = "-title" %} class="disabled"{% endif %}><a role="menuitem" tabindex="-1" param="-title">{% trans "Title (Z-A)" %}</a></li>
<li role="presentation"{% if sorting = "budget" %} class="disabled"{% endif %}><a role="menuitem" tabindex="-1" param="budget">{% trans "Total budget (low-high)" %}</a></li>
<li role="presentation"{% if sorting = "-budget" %} class="disabled"{% endif %}><a role="menuitem" tabindex="-1" param="-budget">{% trans "Total budget (high-low)" %}</a></li>
</ul>
</div>
</div>
</div>
18 changes: 0 additions & 18 deletions akvo/templates/navigation/pagination.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{% load i18n %}

<div class="row center-text paginationWrap">
<div class="col-md-8">
<ul class="pagination">
{% if page.has_previous %}
<li><a href="?page={{ page.previous_page_number }}{{ q }}">&laquo;</a></li>
Expand All @@ -21,21 +20,4 @@
<li class="disabled"><span>&raquo;</span></li>
{% endif %}
</ul>
</div>
<div class="sortList col-md-4">
<div class="dropdown">
<button class="btn btn-primary dropdown-toggle" type="button" id="sortByButton" data-toggle="dropdown" aria-expanded="true">
{% trans "Sort by" %}
<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1" id="sortByDropdown">
<li role="presentation"{% if sorting = "-last_modified_at" %} class="disabled"{% endif %}><a role="menuitem" tabindex="-1" param="-last_modified_at">{% trans "Latest updated" %}</a></li>
<li role="presentation"{% if sorting = "last_modified_at" %} class="disabled"{% endif %}><a role="menuitem" tabindex="-1" param="last_modified_at">{% trans "Oldest updated" %}</a></li>
<li role="presentation"{% if sorting = "title" %} class="disabled"{% endif %}><a role="menuitem" tabindex="-1" param="title">{% trans "Title (A-Z)" %}</a></li>
<li role="presentation"{% if sorting = "-title" %} class="disabled"{% endif %}><a role="menuitem" tabindex="-1" param="-title">{% trans "Title (Z-A)" %}</a></li>
<li role="presentation"{% if sorting = "budget" %} class="disabled"{% endif %}><a role="menuitem" tabindex="-1" param="budget">{% trans "Total budget (low-high)" %}</a></li>
<li role="presentation"{% if sorting = "-budget" %} class="disabled"{% endif %}><a role="menuitem" tabindex="-1" param="-budget">{% trans "Total budget (high-low)" %}</a></li>
</ul>
</div>
</div>
</div>
4 changes: 2 additions & 2 deletions akvo/templates/project_directory.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
<div class="row center-text">
<p class="verticalPadding emTxt">Viewing {{ page.start_index }} - {{ page.end_index }} of {{ paginator.count }} projects</p>
</div>
{% include 'navigation/pagination.html' %}
{% include 'navigation/pagination-sort.html' %}

</div>

Expand Down Expand Up @@ -125,7 +125,7 @@ <h4 class="detailedInfo">{% trans "Finance" %}</h4>
</ul>
</section>
<div class="container">
{% include 'navigation/pagination.html' %}
{% include 'navigation/pagination-sort.html' %}
</div>

{% endblock %}
Expand Down

0 comments on commit f72b25e

Please sign in to comment.