diff --git a/rowers/templates/list_workouts.html b/rowers/templates/list_workouts.html index f26799fc..d1d40ddd 100644 --- a/rowers/templates/list_workouts.html +++ b/rowers/templates/list_workouts.html @@ -24,10 +24,10 @@
-

My Workouts

+

My Workouts

{% if workouts %} - +
@@ -74,29 +74,50 @@
-

Announcements

- {% if announcements %} - {% for a in announcements %} - {{ a.created }} -

{{ a.announcement }}

- {% endfor %} - {% endif %} +
+ {% if announcements %} +

What's New?

+ {% for a in announcements %} +
+
+ {{ a.created }}: + {{ a.announcement }} +
+
+ {% endfor %} +

 

+ {% endif %} +
+
+

About

+

This site is a beta site, pioneering rowing data visualization and analysis. No warrantied. It's author is + Sander Roosendaal. A Masters rower. + + Read his blog +

+
+ +
+
+
-
+ + +
-
+
-
+
{% if workouts.has_previous %} < diff --git a/rowers/views.py b/rowers/views.py index 8b8d84e0..7caa3f8b 100644 --- a/rowers/views.py +++ b/rowers/views.py @@ -1988,8 +1988,12 @@ def workouts_view(request,message='',successmessage='', except EmptyPage: workouts = paginator.page(paginator.num_pages) - - announcements = SiteAnnouncement.objects.all().order_by("-created") + today = timezone.now() + announcements = SiteAnnouncement.objects.filter( + expires__gte=today + ).order_by( + "-created" + ) return render(request, 'list_workouts.html', {'workouts': workouts, @@ -1998,7 +2002,7 @@ def workouts_view(request,message='',successmessage='', 'dateform':dateform, 'startdate':startdate, 'enddate':enddate, - 'announcements':announcements, + 'announcements':announcements[0:4], }) except Rower.DoesNotExist: return HttpResponse("User has no rower instance") diff --git a/static/css/rowsandall.css b/static/css/rowsandall.css index d163a455..a3f4e761 100644 --- a/static/css/rowsandall.css +++ b/static/css/rowsandall.css @@ -140,6 +140,23 @@ th { text-align: center; } +.site-announcement-box { + padding: .2em .5em .2em 0em; +} + +.site-announcement { + font: 1.1em/1.5em sans-serif; + text-decoration: none; + display: block; + padding: .2em .5em .2em .5em; + zoom: 1; + border-radius: .5em; + -moz-border-radius: .5em; + -webkit-border-radius: .5em; + text-align: left; + border: solid 1px #333; +} + .button { font: 1.1em/1.5em sans-serif; text-decoration: none; diff --git a/static/img/sander.jpg b/static/img/sander.jpg new file mode 100644 index 00000000..b9c2be75 Binary files /dev/null and b/static/img/sander.jpg differ
Date