diff options
author | Weitian LI <liweitianux@gmail.com> | 2014-04-28 13:34:41 +0800 |
---|---|---|
committer | Weitian LI <liweitianux@gmail.com> | 2014-04-28 13:34:41 +0800 |
commit | 650b6c5f48bccd2f79e2489ecd9df9157bac421a (patch) | |
tree | ab7fb7065a721dc1af2029c8dbf8021c1cbc2b27 /archive/templates | |
parent | 5af86ee6cbb4d9561c8f0a32d064f1ccd4e4b1cf (diff) | |
download | django-skaschool-650b6c5f48bccd2f79e2489ecd9df9157bac421a.tar.bz2 |
* added app 'archive' to provides downloads
o models: Archive, ArchiveCategory
o views: ArchiveView based on TemplateView
o template: archive.html
o sidebar: sidebar.js, sidebar.css
Diffstat (limited to 'archive/templates')
-rw-r--r-- | archive/templates/archive/archive.html | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/archive/templates/archive/archive.html b/archive/templates/archive/archive.html new file mode 100644 index 0000000..96a93c4 --- /dev/null +++ b/archive/templates/archive/archive.html @@ -0,0 +1,67 @@ +{% extends 'base.html' %} +{% load staticfiles %} +{% load url from future %} +{% load i18n %} +{% load bootstrap3 %} + +{# template to show notice list #} + +{% block title %} +资料下载 | 2014 SKA Summer School +{% endblock %} + +{% block css_extra %} + <link href="{% static 'css/sidebar.css' %}" rel="stylesheet"> +{% endblock %} + +{% block content %} + <div class="container"> + <h2>资料下载</h2> + <hr> + </div> + + <div class="container"> + {% if archive_empty %} + <div class="alert alert-info"> + 暂无资料提供下载…… + </div> + {% else %} + <div class="row"> + <div class="col-md-10" id="content-col"> + {# archive contents #} + {% for category in archive_categories %} + <h3 id="cat{{ category.id }}">{{ category.name }}</h3> + <table class="table table-stripped table-bordered table-hover"> + {% with archives=category.archive_set.all %} + {% for archive in archives %} + <tr> + <th class="col-md-3"><a href="{{ archive.file.url }}">{{ archive.title }}</a></th> + <td class="col-md-7">{{ archive.description }}</td> + </tr> + {% empty %} + <tr class="warning"> + <td>暂无该类资料可供下载</td> + </tr> + {% endfor %} + {% endwith %} + </table> + {% endfor %} + </div> + <div class="col-md-2" id="sidebar-col"> + {# archive sidebar #} + <ul class="nav nav-stacked" id="sidebar"> + {% for category in archive_categories %} + <li><a href="#cat{{ category.id }}">{{ category.name }}</a></li> + {% endfor %} + </ul> + </div> + </div> + {% endif %} + </div> +{% endblock %} + +{% block js_extra %} + <script src="{% static 'js/sidebar.js' %}" type="text/javascript"></script> +{% endblock %} + +{# vim: set ts=8 sw=2 tw=0 fenc=utf-8 ft=htmldjango.html: #} |