Martin Owens has proposed merging lp:~doctormo/loco-directory/expand-ical into
lp:loco-directory.
Requested reviews:
loco-directory-dev (loco-directory-dev)
Add team based ical functionality and some icons to offer it for users.
--
https://code.launchpad.net/~doctormo/loco-directory/expand-ical/+merge/31448
Your team loco-directory-dev is requested to review the proposed merge of
lp:~doctormo/loco-directory/expand-ical into lp:loco-directory.
=== modified file 'loco_directory/events/urls.py'
--- loco_directory/events/urls.py 2010-07-29 01:01:25 +0000
+++ loco_directory/events/urls.py 2010-07-31 05:26:42 +0000
@@ -5,7 +5,8 @@
url(r'^$', 'events.views.event_list', name='event-list'),
url(r'^history/$', 'events.views.event_history_list', name='event-history-list'),
#team events
- url(r'^team/ical/$', 'events.views.team_event_list_ical', name='team-event-list-ical'),
+ url(r'^team/ical/$', 'events.views.teams_event_list_ical', name='teams-event-list-ical'),
+ url(r'^team/ical/(?P<team_slug>[a-zA-Z0-9\-\.\+?]+)/$', 'events.views.team_event_list_ical', name='team-event-list-ical'),
url(r'^team/(?P<team_event_id>\d+)/register/$', 'events.views.team_event_register', name='team-event-register'),
url(r'^team/(?P<team_event_id>\d+)/detail/$', 'events.views.team_event_detail', name='team-event-detail'),
url(r'^team/(?P<team_event_id>\d+)/delete/$', 'events.views.team_event_delete', name='team-event-delete'),
@@ -13,8 +14,8 @@
url(r'^team/(?P<team_event_id>\d+)/comment/$', 'events.views.team_event_comment_new', name='team-event-comment-new'),
url(r'^team/(?P<team_event_id>\d+)/copy/$', 'events.views.team_event_copy', name='team-event-copy'),
url(r'^team/(?P<team_slug>[a-zA-Z0-9\-\.\+?]+)/add/$', 'events.views.team_event_new', name='team-event-new'),
+ url(r'^team/(?P<team_slug>[a-zA-Z0-9\-\.\+?]+)/rss/$', 'events.views.team_events_rss', name='team-events-rss'),
url(r'^team/add/$', 'events.views.team_event_select', name='team-event-select'),
- url(r'^team/(?P<team_slug>[a-zA-Z0-9\-\.\+?]+)/rss/$', 'events.views.team_events_rss', name='team-events-rss'),
#global events
url(r'^global/ical/$', 'events.views.global_event_list_ical', name='global-event-list-ical'),
url(r'^global/(?P<global_event_id>\d+)/detail/$', 'events.views.global_event_detail', name='global-event-detail'),
=== modified file 'loco_directory/events/views.py'
--- loco_directory/events/views.py 2010-07-29 07:54:21 +0000
+++ loco_directory/events/views.py 2010-07-31 05:26:42 +0000
@@ -44,42 +44,37 @@
return render_to_response('events/event_list.html', context,
RequestContext(request))
-def team_event_list_ical(request):
- """
- return a ical list with team events in ical format
- """
- #get all team events
- team_event_list = TeamEvent.objects.all()
-
+def event_list_ical(events, filename):
+ """Return any list events as an ical"""
response = HttpResponse(mimetype='text/calendar')
- response['Content-Disposition'] = 'attachment; filename=loco-team-events.ics'
+ response['Content-Disposition'] = 'attachment; filename=%s' % filename
response.write('''BEGIN:VCALENDAR
PRODID:-//loco.ubuntu.com//EN
VERSION:2.0
''')
- for team_event in team_event_list:
- response.write(team_event.as_ical())
+ for event in events:
+ response.write(event.as_ical())
response.write('''END:VCALENDAR''')
return response
+def team_event_list_ical(request, team_slug):
+ """
+ Return a ical list with a single team events in ical format.
+ """
+ team_events = TeamEvent.objects.filter(teams__lp_name=team_slug)
+ return event_list_ical(team_events, 'loco-team-events.ics')
+
+def teams_event_list_ical(request):
+ """
+ Return a ical list with team events in ical format.
+ """
+ return event_list_ical(TeamEvent.objects.all(), 'loco-teams-events.ics')
+
def global_event_list_ical(request):
"""
- return a ical list with global events in ical format
+ Return a ical list with global events in ical format.
"""
- #get all team events
- global_event_list = GlobalEvent.objects.all()
-
- response = HttpResponse(mimetype='text/calendar')
- response['Content-Disposition'] = 'attachment; filename=loco-team-events.ics'
- response.write('''BEGIN:VCALENDAR
-PRODID:-//loco.ubuntu.com//EN
-VERSION:2.0
-''')
- for global_event in global_event_list:
- response.write(global_event.as_ical())
- response.write('''END:VCALENDAR''')
- return response
-
+ return event_list_ical(GlobalEvent.objects.all(), 'global-events.ics')
def event_history_list(request):
"""
@@ -104,7 +99,7 @@
detailed view for a team event
"""
team_event_object = get_object_or_404(TeamEvent, pk=team_event_id)
- is_member = False
+ iis_member = False
for team_object in team_event_object.teams.all():
is_member = is_member or launchpad.is_team_member(request.user, team_object)
=== added file 'loco_directory/media/images/ical.png'
Binary files loco_directory/media/images/ical.png 1970-01-01 00:00:00 +0000 and loco_directory/media/images/ical.png 2010-07-31 05:26:42 +0000 differ
=== added file 'loco_directory/media/images/ical32.png'
Binary files loco_directory/media/images/ical32.png 1970-01-01 00:00:00 +0000 and loco_directory/media/images/ical32.png 2010-07-31 05:26:42 +0000 differ
=== modified file 'loco_directory/templates/events/event_list.html'
--- loco_directory/templates/events/event_list.html 2010-07-29 15:41:01 +0000
+++ loco_directory/templates/events/event_list.html 2010-07-31 05:26:42 +0000
@@ -22,29 +22,33 @@
{% block content %}
<article class="main-content">
-<h2>{% trans "Ubuntu LoCo Global Events" %}{% if global_event_list %} <a title="{% trans "Global Events as ical" %}" class="global_event_ical" href="{% url global-event-list-ical %}"></a>{% endif %}</h2>
-
+<h2>{% trans "Ubuntu LoCo Global Events" %}
{% if global_event_list %}
+<a class="global_event_ical" href="{% url global-event-list-ical %}">
+<img src="/media/images/ical.png" title="{% trans "Global Events as ical" %}"/></a></h2>
+
<p>{% trans "Select a global event below to see more information about it:" %}</p>
{% include "events/global_event_list.inc.html" %}
{% else %}
-<p>{% trans "There are currently no LoCo Global Events :(" %}</p>
+</h2><p>{% trans "There are currently no LoCo Global Events" %}</p>
{% endif %}
</article>
<hr class="divide" />
<article class="main-content">
-<h2>{% trans "Ubuntu LoCo Team Events" %}{% if team_event_list %} <a title="{% trans "Team Events as ical" %}" class="team_event_ical" href="{% url team-event-list-ical %}"></a>{% endif %}</h2>
+<h2>{% trans "Ubuntu LoCo Team Events" %}
{% if team_event_list %}
+<a class="teams_event_ical" href="{% url teams-event-list-ical %}">
+<img src="/media/images/ical.png" title="{% trans "Team Events as ical" %}"/></a></h2>
<p>{% trans "Select a team event below to see more information about it:" %}</p>
{% include "events/team_event_list.inc.html" %}
{% else %}
-<p>{% trans "There are currently no LoCo Team Events :(" %}</p>
+</h2><p>{% trans "There are currently no LoCo Team Events" %}</p>
{% endif %}
</article>
=== modified file 'loco_directory/templates/teams/team_event_list.html'
--- loco_directory/templates/teams/team_event_list.html 2010-07-29 15:41:01 +0000
+++ loco_directory/templates/teams/team_event_list.html 2010-07-31 05:26:42 +0000
@@ -1,7 +1,7 @@
{% extends "base.html" %}
{% load i18n %}
-{% block title %}{% blocktrans with team_object.lp_name as teamname %}{{teamname}} Events List{% endblocktrans %}{% endblock %}
+{% block title %}{% blocktrans with team_object.name as teamname %}{{teamname}} Events List{% endblocktrans %}{% endblock %}
{% block sub_nav_links %}
<a class="sub-nav-item" href="{% url team-detail team_object.lp_name %}">{% trans "Go back to team details" %}</a>
@@ -17,7 +17,9 @@
{% block content %}
<article class="main-content">
-<h1>{% blocktrans with team_object.lp_name as teamname %}{{teamname}} Events List{% endblocktrans %}</h1>
+<h1>{% blocktrans with team_object.name as teamname %}{{teamname}} Events List{% endblocktrans %}
+<a class="teams_event_ical" href="{% url team-event-list-ical team_object.lp_name %}">
+<img src="/media/images/ical32.png" title="ical"/></a></h1>
{% if team_event_list %}
<p>{% trans "Select a team event below to see more information about it:" %}</p>
=== added file 'sources/ical.svg'
--- sources/ical.svg 1970-01-01 00:00:00 +0000
+++ sources/ical.svg 2010-07-31 05:26:42 +0000
@@ -0,0 +1,169 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ version="1.0"
+ width="48"
+ height="48"
+ id="svg1872"
+ sodipodi:version="0.32"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="ical.svg"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape"
+ inkscape:export-filename="/home/doctormo/Projects/loco-directory/expand-ical/loco_directory/media/images/ical32.png"
+ inkscape:export-xdpi="60"
+ inkscape:export-ydpi="60">
+ <metadata
+ id="metadata10">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <sodipodi:namedview
+ inkscape:window-height="727"
+ inkscape:window-width="1280"
+ inkscape:pageshadow="2"
+ inkscape:pageopacity="0.0"
+ guidetolerance="10.0"
+ gridtolerance="10.0"
+ objecttolerance="10.0"
+ borderopacity="1.0"
+ bordercolor="#666666"
+ pagecolor="#ffffff"
+ id="base"
+ inkscape:zoom="1"
+ inkscape:cx="35.856804"
+ inkscape:cy="16.4978"
+ inkscape:window-x="0"
+ inkscape:window-y="25"
+ inkscape:current-layer="g2901"
+ showgrid="true"
+ width="48px"
+ height="48px"
+ inkscape:window-maximized="1" />
+ <defs
+ id="defs1874">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 24 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="48 : 24 : 1"
+ inkscape:persp3d-origin="24 : 16 : 1"
+ id="perspective23" />
+ <linearGradient
+ id="linearGradient9233">
+ <stop
+ id="stop9235"
+ offset="0"
+ style="stop-color:#eeeeec;stop-opacity:1;" />
+ <stop
+ id="stop9237"
+ offset="1"
+ style="stop-color:#eeeeec;stop-opacity:0;" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient9233"
+ id="linearGradient16273"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(22.43465,4.820297)"
+ x1="-10.638614"
+ y1="7.1375623"
+ x2="-15.286263"
+ y2="-6.2254333" />
+ </defs>
+ <g
+ id="g2901">
+ <g
+ id="g3631">
+ <path
+ d="M 48,24.242578 C 48,37.36344 37.261226,48 24.014276,48 10.767326,48 0.02855132,37.36344 0.02855132,24.242578 0.02855132,11.121717 10.767326,0.48515642 24.014275,0.48515642 37.261226,0.48515642 48,11.121717 48,24.242578 l 0,0 z"
+ style="fill:#ff7000;fill-opacity:1;fill-rule:evenodd;stroke:none"
+ id="path1880" />
+ <rect
+ transform="matrix(0.99994815,0.01018322,-0.01058707,0.99994396,0,0)"
+ y="14.252002"
+ x="13.486924"
+ height="13.315351"
+ width="21.48144"
+ id="rect2942"
+ style="fill:none;stroke:none" />
+ <rect
+ transform="matrix(0.99994815,0.01018322,-0.01058707,0.99994396,0,0)"
+ y="10.885867"
+ x="10.742333"
+ height="26.368856"
+ width="26.970638"
+ id="rect2940"
+ style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:2.74980092;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <rect
+ transform="matrix(0.99998484,0.00550686,-0.00487124,0.99998814,0,0)"
+ y="12.04221"
+ x="10.132347"
+ height="18.296875"
+ width="27.552347"
+ id="rect1882"
+ style="fill:#ff7000;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:1.81274724;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <g
+ transform="matrix(3.391276,0,0,3.3939159,-3.0190169,-3.1862063)"
+ id="g2034">
+ <rect
+ style="fill:none;stroke:none"
+ id="rect2036"
+ width="5.4196706"
+ height="3.3571696"
+ x="1.8729681"
+ y="7.4712706"
+ transform="matrix(0.963005,-0.269485,0.269485,0.963005,0,0)" />
+ <g
+ inkscape:label="Layer 1"
+ id="layer1"
+ transform="translate(0.0412207,0.0747524)">
+ <path
+ sodipodi:nodetypes="cscssscc"
+ id="path2394"
+ d="m 7.9427597,0.86404707 c -3.90417,0 -7.09375001,3.13599843 -7.09375001,7.00000003 0,0.2217652 0.014487,0.5436345 0.034901,0.7601485 C 1.3397607,8.3659402 1.7383699,8.0386301 2.2682039,7.8091296 3.7929949,7.1486588 5.5835057,6.4835094 7.5990097,6.1140471 9.6145137,5.7445847 11.805164,5.551547 14.13026,5.551547 c 0.143826,0 0.263282,0.029695 0.40625,0.03125 C 13.570792,2.8541184 11.028181,0.86404707 7.9427597,0.86404707 z"
+ style="fill:url(#linearGradient16273);fill-opacity:1;fill-rule:evenodd;stroke:none" />
+ </g>
+ </g>
+ <path
+ id="path2840"
+ d="m 19.831921,29.703613 0,-17.412504"
+ style="fill:none;stroke:#ffffff;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ <path
+ style="fill:none;stroke:#ffffff;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="m 25.831921,29.703613 0,-17.412504"
+ id="path2842" />
+ <path
+ style="fill:none;stroke:#ffffff;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="m 31.831921,29.703613 0,-17.412504"
+ id="path2846" />
+ <path
+ style="fill:none;stroke:#ffffff;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="m 13.99829,12.114332 0,17.500893"
+ id="path2848" />
+ <path
+ id="path2850"
+ d="m 37.139328,18.356974 -27.3669705,0"
+ style="fill:none;stroke:#ffffff;stroke-width:1.25049877px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ <path
+ style="fill:none;stroke:#ffffff;stroke-width:1.25049877px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="m 37.139328,24.356974 -27.3669705,0"
+ id="path2852" />
+ </g>
+ </g>
+</svg>
_______________________________________________
Mailing list: https://launchpad.net/~loco-directory-dev
Post to : [email protected]
Unsubscribe : https://launchpad.net/~loco-directory-dev
More help : https://help.launchpad.net/ListHelp