-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from pinax/calendars
Add calendars
- Loading branch information
Showing
1 changed file
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
{% load i18n %} | ||
|
||
<div class="calendar"> | ||
<div class="calendar-heading"> | ||
<h3 class="calendar-title">{{ title }}</h3> | ||
|
||
<div class="calendar-nav"> | ||
{% if prev %} | ||
<a href="{{ prev }}">{% trans "Previous month" %}</a> | ||
{% endif %} | ||
|
||
<span class="calendar-date">{{ calendar_date|date:'m.Y' }}</span> | ||
|
||
{% if next %} | ||
<a href="{{ next }}">{% trans "Next month" %}</a> | ||
{% endif %} | ||
</div> | ||
</div> | ||
|
||
<div class="calendar-body"> | ||
<table class="calendar-table"> | ||
{% for row in grid %} | ||
<tr> | ||
{% for day in row %} | ||
{% if not day %} | ||
<td class="day noday"></td> | ||
{% else %} | ||
{% with day_day=day.0 day_events=day.1 link=day.2 is_today=day.3 %} | ||
<td class="day {% if day.1 %}day-has-events{% else %}day-no-events{% endif %}"> | ||
{% if link %} | ||
<a href="{{ link }}" class="day-number">{{ day_day }}</a> | ||
{% else %} | ||
<span class="day-number">{{ day_day }}</span> | ||
{% endif %} | ||
{% if day_events %} | ||
<div class="day-event-list"> | ||
{% for event in day_events %} | ||
<div class="day-event"> | ||
{{ event }} | ||
</div> | ||
{% endfor %} | ||
</div> | ||
{% endif %} | ||
</td> | ||
{% endwith %} | ||
{% endif %} | ||
{% endfor %} | ||
</tr> | ||
{% endfor %} | ||
</table> | ||
</div> | ||
</div> |