Source

article / article / templates / recipe_detail.html

Full commit
{% extends "theme_base.html" %}

{% block meta %}

    {% load tagging_tags %}

   <meta name="keywords" content="Vegan, Vegetarian, Recipes, low fat, 
	   fat-free, {% tags_for_object recipe as tag_list %}
	   {% for t in tag_list %}{{t.name}}, {%endfor%}" />
   {% if recipe %}
     <meta name="description" content="{{ recipe.recipe_description|striptags|truncatewords:40 }}" />

     <meta property="og:type" content="hh-recipes:recipe" /> 
     <meta property="og:title" content="{{ recipe.recipe_name }} Recipe"/>

     {% if recipephotos.count %}
         {% for i in recipephotos|slice:":1" %}
         <meta property="og:image" content="{{ i.url }}"/>
         {% endfor %}
     {% else %}
         <meta property="og:image" content="http://photos.happyherbivore.com/2012/04/FruitWithVeggies.jpg"/>
     {% endif %}
     <meta property="og:description" content="{{ recipe.recipe_description|striptags|truncatewords:40 }}"/>
  {% endif %}

{% endblock %}

{% block css %}
    <link rel="stylesheet" type="text/css" 
	  href="/media/custom/gritter/jquery.gritter.css" />
{% endblock %}
   
{% block js %}
    {% if debug %}
    <script src="http://css.happyherbivore.com/jquery-ui.1.8.15.js"></script>
	<script src="/media/js/old/hh-lib.js"></script>
    {% else %}
	<!-- <script src="{{ main_js }}"></script> -->
	{% endif %}
    <script type="text/javascript" 
	    src="/media/custom/gritter/jquery.gritter.min.js"></script>
    <script type="text/javascript"> 
      $(function() {
          $(".fullscr").click(function() {
             $("link[rel=stylesheet]").attr({href : "{{ print_css }}"});
          });
          $(".closefullscreen").click(function() {
             $("link[rel=stylesheet]").attr({href : "{{ main_css }}"});
          });
      });
    </script>
{% endblock %}

{% block extra_head %}{% endblock %}

{% block head_title %}{{ recipe.recipe_name }} Recipe{% endblock %}

{% block body %}

    {% load generic_flatblocks %}
    {% load disqus_tags %}
    {% load humanize %}	
    {% spaceless %}

<div id="content">
      <!-- breadcrumb -->
      <div class="container">
        <div class="row">
          <div class="span15">
            <ul class="breadc clearfix">
              <li><a href="/">Home</a></li>
              <li><a href="/recipes/">Recipes</a></li>
            </ul>
            <h2 class="page-title">Happy Herbivore Recipe</h2>
          </div>
        </div>
      </div>
      <div class="container">          
        <!-- first row -->
            <div class="tabbable recipe-tabs">
              <div class="row">
                  <div class="span15">
                  <ul class="nav nav-tabs">
                    <li class="active"><a href="#1" data-toggle="tab">Intro</a></li>
                    <li><a href="#2" data-toggle="tab">Meta</a></li>
                  </ul>
                  </div><!-- / span15 -->
              </div>
            </div>
      </div>

 {% if recipe %}
 {% load fractions %}
    <div id="outer-wrapper" class="hrecipe">

      <div class="container">
            <div class="wrapper-box">
              <div class="tabbable">
              <div class="tab-content">
                <div class="tab-pane active" id="1">
                  
                  <div class="row">
                    <div class="span6">
                      <div class="inner-padding">
                        <h1 class="recipe-title fn">{{ recipe.recipe_name }}</h1>

                        {% if recipe.prep_time %}
                        <p class="times">
                          {% if recipe.prep_time %}Prep time: <span>
                            <time itemprop="prepTime" datetime="PT{{ recipe.prep_time|floatformat }}M"> {{ recipe.prep_time|floatformat }} min<span class="value-title" title="PT{{ recipe.prep_time|floatformat }}M"></span></time></span> 
                          {% endif %}

                          <span class="separator"> | </span> 

                          {% if recipe.cook_time %}
	                      Cook time: <span>
		                  <time itemprop="cookTime" 
		                        datetime="PT{{ recipe.cook_time|floatformat }}M">
		                    {{ recipe.cook_time|floatformat }} min
		                    <span class="value-title" 
			                      title="PT{{ recipe.cook_time|floatformat }}M"></span>
		                  </time></span>
	                      {% endif %}

                          <span class="separator"> | </span> 

	                      {% if recipe.total_time %}
	                      <span class="total-time-box total-time">Total time:
	                        <time itemprop="totalTime" 
		                          datetime="PT{{ recipe.total_time|floatformat }}M">
		                      {{ recipe.total_time|floatformat }} min
		                      <span class="value-title" 
		                            title="PT{{ recipe.total_time|floatformat }}M"></span>
	                      </time></span>
	                      {% endif %}
                        </p><!-- / times -->
                        {% endif %}

                        <p class="recipe-intro yield">
                          Servings: {{ recipe.recipe_servings|floatformat:"-2" }}                      
                          {% if user.is_superuser and not debug %}
	                    | <span><a href="/admin/article/recipe/{{ recipe.pk }}/">Edit</a></span>
                        {% endif %}
</p>

                        <div class="recipe-intro summary">{{ recipe.recipe_description|safe }}</div>
                        <p class="recipe-subintro"></p>
                      </div><!-- /inner-padding -->
                    </div>
                    <div class="span6">
                      <div class="inner-padding">
                        {% if recipephotos.count %}
                           {% for i in recipephotos|slice:":1" %}
	                           <div class="recipe-img-view"><img class="photo" alt="Picture of {{ recipe.recipe_name }}" src="{{ i.url }}"></div>
	                       {% endfor %}
                        {% endif %}
                      </div><!-- /inner-padding -->
                    </div>
                  </div>

                </div>

                <div class="tab-pane" id="2">

                  <div class="row">
                    <div class="span12">

                      <h2 class="secondary-tab">Additional Info</h2>
                      <p>
                        Recipe added on  
	                    <span class="published">
	                      <span class="value-title" 
		                        title="{{ recipe.recipe_date_create|date:"c" }}"> 
	                      </span>
	                      {{ recipe.recipe_date_create|date:"F j, Y" }}
	                    </span> 
	                    by <span class="author">
	                      <a rel="author" href="/about/">Lindsay S. Nixon</a></span>
                      </p>

                    </div>
                  </div>

                </div>    
              </div><!-- / tab-content -->
            </div><!-- /wrapper-box -->
            </div><!-- / tabbable -->

      </div> <!-- /container -->

    </div><!-- / outer-wrapper -->
  </div><!-- / content -->
  

  <div class="recipes-wrapper">
  <div class="container">
        <!-- second row -->
        <div class="row">
          <div class="span4">
                <div class="ingredients-box">
                  <h2>Ingredients</h2>
                  <ul class="ingredients">

                    {% for r in recipe.get_ingredients %}
	                <li class="ingredient">
	                  <span class="value">
	                    {% if r.ri_amount %}
	                    {{ r.ri_amount|html_fraction|safe }}
	                    {% endif %} 
		                {{ r.ri_measurement.m_name }}
	                  </span>
	                  <span class="name">
		                {% if r.ri_ingred.affiliate_link %}
		                <a rel="nofollow" href="{{ r.ri_ingred.affiliate_link }}">
		                  {% endif %}
		                  {{ r.ri_ingred.ingred_name }}
		                  {% if r.ri_ingred.affiliate_link %}</a>{% endif %}
	                  </span> 
	                  {% if r.ri_optional %}(optional){% endif %}
	                </li>
	                {% endfor %}
                    
                  </ul>
                  
                </div><!-- / ingredients-box -->

          </div>
          <div class="span4">
            <div class="instructions-box">
              <h2>Instructions</h2>
              <div class="instructions">
                {{ recipe.recipe_instructions|safe|linebreaks }}
              </div>

              <h2>Nutritional Information</h2>
                  <div class="nutritional-table">
                    <ul>
                      <li>Serving Size: <span class="nvalue">1</span></li>

		              <li class="sixborder">Servings Per Batch: 
                        <span class="nvalue">{% if recipe.recipe_servings %}{{ recipe.recipe_servings|floatformat:"-2" }}{% else %} NA {% endif %}</span>
                      </li>

                      <li class="big-border">Amount Per Serving</li>

		              
		              <li class="fourborder">Calories 
                        <span class="nvalue">{% if recipe.calories %}{{ recipe.calories|floatformat:"-2" }}{% else %} NA {% endif %}</span>
                      </li>

		              
		              <li class="med-border">Fat 
                        <span class="nvalue">{% if recipe.fat %}{{ recipe.fat|floatformat:"-2" }}g
		                {% else %} NA {% endif %}</span>
                      </li>

		              <li>Carbohydrate 
                        <span class="nvalue">{% if recipe.carbohydrates %}{{ recipe.carbohydrates|floatformat:"-2" }}g{% else %} NA {% endif %}</span>
                      </li>

                      <li class="tab">Dietary Fiber<span class="nvalue">{% if recipe.fiber %}{{ recipe.fiber|floatformat:"-2" }}g{% else %} NA {% endif %}</span>
                      </li>

                      <li class="tab">Sugars<span class="nvalue">{% if recipe.sugar %}{{ recipe.sugar|floatformat:"-2" }}g{% else %} NA {% endif %}</span>
                      </li>

                      <li><strong>Protein</strong> 
		                <span class="nvalue">{% if recipe.protein %}{{ recipe.protein|floatformat:"-2" }}g{% else %} NA {% endif %}</span>
                      </li>

                    </ul>
                  </div><!-- / nutritional-table -->
            </div><!-- / instructions-box -->
          </div>
          <div class="span4">
            <div class="recipe-sidebar">

              <!--<a href="#" class="green-big">I made this recipe!</a> -->

              <h2>Tools</h2>
              <!-- <a href="#" id="{{ recipe.id }}" class="add-to-list button-icon-plus" 
		         title="Save this Recipe to your Shopping List"
		         onClick="_gaq.push(['_trackEvent', 'Shop_List', 'Link', '{{ recipe.recipe_slug }}-add']);" class="">Add to shopping list</a><br /><br /> -->
              <a href="#" onClick="window.print();" class="button-icon-plus" title="Print Recipe">Print recipe</a>

              <h2>Share</h2>
              {% include "_social.html" %}
	          {% for i in recipephotos|slice:":1" %}
	          <a href="http://pinterest.com/pin/create/button/?url=http://happyherbivore.com{{ recipe.get_absolute_url }}&media={{ i.url|urlencode }}&description=Happy Herbivore {{ recipe.recipe_name }}" class="pin-it-button" count-layout="horizontal"><img border="0" src="//assets.pinterest.com/images/PinExt.png" title="Pin It" /></a>
	          {% endfor %}
            </div><!-- / recipe-sidebar -->
          </div>
        </div>

      </div> <!-- /container -->

{% endif %}

  </div>
  {% endspaceless %}

{% endblock %}

{% block extra_body %}
     <script type="text/javascript" src="//assets.pinterest.com/js/pinit.js"></script>
     <script src="{{ main_js }}"></script>
{% endblock %}