changeset 1152:fa5d03c5c28c

Finish (?) converting downloads to V3 design.
author Brian Neal <bgneal@gmail.com>
date Sun, 18 Dec 2016 21:19:34 -0600
parents f56798c96ec2
children be34f981596e
files downloads/static/css/downloads.css downloads/views.py sg101/templates/downloads/add.html sg101/templates/downloads/download_detail.html sg101/templates/downloads/download_summary.html sg101/templates/downloads/thanks.html
diffstat 6 files changed, 69 insertions(+), 54 deletions(-) [+]
line wrap: on
line diff
--- a/downloads/static/css/downloads.css	Tue Dec 13 21:56:21 2016 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-#downloads-add td {
-    padding-bottom: 5px;
-}
-
-#downloads-add fieldset {
-    margin: 1em 0 1em;
-    padding: 0.5em;
-}
--- a/downloads/views.py	Tue Dec 13 21:56:21 2016 -0600
+++ b/downloads/views.py	Sun Dec 18 21:19:34 2016 -0600
@@ -97,6 +97,7 @@
     return render(request, 'downloads/download_summary.html', {
         'page': the_page,
         'title': 'Newest Downloads',
+        'V3_DESIGN': True,
         })
 
 #######################################################################
@@ -117,6 +118,7 @@
     return render(request, 'downloads/download_summary.html', {
         'page': the_page,
         'title': 'Popular Downloads',
+        'V3_DESIGN': True,
         })
 
 #######################################################################
@@ -136,6 +138,7 @@
     return render(request, 'downloads/download_summary.html', {
         'page': the_page,
         'title': 'Highest Rated Downloads',
+        'V3_DESIGN': True,
         })
 
 #######################################################################
@@ -147,6 +150,7 @@
         raise Http404
     return render(request, 'downloads/download_detail.html', {
         'download' : download,
+        'V3_DESIGN': True,
         })
 
 #######################################################################
@@ -170,6 +174,7 @@
 
     return render(request, 'downloads/add.html', {
         'add_form': form,
+        'V3_DESIGN': True,
         })
 
 #######################################################################
@@ -177,6 +182,7 @@
 @login_required
 def thanks(request):
     return render(request, 'downloads/thanks.html', {
+        'V3_DESIGN': True,
         })
 
 #######################################################################
--- a/sg101/templates/downloads/add.html	Tue Dec 13 21:56:21 2016 -0600
+++ b/sg101/templates/downloads/add.html	Sun Dec 18 21:19:34 2016 -0600
@@ -1,15 +1,9 @@
-{% extends 'base.html' %}
+{% extends 'v3/base.html' %}
 {% load downloads_tags %}
 {% load core_tags %}
 {% load script_tags %}
 {% load static from staticfiles %}
 {% block title %}Add Download{% endblock %}
-{% block custom_css %}
-<link rel="stylesheet" type="text/css" href="{% static "css/downloads.css" %}" />
-{% endblock %}
-{% block custom_js %}
-{% script_tags 'jquery-ui markitup' %}
-{% endblock %}
 {% block content %}
 <h2>Downloads</h2>
 {% include 'downloads/navigation.html' %}
@@ -35,18 +29,45 @@
 </ol>
 
 <form action="." method="post" enctype="multipart/form-data" id="downloads-add">{% csrf_token %}
-<fieldset>
+<fieldset class="fieldset">
 <legend>Upload Form</legend>
-<table>
-{{ add_form.as_table }}
-<tr>
-   <th>&nbsp;</th>
-   <td>
-      {% comment_dialogs %}
-      <input type="submit" name="submit_button" value="Add Download" />
-   </td>
-</table>
+   {{ add_form.non_field_errors }}
+   {{ add_form.title.errors }}
+   <div class="row">
+      <div class="columns">
+         <label for="{{ add_form.title.id_for_label }}">{{ add_form.title.label }}
+            {{ add_form.title }}
+         </label>
+      </div>
+   </div>
+   {{ add_form.category.errors }}
+   <div class="row">
+      <div class="columns">
+         <label for="{{ add_form.category.id_for_label }}">
+            {{ add_form.category.label }}
+            {{ add_form.category }}
+         </label>
+      </div>
+   </div>
+   {% post_box add_form.description %}
+   {{ add_form.file.errors }}
+   <div class="row">
+      <div class="columns">
+         <label for="{{ add_form.file.id_for_label }}">
+            {{ add_form.file.label }}
+            {{ add_form.file }}
+         </label>
+      </div>
+   </div>
+   <input type="submit" name="submit_button" value="Add Download"
+      class="primary button" />
 </fieldset>
 </form>
 
+{% include 'core/v3/post_box_modals.html' %}
 {% endblock %}
+
+{% block custom_js %}
+   <script src="{% static "js/jquery.form.min.js" %}"></script>
+   <script src="{% static "js/v3/post_box.js" %}"></script>
+{% endblock %}
--- a/sg101/templates/downloads/download_detail.html	Tue Dec 13 21:56:21 2016 -0600
+++ b/sg101/templates/downloads/download_detail.html	Sun Dec 18 21:19:34 2016 -0600
@@ -1,4 +1,4 @@
-{% extends 'base.html' %}
+{% extends 'v3/base.html' %}
 {% load downloads_tags %}
 {% load comment_tags %}
 {% load script_tags %}
@@ -6,13 +6,6 @@
 {% block title %}Downloads Details{% endblock %}
 {% block custom_css %}
 <link rel="stylesheet" type="text/css" href="{% static "css/comments.css" %}" />
-<link rel="stylesheet" type="text/css" href="{% static "css/downloads.css" %}" />
-{% endblock %}
-{% block custom_js %}
-{% script_tags "markitup jquery-ui" %}
-<script type="text/javascript" src="{% static "js/comments.js" %}"></script>
-<script type="text/javascript" src="{% static "js/rating.js" %}"></script>
-<script type="text/javascript" src="{% static "js/downloads-get.js" %}"></script>
 {% endblock %}
 {% block content %}
 <h2>Downloads</h2>
@@ -27,5 +20,13 @@
 <p>This download has <span id="comment-count">{{ comment_count }}</span> comment{{ comment_count|pluralize }}.</p>
 <hr />
 {% render_comment_list download %}
-{% render_comment_form user download %}
+{% render_comment_form_v3 user download %}
+{% include 'core/v3/post_box_modals.html' %}
 {% endblock %}
+{% block custom_js %}
+   <script src="{% static "js/comments.js" %}"></script>
+   <script src="{% static "js/jquery.form.min.js" %}"></script>
+   <script src="{% static "js/v3/post_box.js" %}"></script>
+   <script src="{% static "js/rating.js" %}"></script>
+   <script src="{% static "js/downloads-get.js" %}"></script>
+{% endblock %}
--- a/sg101/templates/downloads/download_summary.html	Tue Dec 13 21:56:21 2016 -0600
+++ b/sg101/templates/downloads/download_summary.html	Sun Dec 18 21:19:34 2016 -0600
@@ -1,30 +1,25 @@
-{% extends 'base.html' %}
+{% extends 'v3/base.html' %}
 {% load downloads_tags %}
 {% load static from staticfiles %}
 {% block title %}{{ title }}{% endblock %}
-{% block custom_css %}
-<link rel="stylesheet" type="text/css" href="{% static "css/downloads.css" %}" />
-<link rel="stylesheet" type="text/css" href="{% static "css/tab-nav.css" %}" />
-<link rel="stylesheet" type="text/css" href="{% static "css/pagination.css" %}" />
-{% endblock %}
-{% block custom_js %}
-<script type="text/javascript" src="{% static "js/rating.js" %}"></script>
-<script type="text/javascript" src="{% static "js/downloads-get.js" %}"></script>
-{% endblock %}
 {% block content %}
 <h2>Downloads</h2>
 {% include 'downloads/navigation.html' %}
 <h3>{{ title }}</h3>
 
 {% if page.object_list %}
-{% include 'core/pagination.html' %}
+{% include 'core/v3/pagination.html' %}
 <dl>
 {% for download in page.object_list %}
    {% include 'downloads/download.html' %}
 {% endfor %}
 </dl>
-{% include 'core/pagination.html' %}
+{% include 'core/v3/pagination.html' %}
 {% else %}
 <p>No downloads available at this time.</p>
 {% endif %}
 {% endblock %}
+{% block custom_js %}
+<script type="text/javascript" src="{% static "js/rating.js" %}"></script>
+<script type="text/javascript" src="{% static "js/downloads-get.js" %}"></script>
+{% endblock %}
--- a/sg101/templates/downloads/thanks.html	Tue Dec 13 21:56:21 2016 -0600
+++ b/sg101/templates/downloads/thanks.html	Sun Dec 18 21:19:34 2016 -0600
@@ -1,15 +1,15 @@
-{% extends 'base.html' %}
+{% extends 'v3/base.html' %}
 {% load static from staticfiles %}
 {% load downloads_tags %}
 {% block title %}Thanks for the Download{% endblock %}
-{% block custom_css %}
-{{ add_form.media }}
-<link rel="stylesheet" type="text/css" href="{% static "css/downloads.css" %}" />
-{% endblock %}
 {% block content %}
 <h2>Downloads</h2>
 {% include 'downloads/navigation.html' %}
-<h3>Thanks for the Download</h3>
-<p>Thank you for sending in a download! Your file will be reviewed by the site staff and made
-available shortly.</p>
+<div class="success callout">
+   <h5>Thanks for the Download</h5>
+   <p>
+   Thank you for sending in a download! Your file will be reviewed by the site
+   staff and made available shortly.
+   </p>
+</div>
 {% endblock %}