Changeset - 6e11735c3a45
[Not reviewed]
default
0 6 0
Branko Majic (branko) - 13 years ago 2013-02-20 10:19:09
branko@majic.rs
Added some missing headings. Some small styling changes. The ingredient page now lists the recipes the ingredient is used in as well.
6 files changed with 18 insertions and 6 deletions:
0 comments (0 inline, 0 general)
djangoshaker/templates/djangoshaker/brand_list.html
Show inline comments
 
@@ -6,6 +6,8 @@
 

	
 
{% block content %}
 

	
 
<h1>Brands</h1>
 

	
 
{% if brands %}
 
<ul class="unstyled">
 
  {% for brand in brands %}
djangoshaker/templates/djangoshaker/index.html
Show inline comments
 
@@ -7,7 +7,7 @@
 
{% block content %}
 

	
 
{% if recipes_added %}
 
<h2 class="title_section">Recently added recipes</h2>
 
<h1 class="title_section">Recently added recipes</h1>
 
<ul class="unstyled">
 
  {% for recipe in recipes_added %}
 
  <li class="item">{% html_link 'recipe' recipe.name recipe.id "btn btn-link btn-fixed" %}</li>
 
@@ -16,7 +16,7 @@
 
{% endif %}
 

	
 
{% if recipes_modified %}
 
<h2 class="title_section">Recently modified recipes</h2>
 
<h1 class="title_section">Recently modified recipes</h1>
 
<ul class="unstyled">
 
  {% for recipe in recipes_modified %}
 
  <li class="item">{% html_link 'recipe' recipe.name recipe.id "btn btn-link btn-fixed" %}</li>
 
@@ -25,7 +25,7 @@
 
{% endif %}
 

	
 
{% if brands_added %}
 
<h2 class="title_section">Recently added brands</h2>
 
<h1 class="title_section">Recently added brands</h1>
 
<ul class="unstyled">
 
  {% for brand in brands_added %}
 
  <li class="item">{% html_link 'brand' brand.name brand.id "btn btn-link btn-fixed" %}</li>
 
@@ -34,7 +34,7 @@
 
{% endif %}
 

	
 
{% if brands_modified %}
 
<h2 class="title_section">Recently modified brands</h2>
 
<h1 class="title_section">Recently modified brands</h1>
 
<ul class="unstyled">
 
  {% for brand in brands_modified %}
 
  <li class="item">{% html_link 'brand' brand.name brand.id "btn btn-link btn-fixed" %}</li>
djangoshaker/templates/djangoshaker/ingredient.html
Show inline comments
 
@@ -24,6 +24,15 @@
 
</ul>
 
{% endif %}
 

	
 
{% if ingredient.recipeingredient_set.all %}
 
<h2>Used in Recipes</h2>
 
<ul class="unstyled">
 
  {% for recing in ingredient.recipeingredient_set.all %}
 
  <li>{% html_link 'recipe' recing.recipe.name recing.recipe.id "btn btn-link btn-fixed" %}</li>
 
  {% endfor %}
 
</ul>
 
{% endif %}
 

	
 
{% endif %}
 

	
 
{% endblock %}
djangoshaker/templates/djangoshaker/ingredient_list.html
Show inline comments
 
@@ -6,6 +6,8 @@
 

	
 
{% block content %}
 

	
 
<h1>Ingredients</h1>
 

	
 
{% if ingredients %}
 
<ul class="unstyled">
 
  {% for ingredient in ingredients %}
djangoshaker/templates/djangoshaker/user.html
Show inline comments
 
@@ -9,7 +9,7 @@
 

	
 
<ul class="unstyled">
 
  {% for recipe in available_recipes %}
 
  <li>{% html_link 'recipe' recipe.name recipe.id "btn btn-link btn-fixed" %}</li>
 
  <li>{% html_link 'recipe' recipe.name recipe.id "btn btn-link" %}</li>
 
  {% endfor %}
 
</ul>
 

	
djangoshaker/views.py
Show inline comments
 
@@ -58,7 +58,6 @@ class UserView(TemplateView):
 
            for recipe in Recipe.objects.all():
 
                recipe_ingredients = set([recing.ingredient_id for recing in recipe.recipeingredient_set.all()])
 
                if recipe_ingredients.issubset(user_ingredients):
 
                    print recipe.name
 
                    available_recipes.append(recipe)
 
            context['available_recipes'] = available_recipes
 
        else:
0 comments (0 inline, 0 general)