Announcements
This commit is contained in:
@@ -24,10 +24,10 @@
|
||||
</div>
|
||||
|
||||
<div class="grid_8 alpha">
|
||||
<h1>My Workouts</h1>
|
||||
<h3>My Workouts</h3>
|
||||
|
||||
{% if workouts %}
|
||||
<table width="95%" class="listtable">
|
||||
<table width="100%" class="listtable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th> Date</th>
|
||||
@@ -74,29 +74,50 @@
|
||||
</div>
|
||||
|
||||
<div class="grid_4 omega">
|
||||
<h1>Announcements</h1>
|
||||
{% if announcements %}
|
||||
{% for a in announcements %}
|
||||
<i>{{ a.created }}</i>
|
||||
<p>{{ a.announcement }}</p>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
<div class="grid_4" id="announcements">
|
||||
{% if announcements %}
|
||||
<h3>What's New?</h3>
|
||||
{% for a in announcements %}
|
||||
<div class="site-announcement-box">
|
||||
<div class="site-announcement">
|
||||
<i>{{ a.created }}:</i>
|
||||
{{ a.announcement }}
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
<p> </p>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="grid_4" id="about">
|
||||
<h3>About</h3>
|
||||
<p>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 <a href="http://blog.rowsandall.com/">blog</a>
|
||||
</p>
|
||||
<div style="text-align: right; padding: 2em">
|
||||
<img src="/static/img/sander.jpg" width="80">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid_6 alpha">
|
||||
|
||||
|
||||
<div class="grid_5 alpha">
|
||||
<form id="searchform" action="/rowers/list-workouts/{{ startdate|date:"Y-m-d" }}/{{ enddate|date:"Y-m-d" }}"
|
||||
method="get" accept-charset="utf-8">
|
||||
<div class="grid_3 prefix_1 alpha">
|
||||
<input class="searchfield" id="searchbox" name="q" type="text" placeholder="Search">
|
||||
</div>
|
||||
<div class="grid_1 suffix_1 omega">
|
||||
<div class="grid_1 omega">
|
||||
<button class="button blue small" type="submit">
|
||||
Search
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="grid_2 prefix_3 omega">
|
||||
<div class="grid_2 prefix_1 omega">
|
||||
<span class="button gray small">
|
||||
{% if workouts.has_previous %}
|
||||
<a class="wh" href="?page={{ workouts.previous_page_number }}"><</a>
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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;
|
||||
|
||||
BIN
static/img/sander.jpg
Normal file
BIN
static/img/sander.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
Reference in New Issue
Block a user