Changeset - b0046f7ebbb8
[Not reviewed]
default
0 6 0
Branko Majic (branko) - 13 years ago 2013-02-24 11:29:50
branko@majic.rs
Added pagination to list pages. Added the measures link.
6 files changed with 28 insertions and 9 deletions:
0 comments (0 inline, 0 general)
djangoshaker/templates/djangoshaker/brand_list.html
Show inline comments
 
@@ -11,10 +11,13 @@
 
{% if brands %}
 
<ul class="unstyled">
 
  {% for brand in brands %}
 
  <li class="item">{% html_link 'brand' brand.name brand.id "btn btn-link btn-fixed" %}</li>
 
  {% endfor %}
 
</ul>
 
{% include "djangoshaker/pagination.html" %}
 
{% else %}
 
<div>No recipes available.</div>
 
{% endif %}
 

	
 
{% endblock %}
 

	
djangoshaker/templates/djangoshaker/ingredient_list.html
Show inline comments
 
@@ -11,10 +11,13 @@
 
{% if ingredients %}
 
<ul class="unstyled">
 
  {% for ingredient in ingredients %}
 
  <li class="item">{% html_link 'ingredient' ingredient.name ingredient.id "btn btn-link btn-fixed" %}</li>
 
  {% endfor %}
 
</ul>
 
{% include "djangoshaker/pagination.html" %}
 
{% else %}
 
<div>No ingredients available.</div>
 
{% endif %}
 

	
 
{% endblock %}
 

	
djangoshaker/templates/djangoshaker/measure_list.html
Show inline comments
 
{% extends "djangoshaker/template.html" %}
 

	
 
{% load djangoshaker_html_helpers %}
 

	
 
{% block title %}Django Shaker - Measure List {% endblock %}
 

	
 
{% block header_title %}Measure List{% endblock %}
 

	
 
{% block content %}
 

	
 
<ul class="listing">
 
<h1>Measures</h1>
 

	
 
{% if measures %}
 
<ul class="unstyled">
 
  {% for measure in measures %}
 
  <li class="item">{% html_link 'measure' measure measure.id "listing_link" %}</li>
 
  {% endfor %}
 
</ul>
 
{% include "djangoshaker/pagination.html" %}
 
{% else %}
 
<div>No measures available.</div>
 
{% endif %}
 

	
 
{% endblock %}
 

	
djangoshaker/templates/djangoshaker/recipe_list.html
Show inline comments
 
@@ -11,10 +11,13 @@
 
{% if recipes %}
 
<ul class="unstyled">
 
  {% for recipe in recipes %}
 
  <li class="item">{% html_link 'recipe' recipe.name recipe.id "btn btn-link btn-fixed" %}</li>
 
  {% endfor %}
 
</ul>
 
{% include "djangoshaker/pagination.html" %}
 
{% else %}
 
<div>No recipes available.</div>
 
{% endif %}
 

	
 
{% endblock %}
 

	
djangoshaker/templates/djangoshaker/template.html
Show inline comments
 
@@ -30,13 +30,14 @@
 
          <div class="nav-collapse collapse">
 
              {% block header %}
 
            <ul class="nav">
 
              <li class="{% active_link 'index' %}"><a href="{% url index %}"><i class="icon-home icon-white"></i> Main Page</a></li>
 
              <li class="{% active_link 'recipe_list' %}"><a href="{% url recipe_list %}"><i class="icon-glass icon-white"></i> Recipes</a></li>
 
              <li class="{% active_link 'brand_list' %}"><a href="{% url brand_list %}"><i class="icon-flag icon-white"></i> Brands</a></li>
 
              <li class="{% active_link 'ingredient_list' %}"><a href="{% url ingredient_list %}"><i class="icon-tint icon-white"></i> Ingredients</a></li>
 
              <li class="{% active_link 'ingredient_list' %}"><a href="{% url ingredient_list %}"><i class="icon-shopping-cart icon-white"></i> Ingredients</a></li>
 
              <li class="{% active_link 'measure_list' %}"><a href="{% url measure_list %}"><i class="icon-tint icon-white"></i> Measures</a></li>
 
              <li class="{% active_link 'user' %}"><a href="{% url user %}"><i class="icon-user icon-white"></i> My Page</a></li>
 
            </ul>
 
              {% endblock %}
 
          </div>
 
        </div>
 
      </div>
djangoshaker/urls.py
Show inline comments
 
@@ -7,34 +7,38 @@ urlpatterns = patterns(
 
    'djangoshaker.views',
 
    url(r'^$', IndexView.as_view(), name="index"),
 

	
 
    url(r'^recipe/$',
 
        ListView.as_view(queryset = Recipe.objects.filter(published = True).order_by("name"),
 
                         template_name = 'djangoshaker/recipe_list.html',
 
                         context_object_name = 'recipes'),
 
                         context_object_name = 'recipes',
 
                         paginate_by = 15),
 
        name='recipe_list'),
 

	
 
    url(r'^brand/$',
 
        ListView.as_view(model = Brand,
 
                         queryset = Brand.objects.all().order_by("name"),
 
                         template_name = 'djangoshaker/brand_list.html',
 
                         context_object_name = 'brands'),
 
                         context_object_name = 'brands',
 
                         paginate_by = 15),
 
        name="brand_list"),
 

	
 
    url(r'^ingredient/$',
 
    url(r'^ingredients$',
 
        ListView.as_view(model = Ingredient,
 
                         queryset = Ingredient.objects.all().order_by("name"),
 
                         template_name = 'djangoshaker/ingredient_list.html',
 
                         context_object_name = 'ingredients'),
 
                         context_object_name = 'ingredients',
 
                         paginate_by = 15),
 
        name="ingredient_list"),
 

	
 
    url(r'^measure/$',
 
        ListView.as_view(model = Measure,
 
                         queryset = Measure.objects.all().order_by("name"),
 
                         template_name = 'djangoshaker/measure_list.html',
 
                         context_object_name = 'measures'),
 
                         context_object_name = 'measures',
 
                         paginate_by = 15),
 
        name="measure_list"),
 
                       
 
    url(r'^brand/(?P<pk>\d+)$',
 
        DetailView.as_view(model = Brand,
 
                           template_name = 'djangoshaker/brand.html'),
 
        name="brand"),
0 comments (0 inline, 0 general)