# HG changeset patch # User Brian Neal # Date 1467859276 18000 # Node ID 977e76f7f7360939783e95588baa000ade66a383 # Parent 2315707f582d44368838bf598492f13ff7771cea POTD converted to V3 design. diff -r 2315707f582d -r 977e76f7f736 core/templatetags/core_tags.py --- a/core/templatetags/core_tags.py Wed Jul 06 20:46:09 2016 -0500 +++ b/core/templatetags/core_tags.py Wed Jul 06 21:41:16 2016 -0500 @@ -62,7 +62,7 @@ @register.simple_tag(takes_context=True) -def social_sharing(context, title, url): +def social_sharing(context, title, url, center=False): """ Displays social media sharing buttons. @@ -77,6 +77,7 @@ with context.push(): context['title'] = title context['url'] = url + context['center'] = center return t.render(context) diff -r 2315707f582d -r 977e76f7f736 potd/static/css/potd.css --- a/potd/static/css/potd.css Wed Jul 06 20:46:09 2016 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ -div.potd-details { - text-align: center; -} -div.potd-details p.caption { - font-weight: bold; -} -div.potd-details p.details { - font-style: italic; - font-size: smaller; -} diff -r 2315707f582d -r 977e76f7f736 potd/views.py --- a/potd/views.py Wed Jul 06 20:46:09 2016 -0500 +++ b/potd/views.py Wed Jul 06 21:41:16 2016 -0500 @@ -14,6 +14,7 @@ return render(request, 'potd/view.html', { 'potd': potd, 'is_current': True, + 'V3_DESIGN': True, }) @@ -22,4 +23,5 @@ return render(request, 'potd/view.html', { 'potd': photo, 'is_current': False, + 'V3_DESIGN': True, }) diff -r 2315707f582d -r 977e76f7f736 sg101/templates/comments/v3/comment_form.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sg101/templates/comments/v3/comment_form.html Wed Jul 06 21:41:16 2016 -0500 @@ -0,0 +1,16 @@ +{% load core_tags %} +{% if user.is_authenticated %} +
{% csrf_token %} + {{ form.non_field_errors }} + {% post_box form.comment %} + {{ form.content_type }} + {{ form.object_pk }} + +
+ {% include 'core/v3/post_box_modals.html' %} +{% else %} +
+ Please login or + register to leave a comment. +
+{% endif %} diff -r 2315707f582d -r 977e76f7f736 sg101/templates/core/v3/social_sharing_tag.html --- a/sg101/templates/core/v3/social_sharing_tag.html Wed Jul 06 20:46:09 2016 -0500 +++ b/sg101/templates/core/v3/social_sharing_tag.html Wed Jul 06 21:41:16 2016 -0500 @@ -1,4 +1,7 @@ {% load static from staticfiles %} +{% if center %} + +{% endif %} diff -r 2315707f582d -r 977e76f7f736 sg101/templates/potd/view.html --- a/sg101/templates/potd/view.html Wed Jul 06 20:46:09 2016 -0500 +++ b/sg101/templates/potd/view.html Wed Jul 06 21:41:16 2016 -0500 @@ -1,4 +1,4 @@ -{% extends 'base.html' %} +{% extends 'v3/base.html' %} {% load static from staticfiles %} {% load bio_tags %} {% load core_tags %} @@ -9,13 +9,8 @@ {% open_graph_meta_tags potd %} {% endblock %} {% block custom_css %} - {% endblock %} -{% block custom_js %} -{% script_tags "markitup jquery-ui" %} - -{% endblock %} {% block content %} {% if is_current %}

Photo Of The Day

@@ -24,29 +19,61 @@

Photo Of The Day Archives

{% endif %} {% if potd %} -
-{{ potd.caption }} -

{{ potd.caption }}

-

-Submitted by -{% profile_link potd.user.username %} on {{ potd.date_added|date:"d F Y" }}.
-This photo has been Photo of the Day {{ potd.potd_count }} time{{ potd.potd_count|pluralize }}. -

-
{{ potd.description|safe }}
-

-If you would like us to feature your photo, send it along with your username, a title, and -short description to admin@surfguitar101.com. -

-{% social_sharing potd.caption potd.get_absolute_url %} +
+
+
+ {{ potd.caption }} +
+
+
+
+
+
+

{{ potd.caption }}

+

+ + Submitted by + {% profile_link potd.user.username %} on {{ potd.date_added|date:"d F Y" }}.
+ This photo has been Photo of the Day {{ potd.potd_count }} time{{ potd.potd_count|pluralize }}. +
+

+
+
+
+
+
+

{{ potd.description|safe }}

+
+
+
+
+
+

+ If you would like us to feature your photo, send it along with your username, a title, and + short description to admin@surfguitar101.com. +

+
+
+
+{% social_sharing potd.caption potd.get_absolute_url center=True %} {% get_comment_count for potd as comment_count %} -

This photo has {{ comment_count }} comment{{ comment_count|pluralize }}.

+
+
+
+ + This photo has {{ comment_count }} comment{{ comment_count|pluralize }}. + +
+
+
+
-
+ {% render_comment_list potd %} +
{% if potd.can_comment_on %}

Leave a comment?

-{% render_comment_form user potd %} -
+{% render_comment_form_v3 user potd %} {% else %}

Comments are allowed only on today's photo of the day. If you'd like to share your thoughts on this photo with the site staff, you can contact us directly.

@@ -55,3 +82,7 @@

We're sorry, there doesn't seem to be a photo of the day right now.

{% endif %} {% endblock %} +{% block custom_js %} + + +{% endblock %}