summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoracracia <acracia0.2@gmail.com>2009-09-05 17:12:04 (GMT)
committer acracia <acracia0.2@gmail.com>2009-09-05 17:12:04 (GMT)
commitdf45f7b3161f0ed0f9c1374440c76a05596bae76 (patch)
treea4570e6b8af745cde8901db5332de1ecadb5deef
parentc5b99ce779c7a4922e7eae76f2c4aee54e2e05b4 (diff)
brand-new-django project version
create an infopoint project with django-admin startproject infopoint and drop the agenda / templates / cal / sites / flatpages applications there, add them to the urls.py and synchronize the database.
-rw-r--r--agenda/billboardviews.py367
-rw-r--r--agenda/forms.py37
-rwxr-xr-xagenda/models.py142
-rw-r--r--agenda/templatetags/__init__.pycbin161 -> 0 bytes
-rw-r--r--agenda/templatetags/calendartable.pycbin1918 -> 0 bytes
-rwxr-xr-xagenda/urls.py72
-rwxr-xr-xagenda/views.py348
-rwxr-xr-xflatpages/__init__.py0
-rwxr-xr-xflatpages/models.py5
-rwxr-xr-xflatpages/views.py1
-rwxr-xr-xsites/__init__.py0
-rwxr-xr-xsites/models.py30
-rwxr-xr-xsites/urls.py23
-rwxr-xr-xsites/views.py33
-rw-r--r--templates/500.html9
-rwxr-xr-xtemplates/admin/base.html2
-rwxr-xr-xtemplates/admin/base_site.html3
-rwxr-xr-xtemplates/admin/index.html2
-rwxr-xr-xtemplates/agenda/add_new_event.html41
-rwxr-xr-xtemplates/agenda/base.html61
-rwxr-xr-xtemplates/agenda/billboard.html47
-rwxr-xr-xtemplates/agenda/calendarshape.html22
-rwxr-xr-xtemplates/agenda/event_list.html21
-rwxr-xr-xtemplates/agenda/event_map_view.html2
-rwxr-xr-xtemplates/agenda/events_tag.html30
-rwxr-xr-xtemplates/agenda/location_events.html38
-rwxr-xr-xtemplates/agenda/map_view.html4
-rwxr-xr-xtemplates/agenda/one_event.html118
-rwxr-xr-xtemplates/agenda/one_group.html46
-rwxr-xr-xtemplates/agenda/user_events.html2
-rwxr-xr-xtemplates/agenda/user_page.html66
-rwxr-xr-xtemplates/agenda/wishlist.html38
-rwxr-xr-xtemplates/base.html2
-rwxr-xr-xtemplates/blog/author_posts.html25
-rwxr-xr-xtemplates/blog/base.html47
-rwxr-xr-xtemplates/blog/blog_list.html22
-rwxr-xr-xtemplates/blog/directory.html29
-rwxr-xr-xtemplates/blog/one_blog.html16
-rwxr-xr-xtemplates/blog/post_alone.html17
-rwxr-xr-xtemplates/blog/post_list.html35
-rw-r--r--templates/comments/approve.html12
-rw-r--r--templates/comments/form.html13
-rw-r--r--templates/comments/posted.html10
-rwxr-xr-xtemplates/flatpages/base.html54
-rwxr-xr-xtemplates/flatpages/default.html10
-rwxr-xr-xtemplates/flatpages/left_menu.html11
-rwxr-xr-xtemplates/polls/base.html47
-rwxr-xr-xtemplates/polls/poll_detail.html39
-rwxr-xr-xtemplates/polls/poll_list.html14
-rwxr-xr-xtemplates/polls/results.html46
-rwxr-xr-xtemplates/sites/base.html52
-rwxr-xr-xtemplates/sites/base_site.html23
-rwxr-xr-xtemplates/sites/default.html13
-rwxr-xr-xtemplates/sites/directory.html29
-rwxr-xr-xtemplates/sites/site_list.html49
-rw-r--r--urls.py19
56 files changed, 1005 insertions, 1239 deletions
diff --git a/agenda/billboardviews.py b/agenda/billboardviews.py
index eaea323..50139ee 100644
--- a/agenda/billboardviews.py
+++ b/agenda/billboardviews.py
@@ -8,231 +8,134 @@ from django.contrib.auth import authenticate, login
from django.contrib.auth.models import Group,User
from django.contrib.comments.models import Comment
from infopoint.agenda.templatetags import *
-from infopoint.agenda.models import Event, Attendance,Todo, Billboard,Location
+from infopoint.agenda.models import Event, Attendance,Todo, Billboard
from infopoint.agenda.forms import TodoCreateForm, TodoForm
from django.contrib.formtools.preview import FormPreview
from django.views.generic import create_update
from django.template import RequestContext
from django.forms import ModelForm
import pydot
-import unicodedata
+today = date.today()
-def event_style(event_id):
- ev_node_style = "style='filled',fontname='Arial',fontsize='14',shape='component',URL='http://infopoint/agenda/'+str(event_id),rank='same'"
- return ev_node_style
-
-def group_galaxymap(request,object_id):
- this_group = Group.objects.get(pk=object_id)
-
- group_map = pydot.Dot(this_group.name, graph_type='digraph',strict=False, suppress_disconnected=True, fontname='Arial',size="12,12",overlap="False", ranksep='0.5',ratio='auto',bgcolor="#ffffff00", packmode="clust",URL="http://infopoint/",concentrate='True' )
- group_map.add_node(pydot.Node(this_group.name,fontname='Arial',style='filled',fontsize='26',shape='tab',fillcolor="#fd47bbff" ,URL="/agenda/map/user/"+object_id))
- related_groups = Group.objects.all().filter(user__in=this_group.user_set.all())
- for other_group in related_groups.exclude(pk=object_id):
- group_map.add_node(pydot.Node(other_group.name,fillcolor='#ec8968ff',fontname='Arial',style='filled',fontsize='12',shape='tab' ,URL="/agenda/group/"+str(other_group.id)))
- for members in other_group.user_set.all().exclude(pk=object_id):
- group_map.add_edge(pydot.Edge(members.username,other_group.name,fontname='Arial',fontsize='8',rank="sink"))
-
- for user_group in User.objects.all().filter(groups__in=(Group.objects.all().filter(user__in=this_group.user_set.all()))).distinct().exclude(pk=object_id):
- group_map.add_node(pydot.Node(user_group.username,color='purple',fontsize='12',style="filled",fillcolor="#00ff005f",fontname='Arial',shape='egg',URL="/agenda/user/"+str(user_group.id),rank="same"))
-
- for person in this_group.user_set.all():
- group_map.add_node(pydot.Node(person.username,color='yellow',fontsize='12',style="filled",fillcolor="#f7c640ff",fontname='Arial',shape='egg',URL="/agenda/user/"+str(person.id),rank="same"))
- group_map.add_edge(pydot.Edge(person.username,this_group.name,style='rounded',fontname='Arial'))
-
- for one_todo in this_group.todo_set.all().exclude(done=True):
- group_map.add_node(pydot.Node(one_todo.title,fillcolor="#f7c640ff",fontname='Arial',style='filled',fontsize='12',shape='note',URL='http://infopoint/agenda/todo/'+str(one_todo.id),rank='sink' ))
- group_map.add_edge(pydot.Edge(one_todo.title,this_group.name,style='rounded',fontname='Arial'))
- group_map.add_edge(pydot.Edge(one_todo.creator,one_todo.title,style='dotted',fontname='Arial',constraint='False'))
- for comment in Comment.objects.filter(content_type=2,object_pk=this_group.id):
- decoded = comment.comment.encode('ascii','replace')[0:12]
- group_map.add_node(pydot.Node(str(comment.id),label=decoded,fillcolor='#8bde93ff',fontname='Arial',style='filled',fontsize='14',shape='note',URL='http://infopoint/comment/'+str(comment.id),rank='same' ))
- group_map.add_edge(pydot.Edge(this_group.name,str(comment.id),style='rounded'))
- group_map.add_edge(pydot.Edge(str(comment.user),str(comment.id),style='dotted'))
- for one_event in this_group.events.all():
- group_map.add_node(pydot.Node(one_event.title[0:20], style='filled',fontname='Arial',fontsize='14',shape='component',URL='http://infopoint/agenda/'+str(one_event.id),rank='same', fillcolor="#acce4aff"))
- this_location = one_event.location
- group_map.add_edge(pydot.Edge(one_event.title[0:20],this_location.title))
- group_map.add_edge(pydot.Edge(this_group.name,this_location.title,style='dotted',fontname='Arial'))
- group_map.add_edge(pydot.Edge(this_group.name,one_event.title[0:20],style='rounded',fontname='Arial'))
- group_map.add_node(pydot.Node(this_location.title,fillcolor="#e399f6ff",fontname='Arial',style='filled',fontsize='8',shape='house',URL='http://infopoint/agenda/location/'+str(this_location.id)))
- if one_event.todo.count():
- todo_count = one_event.todo.count()
- group_map.add_node(pydot.Node(str(todo_count)+" todos",color='black',fillcolor="#f7c640ff",fontname='Arial',style='filled',fontsize='8',shape='note',URL='http://infopoint/agenda/'+str(one_event.id),rank='sink' ))
- group_map.add_edge(pydot.Edge(one_event.title[0:20],str(todo_count)+" todos",style='rounded',fontname='Arial'))
- group_map.add_edge(pydot.Edge(this_group.name,one_event.title[0:20],style='rounded'))
-
- for another_group in one_event.redes.all().exclude(pk=object_id):
- group_map.add_edge(pydot.Edge(another_group.name,one_event.title[0:20],style='dotted',fontname='Arial'))
-
- group_map.write_png('/var/www/media/maps/group_'+object_id+'.png', prog='dot')
- group_map.write_cmap('/var/www/media/maps/group_'+object_id+'.map', prog='dot')
- group_map.write_dot('/var/www/media/maps/group_'+object_id+'.dot', prog='dot')
- return HttpResponseRedirect('/agenda/group/'+object_id)
-
-
-
-def user_galaxymap(request,object_id):
- user = User.objects.get(pk=object_id)
- #comments =
-
-
- user_map = pydot.Dot(user.username, graph_type='digraph',strict=False, suppress_disconnected=True, fontname='Arial',size="11,14",overlap="False", ranksep='0.5',ratio='auto',bgcolor="#ffffff00", packmode="clust",URL="http://infopoint/",concentrate='True' )
- user_map.add_node(pydot.Node(user.username,color='purple',fontname='Arial',style='filled',fontsize='20',shape='record' ,URL="http://infopoint/agenda/map/user/"+object_id))
- user_events = user.events.all()
- user_comments = user.comment_comments.all()
- todos_created_by_user = user.todocreator.all().filter(done=False)
- groups = pydot.Subgraph(graph_name='Groups', label='Groups',suppress_disconnected=False,style='filled',fillcolor='#00ff005d',fontname='Arial', rank='same')
-
- user_map.add_node(pydot.Node('Todos',color='purple',fontname='Arial',style='filled',fontsize='20',shape='note' ,URL="http://infopoint/agenda/map/user/"+object_id))
- user_map.add_edge(pydot.Edge(user.username,'Todos',style='rounded',fontname='Arial',label='location',len='1'))
- for one_event in todos_created_by_user:
- user_map.add_node(pydot.Node(one_event.title,fontname='Arial',style='filled',fontsize='16',shape='component',URL='http://infopoint/agenda/todo/'+str(one_event.id),rank='same' ))
- user_map.add_edge(pydot.Edge('Todos',one_event.title,style='rounded',fontname='Arial'))
-
- for one_event in user_events:
- user_map.add_node(pydot.Node(str(one_event.title),color='green',fontname='Arial',style='filled',fontsize='10',shape='record',URL='http://infopoint/agenda/'+str(one_event.id)))
- user_map.add_edge(pydot.Edge(user.username,str(one_event.title),style='rounded',fontname='Arial',label='goes to',len='1'))
- user_map.add_edge(pydot.Edge(str(one_event.title),str(one_event.location),style='rounded',fontname='Arial',label='location',len='1'))
- user_map.add_subgraph(groups)
-
- user_map.write_png('/var/www/media/maps/user_'+object_id+'.png', prog='dot')
- user_map.write_cmap('/var/www/media/maps/user_'+object_id+'.map', prog='dot')
- map_coordinates = user_map.create_cmap( prog='dot')
- return HttpResponseRedirect('/agenda/user/'+object_id)
-
-
-def location_galaxymap(request,object_id):
- location = Location.places.get(pk=object_id)
- #comments =
- location_map = pydot.Dot(location.title, graph_type='digraph',strict=False, suppress_disconnected=False, fontname='Arial',size="12,4",overlap="False", ranksep='0.5',ratio='auto',bgcolor="#ffffff00", packmode="clust",URL="http://infopoint/", concentrate='True' )
- location_map.add_node(pydot.Node(location.title,fontname='Arial',style='filled',fontsize='24',shape='house',fillcolor='#e399f6ff', URL='/agenda/location/'+str(object_id)))
- events_map = pydot.Subgraph(graph_name='Events')
- todo_map = pydot.Subgraph(graph_name='Todos')
- groups_map = pydot.Subgraph(graph_name='Groups')
- comments_map = pydot.Subgraph(graph_name='Comments')
-
- for one_todo in location.todolocation.all():
- todo_map.add_node(pydot.Node(one_todo.title[0:20],URL='/agenda/'+str(one_todo.id) ))
- location_map.add_edge(pydot.Edge(one_todo.title[0:20],location.title))
- location_map.add_edge(pydot.Edge(one_todo.creator,one_todo.title[0:20]))
-
- for events in location.event_set.all():
- events_map.add_node(pydot.Node(events.title.encode('ascii', 'ignore')[0:20],URL='/agenda/'+str(events.id) ))
- location_map.add_edge(pydot.Edge(events.title.encode('ascii', 'ignore')[0:20],location.title))
- for comment in Comment.objects.filter(content_type='13',object_pk=events.id):
- comment.comment.encode('ascii', 'ignore')
- comments_map.add_node(pydot.Node(comment.comment[0:20],URL='/comment/'+str(comment.id) ))
- location_map.add_edge(pydot.Edge(events.title[0:20],comment.comment[0:20]))
- location_map.add_edge(pydot.Edge(comment.user,comment.comment[0:20],constraint='False'))
-
- for group in events.group.iterator():
- groups_map.add_node(pydot.Node(group.group,URL='/comment/'+str(group.group_id) ))
- location_map.add_edge(pydot.Edge(events.title,group.group[0:20]))
-
- for todo in events.todo.all().exclude(done='True'):
- todo.title.encode('ascii', 'ignore')
- todo_map.add_node(pydot.Node(todo.title[0:20],URL='/agenda/todo/'+str(events.id) ))
- location_map.add_edge(pydot.Edge(todo.title[0:20],events.title[0:20]))
- location_map.add_edge(pydot.Edge(todo.creator,todo.title[0:20]))
-
- for comment in Comment.objects.filter(content_type='12',object_pk=object_id):
- comment.comment.encode('ascii', 'ignore')
- comments_map.add_node(pydot.Node(comment.comment[0:20],URL='/comment/'+str(comment.id) ))
- location_map.add_edge(pydot.Edge(location.title,comment.comment[0:20]))
- location_map.add_edge(pydot.Edge(comment.user,comment.comment[0:20]))
-
-
- for a in todo_map.node_list:
- a.set_fontname('Arial')
- a.set_fillcolor("#f7c640ff")
- a.set_style('filled')
- a.set_shape('tab')
- for a in events_map.node_list:
- a.set_fontname('Arial')
- a.set_fillcolor("#acce4aff")
- a.set_style('filled')
- a.set_shape('component')
-
- for a in comments_map.node_list:
+def event_galaxy(request,object_id):
+ event = Event.calendar.select_related().get(pk=object_id)
+ event_redes = event.redes.all()
+ event_attending = event.atendees.all()
+ comments = Comment.objects.filter(content_type=13,object_pk=object_id,is_public=True)
+ other_events_on_this_location = event.location.event_set.all().filter(public=True,start_date__gte=today,end_date__gte=today)[:3]
+ other_events_attended_by_atendees = Event.events.next_events().filter(public=True,start_date__gte=today,atendees__in=event.atendees.all()).distinct()
+ other_events_with_this_event_groups = Event.events.next_events().filter(public=True,redes__in=event.redes.all()).distinct()
+
+ map = pydot.Dot("ev"+str(event.id), graph_type="digraph",strict="True", suppress_disconnected="False", fontname="Arial",ratio="compress",size="8,8",overlap="False", bgcolor="#ffffff6d", packmode="clust",URL="/",remincross="True" )
+ map.add_node(pydot.Node("ev"+str(event.id),label=str(event.title)+" "+str(event.start_date.strftime('%d %b')),color='purple',fontname='Arial',style='filled',fontsize='30',shape='record' ,URL="/agenda/map/"+str(object_id)))
+ map.add_node(pydot.Node("lo"+str(event.location.id),label=str(event.location.title),fontname='Arial',style='filled',fontsize='20',shape='record', fillcolor='#00ff005d',URL='/agenda/location/'+str(event.location.id)))
+ map.add_edge(pydot.Edge("ev"+str(event.id),"lo"+str(event.location.id),style='rounded',len='1'))
+
+ cluster_Groups = pydot.Subgraph(graph_name='cluster_Groups',label='Groups',fontname='Arial',style='rounded')
+ todos = pydot.Subgraph(graph_name='cluster_Todos',label='Tasks',fontname='Arial',style='rounded')
+ events = pydot.Subgraph(label='Events',shape='note',fillcolor='lightgrey',fontname='Arial',style='rounded')
+ comments_graph = pydot.Subgraph(graph_name='Comments',label='Comments',style='rounded',fontname='Arial')
+ for todo in event.todo.all()[:3]:
+ todos.add_node(pydot.Node("td"+str(todo.id),label=todo.title,color='lightpink',fontname='Arial',style='filled',fontsize='10',shape='box'))
+ events.add_edge(pydot.Edge("ev"+str(event.id),"td"+str(todo.id)))
+ for todo in event.location.todolocation.all()[:3]:
+ todos.add_node(pydot.Node("td"+str(todo.id),label=todo.title,color='lightpink',fontname='Arial',style='filled',fontsize='10',shape='box'))
+ events.add_edge(pydot.Edge("lo"+str(event.location.id),"td"+str(todo.id)))
+ for location_event in event.location.event_set.all().filter(public=True,end_date__gte=today).exclude(id=object_id,end_date__lte=today)[:3]:
+ if (location_event.id != event.id):
+ events.add_edge(pydot.Edge("lo"+str(event.location.id),"ev"+str(location_event.id)))
+ events.add_node(pydot.Node("ev"+str(location_event.id),label=str(location_event.title)+"\\n"+str(location_event.start_date.strftime('%b %d')),color='green',fontname='Arial',style='filled',fontsize='10',shape='record',URL='/agenda/'+str(location_event.id)))
+ for pixie in event.pixie.iterator():
+ comments_graph.add_edge(pydot.Edge(pixie.username,"ev"+str(event.id),style='dotted'))
+ comments_graph.add_node(pydot.Node(pixie.username,color='lightpink',fontname='Arial',style='filled',fontsize='10',shape='record'))
+ for comment in comments:
+ comments_graph.add_node(pydot.Node(unicode(comment.comment).encode('ascii'),color="lightpink",fontname='Arial',style='filled',fontsize='10',shape='note' ,URL="/agenda/"+object_id,rank="min"))
+ comments_graph.add_edge(pydot.Edge(comment.user.username,comment.comment.encode('ascii', 'ignore'),style='dotted'))
+ comments_graph.add_edge(pydot.Edge("ev"+str(event.id),comment.comment.encode('ascii', 'ignore'),style='rounded',rank='same'))
- a.set_fontname('Arial')
- a.set_fillcolor("#8bde93ff")
- a.set_style('filled')
- a.set_shape('note')
- location_map.add_subgraph(events_map)
- location_map.add_subgraph(todo_map)
- location_map.add_subgraph(groups_map)
- location_map.add_subgraph(comments_map)
- location_map.write_png('/var/www/media/maps/location_'+object_id+'.png', prog='dot')
- location_map.write_cmap('/var/www/media/maps/location_'+object_id+'.map', prog='dot')
- map_coordinates = location_map.create_cmap( prog='dot')
- return HttpResponseRedirect('/agenda/location/'+object_id)
+ for group in event_redes:
+ cluster_Groups.add_node(pydot.Node("gr"+str(group.id),label=group.name,color='yellow',style="filled",fillcolor="#ff33cc5f" ,shape='record',group='groups',URL="/agenda/group/"+str(group.id), rank="5"))
+ events.add_edge(pydot.Edge("gr"+str(group.id),"ev"+str(event.id),fontname='Arial',fontsize='8',rank="sink"))
+
+ for related_event in other_events_with_this_event_groups.exclude(pk=object_id,public=False,end_date__lte=today)[:3]:
+ if (related_event.id != event.id):
+ events.add_node(pydot.Node("ev"+str(related_event.id),label=related_event.title+"\\n"+str(related_event.start_date.strftime('%b %d')),color='green',fontsize='12',style="filled",fillcolor="#00ff005f",fontname='Arial',shape='box',URL="/agenda/map/"+str(related_event.id),rank="same"))
+
+ for group in related_event.redes.all():
+ events.add_edge(pydot.Edge("gr"+str(group.id),"ev"+str(related_event.id),shape='point',fontsize='8',rank="sink"))
+ cluster_Groups.add_node(pydot.Node("gr"+str(group.id),label=group.name,color='yellow',style="filled",fillcolor="#ff33cc5f" ,shape='record',group='groups',URL="/agenda/group/"+str(group.id), rank="5",fontname='Arial'))
+ if (related_event.id != event.id):
+ events.add_node(pydot.Node("ev"+str(related_event.id),label=related_event.title+"\\n"+str(related_event.start_date.strftime('%b %d')),color='green',fontsize='12',style="filled",fillcolor="#00ff005f",fontname='Arial',shape='box',URL="/agenda/map/"+str(related_event.id),rank="same"))
+ events.add_edge(pydot.Edge("ev"+str(event.id),"ev"+str(related_event.id),fontname='Arial',fontsize='8',style='dotted'))
+ for user in related_event.atendees.all().distinct():
+ events.add_edge(pydot.Edge(user.username,"ev"+str(related_event.id),fontname='Arial',fontsize='8',rank="sink"))
+ map.add_subgraph(comments_graph)
+ map.add_subgraph(cluster_Groups)
+ map.add_subgraph(todos)
+ map.add_subgraph(events)
+ map.write_png('/var/www/media/maps/event_'+object_id+'.png', prog='dot')
+ map.write_dot('/var/www/media/maps/event_'+object_id+'.dot', prog='dot')
+ map.write_cmap('/var/www/media/maps/event_'+object_id+'.map', prog='dot')
+ map_coordinates = map.create_cmap( prog='dot')
+ #return render_to_response('agenda/map_view.html', {'event': event,'map_coordinates':map_coordinates },context_instance=RequestContext(request))
+ return HttpResponseRedirect('/agenda/'+object_id)
-def event_galaxy(request,object_id):
- event = Event.calendar.get(pk=object_id)
+def event_galaxy_for_map(request,object_id):
+ event = Event.calendar.select_related().get(pk=object_id)
event_redes = event.redes.all()
event_attending = event.atendees.all()
- comments = Comment.objects.filter(content_type=13,object_pk=object_id)
- location_comments = Comment.objects.filter(content_type=12,object_pk=event.location.id)
- other_events_on_this_location = event.location.event_set.all()
- other_events_attended_by_atendees = Event.events.next_events().filter(atendees__in=event.atendees.all()).distinct()
- other_events_with_this_event_groups = Event.events.next_events().filter(redes__in=event.redes.all()).distinct()
-
- map = pydot.Dot(event.description, graph_type='digraph',strict=False, suppress_disconnected=True, size="12,4",overlap="False", ranksep='0.5',ratio='auto',bgcolor="#ffffff00", packmode="clust",URL="http://infopoint/" )
- events = pydot.Subgraph(graph_name='Events',label='Events',style='filled',fillcolor='lightgrey',packmode="clust")
- comments_graph = pydot.Subgraph(graph_name='Comments',label='Comments',style='rounded',fillcolor='lightgrey')
- map.add_node(pydot.Node(event.title,fillcolor="#fd47bbff",style='filled',fontsize='24',shape='component' ,URL="http://infopoint/agenda/"+object_id))
- map.add_edge(pydot.Edge(event.title,event.location.title,style='rounded',label='location',len='1'))
- map.add_node(pydot.Node(event.location.title,style='filled',fontsize='14',shape='house',fillcolor='#e399f6ff', URL='http://infopoint/agenda/location/'+str(event.location.id)))
-
- for comment in location_comments:
- comment.comment.encode('ascii','ignore')
- comments_graph.add_node(pydot.Node(comment.comment[0:20],fillcolor="#8bde93ff",style='filled',fontsize='10',shape='note' ,URL="http://infopoint/admin/comments/comment/"+object_id+"/",rank="min"))
- comments_graph.add_edge(pydot.Edge(comment.user,comment.comment[0:20],style='dotted',label='is_author',len='3'))
- comments_graph.add_edge(pydot.Edge(event.location,comment.comment[0:20],style='rounded',len='1',rank='same' ))
-
- for todo in event.location.todolocation.all().exclude(done=True):
- decoded_todo = todo.title.encode('ascii','ignore')[0:20]
- events.add_node(pydot.Node(decoded_todo,fillcolor="#f7c640ff",style='filled',fontsize='10',shape='note' ,URL="http://infopoint/agenda/todo/"+str(todo.id),rank="min"))
- events.add_edge(pydot.Edge(decoded_todo,event.location,style='dotted',len='1'))
-
- groups = pydot.Subgraph(graph_name='Groups', label='Groups',suppress_disconnected=False,style='filled',fillcolor='#00ff005d')
- for todo in event.todo.all().exclude(done=True):
- decoded_todo = todo.title.encode('ascii','ignore')[0:20]
- events.add_node(pydot.Node(decoded_todo,fillcolor="#f7c640ff",style='filled',fontsize='10',shape='note' ,URL="http://infopoint/agenda/todo/"+str(todo.id),rank="min"))
- events.add_edge(pydot.Edge(decoded_todo,event.title,style='dotted',len='2'))
- events.add_edge(pydot.Edge(todo.creator,decoded_todo,style='dotted',len='2',constraint=False))
- for location_event in event.location.event_set.all().exclude(id=object_id):
- events.add_node(pydot.Node(location_event.title,fillcolor="#acce4aff",style='filled',fontsize='10',shape='component',URL='http://infopoint/agenda/'+str(location_event.id)))
- events.add_edge(pydot.Edge(location_event.title,event.location,fontsize='8',rank="sink"))
+ comments = Comment.objects.filter(content_type=14,object_pk=object_id)
+ other_events_on_this_location = event.location.event_set.all().filter(public=True,end_date__gte=today)[:3]
+ other_events_attended_by_atendees = Event.events.next_events().filter(atendees__in=event.atendees.all()).distinct()[:3]
+ other_events_with_this_event_groups = Event.events.next_events().filter(public=True,end_date__gte=today,redes__in=event.redes.all()).distinct().exclude(id=object_id)
+
+
+ map = pydot.Dot(event.id, graph_type="digraph",strict="True", suppress_disconnected="True", fontname="Arial",size="10,6",overlap="True", ranksep="1",ratio="auto",bgcolor="#dddddd5d", packmode="group",URL="/" )
+ map.add_node(pydot.Node(event.title,color='purple',fontname='Arial',style='filled',fontsize='20',shape='record' ,URL="/agenda/"+object_id))
+ map.add_node(pydot.Node(event.location.title,color='purple',fontname='Arial',style='filled',fontsize='20',shape='record',URL='/agenda/location/'+str(event.location.id)))
+ map.add_edge(pydot.Edge(event.title,event.location.title,fontname='Arial',label='location',len='1'))
+
+ groups = pydot.Subgraph(graph_name='Groups', label='Groups',suppress_disconnected=False,style='filled',fillcolor='#00ff005d',fontname='Arial')
+ events = pydot.Subgraph(graph_name='Events',label='Events',style='filled',shape='note',fillcolor='lightgrey',fontname='Arial')
+ comments_graph = pydot.Subgraph(graph_name='Comments',label='Comments',fillcolor='lightgrey',fontname='Arial')
+ for todo in event.location.todolocation.all()[:3]:
+ events.add_node(pydot.Node("td"+str(todo.id),label=todo.title,color='#00ff005d',fontname='Arial',style='filled',fontsize='10',shape='box'))
+ events.add_edge(pydot.Edge("lo"+str(event.location.location.id),"td"+str(todo.id),rank="sink"))
+ for location_event in event.location.todolocation.all()[:3]:
+ events.add_node(pydot.Node(location_event.title,color='lightpink',fontname='Arial',style='filled',fontsize='10',shape='record',URL='/agenda/map/'+str(location_event.id)))
+ events.add_edge(pydot.Edge(event.location.title,location_event.title,fontname='Arial',fontsize='8',rank="sink"))
+
+ for location_event in event.location.event_set.all().exclude(id=object_id,end_date__gte=today)[:3]:
+ events.add_node(pydot.Node(location_event.title,color='green',fontname='Arial',style='filled',fontsize='10',shape='record',URL='/agenda/map/'+str(location_event.id)))
+ events.add_edge(pydot.Edge(event.location.title,location_event.title,fontname='Arial',fontsize='8',rank="sink"))
for pixie in event.pixie.iterator():
- comments_graph.add_edge(pydot.Edge(pixie,event.title.encode('ascii', 'ignore'),style='dotted',len='2'))
- events.add_node(pydot.Node(pixie,fontsize='12',style="filled",fillcolor="#f7c640ff",shape='egg',URL="/agenda/user/"+str(pixie.id),rank="same"))
+ comments_graph.add_edge(pydot.Edge(pixie.username,event.title.encode('ascii', 'ignore'),style='dotted',fontname='Arial',len='2'))
+ comments_graph.add_node(pydot.Node(pixie.username,color='lightpink',fontname='Arial',style='filled',fontsize='10',shape='record'))
for comment in comments:
- comment.comment.encode('ascii', 'ignore')
- comments_graph.add_node(pydot.Node(comment.comment[0:20],fillcolor="#8bde93ff",style='filled',fontsize='10',shape='note' ,URL="http://infopoint/admin/comments/comment/"+object_id+"/",rank="min"))
- comments_graph.add_edge(pydot.Edge(comment.user,comment.comment[0:20],style='dotted',label='is_author',len='3'))
- comments_graph.add_edge(pydot.Edge(comment.comment[0:20],event.title,style='rounded',len='1',rank='same' ))
+ comments_graph.add_node(pydot.Node(unicode(comment.comment).encode('ascii'),color="lightpink",fontname='Arial',style='filled',fontsize='10',shape='note' ,URL="/agenda/map/"+object_id,rank="min"))
+ comments_graph.add_edge(pydot.Edge(comment.user.username,comment.comment.encode('ascii', 'ignore'),style='dotted',fontname='Arial',label='is_author',len='3'))
+ comments_graph.add_edge(pydot.Edge(event.title,comment.comment.encode('ascii', 'ignore'),fontname='Arial',label='location',len='1',rank='same'))
for person in event_attending:
- events.add_node(pydot.Node(person.username,fontsize='12',style="filled",fillcolor="#f7c640ff",shape='egg',URL="/agenda/user/"+str(person.id),rank="same"))
- events.add_edge(pydot.Edge(person.username,event.title,fontsize='8',rank="sink"))
+ events.add_node(pydot.Node(person.username,color='purple',fontsize='12',style="filled",fillcolor="#00ff005f",fontname='Arial',shape='note',URL="/agenda/map/user/"+str(person.id),rank="same"))
+ events.add_edge(pydot.Edge(person.username,event.title,fontname='Arial',fontsize='8',rank="sink"))
for group in event_redes:
- groups.add_node(pydot.Node(group.name,style="filled",fillcolor='#ec8968ff' ,shape='tab',group='groups',URL="http://infopoint/agenda/group/"+str(group.id), rank="5"))
- events.add_edge(pydot.Edge(group.name,event.title,fontsize='8',rank="sink"))
+ groups.add_node(pydot.Node(group.name,color='yellow',style="filled",fillcolor="#ff33cc5f" ,shape='record',group='groups',URL="/agenda/map/group/"+str(group.id), rank="5",fontname='Arial'))
+ events.add_edge(pydot.Edge(event.title,group.name,fontname='Arial',fontsize='8',rank="sink"))
+
+ for related_event in other_events_with_this_event_groups.exclude(pk=object_id,start_date__gte=datetime.now())[:3]:
- for related_event in other_events_with_this_event_groups.exclude(pk=object_id):
- events.add_node(pydot.Node(related_event.title,fontsize='12',style="filled",fillcolor="#acce4aff",fontname='Arial',shape='component',URL="/agenda/"+str(related_event.id),rank="same"))
+ events.add_node(pydot.Node(related_event.title,color='green',fontsize='12',style="filled",fillcolor="#00ff005f",fontname='Arial',shape='box',URL="/agenda/map/"+str(related_event.id),rank="same"))
- for group in related_event.group.all():
- events.add_edge(pydot.Edge(group.group,related_event.title,fontname='Arial',shape='point',fontsize='8',rank="sink"))
- groups.add_node(pydot.Node(group.group,style="filled",fillcolor='#ec8968ff',shape='tab',group='groups',URL="http://infopoint/agenda/group/"+str(group.group_id), rank="5",fontname='Arial'))
+ for group in related_event.redes.all():
+ events.add_edge(pydot.Edge(group.name,related_event.title,fontname='Arial',shape='point',fontsize='8',rank="sink"))
+ groups.add_node(pydot.Node(group.name,color='yellow',style="filled",fillcolor="#ff33cc5f" ,shape='record',group='groups',URL="/agenda/map/group/"+str(group.id), rank="5",fontname='Arial'))
- events.add_node(pydot.Node(related_event.title,fontsize='12',style="filled",fillcolor="#acce4aff",fontname='Arial',shape='component',URL="/agenda/"+str(related_event.id),rank="same"))
- events.add_edge(pydot.Edge(event.title,related_event.title,fontname='Arial' ,fontsize='8',style='dotted',rank='same'))
+ events.add_node(pydot.Node(related_event.title,color='green',fontsize='12',style="filled",fillcolor="#00ff005f",fontname='Arial',shape='box',URL="/agenda/map/"+str(related_event.id),rank="same"))
+ events.add_edge(pydot.Edge(event.title,related_event.title,fontname='Arial',fontsize='8',style='dotted'))
for user in related_event.atendees.all().distinct():
events.add_edge(pydot.Edge(user.username,related_event.title,fontname='Arial',label='goes to',fontsize='8',rank="sink"))
@@ -240,18 +143,52 @@ def event_galaxy(request,object_id):
map.add_subgraph(comments_graph)
map.add_subgraph(groups)
map.add_subgraph(events)
- for a in comments_graph.node_list:
- a.set_fontname('Arial')
- for a in events.node_list:
- a.set_fontname('Arial')
- for a in groups.node_list:
- a.set_fontname('Arial')
-
map.write_png('/var/www/media/maps/event_'+object_id+'.png', prog='dot')
map.write_cmap('/var/www/media/maps/event_'+object_id+'.map', prog='dot')
map.write_dot('/var/www/media/maps/event_'+object_id+'.dot', prog='dot')
+ map_coordinates = map.create_cmap( prog='dot')
+ #return render_to_response('agenda/event_map_view.html', {'event': event,'map_coordinates':map_coordinates },context_instance=RequestContext(request))
return HttpResponseRedirect('/agenda/'+object_id)
+def event_galaxy2(request,object_id):
+ event = Event.calendar.get(pk=object_id)
+ event_redes = event.redes.all()
+ event_attending = event.atendees.all()
+ other_events_attended_by_atendees = Event.events.next_events().filter(atendees__in=event.atendees.all()).distinct()
+ other_events_with_this_event_groups = Event.events.next_events().filter(redes__in=event.redes.all()).distinct()
+
+ map = pydot.Dot(event.title, graph_type='digraph',strict=True, suppress_disconnected=False, fontname='Arial',size="14,17",overlap="False", ranksep='2',ratio='auto',bgcolor="#dddddd5d", packmode="clust",URL='http://infopoint/' )
+ map.add_node(pydot.Node(event.title,color='purple',fontname='Arial',style='filled',fontsize='20',shape='record' ,URL="http://infopoint/agenda/map/"+str(object_id)))
+ map.add_node(pydot.Node(event.location.title,color='purple',fontname='Arial',style='filled',fontsize='20',shape='record',URL="http://infopoint/agenda/map/location/"+str(event.location.id)))
+ map.add_edge(pydot.Edge(event.title,event.location.title))
+
+ groups = pydot.Subgraph(graph_name='Groups', suppress_disconnected=False,style='filled',fillcolor='#00ff005d',fontname='Arial')
+ events = pydot.Subgraph(graph_name='Events',style='filled',shape='note',fillcolor='lightgrey',fontname='Arial')
+
+
+ for related_event in other_events_with_this_event_groups:
+ for group in related_event.redes.all():
+ events.add_edge(pydot.Edge(group.name,related_event.title,fontname='Arial',shape='point',fontsize='8',rank="sink"))
+
+ for a in event_redes.distinct():
+ groups.add_node(pydot.Node(a.name,color='yellow',style="filled",fillcolor="#ff33cc5f" ,shape='record',group='groups',URL="http://infopoint/agenda/map/group/"+str(a.id), rank="2",fontname='Arial'))
+ groups.add_edge(pydot.Edge(event.title,a.name,style='dotted',fontname='Arial'))
+ for group in event_redes.iterator():
+ for related_event in group.networkevent.all().distinct():
+ events.add_node(pydot.Node(str(related_event.event),color='green',fontsize='8',style="filled",fillcolor="#00ff005f",fontname='Arial',shape='record',URL='/agenda/map/'+str(related_event.event_id),rank="min"))
+
+ for a in event_attending:
+ events.add_node(pydot.Node(a.username,color='yellow',style="filled",fillcolor="#00ffff5f" ,shape='note',group='users',rank="sink",fontname='Arial'))
+ events.add_edge(pydot.Edge(event.title,a.username,fontname='Arial',shape='point',fontsize='8',rank="sink"))
+
+ map.add_subgraph(groups)
+ map.add_subgraph(events)
+ map.write_png('/var/www/media/maps/event_'+object_id+'.png', prog='dot')
+ map.write_dot('/var/www/media/maps/event_'+str(object_id)+'.dot', prog='dot')
+ map_coordinates = map.create_cmap( prog='dot')
+ map.write_imap('/var/www/media/maps/event_'+str(object_id)+'.map', prog='dot')
+ return render_to_response('agenda/billboard_still.html', {'event': event,'map_coordinates':map_coordinates },context_instance=RequestContext(request))
+
def one_still_event(request,object_id,billboard_id):
event = Event.calendar.get(pk=object_id)
style = Billboard.objects.get(pk=billboard_id)
@@ -260,7 +197,15 @@ def one_still_event(request,object_id,billboard_id):
def billboard(request,billboard_id):
style = Billboard.objects.get(pk=billboard_id)
- list = Event.calendar.filter(location__in=style.location.all()).distinct()|Event.calendar.filter(group__in=style.groups.all()).distinct()
+ list = Event.events.filter(location__in=style.location.all())|Event.calendar.filter(redes__in=style.groups.all())
+ if style.timespan=='1':
+ list = Event.events.next_events().filter(location__in=style.location.all()).distinct()|Event.events.next_events().filter(redes__in=style.groups.all()).distinct()
+ if style.timespan=='2':
+ list = Event.events.past_events().filter(location__in=style.location.all()).distinct()|Event.events.past_events().filter(redes__in=style.groups.all()).distinct()
+ if style.timespan=='3':
+ list = Event.events.all().filter(location__in=style.location.all()).distinct()|Event.events.all().filter(redes__in=style.groups.all()).distinct()
+ if style.timespan=='4':
+ list = Event.events.today_events().filter(location__in=style.location.all()).distinct()|Event.events.today_events().filter(redes__in=style.groups.all()).distinct()
event = list.order_by('?')[:1]
return render_to_response('agenda/billboard.html', { 'event': event,'list': list, 'style': style },context_instance=RequestContext(request))
diff --git a/agenda/forms.py b/agenda/forms.py
index c8cb280..bc8a93d 100644
--- a/agenda/forms.py
+++ b/agenda/forms.py
@@ -6,11 +6,13 @@ from infopoint.sites.models import Site
import datetime
from django.contrib.contenttypes import generic
from django.contrib import databrowse
+from django.contrib.admin import widgets
from django.contrib.auth.models import User,Group
from django.contrib.comments.models import Comment,ContentType,User
from django import forms
from django.forms import ModelForm,DateTimeInput
from django.template.loader import render_to_string
+from django.utils.translation import ugettext as _
from django.contrib import admin
@@ -20,17 +22,28 @@ from django.contrib import admin
class EventForm(ModelForm):
class Meta:
model = Event
+class SubmitEventForm(EventForm):
+ class Meta:
+ model = Event
+ exclude = ['site', 'atendees', 'redes', 'isrecurrenceof']
+
+class NewEventForm(ModelForm):
+ class Meta:
+ model = Event
+ exclude = ['site', 'start_date', 'end_date', 'pixie', 'atendees', 'redes']
+class NewEventRestrictedForm(NewEventForm):
+ pass
class RedesForm(ModelForm):
class Meta:
model = Network
class GroupAddEventForm(forms.Form):
- group = forms.ModelMultipleChoiceField(queryset=Group.objects.all(),help_text='Send this event information to a group')
+ group = forms.ModelMultipleChoiceField(queryset=Group.objects.all(),help_text=_('Send this event information to a group'))
class TodoForm(ModelForm):
- class Meta:
- model = Todo
+ class Meta:
+ model = Todo
class TodoCompletedForm(forms.Form):
pass
@@ -44,9 +57,9 @@ class TodoCreateForm(forms.Form):
description = forms.CharField(max_length=300,required=False,widget=forms.TextInput(attrs={'size':'40'}))
due_date = forms.DateField(required=False,widget=forms.DateTimeInput)
public = forms.BooleanField(required=False)
- group = forms.ModelMultipleChoiceField(queryset=Group.objects.all(), required=False,help_text='Is this task related to a group?')
- event = forms.ModelMultipleChoiceField(queryset=Event.calendar.all(), required=False,help_text='Is this task related to an event?')
- location = forms.ModelMultipleChoiceField(queryset=Location.places.all(), required=False,help_text='Is this task related to a locattion?')
+ group = forms.ModelMultipleChoiceField(queryset=Group.objects.all(), required=False,help_text=_('Is this task related to a group?'))
+ event = forms.ModelMultipleChoiceField(queryset=Event.calendar.all(), required=False,help_text=_('Is this task related to an event?'))
+ location = forms.ModelMultipleChoiceField(queryset=Location.places.all(), required=False,help_text=_('Is this task related to a locattion?'))
class TodoRelatedCreateForm(forms.Form):
@@ -54,11 +67,14 @@ class TodoRelatedCreateForm(forms.Form):
Put here the tasks needed to be done before the event...
"""
title = forms.CharField(max_length=100)
- public = forms.BooleanField(required=False,help_text='Is this todo public?')
+ public = forms.BooleanField(required=False,help_text=_('Is this todo public?'))
description = forms.CharField(max_length=300,required=False,widget=forms.TextInput(attrs={'size':'25'}))
due_date = forms.DateField(required=False,widget=forms.DateTimeInput)
+class DateForm(forms.Form):
+ start_date = forms.DateField(widget=widgets.AdminSplitDateTime)
+ end_date = forms.DateField(widget=widgets.AdminSplitDateTime)
class AttendanceForm(ModelForm):
class Meta:
@@ -66,11 +82,6 @@ class AttendanceForm(ModelForm):
class ConfirmForm(ModelForm):
- exclude = ['person', 'update', 'event']
class Meta:
model = Attendance
-
-
-
-
-
+ exclude = ['person', 'update', 'event']
diff --git a/agenda/models.py b/agenda/models.py
index 634f583..0574098 100755
--- a/agenda/models.py
+++ b/agenda/models.py
@@ -1,6 +1,3 @@
-#!/usr/bin/python
-# -*- coding: utf -*-
-
from django.db import models
from django.conf import settings
from infopoint.agenda import *
@@ -15,11 +12,24 @@ from django import forms
from django.forms import ModelForm
from django.template.loader import render_to_string
from datetime import datetime
+from django.utils.translation import ugettext as _
+from calendar import HTMLCalendar
+from datetime import date
+from itertools import groupby
+
+from django.utils.html import conditional_escape as esc
from django.contrib import admin
# Create your models here.
+RECURRENCE_CHOICES = (
+ ('0', 'No recurrence'),
+ ('1', 'Everyday'),
+ ('2', 'Each week'),
+ ('3', 'Monthly'),
+)
+
TIMESPAN_CHOICES = (
('1', 'Future events'),
('2', 'Past events'),
@@ -28,17 +38,42 @@ TIMESPAN_CHOICES = (
)
-EVENT_STATUS_CHOICES = (
- ('1', 'TENTATIVE'),
- ('2', 'CONFIRMED'),
- ('3', 'NEEDS ACTION'),
- ('4', 'CANCELLED'),
-)
-EVENT_CLASS_CHOICES = (
- ('1', 'PUBLIC'),
- ('2', 'PRIVATE'),
- ('3', 'CONFIDENTIAL'),
-)
+class EventShapeCalendar(HTMLCalendar):
+ def __init__(self, events):
+ super(EventShapeCalendar, self).__init__()
+ self.events = self.group_by_day(events)
+ def formatday(self, day, weekday):
+ if day != 0:
+ cssclass = self.cssclasses[weekday]
+ if date.today() == date(self.year, self.month, day):
+ cssclass += ' today'
+ if day in self.events:
+ cssclass += ' filled'
+ body = ['<ul>']
+ for event in self.events[day]:
+ body.append('<li>')
+ body.append(esc(event.start_date.hour))
+ if event.start_date.minute != 0:
+ body.append(':%s' % event.start_date.minute)
+ body.append(' hs. <a href="%s">' % event.get_absolute_url())
+ body.append(esc(event.title))
+ body.append('</a></li>')
+ body.append('</ul>')
+ return self.day_cell(cssclass, '%d %s' % (day, ''.join(body)))
+ return self.day_cell(cssclass, day)
+ return self.day_cell('noday', '&nbsp;')
+
+ def formatmonth(self, year, month):
+ self.year, self.month = year, month
+ return super(EventShapeCalendar, self).formatmonth(year, month)
+
+ def group_by_day(self, events):
+ field = lambda event: event.start_date.day
+ return dict(
+ [(day, list(items)) for day, items in groupby(events, field)] )
+
+ def day_cell(self, cssclass, body):
+ return '<td class="%s">%s</td>' % (cssclass, body)
class Location(models.Model):
"""
@@ -48,7 +83,7 @@ class Location(models.Model):
"""
title = models.CharField(max_length=50)
description = models.TextField()
- size = models.IntegerField(help_text='how many people fits here?')
+ size = models.IntegerField(help_text=_('how many people fits here?'))
color = models.CharField(max_length=6, null=True, blank=True)
picture = models.FileField(upload_to='locations/', null=True,blank=True)
gallery = models.URLField(null=True,blank=True)
@@ -61,6 +96,10 @@ class Location(models.Model):
def colored_location(self):
return '<span style="color: #%s;">%s</span>' % (self.color, self.title)
colored_location.allow_tags = True
+ @models.permalink
+ def get_absolute_url(self):
+ return ('infopoint.agenda.views.location', [str(self.id)])
+
class EventManager(models.Manager):
@@ -89,36 +128,43 @@ class Event(models.Model):
"""
title = models.CharField(max_length=100)
public = models.BooleanField(null=True,blank=True,default=True)
+ confirmed = models.BooleanField(null=True,blank=True,default=True)
description = models.TextField(null=True,blank=True)
- start_date = models.DateTimeField(help_text='event start')
- end_date = models.DateTimeField(help_text='event end')
+ start_date = models.DateTimeField(help_text=_('event start'))
+ end_date = models.DateTimeField(help_text=_('event end'))
location = models.ForeignKey(Location,blank=True)
link = models.URLField(blank=True)
site = models.ManyToManyField(Site,blank=True)
calendar = models.Manager()
events = EventManager()
- status = models.CharField(max_length=1, choices=EVENT_STATUS_CHOICES,default=2)
- event_class = models.CharField(max_length=1, choices=EVENT_CLASS_CHOICES,default=1)
- pixie = models.ManyToManyField(User,blank=True,null=True,related_name='events')
+ pixie = models.ManyToManyField(User,verbose_name=_('mentor'),related_name='mentor',blank=True)
picture = models.FileField(upload_to='events/', null=True,blank=True)
- redes = models.ManyToManyField(Group, through='Network',null=True,blank=True, related_name='events')
+ redes = models.ManyToManyField(Group, through='Network',null=True,blank=True, related_name='masredes')
atendees = models.ManyToManyField(User, through='Attendance', null=True,blank=True)
+ save_as = True
+ recurrence = models.CharField(max_length=1, choices=RECURRENCE_CHOICES,default='0')
+ start_period = models.DateTimeField(null=True,blank=True,help_text=_('start period for the recurrence of the event'))
+ end_period = models.DateTimeField(null=True,blank=True,help_text=_('event period'))
def __unicode__(self):
return self.title
-
+ class Meta:
+ ordering = ['start_date']
+ @models.permalink
+ def get_absolute_url(self):
+ return ('infopoint.agenda.views.event', [str(self.id)])
class Network(models.Model):
"""
Relation between Groups and events
"""
- event = models.ForeignKey(Event,related_name='group')
+ event = models.ForeignKey(Event,related_name='groupevent')
group = models.ForeignKey(Group,related_name='networkevent')
creator = models.ForeignKey(User)
last_update = models.DateTimeField(auto_now=True)
def __unicode__(self):
- return self.group
- class META:
- unique_together = (("event", "group"),)
+ return self.group.name
+ class Meta:
+ unique_together = (('event', 'group'),)
class PendingTodoManager(models.Manager):
@@ -129,6 +175,25 @@ class PendingTodoManager(models.Manager):
return self.filter(done=False).order_by('due_date')
+
+class Wish(models.Model):
+ """
+ This is the list of things we need.
+ """
+ title = models.CharField(max_length=100)
+ public = models.BooleanField(null=True,blank=True,default=True,help_text=_('Is this todo public?'))
+ description = models.TextField(null=True,blank=True)
+ due_date = models.DateField(help_text=_('When do we need it'),null=True,blank=True)
+ done = models.BooleanField(blank=True,null=True)
+ network = models.ManyToManyField(Group, null=True,blank=True)
+ event = models.ManyToManyField(Event, null=True,blank=True, related_name='wishlist')
+ location = models.ManyToManyField(Location, null=True,blank=True, related_name='wishlistlocation')
+ creator = models.ForeignKey(User, related_name='wish_creator')
+ def __unicode__(self):
+ return self.title
+ class Meta:
+ verbose_name_plural = 'wishlist'
+
class Todo(models.Model):
"""
All the tasks that have to be done in the house, even if you dont know how to do them
@@ -136,7 +201,7 @@ class Todo(models.Model):
title = models.CharField(max_length=100)
public = models.BooleanField(null=True,blank=True,default=True)
description = models.TextField(null=True,blank=True)
- due_date = models.DateField(help_text='due date',null=True,blank=True)
+ due_date = models.DateField(help_text=_('Limit date'),null=True,blank=True)
done = models.BooleanField(blank=True,null=True)
todos = PendingTodoManager()
network = models.ManyToManyField(Group, null=True,blank=True)
@@ -155,9 +220,9 @@ class Attendance(models.Model):
"""
person = models.ForeignKey(User)
event = models.ForeignKey(Event)
- attendance = models.BooleanField(help_text="Confirm your assistance to the event",blank=True,null=True)
- update = models.DateTimeField(auto_now=True, verbose_name="Last update")
- reject_reason = models.CharField(max_length=64,blank=True,null=True, help_text="Let others know why you can't come to the event (optional)")
+ attendance = models.BooleanField(help_text=_('Confirm your assistance to the event'),blank=True,null=True)
+ update = models.DateTimeField(auto_now=True, verbose_name=_('Last update'))
+ reject_reason = models.CharField(max_length=64,blank=True,null=True, help_text=_("Let others know why you can't come to the event (optional)"))
class Meta:
unique_together = (('person', 'event'),)
@@ -187,7 +252,7 @@ class NetworkInline(admin.TabularInline):
model = Network
class AttendanceAdmin(admin.ModelAdmin):
- pass
+ list_display = ('event', 'person', 'attendance' )
admin.site.register(Attendance,AttendanceAdmin)
class LocationAdmin(admin.ModelAdmin):
@@ -201,19 +266,26 @@ class TodoAdmin(admin.ModelAdmin):
admin.site.register(Todo,TodoAdmin)
+class WishAdmin(admin.ModelAdmin):
+ list_display = ('title', 'public','due_date','creator', 'done')
+ date_hierarchy = 'due_date'
+
+admin.site.register(Wish,WishAdmin)
class EventAdmin(admin.ModelAdmin):
- list_display = ('title', 'description', 'location', 'start_date', 'public')
+ list_display = ('title', 'confirmed','description', 'location', 'start_date', 'public')
+ list_filter = ('location', 'public')
+ save_as = True
admin.site.register(Event,EventAdmin)
class NetworkAdmin(admin.ModelAdmin):
- pass
+ list_display = ('event', 'group')
admin.site.register(Network,NetworkAdmin)
class Billboard(models.Model):
title = models.CharField(max_length=100)
groups = models.ManyToManyField(Group, null=True,blank=True,related_name='cartel')
- refresh = models.IntegerField(help_text='In seconds',max_length=3)
+ refresh = models.IntegerField(help_text=_('In seconds'),max_length=3)
published = models.BooleanField(null=True,blank=True)
location = models.ManyToManyField(Location, null=True,blank=True, related_name='cartel')
timespan = models.CharField(max_length=1, choices=TIMESPAN_CHOICES)
@@ -261,6 +333,8 @@ databrowse.site.register(Comment)
databrowse.site.register(Billboard)
databrowse.site.register(ContentType)
databrowse.site.register(Group)
+databrowse.site.register(Network)
databrowse.site.register(Todo)
+databrowse.site.register(Wish)
databrowse.site.register(User)
diff --git a/agenda/templatetags/__init__.pyc b/agenda/templatetags/__init__.pyc
deleted file mode 100644
index 9c93547..0000000
--- a/agenda/templatetags/__init__.pyc
+++ /dev/null
Binary files differ
diff --git a/agenda/templatetags/calendartable.pyc b/agenda/templatetags/calendartable.pyc
deleted file mode 100644
index b4bfdd7..0000000
--- a/agenda/templatetags/calendartable.pyc
+++ /dev/null
Binary files differ
diff --git a/agenda/urls.py b/agenda/urls.py
index dfe6593..72f093a 100755
--- a/agenda/urls.py
+++ b/agenda/urls.py
@@ -1,11 +1,71 @@
-from django.conf.urls.defaults import *
from infopoint.agenda.models import Event
+from django.conf.urls.defaults import *
+from django.db import models
+from django.contrib import admin, databrowse, admindocs
+from django.contrib.admindocs import views,urls
+from django.contrib.auth import views
+from django.views.generic import create_update
+from django.views.generic.create_update import update_object
+from django.contrib.auth.decorators import login_required
+from infopoint.agenda.models import *
+from django.contrib.admindocs import *
+from django import template, templatetags
+from django.template import RequestContext
+from django.conf import settings
+from django.contrib.admin.views.decorators import staff_member_required
+from django.shortcuts import render_to_response
+from django.core.exceptions import *
+from django.http import Http404
+from django.core import urlresolvers
+from django.contrib.sites.models import Site
+from django.utils.translation import ugettext as _
+from django.utils.safestring import mark_safe
+import inspect, os, re
+from infopoint.agenda.views import *
+from django.contrib.comments.models import Comment
+from django.contrib.comments.urls import *
+from django import forms
+from django.contrib.formtools.preview import FormPreview
+from infopoint.agenda.forms import *
+
+
+urlpatterns = patterns('infopoint.agenda.views',
+ (r'^agenda/(?P<object_id>\d+)/$', 'event'),
+ (r'^agenda/(?P<object_id>\d+)/adopt/$', 'adoptevent'),
+ (r'^agenda/event/(?P<object_id>\d+)/$', 'event'),
+ (r'^event/(?P<object_id>\d+)/$', 'event'),
+ (r'^agenda/location/(?P<object_id>\d+)/$', 'location'),
+ (r'^agenda/$', 'calendar'),
+ (r'^orphan/$', 'orphan_events'),
+ (r'^agenda/wishlist/$', 'wishlist'),
+ (r'^agenda/add/$', 'add_new_event'),
+ (r'^cal/(?P<year>\d+)/(?P<month>\d+)/$', 'calendarshape'),
+ (r'^agenda/add/submit/$', 'submit_new_event'),
+ (r'^$', 'calendar'),
+ (r'^random/$', 'random'),
+ (r'^agenda/(?P<event_id>\d+)/todo/(?P<todo_id>\d+)/close/$','closetodo'),
+ (r'^agenda/(?P<event_id>\d+)/todo/submit/$','saveeventtodo'),
+ (r'^agenda/(?P<event_id>\d+)/group/add/$','addeventtogroupsave'),
+ (r'^agenda/me/$', 'mismensajes'),
+ (r'^group/(?P<object_id>\d+)/$', 'justonegroup'),
+ (r'^agenda/group/(?P<object_id>\d+)/$', 'justonegroup'),
+ (r'^group/(?P<object_id>\d+)/todo/(?P<todo_id>\d+)/close/$', 'closegrouptodo'),
+ (r'^group/(?P<object_id>\d+)/todo/add/$', 'savegrouptodo'),
+ (r'^todo/add/$', 'addtodo'),
+ (r'^todo/(?P<todo_id>\d+)/close/$', 'closealltodo'),
+
-info_dict = {
- 'queryset': Event.calendar.all(),
-}
+)
+urlpatterns += patterns('infopoint.agenda.billboardviews',
+ (r'^agenda/map/(?P<object_id>\d+)/$', 'event_galaxy'),
+ (r'^agenda/map2/(?P<object_id>\d+)/$', 'event_galaxy_for_map'),
+ (r'^agenda/(?P<object_id>\d+)/(?P<billboard_id>\d+)$', 'one_still_event'),
+ (r'^agenda/random/(?P<billboard_id>\d+)$', 'billboard'),
+
+
+)
-urlpatterns = patterns('',
- (r'^group/(?P<object_id>\d+)/$', 'infopoint.agenda.views.justonegroup'),
+urlpatterns += patterns('',
+ (r'^comments/', include('django.contrib.comments.urls')),
)
diff --git a/agenda/views.py b/agenda/views.py
index 3a4b3ba..524558c 100755
--- a/agenda/views.py
+++ b/agenda/views.py
@@ -1,203 +1,153 @@
# Create your views here.
-from __future__ import with_statement
+#from __future__ import with_statement
from django.shortcuts import render_to_response, get_object_or_404, get_list_or_404
+from django.db.models import Q
from infopoint.agenda.models import *
from datetime import date
+from django.utils.translation import ugettext as _
from django.http import HttpResponse, HttpResponseRedirect
from django.contrib.contenttypes.models import ContentType
from django.contrib.auth import authenticate, login
from django.contrib.auth.models import Group,User
from django.contrib.comments.models import Comment
from infopoint.agenda.templatetags import *
-from infopoint.agenda.models import Event, Attendance,Todo,PendingTodoManager
-from infopoint.agenda.forms import TodoCreateForm, TodoForm,TodoRelatedCreateForm,GroupAddEventForm,EventForm, RedesForm,TodoCompletedForm
+from infopoint.agenda.models import *
+from infopoint.agenda.forms import EventForm, NewEventForm, NewEventRestrictedForm, RedesForm, GroupAddEventForm, TodoForm, TodoCompletedForm, TodoCreateForm, TodoRelatedCreateForm, DateForm, AttendanceForm, ConfirmForm
from django.contrib.formtools.preview import FormPreview
from django.views.generic import create_update
from django.template import RequestContext
from django.forms import ModelForm
-import vobject
+from django.shortcuts import render_to_response
+from django.utils.safestring import mark_safe
+import calendar as therealcalendar
+import copy
-address = 'Gaona 3'
-city = 'Malaga'
-today = date.today()
+fuckthiscalendar = therealcalendar.Calendar()
-def get_map(type,object_id):
- map = open( '/var/www/media/maps/'+str(type)+'_'+str(object_id)+'.map' )
- info = str(map.read())
- return info
+today = date.today()
+def find_recurrences(event,year,month):
+ recurrences = []
+ alldays = list(fuckthiscalendar.itermonthdays2(int(year), int(month)))
+ if event.recurrence == '2':
+ weekday = event.start_date.isoweekday()-1
+ days_list = filter(lambda day:day[1]==weekday,alldays)
+ for day,weekday in days_list:
+ fakeevent = copy.copy(event)
+ fakeevent.start_date = fakeevent.start_date.replace(day=day+1)
+ if (fakeevent.start_date>fakeevent.end_period):
+ recurrences.append(fakeevent)
+ return recurrences
+
+def calendarshape(request, year, month):
+ """
+ taken from http://journal.redflavor.com/creating-a-flexible-monthly-calendar-in-django
+ """
+ next_events = Event.events.all().order_by('start_date').filter(start_date__year=year, start_date__month=month,public=True,recurrence='0')
+ year = int(year)
+ month = int(month)
+ nothing, last_day = therealcalendar.monthrange(year,month)
+ recurrent_events = Event.events.all().order_by('start_date').filter(start_period__lte=(date(int(year),int(month),last_day)),end_period__gte=(date(int(year),int(month),1)),recurrence__in=['1','2','3'])
+ all_events = list(next_events)
+ for recurrent_event in recurrent_events:
+ all_events += find_recurrences(recurrent_event,year,month)
+ all_days = map(lambda ev:ev.start_date.day, all_events)
+
+ cal = EventShapeCalendar(all_events).formatmonth(year, month)
+ previous, next = month-1,month+1
+ prevyear, postyear = year, year
+ if int(month) == 1:
+ previous = 12
+ prevyear = year-1
+
+ if int(month) == 12:
+ next = 1
+ postyear = year+1
-def ical_one_event(request,object_id):
- cal = vobject.iCalendar()
- cal.add('method').value = 'PUBLISH' # IE/Outlook needs this
- cal.add('calscale').value = 'GREGORIAN'
- for one_event in Event.calendar.filter(pk=object_id):
- cal.add('caldesc').value = 'Infopoint event - '+one_event.title
- cal.add('x-wr-calname').value = one_event.title+' calendar'
- vevent = cal.add('vevent')
- vevent.add('summary').value = one_event.title
- vevent.add('dtstart').value = one_event.start_date
- vevent.add('dtend').value = one_event.end_date
- vevent.add('dtstamp').value = one_event.start_date
- vevent.add('status').value = 'CONFIRMED'
- vevent.add('description').value = one_event.description
- vevent.add('location').value = one_event.location.title
- for user in one_event.atendees.all():
- att = vevent.add('attendee')
- att.value=user.email
- att.rsvp_param='True'
- att.cn_param=user.username
- att.role_param='REQ-PARTICIPANT'
- if user.attendance == 1:
- att.partstat_param='ACCEPTED'
- att.dir_param="http://infopoint/agenda/user/"+str(user.id)+"/busy/"
-
- for group in one_event.group.all():
- one_group = vevent.add('categorie')
- one_group.value=group.group
- one_group.dir_param="http://infopoint/agenda/group/"+str(group.group.id)+"/cal/"
- for pixie in one_event.pixie.all()[:1]:
- vevent.add('organizer').value = pixie.email
- icalstream = cal.serialize()
- response = HttpResponse(icalstream, mimetype='text/calendar')
- response['Filename'] = 'filename.ics' # IE needs this
- response['Content-Disposition'] = 'attachment; filename=filename.ics'
- return response
-
-def ical_user_busytime(request,object_id):
- cal = vobject.iCalendar()
- user = User.objects.get(pk=object_id)
- cal.add('x-wr-calname').value = 'infopoint free/busy time for '+user.username
- cal.add('calscale').value = 'GREGORIAN'
- cal.add('URL').value = 'http://infopoint/agenda/user/'+object_id+'/busy'
- for one_event in user.events.all().exclude(title__in=user.event_set.all()):
- freebusystart = one_event.start_date
- freebusyend = one_event.end_date
- vevent = cal.add('VFREEBUSY')
- vevent.add('summary').value = 'BUSY'
- vevent.add('dtstart').value = one_event.start_date
- vevent.add('dtend').value = one_event.end_date
- vevent.add('transp').value = 'OPAQUE'
- vevent.add('freebusy').value = [(vevent.dtstart.value,vevent.dtend.value)]
- for one_event in user.event_set.all():
- freebusystart = one_event.start_date
- freebusyend = one_event.end_date
- vevent = cal.add('VFREEBUSY')
- vevent.add('summary').value = 'BUSY'
- vevent.add('dtstart').value = one_event.start_date
- vevent.add('dtend').value = one_event.end_date
- vevent.add('transp').value = 'OPAQUE'
- vevent.add('freebusy').value = [(vevent.dtstart.value,vevent.dtend.value)]
- icalstream = cal.serialize()
- response = HttpResponse(icalstream, mimetype='text/calendar')
- response['Filename'] = 'filename.ics' # IE needs this
- response['Content-Disposition'] = 'attachment; filename=filename.ics'
- return response
-
-def ical_user_events(request,object_id):
- cal = vobject.iCalendar()
- user = User.objects.get(pk=object_id)
- cal.add('method').value = 'PUBLISH' # IE/Outlook needs this
- cal.add('calscale').value = 'GREGORIAN'
- cal.add('x-wr-calname').value = 'infopoint calendar for '+user.username
- for one_event in user.event_set.all():
- vevent = cal.add('vevent')
- vevent.add('summary').value = one_event.title
- vevent.add('dtstart').value = one_event.start_date
- vevent.add('status').value = 'CONFIRMED'
- vevent.add('TRANSP').value = 'OPAQUE'
- vevent.add('dtend').value = one_event.end_date
- vevent.add('description').value = one_event.description
- vevent.add('location').value = one_event.location.title
- for user in one_event.atendees.all():
- att = vevent.add('attendee')
- att.value=user.email
- att.rsvp_param='True'
- att.cn_param=user.username
- att.role_param='REQ-PARTICIPANT'
- att.partstat_param='ACCEPTED'
- att.dir_param="http://infopoint/agenda/user/"+str(user.id)+"/busy/"
- for pixie in one_event.pixie.all()[:1]:
- vevent.add('organizer').value = pixie.email
- icalstream = cal.serialize()
- response = HttpResponse(icalstream, mimetype='text/calendar')
- response['Filename'] = 'filename.ics' # IE needs this
- response['Content-Disposition'] = 'attachment; filename=filename.ics'
- return response
-
-def ical_next_events(request):
- cal = vobject.iCalendar()
- cal.add('method').value = 'PUBLISH' # IE/Outlook needs this
- cal.add('calscale').value = 'GREGORIAN'
- cal.add('x-wr-calname').value = 'infopoint calendar'
- for one_event in Event.events.next_events():
- vevent = cal.add('vevent')
- vevent.add('summary').value = one_event.title
- vevent.add('dtstart').value = one_event.start_date
- vevent.add('dtend').value = one_event.end_date
- vevent.add('dtstamp').value = one_event.start_date
- vevent.add('description').value = one_event.description
- vevent.add('location').value = one_event.location.title
- for user in one_event.atendees.all():
- att = vevent.add('attendee')
- att.value=user.email
- att.rsvp_param='True'
- att.cn_param=user.username
- att.role_param='REQ-PARTICIPANT'
- att.partstat_param='ACCEPTED'
- att.dir_param="http://infopoint/agenda/user/"+str(user.id)+"/busy/"
- for pixie in one_event.pixie.all()[:1]:
- vevent.add('organizer').value = pixie.email
- icalstream = cal.serialize()
- response = HttpResponse(icalstream, mimetype='text/calendar')
- response['Filename'] = 'filename.ics' # IE needs this
- response['Content-Disposition'] = 'attachment; filename=filename.ics'
- return response
+ return render_to_response('agenda/calendarshape.html', {'prevyear':prevyear, 'postyear':postyear, 'month':month,'previous':previous,'next':next, 'calendar': mark_safe(cal),'today': today })
def justonegroup(request,object_id):
- group = Group.objects.get(pk=object_id)
+ group = Group.objects.select_related().get(pk=object_id)
+ todolist = Todo.todos.all().filter(network=group,done=False).order_by('due_date')
+ wishlist = Wish.objects.all().filter(network=group,done=False).order_by('due_date')
+ group_events = Event.events.next_events().filter(redes=object_id).distinct()
newtodo = TodoRelatedCreateForm()
todos = Todo.todos.pending_todos().filter(network=object_id).filter(public=True)
- map_coordinates = str(get_map('group',object_id)).encode()
- return render_to_response('agenda/one_group.html', {'group': group, 'todos': todos, 'newtodo': newtodo, 'map_coordinates':map_coordinates },context_instance=RequestContext(request))
+ return render_to_response('agenda/one_group.html', {'wishlist':wishlist, 'todolist':todolist,'group': group, 'group_events': group_events,'todos': todos, 'newtodo': newtodo },context_instance=RequestContext(request))
def mismensajes(request):
- group_todos = Todo.todos.pending_todos().filter(network__user=request.user).order_by('due_date')
- missing_pixies = Event.events.missing_pixies().filter(redes__user=1).distinct()
user = request.user
- logentries = user.logentry_set.all()[:5]
+ todolist = Todo.todos.all().filter(done=False).order_by('due_date')
+ wishlist = Wish.objects.all().filter(done=False).order_by('due_date')
newtodo = TodoCreateForm()
if request.user.is_authenticated():
- return render_to_response('agenda/user_page.html', {'logentries': logentries,'group_todos': group_todos, 'newtodo': newtodo, 'missing_pixies': missing_pixies },context_instance=RequestContext(request))
+ missing_pixies = Event.events.missing_pixies().filter(redes__user=user.id).distinct()
+ group_todos = Todo.todos.pending_todos().filter(network__user=request.user).order_by('due_date')
+ my_mentored_events = Event.events.next_events().filter(pixie=user).select_related()
+ return render_to_response('agenda/user_page.html', {'wishlist':wishlist, 'todolist':todolist,'group_todos': group_todos, 'my_mentored_events': my_mentored_events,'newtodo': newtodo, 'missing_pixies': missing_pixies },context_instance=RequestContext(request))
else:
event = Event.calendar.filter(public=True)
- return render_to_response('agenda/event_list.html', {'log': log })
+ return render_to_response('agenda/event_list.html', {'event':event })
def render (request):
- event = Event.events.today_events.filter(public=True)
+ event = Event.events.today_events().filter(public=True)
if request.user.is_authenticated():
+ event = Event.events.today_events()
return render_to_response('agenda/event_list.html', {'event': event},context_instance=RequestContext(request))
else:
- #event = Event.calendar.filter(public=True)
return render_to_response('agenda/event_list.html', {'event': event })
+
+def orphan_events (request):
+ event = missing_pixies = Event.events.missing_pixies().distinct()
+ wishlist = Wish.objects.all().filter(done=False).order_by('due_date')
+ if request.user.is_authenticated():
+ todolist = Todo.todos.all().filter(done=False).order_by('due_date')
+ return render_to_response('agenda/event_list.html', {'todolist':todolist,'wishlist': wishlist,'event': event},context_instance=RequestContext(request))
+ else:
+ event = Event.events.next_events().filter(public=True)
+ return render_to_response('agenda/event_list.html', {'event': event })
+
+def calendar_shape(request):
+ event = Event.events.all().order_by('start_date')
+ wishlist = Wish.objects.all().filter(done=False).order_by('due_date')
+ todolist = Todo.todos.all().filter(done=False).order_by('due_date')
+ return render_to_response('agenda/event_list.html', {'todolist':todolist,'wishlist': wishlist,'event': event},context_instance=RequestContext(request))
+
def calendar (request):
- event = Event.events.next_events()
+ event = Event.events.next_events().order_by('start_date')
+ wishlist = Wish.objects.all().filter(done=False).order_by('due_date')
if request.user.is_authenticated():
- return render_to_response('agenda/event_list.html', {'event': event},context_instance=RequestContext(request))
+ todolist = Todo.todos.all().filter(done=False).order_by('due_date')
+ return render_to_response('agenda/event_list.html', {'todolist':todolist,'wishlist': wishlist,'event': event},context_instance=RequestContext(request))
else:
- #event = Event.calendar.filter(public=True)
+ event = Event.events.next_events().filter(public=True)
return render_to_response('agenda/event_list.html', {'event': event })
+def wishlist (request):
+ wishlist = Wish.objects.all().filter(done=False).order_by('due_date')
+ return render_to_response('agenda/wishlist.html', {'wishlist': wishlist}, context_instance=RequestContext(request))
+
+def logout_view(request):
+ logout(request)
+ return HttpResponseRedirect('/agenda/')
+
def random(request):
- event = Event.events.next_events.order_by('?')[:1]
+ event = Event.events.next_events().order_by('?')[:1]
return render_to_response('agenda/random.html', {'event': event },context_instance=RequestContext(request))
+def get_map(object_id):
+ try:
+ map = open( '/var/www/media/maps/event_'+str(object_id)+'.map' )
+ except:
+ return HttpResponseRedirect('/agenda/map/'+object_id)
+ info = str(map.read())
+ return info
def event(request,object_id):
event = get_object_or_404(Event, pk=object_id)
@@ -210,36 +160,76 @@ def event(request,object_id):
attendance = 'none'
newtodo = TodoRelatedCreateForm()
completed_todo = TodoCompletedForm()
- map_coordinates = str(get_map('event',object_id)).encode()
+ try:
+ map_coordinates = str(get_map(object_id)).encode()
+ except:
+ return HttpResponseRedirect('/agenda/map/'+object_id)
addtogroup = GroupAddEventForm()
pending_todos = Todo.todos.pending_todos().filter(event=object_id)
- return render_to_response('agenda/one_event.html', {'event': event, 'invite': invite, 'attendance': attendance, 'newtodo': newtodo, 'addtogroup': addtogroup, 'pending_todos': pending_todos, 'completed_todo': completed_todo, 'map_coordinates': map_coordinates, 'address': address, 'city': city },context_instance=RequestContext(request))
+ return render_to_response('agenda/one_event.html', {'event': event,'today': today , 'invite': invite, 'attendance': attendance, 'newtodo': newtodo, 'addtogroup': addtogroup, 'pending_todos': pending_todos, 'completed_todo': completed_todo, 'map_coordinates': map_coordinates },context_instance=RequestContext(request))
+
+def add_new_event(request):
+ form = NewEventRestrictedForm()
+ general_form = EventForm()
+ mydate = DateForm()
+ return render_to_response('agenda/add_new_event.html', {'general_form':general_form,'form': form, 'mydate': mydate },context_instance=RequestContext(request))
+
+def submit_new_event(request):
+ if request.method == 'POST':
+
+ request.POST['start_date'] = str(request.POST['start_date_0']+" "+request.POST['start_date_1'])
+
+
+ form = NewEventRestrictedForm(request.POST)
+
+ #form.start_date = str(request.POST['start_date_0']+" "+request.POST['start_date_1'])
+ #request.POST['start_date_0']+" "+request.POST['start_date_1'] = form.start_date
+ #form.end_date = str(request.POST['end_date_0']+" "+request.POST['end_date_1'])
+ if form.is_valid():
+ new_event = form.save(commit=False)
+ #form.save_m2m()
+ form.save()
+
+ return HttpResponseRedirect('/agenda/'+new_event.id)
+ return render_to_response('agenda/add_new_event.html', {'form': form },context_instance=RequestContext(request))
+ return render_to_response('agenda/add_new_event.html', {'form': form, 'mydate': mydate },context_instance=RequestContext(request))
def adoptevent(request,object_id):
- event = get_object_or_404(Event, pk=object_id)
- event.pixie.add(request.user)
- return HttpResponseRedirect('/agenda/'+object_id)
+ if request.method == 'POST':
+ event = get_object_or_404(Event, pk=object_id)
+ event.pixie.add(request.user)
+ return HttpResponseRedirect('/agenda/'+object_id)
def submittodo(request):
- f = TodoForm(request.POST)
- f.save()
- user = request.user
- user.message_set.create(message=f.title+' has been saved')
- return render_to_response('agenda/user_events.html', {'f': f},context_instance=RequestContext(request))
+ if request.method == 'POST':
+ f = TodoForm(request.POST)
+ f.save()
+ user = request.user
+ user.message_set.create(message=str(f.title+' has been saved'))
+ return render_to_response('agenda/user_events.html', {'f': f},context_instance=RequestContext(request))
-def closetodo(request,todo_id,event_id):
+def closealltodo(request,todo_id):
todo = get_object_or_404(Todo, pk=todo_id)
todo.done = True
todo.save()
- request.user.message_set.create(message=todo.title+' has been closed as completed')
- return HttpResponseRedirect('/agenda/'+event_id)
+ request.user.message_set.create(message=todo.title+_(' has been closed as completed'))
+ return HttpResponseRedirect('/agenda/me/')
+
+def closetodo(request,todo_id,event_id):
+ if request.method == 'POST':
+ todo = get_object_or_404(Todo, pk=todo_id)
+ todo.done = True
+ todo.save()
+ request.user.message_set.create(message=todo.title+' has been closed as completed')
+ return HttpResponseRedirect('/agenda/map/'+event_id)
def closegrouptodo(request,todo_id,object_id):
- todo = get_object_or_404(Todo, pk=todo_id)
- todo.done = True
- todo.save()
- return HttpResponseRedirect('/group/'+object_id)
+ if request.method == 'POST':
+ todo = get_object_or_404(Todo, pk=todo_id)
+ todo.done = True
+ todo.save()
+ return HttpResponseRedirect('/group/'+object_id)
def addtodo(request):
@@ -258,7 +248,7 @@ def addeventtogroupsave(request,event_id):
f.save()
except:
pass
- return HttpResponseRedirect('/agenda/'+event_id)
+ return HttpResponseRedirect('/agenda/map/'+event_id)
#return render_to_response('agenda/one_event.html', {'f': f, 'event': event},context_instance=RequestContext(request))
def addtodotoevent(request,event_id):
@@ -270,7 +260,7 @@ def saveeventtodo(request,event_id):
event = get_object_or_404(Event, pk=event_id)
f = TodoForm(request.POST)
f.save()
- return HttpResponseRedirect('/agenda/'+event_id)
+ return HttpResponseRedirect('/agenda/map/'+event_id)
#return render_to_response('agenda/one_event.html', {'f': f, 'event': event},context_instance=RequestContext(request))
def savegrouptodo(request,object_id):
@@ -286,14 +276,18 @@ def location(request, object_id):
want
"""
location = get_object_or_404(Location, pk=object_id)
- map_coordinates = str(get_map('location',object_id)).encode()
- if request.user.is_authenticated():
- return render_to_response('agenda/location_events.html', {'location': location, 'map_coordinates': map_coordinates},context_instance=RequestContext(request))
+ wishlist = Wish.objects.all().filter(location=location,done=False).order_by('due_date')
+
+ if request.user.is_authenticated():
+ todolist = Todo.todos.all().filter(location=location,done=False).order_by('due_date')
+ location_events = Event.events.next_events().filter(location=location.id).distinct()
+ return render_to_response('agenda/location_events.html', {'wishlist':wishlist,'todolist':todolist,'location_events':location_events,'location': location},context_instance=RequestContext(request))
else:
- return render_to_response('agenda/location_events.html', {'location': location })
+ location_events = Event.events.next_events().filter(public=True,redes=location.redes.id).distinct()
+ return render_to_response('agenda/location_events.html', {'location': location,'wishlist':wishlist,'location_events':location_events })
def attendance(request, object_id):
- if request.user.is_authenticated():
+ if request.user.is_authenticated():
event = get_object_or_404(Event, pk=object_id)
person = request.user.id()
@@ -318,7 +312,7 @@ def attendance(request, object_id):
def confirmation_pending(request):
object_id=request.user.id
- if request.user.is_authenticated():
+ if request.user.is_authenticated():
user = get_object_or_404(User, pk=object_id)
attendance = user.attendance_set.all()
confirmed = user.attendance.filter(attendance='1')
@@ -337,5 +331,3 @@ def attend(request,object_id):
def one_comment(request,object_id):
comment = Comment.objects.get(pk=object_id)
return render_to_response('agenda/one_comment.html', {'comment': comment},context_instance=RequestContext(request))
-
-
diff --git a/flatpages/__init__.py b/flatpages/__init__.py
new file mode 100755
index 0000000..e69de29
--- /dev/null
+++ b/flatpages/__init__.py
diff --git a/flatpages/models.py b/flatpages/models.py
new file mode 100755
index 0000000..508029f
--- /dev/null
+++ b/flatpages/models.py
@@ -0,0 +1,5 @@
+from django.db import models
+
+# Create your models here.
+
+
diff --git a/flatpages/views.py b/flatpages/views.py
new file mode 100755
index 0000000..60f00ef
--- /dev/null
+++ b/flatpages/views.py
@@ -0,0 +1 @@
+# Create your views here.
diff --git a/sites/__init__.py b/sites/__init__.py
new file mode 100755
index 0000000..e69de29
--- /dev/null
+++ b/sites/__init__.py
diff --git a/sites/models.py b/sites/models.py
new file mode 100755
index 0000000..8e12825
--- /dev/null
+++ b/sites/models.py
@@ -0,0 +1,30 @@
+from django.db import models
+# Create your models here.
+from django.contrib import admin, auth
+from django.contrib.auth.models import User
+from django.contrib.sites.models import *
+from infopoint.sites.models import *
+from infopoint.flatpages.models import models
+from django.contrib.flatpages.models import FlatPage
+from django.contrib import databrowse
+
+databrowse.site.register(Site)
+
+
+class SiteInline(admin.TabularInline):
+ model = Site
+#from infopoint.flatpages.models import Flatpages
+
+class FlatPageAdmin(admin.ModelAdmin):
+ #inlines = [SiteInline]
+ pass
+admin.site.register(FlatPage, FlatPageAdmin)
+
+
+class FlatPageInline(admin.TabularInline):
+ model = FlatPage
+#class SiteAdmin(admin.ModelAdmin):
+# inlines = [FlatPageInline]
+#admin.site.register(Site, SiteAdmin)
+
+
diff --git a/sites/urls.py b/sites/urls.py
new file mode 100755
index 0000000..9131235
--- /dev/null
+++ b/sites/urls.py
@@ -0,0 +1,23 @@
+from django.conf.urls.defaults import *
+from infopoint.sites.models import *
+from infopoint.agenda.models import *
+from django.contrib.auth import views
+
+
+posts_dict = {
+ 'queryset': FlatPage.objects.all()
+ }
+
+site_dict = {
+ 'queryset': Site.objects.all()
+ }
+
+
+urlpatterns = patterns('',
+ (r'^$', 'django.views.generic.list_detail.object_list', site_dict),
+ #(r'^2/$', 'infopoint.sites.views.all_activity'),
+ #(r'^f/(?P<object_id>\d+)/$', 'infopoint.sites.views.one_flatpage'),
+ #(r'^f/$', 'infopoint.sites.views.flatpages'),
+ (r'^post/(?P<object_id>\d+)/$', 'django.views.generic.list_detail.object_detail', posts_dict ),
+ (r'^/post/(?P<object_id>\d+)/edit/$', 'django.views.generic.create_update.update_object', posts_dict),
+)
diff --git a/sites/views.py b/sites/views.py
new file mode 100755
index 0000000..afb8548
--- /dev/null
+++ b/sites/views.py
@@ -0,0 +1,33 @@
+# Create your views here.
+from django.shortcuts import render_to_response, get_object_or_404
+from django.http import HttpResponse
+from django.contrib.sites.models import *
+from django.contrib.sites.models import *
+from django.conf import settings
+from django.contrib.flatpages.models import FlatPage
+from django.contrib.auth.models import User
+
+
+def all_activity(request):
+ post_list= Flatpage.objects.all()
+
+ return render_to_response('sites/directory.html', {'post_list': posts_list, 'a.site': blog})
+
+def index(request):
+ return HttpResponse("Hello, world. You're at the sites index.")
+
+
+def one_flatpage(request, object_id):
+ a = get_object_or_404(FlatPage,pk=object_id)
+ return render_to_response('flatpages/default.html', {'a': flatpages, })
+
+def flatpages(request, object_id):
+ a = get_object_or_404(Flatpage,pk=object_id)
+ return render_to_response('flatpages/default.html', {'a': flatpages})
+
+def article_detail(request, object_id):
+ a = get_object_or_404(Article,pk=object_id)
+ return render_to_response('blog/one_blog.html', {'a': flatpages})
+
+
+
diff --git a/templates/500.html b/templates/500.html
new file mode 100644
index 0000000..5bad62a
--- /dev/null
+++ b/templates/500.html
@@ -0,0 +1,9 @@
+{% extends 'agenda/base.html' %}
+{% load i18n %}
+{% block content %}
+{{ messages }}
+{{ error_message }}
+This page creates a 500 internal error.....
+
+{% if error_message %}<p><strong>{{ error_message }}</strong></p>{% endif %}
+{% endblock %}
diff --git a/templates/admin/base.html b/templates/admin/base.html
index 62d49db..70f4686 100755
--- a/templates/admin/base.html
+++ b/templates/admin/base.html
@@ -19,7 +19,7 @@
<!-- Header -->
<div id="header">
<div id="branding">
- {% block branding %}Infopoint{% endblock %}
+ {% block branding %}<h1 id="site-name"><a href="/">Infopoint</a></h1>{% endblock %}
</div>
{% if user.is_authenticated and user.is_staff %}
<div id="user-tools">{% trans 'Welcome,' %} <strong>{% if user.first_name %}{{ user.first_name|escape }}{% else %}{{ user.username }}{% endif %}</strong>. {% block userlinks %}<a href="{{ root_path }}doc/">{% trans 'Documentation' %}</a> / <a href="{{ root_path }}password_change/">{% trans 'Change password' %}</a> / <a href="{{ root_path }}logout/">{% trans 'Log out' %}</a>{% endblock %}</div>
diff --git a/templates/admin/base_site.html b/templates/admin/base_site.html
index 1a33867..2b1c295 100755
--- a/templates/admin/base_site.html
+++ b/templates/admin/base_site.html
@@ -3,9 +3,6 @@
{% block head %}{{ object.title }}{{ title }} {% endblock %}
-{% block branding %}
-<h1 id="site-name">{% block title %}{{ title }} {% endblock %}</h1>
-{% endblock %}
{% block nav-global %}{% endblock %}
diff --git a/templates/admin/index.html b/templates/admin/index.html
index d65772a..f0ae8fb 100755
--- a/templates/admin/index.html
+++ b/templates/admin/index.html
@@ -1,7 +1,7 @@
{% extends "admin/base_site.html" %}
{% load i18n %}
-{% block stylesheet %}{% load adminmedia %}{% admin_media_prefix %}css/dashboard.css{% endblock %}
+{% block stylesheet %}{% load adminmedia %}{% admin_media_prefix %}css/base.css{% endblock %}
{% block coltype %}colMS{% endblock %}
diff --git a/templates/agenda/add_new_event.html b/templates/agenda/add_new_event.html
new file mode 100755
index 0000000..ab5479e
--- /dev/null
+++ b/templates/agenda/add_new_event.html
@@ -0,0 +1,41 @@
+{% extends "agenda/base.html" %}
+{% load i18n %}
+{% load comments %}
+{% block info %} {% endblock %}
+{% block head %}{{ block.super }}
+{{ mydate.media }}
+{% endblock %}
+{% block title %}{% trans 'Add new event' %}{% endblock %}
+{% block branding %}{% trans 'Add new event' %}{% endblock %}
+{% block content_title %}<h1>{% trans 'Add new event' %}</h1> {% endblock %}
+
+{% block content %}
+<div class="module">
+<h2>{% trans 'Add new event' %}</h2>
+{% if form.errormessages %}<p><strong>{{ form.error_messages }}</strong></p>{% endif %}
+{% if mydate.errormessages %}<p><strong>{{ form.error_messages }}</strong></p>{% endif %}
+
+<form method="post" action="{% url agenda.views.submit_new_event %}">
+
+{{ mydate.as_p }}
+{{ form.as_p }}
+<input type="hidden" name="site" value="1" />
+<input type="hidden" name="user" value="{{ user.id }}" />
+<input type="submit" />
+</form>
+</div>
+<div class="module">
+{{ general_form.as_p }}
+{% if error_message %}<p><strong>{{ error_message }}</strong></p>{% endif %}
+{% if messages %}<p><strong>{{ messages }}</strong></p>{% endif %}
+
+
+</div>
+</div>
+</div>
+</div>
+
+{% endblock %}
+
+{% block sidebar %}{{ block.super }}
+{% endblock %}
diff --git a/templates/agenda/base.html b/templates/agenda/base.html
index 8ecf206..6d67e43 100755
--- a/templates/agenda/base.html
+++ b/templates/agenda/base.html
@@ -2,8 +2,13 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
- <link rel="stylesheet" href="{% load adminmedia %}{% admin_media_prefix %}css/dashboard.css" />
+ <link rel="stylesheet" href="{% load adminmedia %}{% admin_media_prefix %}css/base.css" />
<title>{% block title %}Infopoint{% endblock %}</title>
+ <script type="text/javascript" src="http://infopoint/media/js/core.js"></script>
+ <script type="text/javascript" src="/admin/jsi18n/"></script>
+
+ <script type="text/javascript" src="http://infopoint/media/js/admin/RelatedObjectLookups.js"></script>
+{% block head %}{% endblock %}
</head>
{% load i18n %}
<body class="dashboard">
@@ -12,33 +17,63 @@
<!-- Header -->
<div id="header">
<div id="branding">
- <h1 id="site-name">{% block branding %}Infopoint{% endblock %}</h1> </div>
+ <h1 id="site-name">{% block branding %}<a href="/">Infopoint</a>{% endblock %}</h1> </div>
{% if user.is_authenticated and user.is_staff %}
- <div id="user-tools">{% trans 'Welcome,' %} <strong>{% if user.first_name %}{{ user.first_name|escape }}{% else %}{{ user.username }}{% endif %}</strong>. {% block userlinks %}<a href="{{ root_path }}doc/">{% trans 'Documentation' %}</a> / <a href="{{ root_path }}password_change/">{% trans 'Change password' %}</a> / {% block info %}{% endblock %} <a href="{{ root_path }}logout/">{% trans 'Log out' %}</a>{% endblock %}</div>
+ <div id="user-tools">{% trans 'Welcome,' %} <strong>{% if user.first_name %}{{ user.first_name|escape }}{% else %}{{ user.username }}{% endif %}</strong>. {% block userlinks %}<a href="{{ root_path }}doc/">{% trans 'Documentation' %}</a> / <a href="{{ root_path }}password_change/">{% trans 'Change password' %}</a> / {% block info %}{% endblock %} <a href="/admin/logout/">{% trans 'Log out' %}</a>{% endblock %}</div>
{% endif %}
{% block nav-global %}{% endblock %}
- {% block map %}{% endblock %}
</div>
<!-- END Header -->
- {% endif %}
-
+ {% endif %}
<div id="content" class="colMS">
<div id="content-related">
{% block sidebar %}
<div class="module">
<h2>{% trans 'Links' %}</h2>
<ul class="actionlist">
- <li><a href="/agenda/me/">My page</a></li>
- <li><a href="/agenda/">Agenda</a></li>
- <li><a href="/admin/">Admin</a></li>
- <li><a href="/todo/add">Add todo</a></li>
- <li><a href="map/">Refresh_map</a></li>
+ <li><a href="{% url agenda.views.calendar %}">{% trans 'Home' %}</a></li>
+ {% if user.is_authenticated and user.is_staff %}<li><a href="{% url agenda.views.mismensajes %}">{% trans 'My page' %}</a></li>{% endif %}
+ <li><a href="{% url agenda.views.wishlist %}">{% trans 'Wishlist' %}</a></li>
+ <li><a href="/cal/{% now "Y\/m" %}/">{% trans 'Calendar' %}</a></li>
+ {% if user.is_authenticated and user.is_staff %}<li><a href="{% url agenda.views.orphan_events %}">{% trans 'Events with no mentor' %}</a></li>{% endif %}
+ <li><a href="/admin/">{% trans 'Admin' %}</a></li>
</ul>
</div>
+{% if todolist %}
+ <div class="module">
+ <h2><a href="{#% url agenda.views.todolist %#}" >{% trans 'ToDo list' %}</a></h2>
+ <ul>
+ {% for object in todolist %}
+ <li>{{ object.title }} - <a href="{% url agenda.views.closealltodo object.id %}" class="deletelink">close</a></li>
+ {% endfor %}
+ </ul>
+ <p><a href="http://infopoint/admin/agenda/todo/add/" class="changelink">Add new Todo</a>
+ </div>
+{% endif %}
+
+{% if wishlist %}
+ <div class="module">
+ <h2><a href="{% url agenda.views.wishlist %}" >{% trans 'Wishlist' %}</a></h2>
+ <ul>
+ {% for object in wishlist %}
+ <li>{{ object.title|title }}</li>
+ {% endfor %}
+ </ul>
+ <p><a href="http://infopoint/admin/agenda/wish/add/" class="changelink">Add new wishitem</a>
+ </div>
+{% endif %}
+
{% endblock %}
- </div>
- <div id="content-main">
+ </div>
+ <div id="content-main">
+ {% if messages %}
+ {% for message in messages %}
+ <li>{{ message }}</li>
+ {% endfor %}
+
+ {% endif %}
+
{% block content %}
<h1>Infopoint</h1>
This is the default content.<br>
diff --git a/templates/agenda/billboard.html b/templates/agenda/billboard.html
index f2498c9..9228b4b 100755
--- a/templates/agenda/billboard.html
+++ b/templates/agenda/billboard.html
@@ -3,7 +3,7 @@
{% load comments %}
{% block refresh %}{{ style.refresh }}{% endblock %}
-{% block body_style %}{% for event in event %}" background="/media/{{ event.picture }}{% endfor %}{% endblock %}
+{% block body_style %}{% for event in event %}" background="http://infopoint/media/{{ event.picture }}{% endfor %}{% endblock %}
{% block style %}
body {
font-family: Verdana, Arial, sans-serif;
@@ -12,33 +12,32 @@ body {
color: #{{ style.color1 }};
background-color: #{{ style.color2 }};
position: absolute;
- left: 300px;
+ left: 400px;
top: 100px;
{% if style.csstitle %}{{ style.csstitle }}{% endif %}
- width: 500px; height: 90px;
- z-index:3;
+ width: 400px; height: 90px;
}
#location {
color: #{{ style.color2 }};
background-color: #{{ style.color1 }};
position: absolute;
- right: 50px;
+ right: 250px;
bottom: 50px;
{% if style.csslocation %} {{ style.csslocation }}{% endif %}
width: 210px;
{% for event in event %}{% if event.location.picture %}height: 190px;{% else %}height: 50px;{% endif %}{% endfor %}
display: block;
- z-index:4;
}
#date {
color: #{{ style.color1 }};
background-color: #{{ style.color2 }};
- left: 200px;
+ position: absolute;
+ left: 100px;
top: 100px;
{% if style.cssdate %}{{ style.cssdate }}{% endif %}
- width: 180px; height: 50px;
+ width: 220px; height: 50px;
display: block;
}
@@ -51,45 +50,41 @@ body {
top: 280px;
width: 300px; height: 150px;
display: block;
- z-index:2;
}
{% endblock %}
{% block content %}
-{% if group %} group: {{ group }} {% endif %}
-{% if event %} event: {{ event }} {% endif %}
-{% if location %} location: {{ location }} {% endif %}
-{% if list %} list: {{ list }} {% endif %}
{% for event in event %}
<div id='title'><h1>{{ event.title }}</h1></div>
{% if event.location %}<div id='location'>{{ event.location }}
{% if event.location.picture %}
- <img src="/media/{{ event.location.picture }}" width="200px">
+ <img src="http://infopoint/media/{{ event.location.picture }}" width="200px">
{% endif %}
</div>
{% endif %}
-<p><p><p><p>
-{% if event.start_date %}<div id='date'>{% trans 'When' %}: {{ event.start_date|date }}</div>{% endif %}
+{#% list %#}
+{#% for event in list %#}
+{#% event.start_date|date #}
+{#% endfor %#}
+
+{% if event.start_date %}<div id='date'>{% trans 'When' %}: {{ event.start_date|date }} at {{ event.start_date|time }} </div>{% endif %}
{% if error_message %}<p><strong>{{ error_message }}</strong></p>{% endif %}
{% if event.description %}<div id='description'>{% trans 'Description' %}: {{ event.description|truncatewords:"30"|escape }}</div>{% endif %}
-{% if event.picture %}<img src="/media/{{ event.picture }}" width="600px"><br>{% endif %}
+{% if event.picture %}<img src="http://infopoint/media/{{ event.picture }}" width="600px"><br>
+
+{% endif %}
{% endfor %}
{% endblock %}
{% block endscript %}
- new Effect.BlindDown("title",{duration:2.0,direction: "bottom-left"});
- new Effect.Pulsate("title",{queue: "end"});
- new Effect.Fade("title",{queue: "end"});
+ new Effect.BlindDown("title",{duration:2.0,direction: "bottom-left", queue: 'end'});
new Effect.Grow("description",{duration:2.0,direction: "bottom-left", queue: 'end'});
- new Effect.Shrink("description",{queue: "end"});
- new Effect.Grow("date",{duration:1.0,direction: "bottom-left",opacityTransition:Effect.Transitions.linear, queue: 'end'});
- new Effect.Shrink("date",{queue: "end"});
- new Effect.Grow("location",{duration:1.0,direction: "bottom-left",opacityTransition:Effect.Transitions.linear, queue: "end"});
- new Effect.Appear("title",{duration:2.0,direction: "bottom-left", queue: 'end'});
- new Effect.Fade("location",{queue: "end"});
+ new Effect.Grow("location",{duration:1.0,direction: "bottom-left",opacityTransition:Effect.Transitions.linear, queue: 'end'});
+ new Effect.Grow("date",{duration:2.0,direction: "bottom-left",opacityTransition:Effect.Transitions.linear, queue: 'end'});
+ new Effect.Shrink("description",{duration:2.0,direction: "bottom-left", queue: 'end'});
{% endblock %}
diff --git a/templates/agenda/calendarshape.html b/templates/agenda/calendarshape.html
new file mode 100755
index 0000000..249c1ae
--- /dev/null
+++ b/templates/agenda/calendarshape.html
@@ -0,0 +1,22 @@
+{% extends 'agenda/base.html' %}
+{% load i18n %}
+{% if title %}{% block content_title %}<h1>{{ title|escape }}</h1>{% endblock %}
+{% endif %}
+{% block content %}
+ <div class="module">
+{{ calendar }}
+<table with="100%" class="month">
+<tr><td><a href="{% url agenda.views.calendarshape prevyear previous %}">Prev</a></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td><a href="{% url agenda.views.calendarshape postyear next %}">Next</a></td></tr>
+</table>
+
+</div>
+
+{% endblock %}
+{% block sidebar %}
+ {{ block.super }}
+ <div class="module">
+ </div>
+{% endblock %}
+{% block info %}
+template: "agenda/calendarshape.html"
+{% endblock %}
diff --git a/templates/agenda/event_list.html b/templates/agenda/event_list.html
index b9517b8..2b9ae2b 100755
--- a/templates/agenda/event_list.html
+++ b/templates/agenda/event_list.html
@@ -3,27 +3,8 @@
{% if title %}{% block content_title %}<h1>{{ title|escape }}</h1>{% endblock %}
{% endif %}
{% block content %}
-{% if event %}
- {% for object in event %}
- <div class="module">
- {% ifchanged object.start_date %} <h2><a href="/agenda/{{ object.id }}">{{ object.start_date|date }}</a></h2>{% endifchanged %}
- <h3><a href="/agenda/{{ object.id }}">{{ object.title|upper }}</a></h3>
- <p>{{ object.description }}</p>
- <tr>
- <td>{% if object.attendance_set.count %}{% trans 'Interested' %}: {{ object.attendance_set.count }}{% endif %}
- {% if object.comment_set.all %}{% trans 'Comments' %}: {{ object.comment_set.count }}{% endif %}</td>
- <td bgcolor="#{{ object.location.color }}"><a href="location/{{ object.location.id }}" class="changelink">Location: {{ object.location.title }}</a></td>
- <td><a href="{{ object.id }}/attend/" class="addlink">I'm attending</a></td>
- <td><a href="admin/agenda/event/{{ object.id }}" class="changelink">{% trans 'Modify' %}</a></td>
- </tr>
-
- </table>
- <br>
- </div>
- {% endfor %}
-{% endif %}
+{% include "agenda/events_tag.html" %}
{% endblock %}
{% block info %}
template: "agenda/event_list.html"
{% endblock %}
-
diff --git a/templates/agenda/event_map_view.html b/templates/agenda/event_map_view.html
index 04ca158..7289be4 100755
--- a/templates/agenda/event_map_view.html
+++ b/templates/agenda/event_map_view.html
@@ -1,4 +1,4 @@
-<img src="/media/maps/event_{{ event.id }}.png" USEMAP="#ismap" border="0">
+<img src="http://infopoint/media/maps/event_{{ event.id }}.png" USEMAP="#ismap" border="0">
<map name="ismap">
{{ map_coordinates|safe }}
diff --git a/templates/agenda/events_tag.html b/templates/agenda/events_tag.html
new file mode 100755
index 0000000..3053243
--- /dev/null
+++ b/templates/agenda/events_tag.html
@@ -0,0 +1,30 @@
+{% load i18n %}
+{% for object in event %}
+ {% if object.public or user.is_staff %}
+ <div class="module">
+ {% ifchanged object.start_date.day %} <h2><a href="{% url agenda.views.calendarshape object.start_date.year object.start_date.month %}">{{ object.start_date|date:"D" }} - {{ object.start_date|date }}</a></h2>{% endifchanged %}
+
+ {% if object.picture %}<img src="{{ object.picture.url }}" width="90px" align="right" >{% endif %}
+ <h3><a href="{% url agenda.views.event object.id %}">{{ object.title|upper }}</a></h3>
+ <p>{{ object.description|linebreaks }}</p>
+ {% if user.is_staff %}
+ <p>{% trans 'Public' %}: {{ object.public|yesno }} | {% trans 'Confirmed' %}: {{ object.confirmed|yesno:"yes,no" }}
+ {% if object.confirmed %}<img src="http://infopoint/media/img/admin/icon-yes.gif" alt="1" />{% else %}
+ <img src="http://infopoint/media/img/admin/icon-no.gif" alt="0" />
+ {% endif %}
+ {% endif %}<p>
+ {% if object.attendance_set.count %}{% trans 'Interested' %}: {{ object.attendance_set.count }}{% endif %}
+ {% if object.comment_set.all %}<p>{% trans 'Comments' %}: {{ object.comment_set.count }}{% endif %}</td>
+ {% if object.redes.count %}<p>{% trans 'Groups' %}:
+ {% for network in object.redes.all %}
+ <a href="{% url agenda.views.justonegroup network.id %}">{{ network.name }}</a>
+ {% endfor %} - {% endif %}
+ <a href="{% url agenda.views.location object.location.id %}" >{% trans 'Location' %}: {{ object.location.title }}</a></td>
+ {% if user.is_staff %}
+ <td><a href="/admin/agenda/event/{{ object.id }}" class="changelink">{% trans 'Modify' %}</a> - {{ object.start_date|time }}</td>
+ {% endif %}
+<br>
+{% endif %}
+
+</div>
+{% endfor %}
diff --git a/templates/agenda/location_events.html b/templates/agenda/location_events.html
index d8fd595..8b1fa2f 100755
--- a/templates/agenda/location_events.html
+++ b/templates/agenda/location_events.html
@@ -1,32 +1,27 @@
{% extends "agenda/base.html" %}
{% load i18n %}
{% block info %}{% endblock %}
-{% block map %}
-<div class="map" style="float: right;">
- {% include "agenda/location_map_view.html" %}
-</div>
-{% endblock %}
{% block branding %}{{ location.title }} {% endblock %}
{% block title %}{{ location.title }} {% endblock %}
{% block sidebar %}{{ block.super }}
-<div class="module">
{% load comments %}
-{% get_comment_list for agenda.location location.id as comment_list %}
+{% get_comment_list for location as comment_list %}
{% if comment_list %}
+<div class="module">
<h2>{% trans 'Comments about this location' %}:</h2>
{% for comment in comment_list %}
{% if comment.is_public %}
<h3>{{ comment.headline }}</h3>
-<p>{{ comment.comment }}
+<p>{{ comment.comment|linebreaks }}
<p>{% trans 'Posted by' %} {{ comment.user }} on {{ comment.submit_date|date }}
{% if user.is_authenticated %} <a href="/admin/comments/comment/{{ comment.id }}/delete" class="deletelink">{% trans 'Delete' %}</a>{% endif %}
{% endif %}
{% endfor %}
-{% endif %}
</div>
+{% endif %}
{% endblock %}
{% block content %}
@@ -35,27 +30,26 @@
<div class="module">
{% if error_message %}<p><strong>{{ error_message }}</strong></p>{% endif %}
-<img src="/media/{{ location.picture }}" width="450px"><br>
+{% if location.picture %}
+ <img src="{{ location.picture.url }}" width="450px"><br>
+{% endif %}
+
{% if location.description %}
-{% trans 'Description' %}:<br>{{ location.description }}{% endif %}
+<p>{% trans 'Description' %}:<br>{{ location.description|linebreaks }}{% endif %}
</div>
<div class="module">
-<h2>{% trans 'Events for this location' %}</h2>
-{% for id in location.event_set.all %}
-
-<h3><a href="/agenda/{{ id.id }}">{{ id.title }}</a></h3>
-{% trans 'When' %}: {{ id.start_date|date }}
-{% if user.is_authenticated %} <a href="/admin/agenda/event/{{ id.id }}" class="changelink">{% trans 'Change' %}</a>{% endif %}
+{% with location_events as event %}
+{% include "agenda/events_tag.html" %}
+{% endwith %}
+</div>
-{% if id.group.count %}{% trans 'Groups' %}:
+{% if id.group.count %}- {% trans 'groups' %}:
{% for network in id.group.all %} <a href="/group/{{ network.group.id }}">{{ network.group }}</a> {% endfor %}
<br> {% endif %}
-{% endfor %}
</div>
<div class="module">
<h2>{% trans 'Leave a comment on this location' %}</h2>
-{% render_comment_form for agenda.location location.id %}
-
-
+<form action="{% comment_form_target %}" method="POST">
+{% render_comment_form for location %}
</div>
{% endblock %}
diff --git a/templates/agenda/map_view.html b/templates/agenda/map_view.html
index 6e6eb99..dd64a24 100755
--- a/templates/agenda/map_view.html
+++ b/templates/agenda/map_view.html
@@ -3,7 +3,7 @@
{% load comments %}
{% block refresh %}{{ style.refresh }}{% endblock %}
-{% block body_style %}" background="/media/{{ event.location.picture }}{% endblock %}
+{% block body_style %}" background="http://infopoint/media/{{ event.location.picture }}{% endblock %}
{% block style %}
body {
font-family: Verdana, Arial, sans-serif;
@@ -62,7 +62,7 @@ body {
{% if list %} list: {{ list }} {% endif %}
<div id='title'><h1>{{ event.title }}</h1></div>
<!--<A HREF="/media/maps/event_{{ event.id }}.map"><img src="/media/maps/event_{{ event.id }}.png" ismap="ismap" border="0"></A> !-->
-<img src="/media/maps/event_{{ event.id }}.png" USEMAP="#ismap" border="0">
+<img src="http://infopoint/media/maps/event_{{ event.id }}.png" USEMAP="#ismap" border="0">
<map name="ismap">
{{ map_coordinates|safe }}
</map>
diff --git a/templates/agenda/one_event.html b/templates/agenda/one_event.html
index cf43fcb..97824f7 100755
--- a/templates/agenda/one_event.html
+++ b/templates/agenda/one_event.html
@@ -1,39 +1,36 @@
{% extends "agenda/base.html" %}
{% load i18n %}
-<link rel="alternate" type="text/calendar" title="iCalendar" href="cal" />
-
{% load comments %}
{% block info %} {% endblock %}
{% block title %}{{ event.title }}{% endblock %}
-{% block branding %}{{ event.title }}{% endblock %}
-{% block content_title %} <h1>{{ event.title }}</h1>
-{% endblock %}
+{% block content_title %} <h1>{{ event.title }}</h1> {% endblock %}
{% block content %}
<div id="content-main">
-
-
- <div class="module">
-
- {% trans 'Location' %}: <a href="/agenda/location/{{ event.location_id }}" class="viewsitelink">{{ event.location.colored_location|safe }}</a><br>
- {% trans 'Starts' %}: {{ event.start_date|date }}<br>
- {% trans 'Ends' %}: {{ event.end_date|date }}<br>
-
-
+ <h1>{{ event.title }}</h1>
+<div class="module">
+ <p>{% trans 'Location' %}: <a href="/agenda/location/{{ event.location_id }}" class="viewsitelink">{{ event.location.colored_location|safe }}</a><br>
+ <p>{% trans 'Starts' %}: {{ event.start_date|date:"D" }} - <a href="/cal/{{ event.start_date.year }}/{{ event.start_date.month }}/">{{ event.start_date|date }}</a> - {{ event.start_date|time }}<br>
+ <p>{% trans 'Ends' %}: {{ event.end_date|date:"D" }} - <a href="/cal/{{ event.start_date.year }}/{{ event.start_date.month }}/">{{ event.end_date|date }}</a> - {{ event.end_date|time }}<br>
{% if error_message %}<p><strong>{{ error_message }}</strong></p>{% endif %}
<ul class="object-tools">
<li><a href="/admin/agenda/event/add">{% trans 'New Event' %}</a></li>
- <li><a href="/agenda/location/{{ event.location_id }}" class="viewsitelink">{% trans 'See location' %}</a></li>
- <li><a href="/admin/agenda/event/{{ event.id }}">{% trans 'Edit' %}</a></li>
+ <li><a href="/cal/{{ event.start_date.year }}/{{ event.start_date.month }}/">{% trans 'Calendar' %}</a></li>
+ <li><a href="/admin/agenda/event/{{ event.id }}" class="viewsitelink">{% trans 'Edit' %}</a></li>
</ul>
+{% if event.picture %}<a href="http://infopoint/media/{{ event.picture }}"><img src="http://infopoint/media/{{ event.picture }}" width="300px"></a><br>
+{% endif %}
+<p>{% trans 'Public' %}: {{ event.public|yesno }}
+<p>{% trans 'Confirmed' %}: {{ event.confirmed|yesno:"yes,no" }}
+{% if event.confirmed %}<img src="http://infopoint/media/img/admin/icon-yes.gif" alt="1" />{% else %}
+<img src="http://infopoint/media/img/admin/icon-no.gif" alt="0" />
-{% if event.picture %}<img src="/media/{{ event.picture }}" width="300px"><br>
{% endif %}
-{% if event.description %}{% trans 'Description' %}: {{ event.description }}<br>{% endif %}
-<a href="cal">{% trans 'Add to your calendar' %}</a>
+{% if event.description %}<p>{% trans 'Description' %}: {{ event.description|linebreaks }}<br>{% endif %}
+
</div>
<div class="module">
{% if event.attendance_set.count %}
@@ -52,63 +49,72 @@
{% endfor %}
</table><br>
{% endif %}
-</div>
+
</div>
<div class="module">
- <h2>{% trans 'Leave comment' %}:</h2>
+ <h2>{% trans 'Comments' %}:</h2>
- {% get_comment_form for agenda.event event.id as form %}
- {% render_comment_form for agenda.event event.id %}
+{% get_comment_list for event as comment_list %}
+ {% if comment_list %}
+ {% for comment in comment_list %}
+ {% if comment.is_public %}
+ <h4>{{ comment.headline }}</h4>
+ <p>{{ comment.comment|linebreaks }}
+ <p>{% trans 'Posted by' %} {{ comment.user }} on {{ comment.submit_date|date }}
+ {% if user.is_staff %} <a href="/admin/comments/comment/{{ comment.id }}/delete" class="deletelink">{% trans 'Delete' %}</a>{% endif %}
+ {% endif %}
+ {% endfor %}
+ {% endif %}
+
+<h3>{% trans 'Leave comment' %}:</h3>
+ <form action="{% comment_form_target %}" method="POST">
+ {% render_comment_form for event %}
</div>
</div>
</div>
</div>
-
-{% endblock %}
-
-{% block map %}
-<div class="map" style="float: right;">
+</div>
+<div class="map">
{% include "agenda/event_map_view.html" %}
+<a href="{% url agenda.billboardviews.event_galaxy event.id %}" class="deletelink">map it!</a>
</div>
+
{% endblock %}
-{% block sidebar %}
-{{ block.super }}
-
- <div id="hcalendar-{{ event.title|slugify }}" class="vevent">
- <span class="summary">{{ event.title }}</span><br>
- <abbr title="{{ event.start_date }}" class="dtstart">{{ event.start_date }}</abbr><br>
- <abbr title="{{ event.end_date }}" class="dtend"> {{ event.end_date }}</abbr><br>
- <div class="description">{{ event.description }}</div>
- <div class="venue location vcard">
- <span class="fn org"><a href="/agenda/location/{{ event.location.id }}">{{ event.location.title }}</a></span><br />
- <div class="address adr">
- <span class="street-address">{{ address }}</span>
- <span class="locality">{{ city }}</span>, <span class="region">{{ city }}</span> <span class="postal-code">29012</span>
-
- <span class="city">{{ city }}</span>
- </div>
- </div>
- </div>
+
+{% block sidebar %}{{ block.super }}
+
{% if not event.pixie.count %}
<div class="module">
<h2>{% trans 'Adopt this event' %}:</h2>
-<p><form action="/agenda/{{ event.id }}/adopt/" class="collapse" method="POST"> <input type="hidden" name="event" value="{{ event.id }}" id="id_event" /> Groups: {{ event.network.iterator|join:" ," }}</span> {% if user.is_authenticated %}<a href="/admin/agenda/event/{{ event.id }}/" class="changelink">edit</a> <input type="hidden" name="pixie" value="{{ user.id }}" id="id_pixie" /> <input type="submit" name="submit" class="close-post" value="I will do it">{% endif %}
+ <p>{% trans "This event still has no mentor. Do you want to help coordinate it?" %}
+<p><form action="{% url infopoint.agenda.views.adoptevent event.id %}" class="collapse" method="POST"> <input type="hidden" name="event" value="{{ event.id }}" id="id_event" /> {% if user.is_authenticated %} <input type="hidden" name="pixie" value="{{ user.id }}" id="id_pixie" /> <p><input type="submit" name="submit" class="close-post" value="I will do it">
+{% endif %}
</form>
</div>
{% endif %}
+{% if event.pixie.count %}
+<div class="module">
+<h2>{% trans 'Event coordinator' %}:</h2>
+<p>{{ event.pixie.all|join:", " }}</p>
+<p><form action="{% url infopoint.agenda.views.adoptevent event.id %}" class="collapse" method="POST"> <input type="hidden" name="event" value="{{ event.id }}" id="id_event" />
+{% if user.is_authenticated %}
+ <input type="hidden" name="pixie" value="{{ user.id }}" id="id_pixie" /> <p><input type="submit" name="submit" class="close-post" value="I can help too">
+{% endif %}
+ </form>
+ </div>
+{% endif %}
+
<div class="module">
<h2>{% trans 'Groups' %}:</h2>
- {% for group in event.group.all %}
- <p><a href="/group/{{ group.group.id }}">{{ group.group }}</a>
+ {% for group in event.redes.all %}
+ <p><a href="{% url agenda.views.justonegroup group.id %}">{{ group.name }}</a>
{% endfor %}
<h3>{% trans 'Add event to a group' %}</h3>
- <form action="group/add/" method="POST">
- <ul class="actionlist">
- {{ addtogroup.as_ul }}
- <li><input type="submit" name="submit" class="submit-post" value="{% trans 'Add' %}"></li>
- </ul>
+ <form action="{% url agenda.views.addeventtogroupsave event.id %}" method="POST">
+ {{ addtogroup.as_p }}
+ <p><input type="submit" name="submit" class="submit-post" value="{% trans 'Add' %}">
<input type="hidden" name="event" value="{{ event.id }}" id="id_event" />
<input type="hidden" name="creator" value="{{ user.id }}" id="id_creator" />
</form>
@@ -117,12 +123,12 @@
<div class="module">
<h2>{% trans 'Todo' %}:</h2>
{% for todo in pending_todos %}
- <form action="todo/{{ todo.id }}/close/" class="collapse" method="POST"> <input type="hidden" name="todo" value="{{ todo.id }}" id="id_todo" />
+ <form action="{% url agenda.views.closetodo event.id todo.id %}" class="collapse" method="POST"> <input type="hidden" name="todo" value="{{ todo.id }}" id="id_todo" />
<p><a href="/admin/agenda/todo/{{ todo.id }}/">{{ todo.title }}</a>: <span class="mini quiet">{{ todo.description }} </span>{% if user.is_authenticated %}<a href="/admin/agenda/todo/{{ todo.id }}/" class="changelink">edit</a> <input type="hidden" name="done" value="True" id="id_done" /> <input type="submit" name="submit" class="close-post" value="close"></form>
{% endif %}
{% endfor %}
<h3>{% trans 'Add Todo' %}:</h3>
- <form action="todo/submit/" class="collapse" method="POST">
+ <form action="{% url agenda.views.saveeventtodo event.id %}" class="collapse" method="POST">
<ul class="actionlist">
{{ newtodo.as_ul }}
<li><input type="submit" name="submit" class="submit-post" value="Post"></li>
diff --git a/templates/agenda/one_group.html b/templates/agenda/one_group.html
index 6f0adfb..cccd0ae 100755
--- a/templates/agenda/one_group.html
+++ b/templates/agenda/one_group.html
@@ -1,33 +1,41 @@
{% extends "agenda/base.html" %}
{% load i18n %}
{% load comments %}
-{% block title %}{{ group.name }}{% endblock %}
+{% block title %}{{ group.title }}{% endblock %}
{% block branding %}{{ group.name }}{% endblock %}
{% block content_title %} <h1>{{ group.name }}</h1> {% endblock %}
-{% block map %}
-<div class="map" style="float: right;">
- {% include "agenda/group_map_view.html" %}
-</div>
-{% endblock %}
-
{% block content %}
<div id="content-main">
{% if error_message %}<p><strong>{{ error_message }}</strong></p>{% endif %}
- {% if group.networkevent.count %}
+ {% if group_events %}
<div class="module">
<h2>{% trans 'Events' %}</h2>
- {% for event_link in group.networkevent.all %}
- <h4><a href="/agenda/{{ event_link.event.id }}">{{ event_link.event }}</a> {{ event_link.event.start_date|date }}</h4>
- <p>{{ event_link.event.description }}
+ {% for event_link in group_events %}
+ <h4><a href="/agenda/{{ event_link.id }}">{{ event_link.title }}</a> {{ event_link.start_date|date:"D" }} - {{ event_link.start_date|date }}</h4>
+ <p>{{ event_link.description|linebreaks }}
{% endfor %}
</div>
{% endif %}
<div class="module">
<h2>{% trans 'Comments' %}</h2>
+
+{% get_comment_list for group as comment_list %}
+{% if comment_list %}
+<h2>{% trans 'Comments for this group' %}:</h2>
+{% for comment in comment_list %}
+{% if comment.is_public %}
+<h3>{{ comment.headline }}</h3>
+<p>{{ comment.comment|linebreaks }}
+<p>{% trans 'Posted by' %} {{ comment.user }} on {{ comment.submit_date|date }}
+{% if user.is_authenticated %} <a href="/admin/comments/comment/{{ comment.id }}/delete" class="deletelink">{% trans 'Delete' %}</a>{% endif %}
+{% endif %}
+{% endfor %}
+ {% endif %}
<h4>{% trans 'Leave comment' %}:</h4>
- {% render_comment_form for auth.group group.id %}
+ <form action="{% comment_form_target %}" method="POST">
+
+ {% render_comment_form for group %}
-</div>
</div>
</div>
</div>
@@ -36,11 +44,9 @@
<div class="module">
<h2>{% trans 'To do' %}</h2>
-<form action="todo/add/" class="collapse" method="POST">
-<ul class="actionlist">
-{{ newtodo.as_ul }}
-<li><input type="submit" name="submit" class="submit-post" value="Post"></li>
-</ul>
+<form action="{% url agenda.views.savegrouptodo group.id %}" class="collapse" method="POST">
+{{ newtodo.as_p }}
+<p><input type="submit" name="submit" class="submit-post" value="Post"></p>
<input type="hidden" name="network" value="{{ group.id }}" id="id_group" />
<input type="hidden" name="creator" value="{{ user.id }}" id="id_creator" />
</form>
@@ -53,9 +59,9 @@
{% endfor %}
{% endif %}
</div>
-<div class="module">
{% get_comment_list for auth.group group.id as comment_list %}
{% if comment_list %}
+<div class="module">
<h2>{% trans 'Comments for this group' %}</h2>
<ul class="actionlist">
{% for comment in comment_list %}
@@ -68,6 +74,6 @@
{% endfor %}
</ul>
-{% endif %}
</div>
+{% endif %}
{% endblock %}
diff --git a/templates/agenda/user_events.html b/templates/agenda/user_events.html
index 498fba5..fa42521 100755
--- a/templates/agenda/user_events.html
+++ b/templates/agenda/user_events.html
@@ -32,7 +32,7 @@ broken! is not showing the pending or the confirmed events for the user...
{% endif %}
{% if confirmed %}
<div class="module">
- <h3>confirmed events</h3>
+ <h3>{% trans 'confirmed events' %}</h3>
{% for object in confirmed %}
<table summary="blogs">
diff --git a/templates/agenda/user_page.html b/templates/agenda/user_page.html
index 335baa9..f9ac453 100755
--- a/templates/agenda/user_page.html
+++ b/templates/agenda/user_page.html
@@ -9,43 +9,57 @@
<h2>{% trans 'Events that need a pixie' %}:</h2>
<ul class="actionlist">
{% for event in missing_pixies %}
- <li><form action="/agenda/{{ event.id }}/adopt/" class="collapse" method="POST"> <input type="hidden" name="event" value="{{ event.id }}" id="id_event" /><a href="/admin/agenda/event/{{ event.id }}/">{{ event.title }}</a>: <span class="mini quiet">{{ event.description }} Groups: {{ event.network.iterator|join:" ," }}</span> {% if user.is_authenticated %}<a href="/admin/agenda/event/{{ event.id }}/" class="changelink">edit</a> <input type="hidden" name="pixie" value="{{ user.id }}" id="id_pixie" /> <input type="submit" name="submit" class="close-post" value="I will do it">{% endif %}
+ <li><form action="{% url agenda.views.adoptevent event.id %}" class="collapse" method="POST"> <input type="hidden" name="event" value="{{ event.id }}" id="id_event" />
+ <a href="{% url agenda.views.event event.id %}">{{ event.title }}</a>: <span class="mini quiet">{{ event.description }} - {{ event.start_date|date }}
+ {% if event.groups.count %} {% trans 'Groups' %}: {{ event.network.iterator|join:" ," }} {% endif %}
+ </span>
+ {% if user.is_authenticated %}<a href="/admin/agenda/event/{{ event.id }}/" class="changelink">edit</a> <input type="hidden" name="pixie" value="{{ user.id }}" id="id_pixie" /> <input type="submit" name="submit" class="close-post" value="{% trans 'I will do it' %}">{% endif %}
</form></li>
{% endfor %}
</ul>
</div>
{% endif %}
+{% endblock %}
+{% block content %}
{% if group_todos.count %}
<div class="module">
<h2>{% trans 'Pending ToDos on your groups' %}:</h2>
<ul class="actionlist">
{% for todo in group_todos %}
- <li><form action="todo/{{ todo.id }}/close/" class="collapse" method="POST"> <input type="hidden" name="todo" value="{{ todo.id }}" id="id_todo" /><a href="/admin/agenda/todo/{{ todo.id }}/">{{ todo.title }}</a>: <span class="mini quiet">{{ todo.description }} Groups: {{ todo.network.iterator|join:" ," }}</span> {% if user.is_authenticated %}<a href="/admin/agenda/todo/{{ todo.id }}/" class="changelink">edit</a> <input type="hidden" name="done" value="True" id="id_done" /> <input type="submit" name="submit" class="close-post" value="close">{% endif %}
+ <li><form action="{% url agenda.views.closealltodo todo.id %}" class="collapse" method="POST"> <input type="hidden" name="todo" value="{{ todo.id }}" id="id_todo" /><a href="/admin/agenda/todo/{{ todo.id }}/">{{ todo.title }}</a>: <span class="mini quiet">{{ todo.description }} Groups: {{ todo.network.iterator|join:" ," }}</span> {% if user.is_authenticated %}<a href="/admin/agenda/todo/{{ todo.id }}/" class="changelink">edit</a> <input type="hidden" name="done" value="True" id="id_done" /> <input type="submit" name="submit" class="close-post" value="close">{% endif %}
</form></li>
{% endfor %}
</ul>
</div>
{% endif %}
+ <div class="module">
+
+ <h2>{% trans 'Your groups' %}</h2>
+
+ <ul>
+ {% for group in user.groups.all %}
+ <li><a href="{% url agenda.views.justonegroup group.id %}">{{ group }}</a>
+ </li>
+ {% endfor %}
+ </ul>
+
+
+ </div>
<div class="module">
-<h3>{% trans 'Add Todo' %}:</h3>
-<form action="todo/submit/" class="collapse" method="POST">
-<ul class="actionlist">
-{{ newtodo.as_ul }}
-<li><input type="submit" name="submit" class="submit-post" value="Post"></li>
-</ul>
-<input type="hidden" name="event" value="{{ event.id }}" id="id_event" />
-<input type="hidden" name="creator" value="{{ user.id }}" id="id_creator" />
-</form>
-</div>
-{% endblock %}
-{% block content %}
-<div class="module">
-<h2><a href="{{ user.id }}">{{ user.name|upper }}</a></h2>
- {% if user.event_set.count %}
<h2>{% trans 'Your events' %}</h2>
+ {% if my_mentored_events %}
+ <h3>{% trans 'Events you coordinate' %}</h3>
+ <ul class="actionlist">
+ {% for event in my_mentored_events %}
+ <li><a href="{% url agenda.views.event event.id %}">{{ event.title }}</a> - {{ event.start_date|date }}</li>
+ {% endfor %}
+ </ul>
+ {% endif %}
+ {% if user.event_set.count %}
+ <h3>{% trans 'Events you are attending' %}</h3>
<ul class="actionlist">
{% for event in user.event_set.all %}
- <li><a href="/agenda/{{ event.id }}/">{{ event.title }}</a> - {{ event.start_date|date }}</li>
+ <li><a href="{% url agenda.views.event event.id %}">{{ event.title }}</a> - {{ event.start_date|date }}</li>
{% endfor %}
</ul>
{% endif %}
@@ -58,15 +72,6 @@
{% endfor %}</td></div>
{% endif %}
- {% if user.logentry_set.count %}
- <div class="module">
- <h2>{% trans 'Log entries' %}:</h2>
- <ul class="actionlist">
- {% for logentry in logentries %} <br>
- <li>{{ logentry.change_message }} {% trans 'on' %} {{ logentry.get_edited_object }},{% trans 'on the' %} {{ logentry.action_time|date }}</li>
- {% endfor %}
- </ul></div>
- {% endif %}
{% if user.messages_set.count %}
<div class="module">
<h2>{% trans 'Messages' %}:</h2>
@@ -83,14 +88,9 @@
<li>{{ comment.headline }}</li>
{% endfor %}</ul></div>
{% endif %}
-</td>
-<td><a href="{{ user.karmascore_set.count }}" class="changelink">karmascore_set.count: {{ user.karmascore_set.count }}</a></td>
{{ calendartable }}
-</tr>
-
-</table>
</div>
{% endblock %}
{% block info %}
-template: "agenda/event_list.html"
+template: "agenda/user_page.html"
{% endblock %}
diff --git a/templates/agenda/wishlist.html b/templates/agenda/wishlist.html
new file mode 100755
index 0000000..bb4f176
--- /dev/null
+++ b/templates/agenda/wishlist.html
@@ -0,0 +1,38 @@
+{% extends 'agenda/base.html' %}
+{% load i18n %}
+{% block content_title %}<h1>{% trans 'Wishlist' %}</h1>{% endblock %}
+{% block content %}
+ <div class="module">
+ <h2>{% trans 'Wishlist' %}</h2>
+{% if wishlist %}
+ <ul>
+ {% for object in wishlist %}
+ <li>{{ object.title|title }}
+ <p>{{ object.description }}</p>
+ {% if object.due_date %}<p>Due date: {{ object.due_date|date }}</p>{% endif %}
+ {% if object.location.count %}{% trans 'Location' %}:
+ {% for location in object.location.all %}
+ <a href="{% url agenda.views.location location.id %}" class="location">{{ location.title }}</a>
+
+ {% endfor %}
+
+ {% endif %}
+ {% if object.comment_set.all %}{% trans 'Comments' %}: {{ object.comment_set.count }}{% endif %}
+{% if user.is_staff %} - <a href="/admin/agenda/wish/{{ object.id }}" class="changelink">{% trans 'Modify' %}</a> - <a href="/admin/agenda/wish/{{ object.id }}/delete" class="deletelink">{% trans 'Delete' %}</a>
+{% endif %}
+
+ </li>
+ {% endfor %}
+ </ul>
+{% else %}
+<p>{% trans 'There are no items on the wishlist! Do you want to add one?' %}<a href="/admin/agenda/wish/add" class="actionlink">{% trans ' Click here.' %}</a>
+ </div>
+{% endif %}
+{% endblock %}
+{% block sidebar %}
+ {{ block.super }}
+{% endblock %}
+{% block info %}
+template: "agenda/wishlist.html"
+{% endblock %}
+
diff --git a/templates/base.html b/templates/base.html
index 5e981d9..aa7111a 100755
--- a/templates/base.html
+++ b/templates/base.html
@@ -2,7 +2,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
- <link rel="stylesheet" href="{% load adminmedia %}{% admin_media_prefix %}css/dashboard.css" />
+ <link rel="stylesheet" href="{% load adminmedia %}{% admin_media_prefix %}css/base.css" />
<title>{% block title %}Infopoint{% endblock %}</title>
</head>
{% load i18n %}
diff --git a/templates/blog/author_posts.html b/templates/blog/author_posts.html
deleted file mode 100755
index ede500d..0000000
--- a/templates/blog/author_posts.html
+++ /dev/null
@@ -1,25 +0,0 @@
-{% extends 'polls/base.html' %}
-{% block content %}
- {% for object in object_list %}
- <div class="module">
- {{ object.all }}
- {% block title%} {{ object.headline }}{% endblock %}
- <h3><a href="{{ object.blog.id }}"> {{ object.blog }}</a> - <a href="post/{{ object.id }}">{{ object.headline }} </a></h3>
- <div class="date">{{ object.pub_date }} </div>
- <div class=".MS">{{ object.body_text }}</div>
- </div>
- {% endfor %}
-<table border=1>
-<tr>
-<td>Author Name</td><td>Posts</td>
-</tr>
-{% for author in authors_list %}
-<tr>
-<td>{{author.name}} {{post.id}}</td>
-<td></td>
-</tr>
-{% endfor %}
-</table>
-
-{% endblock %}
-
diff --git a/templates/blog/base.html b/templates/blog/base.html
deleted file mode 100755
index 3e51236..0000000
--- a/templates/blog/base.html
+++ /dev/null
@@ -1,47 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
- <link rel="stylesheet" href="/media/css/dashboard.css" />
- <title>{% block title %}Infopoint{% endblock %}</title>
-</head>
-{% load i18n %}
-<body class="dashboard">
-<div id="container">
- {% if not is_popup %}
- <!-- Header -->
- <div id="header">
- <div id="branding">
- <h1 id="site-name">{% block branding %}Infopoint{% endblock %}</h1> </div>
- {% if user.is_authenticated and user.is_staff %}
- <div id="user-tools">{% trans 'Welcome,' %} <strong>{% if user.first_name %}{{ user.first_name|escape }}{% else %}{{ user.username }}{% endif %}</strong>. {% block userlinks %}<a href="{{ root_path }}doc/">{% trans 'Documentation' %}</a> / <a href="{{ root_path }}password_change/">{% trans 'Change password' %}</a> / {% block info %}{% endblock %} <a href="{{ root_path }}logout/">{% trans 'Log out' %}</a>{% endblock %}</div>
- {% endif %}
- {% block nav-global %}{% endblock %}
- </div>
- <!-- END Header -->
-
- {% endif %}
- <div id="content" class="colMS">
- <div id="content-main">
- <div id="content-related">
- {% block sidebar %}
- <ul>
- <li><a href="/blog">Home</a></li>
- <li><a href="/admin/">Admin</a></li>
- <li><a href="/blog/">Planet</a></li>
- <li><a href="/agenda/">events</a></li>
- </ul>
- {% endblock %}
- </div>
- {% block content %}
- <h1>Infopoint</h1>
- This is the default content.<br>
- Your content should appear here instead
- {% endblock %}
- </div>
- </div>
-
-
-</body>
-</html>
-
diff --git a/templates/blog/blog_list.html b/templates/blog/blog_list.html
deleted file mode 100755
index 55c8c6f..0000000
--- a/templates/blog/blog_list.html
+++ /dev/null
@@ -1,22 +0,0 @@
-{% extends 'polls/base.html' %}
-{% block info %}
-template: "blog/blog_list.html"
-{% endblock %}
-
-
-{% block content %}
- <h3><a href="/admin/blog/">Blogs</a> </h3>
- {% for blog in blogs_summary %}
- <div class="module">
- <table summary="blogs">
- <caption><a href="{{ object.id }}">{{ object.name }}</a> </caption>
- <tr>
- <th scope="row"><a href="{{ object.id }}/">{{ object.tagline }}</a></th>
- <td><a href="post/add/" class="addlink">New post</a></td>
- <td><a href="/admin/blog/blog/{{ object.id }}" class="changelink">Modificar</a></td>
- </tr>
- </table>
- {% endfor %}
-{% for object in Blog.objects.all %}
-{% endfor %}
-{% endblock %}
diff --git a/templates/blog/directory.html b/templates/blog/directory.html
deleted file mode 100755
index 06a353e..0000000
--- a/templates/blog/directory.html
+++ /dev/null
@@ -1,29 +0,0 @@
-{% extends 'polls/base.html' %}
-
-{% block content %}
-
- {% if object_list %}
- <h3><a href="/admin/blog/">Blogs</a> </h3>
- {% for object in object_list %}
- <div class="module">
- <table summary="blogs">
- <caption><a href="{{ object.id }}">{{ object.name }}</a> </caption>
- <tr>
- <th scope="row"><a href="{{ object.id }}/">{{ object.tagline }}</a></th>
- <td><a href="/admin/blog/{{ object.id }}/post/add/" class="addlink">New post</a></td>
- <td><a href="/admin/blog/blog/{{ object.id }}" class="changelink">Modificar</a></td>
- </tr>
- {% for object in posts_list %}
- <tr>
- <td> {{ object.name }}</td>
- </tr>
- {% endfor %}
-
- </table>
- {% endfor %}
-{% endif %}
-{% endblock %}
-{% block info %}
-template: "blog/directory.html"
-{% endblock %}
-
diff --git a/templates/blog/one_blog.html b/templates/blog/one_blog.html
deleted file mode 100755
index cf0f956..0000000
--- a/templates/blog/one_blog.html
+++ /dev/null
@@ -1,16 +0,0 @@
-{% extends 'blog/base.html' %}
-{% block branding %}{{ blog.name }}{{ author.name }}{% endblock %}
-
-{% block content %}
- {% for Post in posts_list %}
- <h3><a href="post/{{ Post.id }}">{{ Post.headline }}</a> </h3>
- <div class="tiny">{{ Post.pub_date|date:"d/m" }}</div>
- <p>{{ Post.body_text }}</p>
- <cite>{{ Post.name }}</cite>
-{% endfor %}
-
-{% endblock %}
-{% block info %}
-template: "blog/one_blog.html"
-{% endblock %}
-
diff --git a/templates/blog/post_alone.html b/templates/blog/post_alone.html
deleted file mode 100755
index cae6605..0000000
--- a/templates/blog/post_alone.html
+++ /dev/null
@@ -1,17 +0,0 @@
-{% extends 'polls/base.html' %}
-
-{% block content %}
-{% if object%}
- <div class="module">
- <h3>{{ object.headline }} </h3>
- <div class="date">{{ object.pub_date }} </div>
- <div class=".MS">{{ object.body_text }}</div>
- <div class="author">{{ object.all }}</div>
-</div>
-
-{% else %}
- <p>This post doesn't exist! Go back to the <a href="/blog">blog? </a>
-</p>
-{% endif %}
- {% endblock %}
-
diff --git a/templates/blog/post_list.html b/templates/blog/post_list.html
deleted file mode 100755
index 5a89652..0000000
--- a/templates/blog/post_list.html
+++ /dev/null
@@ -1,35 +0,0 @@
-{% extends 'polls/base.html' %}
-
-{% block content %}
- {% if object_list %}
- object!
- check the template as is prepared for object_list!
- {% endif %}
-{% if object %}
- <h3><a href="/admin/blog/">Blogs</a> </h3>
- {% for object in post_list %}
- <div class="module">
- <table summary="blogs">
- <caption><a href="{{ object.id }}">{{ object.name }}</a> </caption>
- <tr>
- <th scope="row"><a href="{{ object.id }}/">{{ object.tagline }}</a></th>
- <td><a href="post/add/" class="addlink">New post</a></td>
- <td><a href="/admin/blog/blog/{{ object.id }}" class="changelink">Modificar</a></td>
- </tr>
- {% for object in posts_list %}
- <tr>
- <td> {{ object.name }}</td>
- </tr>
- {% endfor %}
-
- </table>
- {% endfor %}
-{% endif %}
-test
-{% debug %}
-{% endblock %}
-{% block info %}
-{{ object.list }}
-template: "blog/post_list.html"
-{% endblock %}
-
diff --git a/templates/comments/approve.html b/templates/comments/approve.html
index 18157b7..d34b0c6 100644
--- a/templates/comments/approve.html
+++ b/templates/comments/approve.html
@@ -1,14 +1,14 @@
-{% extends "comments/base.html" %}
-
-{% block title %}Approve a comment{% endblock %}
+{% extends "agenda/base.html" %}
+{% load i18n %}
+{% block title %}{% trans 'Approve a comment' %}{% endblock %}
{% block content %}
- <h1>Really make this comment public?</h1>
+ <h1>{% trans 'Really make this comment public?' %}</h1>
<blockquote>{{ comment|escape|linebreaks }}</blockquote>
<form action="." method="POST">
<input type="hidden" name="next" value="{{ next|escape }}" id="next">
<p class="submit">
- <input type="submit" name="submit" value="Approve"> or <a href="{{ comment.permalink }}">cancel</a>
+ <input type="submit" name="submit" value="{% trans 'Approve' %}"> or <a href="{{ comment.permalink }}">{% trans 'cancel' %}</a>
</p>
</form>
-{% endblock %} \ No newline at end of file
+{% endblock %}
diff --git a/templates/comments/form.html b/templates/comments/form.html
index 5c43c62..879f978 100644
--- a/templates/comments/form.html
+++ b/templates/comments/form.html
@@ -1,14 +1,11 @@
{% load comments %}
-<form action="{% comment_form_target %}" method="POST">
+ {% if form.comment.errors %}{{ form.comment.errors }}{% endif %}
+
+ {{ form.comment }}
{% for field in form %}
+
{% if field.is_hidden %}
{{ field }}
- {% else %}
- <p
- {% if field.errors %} class="error"{% endif %}
- {% ifequal field.name "honeypot" %} style="display:none;"{% endifequal %}>
- {% if field.errors %}{{ field.errors }}{% endif %}
- {{ field.label_tag }} {{ field }}
</p>
{% endif %}
{% endfor %}
@@ -16,4 +13,4 @@
<input type="submit" name="submit" class="submit-post" value="Post">
<input type="submit" name="submit" class="submit-preview" value="Preview">
</p>
-</form> \ No newline at end of file
+</form>
diff --git a/templates/comments/posted.html b/templates/comments/posted.html
index 2833c11..cf50afd 100644
--- a/templates/comments/posted.html
+++ b/templates/comments/posted.html
@@ -1,7 +1,7 @@
-{% extends "comments/base.html" %}
-
-{% block title %}Thanks for commenting.{% endblock %}
+{% extends "agenda/base.html" %}
+{% load i18n %}
+{% block title %}{% trans 'Thanks for commenting' %}.{% endblock %}
{% block content %}
- <h1>Thank you for your comment.</h1>
-{% endblock %} \ No newline at end of file
+ <h1>{% trans 'Thank you for your comment' %}.</h1>
+{% endblock %}
diff --git a/templates/flatpages/base.html b/templates/flatpages/base.html
deleted file mode 100755
index 5f28f76..0000000
--- a/templates/flatpages/base.html
+++ /dev/null
@@ -1,54 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" lang="{{ LANGUAGE_CODE }}" xml:lang="{{ LANGUAGE_CODE }}" {% if LANGUAGE_BIDI %}dir="rtl"{% endif %}>
-<head>
-<title>{% block title %}{% endblock %}</title>
-<link rel="stylesheet" type="text/css" href="{% block stylesheet %}{% load adminmedia %}{% admin_media_prefix %}/media/css/dashboard.css{% endblock %}" />
-{% if LANGUAGE_BIDI %}<link rel="stylesheet" type="text/css" href="{% block stylesheet_rtl %}{% admin_media_prefix %}css/rtl.css{% endblock %}" />{% endif %}
-{% block extrastyle %}{% endblock %}
-{% block extrahead %}{% endblock %}
-</head>
-{% load i18n %}
-
-<body class="{% if is_popup %}popup {% endif %}{% block bodyclass %}{% endblock %}">
-
-<!-- Container -->
-<div id="container">
-
- {% if not is_popup %}
- <!-- Header -->
- <div id="header">
- <div id="branding">
- {% block branding %}{% endblock %}
- </div>
- {% if user.is_authenticated and user.is_staff %}
- <div id="user-tools">{% trans 'Welcome,' %} <strong>{% if user.first_name %}{{ user.first_name|escape }}{% else %}{{ user.username }}{% endif %}</strong>. {% block userlinks %}<a href="{{ root_path }}doc/">{% trans 'Documentation' %}</a> / <a href="{{ root_path }}password_change/">{% trans 'Change password' %}</a> / <a href="{{ root_path }}logout/">{% trans 'Log out' %}</a>{% endblock %}</div>
- {% endif %}
- {% block nav-global %}{% endblock %}
- </div>
- <!-- END Header -->
- {% block breadcrumbs %}<div class="breadcrumbs"><a href="/">{% trans 'Home' %}</a>{% if title %} &rsaquo; {{ title|escape }}{% endif %}</div>{% endblock %}
- {% endif %}
-
- {% if messages %}
- <ul class="messagelist">{% for message in messages %}<li>{{ message|escape }}</li>{% endfor %}</ul>
- {% endif %}
-
- <!-- Content -->
- <div id="content" class="{% block coltype %}colM{% endblock %}">
- {% block pretitle %}{% endblock %}
- {% block content_title %}{% if title %}<h1>{{ title|escape }}</h1>{% endif %}{% endblock %}
- {% block content %}
- {% block object-tools %}{% endblock %}
- {{ content }}
- {% endblock %}
- {% block sidebar %}{% endblock %}
- <br class="clear" />
- </div>
- <!-- END Content -->
-
- {% block footer %}<div id="footer"></div>{% endblock %}
-</div>
-<!-- END Container -->
-
-</body>
-</html>
diff --git a/templates/flatpages/default.html b/templates/flatpages/default.html
deleted file mode 100755
index 2c5df19..0000000
--- a/templates/flatpages/default.html
+++ /dev/null
@@ -1,10 +0,0 @@
-{% extends "flatpages/base.html" %}
-{% load comments %}
-{% block title %}
-{{ flatpage.title }}
-{% endblock %}
-
-{% block content %}
-{{ flatpage.content }}
-
-{% endblock content %}
diff --git a/templates/flatpages/left_menu.html b/templates/flatpages/left_menu.html
deleted file mode 100755
index 73884c0..0000000
--- a/templates/flatpages/left_menu.html
+++ /dev/null
@@ -1,11 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
- "http://www.w3.org/TR/REC-html40/loose.dtd">
-<html>
-<head>
-<title>{{ flatpage.title }}</title>
-</head>
-<body>
-{{ flatpage.content }}
-</body>
-</html>
-
diff --git a/templates/polls/base.html b/templates/polls/base.html
deleted file mode 100755
index 8017736..0000000
--- a/templates/polls/base.html
+++ /dev/null
@@ -1,47 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
- <link rel="stylesheet" href="/media/css/dashboard.css" />
- <title>{% block title %}Infopoint{% endblock %}</title>
-</head>
-{% load i18n %}
-<body class="dashboard">
-<div id="container">
- {% if not is_popup %}
- <!-- Header -->
- <div id="header">
- <div id="branding">
- <h1 id="site-name">{% block branding %}Infopoint{% endblock %}</h1> </div>
- {% if user.is_authenticated and user.is_staff %}
- <div id="user-tools">{% trans 'Welcome,' %} <strong>{% if user.first_name %}{{ user.first_name|escape }}{% else %}{{ user.username }}{% endif %}</strong>. {% block userlinks %}<a href="{{ root_path }}doc/">{% trans 'Documentation' %}</a> / <a href="{{ root_path }}password_change/">{% trans 'Change password' %}</a> / {% block info %}{% endblock %} <a href="{{ root_path }}logout/">{% trans 'Log out' %}</a>{% endblock %}</div>
- {% endif %}
- {% block nav-global %}{% endblock %}
- </div>
- <!-- END Header -->
-
- {% endif %}
- <div id="content" class="colMS">
- <div id="content-main">
- <div id="content-related">
- {% block sidebar %}
- <ul>
- <li><a href="/">Home</a></li>
- <li><a href="/admin/">Admin</a></li>
- <li><a href="/polls/">Polls</a></li>
- <li><a href="/blog/">Blog</a></li>
- </ul>
- {% endblock %}
- </div>
- {% block content %}
- <h1>Infopoint</h1>
- This is the default content.<br>
- Your content should appear here instead
- {% endblock %}
- </div>
- </div>
-
-
-</body>
-</html>
-
diff --git a/templates/polls/poll_detail.html b/templates/polls/poll_detail.html
deleted file mode 100755
index 35b7757..0000000
--- a/templates/polls/poll_detail.html
+++ /dev/null
@@ -1,39 +0,0 @@
-{% extends "admin/base_site.html" %}
-{% load i18n %}
-
-{% block stylesheet %}{% load adminmedia %}{% admin_media_prefix %}css/dashboard.css{% endblock %}
-
-{% block coltype %}colMS{% endblock %}
-
-{% block bodyclass %}dashboard{% endblock %}
-
-{% block breadcrumbs %}{% endblock %}
-
-{% block content %}
-<div id="content-main">
-
-{{ object.header }}
-<h1>{{ object.question }}</h1>
-
-
-{% if error_message %}<p><strong>{{ error_message }}</strong></p>{% endif %}
-
-<form action="/polls/{{ object.id }}/vote/" method="post">
-{% for choice in object.choice_set.all %}
- <input type="radio" name="choice" id="choice{{ forloop.counter }}" value="{{ choice.id }}" />
- <label for="choice{{ forloop.counter }}">{{ choice.choice }}</label><br />
-{% endfor %}
-<input type="submit" value="Vote" />
-</form>
-</div>
-
-{% endblock %}
-
-{% block sidebar %}
-<div id="content-related">
- <div class="module" id="recent-actions-module">
- <h2>{% trans 'Recent Actions' %}</h2>
-</div>
-</div>
-{% endblock %}
-
diff --git a/templates/polls/poll_list.html b/templates/polls/poll_list.html
deleted file mode 100755
index 2888cf2..0000000
--- a/templates/polls/poll_list.html
+++ /dev/null
@@ -1,14 +0,0 @@
-{% extends 'polls/base.html' %}
-
-{% block content %}
-{% if object_list %}
- <ul>
- {% for object in object_list %}
- <li>{{ object.question }} {{ object.all }}</li>
- {% endfor %}
- </ul>
-{% else %}
- <p>No polls are available.</p>
-{% endif %}
- {% endblock %}
-
diff --git a/templates/polls/results.html b/templates/polls/results.html
deleted file mode 100755
index 57c6d6b..0000000
--- a/templates/polls/results.html
+++ /dev/null
@@ -1,46 +0,0 @@
-{% extends "admin/base_site.html" %}
-{% load i18n %}
-
-{% block stylesheet %}{% load adminmedia %}{% admin_media_prefix %}css/dashboard.css{% endblock %}
-
-{% block coltype %}colMS{% endblock %}
-
-{% block bodyclass %}dashboard{% endblock %}
-
-{% block breadcrumbs %}{% endblock %}
-
-{% block content %}
-<div id="content-main">
-
-<h1>{{ poll.question }}</h1>
-
-
-{% if error_message %}<p><strong>{{ error_message }}</strong></p>{% endif %}
-<ul>
-{% for choice in poll.choice_set.all %}
- <li>{{ choice.choice }} -- {{ choice.votes }} vote{{ choice.votes|pluralize }}</li>
-{% endfor %}
-</ul>
-
-<form action="/polls/{{ poll.id }}/vote/" method="post">
-<ul>
-{% for choice in poll.choice_set.all %}
- <li>
- <input type="radio" name="choice" id="choice{{ forloop.counter }}" value="{{ choice.id }}" />
- <label for="choice{{ forloop.counter }}">{{ choice.choice }}</label></li>
-{% endfor %}
-</ul>
-<input type="submit" value="Vote" />
-</form>
-</div>
-
-{% endblock %}
-
-{% block sidebar %}
-<div id="content-related">
- <div class="module" id="recent-actions-module">
- <h2>{% trans 'Recent Actions' %}</h2>
-</div>
-</div>
-{% endblock %}
-
diff --git a/templates/sites/base.html b/templates/sites/base.html
deleted file mode 100755
index dca2129..0000000
--- a/templates/sites/base.html
+++ /dev/null
@@ -1,52 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
- <link rel="stylesheet" href="{% load adminmedia %}{% admin_media_prefix %}css/dashboard.css" />
- <title>{% block title %}Infopoint{% endblock %}</title>
-</head>
-{% load i18n %}
-<body class="dashboard">
-<div id="container">
- {% if not is_popup %}
- <!-- Header -->
- <div id="header">
- <div id="branding">
- <h1 id="site-name">{% block branding %}Infopoint{% endblock %}</h1> </div>
- {% if user.is_authenticated and user.is_staff %}
- <div id="user-tools">{% trans 'Welcome,' %} <strong>{% if user.first_name %}{{ user.first_name|escape }}{% else %}{{ user.username }}{% endif %}</strong>. {% block userlinks %}<a href="{{ root_path }}doc/">{% trans 'Documentation' %}</a> / <a href="{{ root_path }}password_change/">{% trans 'Change password' %}</a> / {% block info %}{% endblock %} <a href="{{ root_path }}logout/">{% trans 'Log out' %}</a>{% endblock %}</div>
- {% endif %}
- {% block nav-global %}{% endblock %}
- </div>
- <!-- END Header -->
-
- {% endif %}
- <div id="content" class="colMS">
- <div id="content-related">
- {% block sidebar %}
- <div class="module">
- <h2>{% trans 'Links' %}</h2>
- <ul class="actionlist">
- <li><a href="/">Home</a></li>
- <li><a href="/random/">Random events</a></li>
- <li><a href="/agenda/">Agenda</a></li>
- <li><a href="/admin/">Admin</a></li>
- <li><a href="/agenda/next_events_cal/">iCal</a></li>
- </ul>
- </div>
- {% endblock %}
- </div>
- <div id="content-main">
- {% block content %}
- <h1>Infopoint</h1>
- This is the default content.<br>
- Your content should appear here instead
- {% endblock %}
- </div>
- </div>
- </div>
-
-
-</body>
-</html>
-
diff --git a/templates/sites/base_site.html b/templates/sites/base_site.html
deleted file mode 100755
index 371e4dd..0000000
--- a/templates/sites/base_site.html
+++ /dev/null
@@ -1,23 +0,0 @@
-{% extends "admin/base.html" %}
-{% load i18n %}
-
-{% block head %}{{ object.title }}{{ site.name }}{% endblock %}
-
-
-{% block object-tools %}
-{% if perms. %}
-<div class="module"><h2>Polls</h2><table>
-</table></div>
-{% endif %}
-
-{% if perms.site %}
-<div class="module"><h2>Site</h2><table>
-</table></div>
-{% endif %}
-
-{% if perms.agenda %}
-<div class="module"><h2>Events</h2><table>
-</table></div>
-{% endif %}
-{% endblock %}
-
diff --git a/templates/sites/default.html b/templates/sites/default.html
deleted file mode 100755
index 80392ad..0000000
--- a/templates/sites/default.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
- "http://www.w3.org/TR/REC-html40/loose.dtd">
-<html>
-<head>
-<title>{{ object.title }}</title>
-</head>
-<body>
-test
-"sites/default.html"
-{{ object.content }}
-</body>
-</html>
-
diff --git a/templates/sites/directory.html b/templates/sites/directory.html
deleted file mode 100755
index 06a353e..0000000
--- a/templates/sites/directory.html
+++ /dev/null
@@ -1,29 +0,0 @@
-{% extends 'polls/base.html' %}
-
-{% block content %}
-
- {% if object_list %}
- <h3><a href="/admin/blog/">Blogs</a> </h3>
- {% for object in object_list %}
- <div class="module">
- <table summary="blogs">
- <caption><a href="{{ object.id }}">{{ object.name }}</a> </caption>
- <tr>
- <th scope="row"><a href="{{ object.id }}/">{{ object.tagline }}</a></th>
- <td><a href="/admin/blog/{{ object.id }}/post/add/" class="addlink">New post</a></td>
- <td><a href="/admin/blog/blog/{{ object.id }}" class="changelink">Modificar</a></td>
- </tr>
- {% for object in posts_list %}
- <tr>
- <td> {{ object.name }}</td>
- </tr>
- {% endfor %}
-
- </table>
- {% endfor %}
-{% endif %}
-{% endblock %}
-{% block info %}
-template: "blog/directory.html"
-{% endblock %}
-
diff --git a/templates/sites/site_list.html b/templates/sites/site_list.html
deleted file mode 100755
index 980083b..0000000
--- a/templates/sites/site_list.html
+++ /dev/null
@@ -1,49 +0,0 @@
-{% extends 'sites/base.html' %}
-{% load i18n %}
-{% block stylesheet %}{% load adminmedia %}{% admin_media_prefix %}css/dashboard.css{% endblock %}
-{% block head %}{{ object.title }}{{ title }} {% trans 'Infopoint website' %}{% endblock %}
-
-{% block title %}{{ site.name }}{% endblock %}
-{% block content %}
- {% for object in object_list %}
- {% for article in object.event_set.all %}
- <div class="module">
- <h2>{% trans 'Event' %}: <a href="/agenda/{{ article.id }}" class="changelink">{{ article.title }}</a></h2>
- <p>{{ article.description }}</p>
- {% if article.link %}<p>{{ article.link }} </p>{% endif %}
- <p> {{ article.start_date|date }}
-
- <p>{% if article.attendance_set.count %}{% trans 'Asistencia confirmada' %}: {{ article.attendance_set.count }}{% endif %}
- {% if article.comment_set.count %}{% trans 'Comments' %}: {{ article.comment_set.count }}{% endif %}</p>
- <p><a href="agenda/location/{{ article.location_id }}" class="changelink">{% trans 'Location' %}: {{ article.location.colored_location|safe }}</a></p>
- <td><a href="agenda/{{ article.id }}/attend/" class="addlink">{% trans 'I am attending' %}</a></td>
- <td><a href="admin/agenda/event/{{ article.id }}" class="changelink">{% trans 'Modify' %}</a></td>
- </div>
- {% endfor %}
- {% for article in object.flatpage_set.all %}
- <div class="module">
- <h2>{% trans 'Article' %}: {{ article.title }}</h2>
- <p>{{ article.content }}</p>
- </div>
- {% endfor %}
- {% endfor %}
-{% endblock %}
-{% block sidebar %}{{ block.super }}
-{% for object in object_list %}
- {% if object.comment_set.count %}
- <div class="module">
- <h2>{% trans 'Comments' %}</h2>
- <ul class="actionlist">
- {% for article in object.comment_set.all %}
- {% if article.is_public %}
- <li><a href="/agenda/{{ article.content_type }}/{{ article.object_pk }}">{{ article.get_content_object.title }}{{ article.get_content_object.name }} - <strong>{{ article.headline }}</strong>
- <span class="mini quiet">{{ article.comment|truncatewords_html:"10" }}</span></a></li>
- {% endif %}
- {% endfor %}
- <li>Add Comment</li>
- </ul>
- </div>
- {% endif %}
-{% endfor %}
-{% endblock %}
-
diff --git a/urls.py b/urls.py
new file mode 100644
index 0000000..3bbd833
--- /dev/null
+++ b/urls.py
@@ -0,0 +1,19 @@
+from django.conf.urls.defaults import *
+from django.db import models
+
+# Uncomment the next two lines to enable the admin:
+from django.contrib import admin
+admin.autodiscover()
+
+urlpatterns = patterns('',
+ # Example:
+
+
+ # Uncomment the admin/doc line below and add 'django.contrib.admindocs'
+ # to INSTALLED_APPS to enable admin documentation:
+ (r'^admin/doc/', include('django.contrib.admindocs.urls')),
+
+ # Uncomment the next line to enable the admin:
+ (r'^admin/(.*)', admin.site.root),
+ (r'^', include('infopoint.agenda.urls')),
+)