Changeset - 421d2a0bc61b
[Not reviewed]
tip default
0 2 0
Branko Majic (branko) - 13 years ago 2013-02-24 17:25:53
branko@majic.rs
Always show the headings on user page. Show pagination _only_ if there's at least one page available.
2 files changed with 5 insertions and 1 deletions:
0 comments (0 inline, 0 general)
djangoshaker/templates/djangoshaker/pagination.html
Show inline comments
 
{% if page_obj.number %}
 
<div class="pagination">
 
  <ul>
 
    {% if page_obj.has_previous %}
 
    <li><a href="?{{page_param|default:"page"}}={{page_obj.previous_page_number}}{% if extra_param %}&{{extra_param}}{% endif %}">Prev</a></li>
 
    {% else %}
 
    <li class="disabled"><span>Prev</span></li>
 
    {% endif %}
 
    <li class="active"><span>Page {{page_obj.number}} of {{page_obj.paginator.num_pages}}</span></li>
 
    {% if page_obj.has_next %}
 
    <li><a href="?{{page_param|default:"page"}}={{page_obj.next_page_number}}{% if extra_param %}&{{extra_param}}{% endif %}">Next</a></li>
 
    {% else %}
 
    <li class="disabled"><span>Next</span></li>
 
    {% endif %}
 
  </ul>
 
</div>
 
{% endif %}
 
\ No newline at end of file
djangoshaker/templates/djangoshaker/user.html
Show inline comments
 
{% extends "djangoshaker/template.html" %}
 

	
 
{% load djangoshaker_html_helpers %}
 

	
 
{% block content %}
 
<div class="row">
 

	
 
  <div class="span6">  
 
    <h1>Your Drinks</h1>
 
    <div>This is a list of drinks you can make with the ingredients you have.</div>
 
{% if available_recipes %}
 
<h1>Your Drinks</h1>
 
<ul class="unstyled">
 
  {% for recipe in available_recipes %}
 
  <li>{% html_link 'recipe' recipe.name recipe.id "btn btn-link" %}</li>
 
  {% endfor %}
 
</ul>
 
{% include "djangoshaker/pagination.html" with page_obj=available_recipes page_param="recipe_page" extra_param=ingredient_page_param %}
 
{% endif %}
 
  </div>
 

	
 
  <div class="span6">
 
<h1>Your Ingredients</h1>
 
    <div>This is a list of ingredients you have.</div>
 
{% if user_ingredients %}
 
{% include "djangoshaker/ingredient_selection.html" with ingredients=user_ingredients %}
 
{% endif %}
 
{% include "djangoshaker/pagination.html" with page_obj=user_ingredients page_param="ingredient_page" extra_param=recipe_page_param %}
 
<a class="btn" href="{% url user_ingredient_list %}">Show all ingredients.</a>
 

	
 
  </div>
 
</div>
 

	
 
{% endblock %}
 

	
0 comments (0 inline, 0 general)