This repository has been archived by the owner on Sep 3, 2019. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
200 additions
and
6 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
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
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,37 @@ | ||
{% extends "events/base_events.html" %} | ||
|
||
{% block title %}{{ block.super }}: Events Tag {{ tag }}{% endblock %} | ||
|
||
{% block content_title %} | ||
<h2>Events <a href="{% url events_tag_list %}">Tag</a> {{ tag }}</h2> | ||
{% endblock %} | ||
|
||
{% block content %} | ||
<ul class="link_list"> | ||
{% for event in events.object_list %} | ||
<li><a href="{{ event.get_absolute_url }}">{{ event }}</a></li> | ||
{% endfor %} | ||
</ul> | ||
|
||
{% if has_other_pages %} | ||
<ul id="pagination"> | ||
{% if has_previous %} | ||
<li class="previous on"><a href="{% url events_tag_detail_paginated event.previous_page_number %}" title="Page {{ events.previous_page_number }}">Previous</a></li> | ||
{% else %} | ||
<li class="previous off">Previous</li> | ||
{% endif %} | ||
{% for page in posts.page_range %} | ||
{% ifequal page posts.page_number %} | ||
<li class="active">{{ page }}</li> | ||
{% else %} | ||
<li><a href="{% url events_tag_detail_paginated page %}">{{ page }}</a></li> | ||
{% endifequal %} | ||
{% endfor %} | ||
{% if has_next %} | ||
<li class="next on"><a href="{% url events_tag_detail_paginated posts.next_page_number %}" title="Page {{ events.next_page_number }}">Next</a></li> | ||
{% else %} | ||
<li class="next off">Next</li> | ||
{% endif %} | ||
</ul> | ||
{% endif %} | ||
{% endblock %} |
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,15 @@ | ||
{% extends "events/base_events.html" %} | ||
|
||
{% block title %}{{ block.super }}: Calendar Tags{% endblock %} | ||
|
||
{% block content_title %} | ||
<h2>Calendar Tags</h2> | ||
{% endblock %} | ||
|
||
{% block content %} | ||
<ul id="events_tags" class="tag_cloud"> | ||
{% for tag in tags %} | ||
<li><a href="{% url events_tag_detail tag.slug %}" rel="tag">{{ tag }}</a></li> | ||
{% endfor %} | ||
</ul> | ||
{% endblock %} |
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
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,29 @@ | ||
from icalendar import Calendar, Event, vText, vUri | ||
|
||
from django.contrib.sites.models import Site | ||
|
||
def export_ical(events): | ||
cal = Calendar() | ||
|
||
site = Site.objects.get_current() | ||
|
||
cal.add('prodid', '-//%s Events Calendar//%s//' % (site.name, site.domain)) | ||
cal.add('version', '2.0') | ||
|
||
site_token = site.domain.split('.') | ||
site_token.reverse() | ||
site_token = '.'.join(site_token) | ||
|
||
for event in events: | ||
ical_event = Event() | ||
ical_event.add('summary', event.title) | ||
ical_event.add('description', event.body) | ||
ical_event.add('dtstart', event.start_datetime) | ||
ical_event.add('dtend', event.end_datetime) | ||
ical_event.add('dtstamp', event.end_datetime) | ||
ical_event.add('url', vUri('http://' + site.domain + event.get_absolute_url())) | ||
ical_event['location'] = vText(event.location) | ||
ical_event['uid'] = '%d.event.events.%s' % (event.id, site_token) | ||
cal.add_component(ical_event) | ||
|
||
return cal |
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
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
python-dateutil | ||
django-taggit | ||
django-markup | ||
django-markup | ||
icalendar |