comparison gpp/templates/potd/view.html @ 6:b6263ac72052

Use DRY principle to manage third party javascript libraries. Created script_tags template tags to generate the correct link and script tags for 3rd party libraries. The settings.py file is the only place where the full path name is specified.
author Brian Neal <bgneal@gmail.com>
date Sat, 11 Apr 2009 22:50:56 +0000
parents dbd703f7d63a
children f408971657b9
comparison
equal deleted inserted replaced
5:63696b279e35 6:b6263ac72052
1 {% extends 'base.html' %} 1 {% extends 'base.html' %}
2 {% load comment_tags %} 2 {% load comment_tags %}
3 {% load script_tags %}
3 {% block title %}Photo Of The Day{% endblock %} 4 {% block title %}Photo Of The Day{% endblock %}
4 {% block custom_css %} 5 {% block custom_css %}
5 <link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/potd.css" /> 6 <link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/potd.css" />
6 <link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/comments.css" /> 7 <link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/comments.css" />
7 <link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}js/markitup/skins/markitup/style.css" />
8 <link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}js/markitup/sets/markdown/style.css" />
9 {% endblock %} 8 {% endblock %}
10 {% block custom_js %} 9 {% block custom_js %}
11 <script type="text/javascript" src="{{ MEDIA_URL }}js/jquery-1.2.6.min.js"></script> 10 {% script_tags "jquery" %}
11 {% script_tags "markitup" %}
12 <script type="text/javascript" src="{{ MEDIA_URL }}js/comments.js"></script> 12 <script type="text/javascript" src="{{ MEDIA_URL }}js/comments.js"></script>
13 <script type="text/javascript" src="{{ MEDIA_URL }}js/markitup/jquery.markitup.pack.js"></script>
14 <script type="text/javascript" src="{{ MEDIA_URL }}js/markitup/sets/markdown/set.js"></script>
15 {% endblock %} 13 {% endblock %}
16 {% block content %} 14 {% block content %}
17 <h2>Photo Of The Day</h2> 15 <h2>Photo Of The Day</h2>
18 <h3>{% now "l, F d, Y" %}</h3> 16 <h3>{% now "l, F d, Y" %}</h3>
19 <div class="potd-details"> 17 <div class="potd-details">
37 </div> 35 </div>
38 {% render_comment_list potd %} 36 {% render_comment_list potd %}
39 {% if potd.can_comment_on %} 37 {% if potd.can_comment_on %}
40 <p>Leave a comment?</p> 38 <p>Leave a comment?</p>
41 {% render_comment_form for potd %} 39 {% render_comment_form for potd %}
40 <br />
42 {% else %} 41 {% else %}
43 <p>Comments are allowed only on today's photo of the day. If you'd like to share your thoughts on this photo 42 <p>Comments are allowed only on today's photo of the day. If you'd like to share your thoughts on this photo
44 with the site staff, you can <a href="{% url contact-form %}">contact us directly</a>.</p> 43 with the site staff, you can <a href="{% url contact-form %}">contact us directly</a>.</p>
45 {% endif %} 44 {% endif %}
46 {% else %} 45 {% else %}