From 1c137a68523d07faa8bcfcb8299af0cdd49e4392 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Mon, 9 Oct 2017 11:07:29 +0200 Subject: [PATCH 1/2] added FB and Twitter share buttons --- rowers/templates/show_graph.html | 19 +++++++++++++++++-- rowers/templates/workout_form.html | 16 ++++++++++++++++ rowers/templates/workout_view.html | 15 +++++++++++++-- rowsandall_app/settings.py | 1 + templates/base.html | 2 ++ templates/basebase.html | 27 +++++++++++++++++++++++++++ 6 files changed, 76 insertions(+), 4 deletions(-) diff --git a/rowers/templates/show_graph.html b/rowers/templates/show_graph.html index 1221cc03..f6ecc9a4 100644 --- a/rowers/templates/show_graph.html +++ b/rowers/templates/show_graph.html @@ -12,8 +12,23 @@ {% endblock %} {% block content %} -

{{ workout.name }}

+

{{ workout.name }}

+
+
+ +
+
+ +
+
+ +

 

+
{% if user.is_authenticated and user == rower.user %}

@@ -34,7 +49,7 @@

 

{% endif %}
- +

diff --git a/rowers/templates/workout_form.html b/rowers/templates/workout_form.html index 65420ad6..be616ef9 100644 --- a/rowers/templates/workout_form.html +++ b/rowers/templates/workout_form.html @@ -2,6 +2,8 @@ {% load staticfiles %} {% load rowerfilters %} {% load tz %} + + {% get_current_timezone as TIME_ZONE %} {% block title %}{{ workout.name }}{% endblock %} @@ -67,6 +69,20 @@ https://rowsandall.com/rowers/workout/{{ workout.id }} + + Share to + +

+ +
+
+ +
+ Comments diff --git a/rowers/templates/workout_view.html b/rowers/templates/workout_view.html index a823aec1..75f9b0c6 100644 --- a/rowers/templates/workout_view.html +++ b/rowers/templates/workout_view.html @@ -27,9 +27,20 @@
-

{{ workout.name }}

+

{{ workout.name }}

+
+ +
+
+ +
+ - + diff --git a/rowsandall_app/settings.py b/rowsandall_app/settings.py index 3020084e..a7f25d88 100644 --- a/rowsandall_app/settings.py +++ b/rowsandall_app/settings.py @@ -64,6 +64,7 @@ INSTALLED_APPS = [ 'cookielaw', 'django_extensions', 'tz_detect', + 'django_social_share', ] AUTHENTICATION_BACKENDS = ( diff --git a/templates/base.html b/templates/base.html index 77fa6213..21de4904 100644 --- a/templates/base.html +++ b/templates/base.html @@ -3,6 +3,8 @@ {% load rowerfilters %} {% endblock %} + + {% block teams %} {% if user.is_authenticated and user|has_teams %}
Rower:{{ first_name }} {{ last_name }}