Mercurial > public > sg101
changeset 1151:f56798c96ec2
WIP convert downloads to V3 design.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Tue, 13 Dec 2016 21:56:21 -0600 |
parents | 0e0cd152b86d |
children | fa5d03c5c28c |
files | downloads/static/js/downloads-get.js downloads/views.py sg101/templates/downloads/download.html sg101/templates/downloads/download_list.html |
diffstat | 4 files changed, 45 insertions(+), 42 deletions(-) [+] |
line wrap: on
line diff
--- a/downloads/static/js/downloads-get.js Tue Dec 13 20:20:24 2016 -0600 +++ b/downloads/static/js/downloads-get.js Tue Dec 13 21:56:21 2016 -0600 @@ -18,6 +18,7 @@ var link_id = result.id; var div = $('#link-' + link_id); div.hide(); + div.addClass('success callout'); div.html( 'Thank you! Your download is now ready. <a href="' + result.url + '">Click here to download</a>.');
--- a/downloads/views.py Tue Dec 13 20:20:24 2016 -0600 +++ b/downloads/views.py Tue Dec 13 21:56:21 2016 -0600 @@ -75,6 +75,8 @@ 's' : sort, 'category' : cat, 'page' : the_page, + 'top_menu': 'categories', + 'V3_DESIGN': True, }) #######################################################################
--- a/sg101/templates/downloads/download.html Tue Dec 13 20:20:24 2016 -0600 +++ b/sg101/templates/downloads/download.html Tue Dec 13 21:56:21 2016 -0600 @@ -1,29 +1,30 @@ {% load comment_tags %} {% load bio_tags %} -{% load static from staticfiles %} {% get_comment_count for download as comment_count %} -<dt> +<dt class="more-top-margin"> <a href="{{ download.get_absolute_url }}">{{ download.title }}</a> </dt> <dd> {{ download.html|safe }} -<table> -<tr> - <th>Added By:</th> - <td>{% profile_link download.user.username %}</td> - <th>Date:</th><td>{{ download.date_added|date:"M d, Y" }}</td> - <th>Size:</th><td>{{ download.size }}</td> -</tr> -<tr> - <th>Category:</th><td>{{ download.category.title }}</td> - <th>Downloads:</th><td>{{ download.hits }}</td> -</tr> -<tr> - <th>Rating:</th><td><div class="rating" id="rating-{{ download.id }}">{{ download.average_score|floatformat }}</div></td> - <th><img src="{% static "icons/comments.png" %}" alt="Comments" title="Comments" /> - <a href="{{ download.get_absolute_url }}">Comments</a>:</th><td>{{ comment_count }}</td> -</tr> -</table> -<div id="link-{{ download.id }}"><button type="button" class="dl-button" id="dl-{{ download.id }}">Download</button></div> -<br /> +<ul> + <li>Added By: {% profile_link download.user.username %}</li> + <li>Date: {{ download.date_added|date:"M d, Y" }}</li> + <li>Size: {{ download.size }}</li> + <li>Category: {{ download.category.title }}</li> + <li>Downloads: {{ download.hits }}</li> + <li>Rating: + <div class="rating" id="rating-{{ download.id }}" style="display: inline-block"> + {{ download.average_score|floatformat }} + </div> + </li> + <li> + <a href="{{ download.get_absolute_url }}"><i class="fi-comments size-16"></i> + Comments: {{ comment_count }}</a> + </li> +</ul> +<div id="link-{{ download.id }}"> + <button type="button" class="dl-button button" id="dl-{{ download.id }}"> + Download + </button> +</div> </dd>
--- a/sg101/templates/downloads/download_list.html Tue Dec 13 20:20:24 2016 -0600 +++ b/sg101/templates/downloads/download_list.html Tue Dec 13 21:56:21 2016 -0600 @@ -1,34 +1,29 @@ -{% extends 'base.html' %} +{% extends 'v3/base.html' %} {% load static from staticfiles %} {% load downloads_tags %} {% block title %}Downloads: {{ category.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>Category: {{ category.title }}</h3> {% if page.object_list %} -<ul class="tab-nav"> - <li><a href="{% url 'downloads-category' slug=category.slug sort="title" %}" - {% ifequal s "title" %}class="active" {% endifequal %}>Title</a></li> - <li><a href="{% url 'downloads-category' slug=category.slug sort="date" %}" - {% ifequal s "date" %}class="active"{% endifequal %}>Date</a></li> - <li><a href="{% url 'downloads-category' slug=category.slug sort="rating" %}" - {% ifequal s "rating" %}class="active"{% endifequal %}>Rating</a></li> - <li><a href="{% url 'downloads-category' slug=category.slug sort="hits" %}" - {% ifequal s "hits" %}class="active"{% endifequal %}>Hits</a></li> +<ul class="menu"> + <li{% ifequal s "title" %} class="active"{% endifequal %}> + <a href="{% url 'downloads-category' slug=category.slug sort="title" %}">Title</a> + </li> + <li{% ifequal s "date" %} class="active"{% endifequal %}> + <a href="{% url 'downloads-category' slug=category.slug sort="date" %}">Date</a> + </li> + <li{% ifequal s "rating" %} class="active"{% endifequal %}> + <a href="{% url 'downloads-category' slug=category.slug sort="rating" %}">Rating</a> + </li> + <li{% ifequal s "hits" %} class="active"{% endifequal %}> + <a href="{% url 'downloads-category' slug=category.slug sort="hits" %}">Hits</a> + </li> </ul> -{% include 'core/pagination.html' %} +{% include 'core/v3/pagination.html' %} <dl> {% for download in page.object_list %} @@ -36,8 +31,12 @@ {% endfor %} </dl> -{% include 'core/pagination.html' %} +{% include 'core/v3/pagination.html' %} {% else %} <p>No downloads in this category 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 %}