Mercurial > public > sg101
comparison gpp/templates/news/story.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 | 63696b279e35 |
children | f408971657b9 |
comparison
equal
deleted
inserted
replaced
5:63696b279e35 | 6:b6263ac72052 |
---|---|
1 {% extends 'news/base.html' %} | 1 {% extends 'news/base.html' %} |
2 {% load tagging_tags %} | 2 {% load tagging_tags %} |
3 {% load comment_tags %} | 3 {% load comment_tags %} |
4 {% load script_tags %} | |
4 {% block title %}News: {{ story.title }}{% endblock %} | 5 {% block title %}News: {{ story.title }}{% endblock %} |
5 {% block news_css %} | 6 {% block news_css %} |
6 <link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}js/markitup/skins/markitup/style.css" /> | |
7 <link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}js/markitup/sets/markdown/style.css" /> | |
8 <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" /> |
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 {% if story.can_comment_on %} |
11 {% script_tags "jquery" %} | |
12 {% script_tags "markitup" %} | |
12 <script type="text/javascript" src="{{ MEDIA_URL }}js/comments.js"></script> | 13 <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 {% endif %} |
14 <script type="text/javascript" src="{{ MEDIA_URL }}js/markitup/sets/markdown/set.js"></script> | |
15 {% endblock %} | 15 {% endblock %} |
16 {% block news_content %} | 16 {% block news_content %} |
17 <h3>{{ story.title }}</h3> | 17 <h3>{{ story.title }}</h3> |
18 <div class="news-details"> | 18 <div class="news-details"> |
19 Submitted by {{ story.submitter.username }} on {{ story.date_published|date:"F d, Y" }}. | 19 Submitted by {{ story.submitter.username }} on {{ story.date_published|date:"F d, Y" }}. |