diff options
163 files changed, 8203 insertions, 0 deletions
diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/__init__.py diff --git a/__init__.pyc b/__init__.pyc Binary files differnew file mode 100644 index 0000000..fc48a8a --- /dev/null +++ b/__init__.pyc diff --git a/agenda/.forms.py.swp b/agenda/.forms.py.swp Binary files differnew file mode 100644 index 0000000..480de33 --- /dev/null +++ b/agenda/.forms.py.swp diff --git a/agenda/.views.py.swp b/agenda/.views.py.swp Binary files differnew file mode 100644 index 0000000..ac17a3d --- /dev/null +++ b/agenda/.views.py.swp diff --git a/agenda/__init__.py b/agenda/__init__.py new file mode 100755 index 0000000..e69de29 --- /dev/null +++ b/agenda/__init__.py diff --git a/agenda/__init__.pyc b/agenda/__init__.pyc Binary files differnew file mode 100644 index 0000000..757e465 --- /dev/null +++ b/agenda/__init__.pyc diff --git a/agenda/billboardviews.py b/agenda/billboardviews.py new file mode 100644 index 0000000..eaea323 --- /dev/null +++ b/agenda/billboardviews.py @@ -0,0 +1,268 @@ +# Create your views here. +from django.shortcuts import render_to_response, get_object_or_404, get_list_or_404 +from infopoint.agenda.models import * +from datetime import date +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, Billboard,Location +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 + + +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: + + 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) + + + +def event_galaxy(request,object_id): + event = Event.calendar.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")) + 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")) + 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' )) + + 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")) + 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")) + + 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")) + + 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')) + + 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')) + 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")) + + + 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') + return HttpResponseRedirect('/agenda/'+object_id) + +def one_still_event(request,object_id,billboard_id): + event = Event.calendar.get(pk=object_id) + style = Billboard.objects.get(pk=billboard_id) + return render_to_response('agenda/billboard_still.html', {'event': event, 'style': style },context_instance=RequestContext(request)) + + +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() + 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/billboardviews.pyc b/agenda/billboardviews.pyc Binary files differnew file mode 100644 index 0000000..192b786 --- /dev/null +++ b/agenda/billboardviews.pyc diff --git a/agenda/customfields.py b/agenda/customfields.py new file mode 100755 index 0000000..ce96efe --- /dev/null +++ b/agenda/customfields.py @@ -0,0 +1,26 @@ +# customfields.py + +from django import forms +from django.conf import settings +from django.db import models +from django.template.loader import render_to_string + + + +class ColorWidget(forms.Widget): + class Media: + js = [settings.ADMIN_MEDIA_PREFIX + "js/ColorPicker2.js"] + + def render(self, name, value, attrs=None): + return render_to_string("agenda/color.html", locals()) + +class ColorField(models.CharField): + def __init__(self, *args, **kwargs): + kwargs['max_length'] = 10 + super(ColorField, self).__init__(*args, **kwargs) + + def formfield(self, **kwargs): + defaults = {'widget': ColorWidget()} + defaults.update(kwargs) + return super(ColorField, self).formfield(**defaults) + diff --git a/agenda/customfields.pyc b/agenda/customfields.pyc Binary files differnew file mode 100755 index 0000000..7116ba7 --- /dev/null +++ b/agenda/customfields.pyc diff --git a/agenda/forms.py b/agenda/forms.py new file mode 100644 index 0000000..c8cb280 --- /dev/null +++ b/agenda/forms.py @@ -0,0 +1,76 @@ +from django.db import models +from django.conf import settings +from infopoint.agenda import * +from infopoint.agenda.models import * +from infopoint.sites.models import Site +import datetime +from django.contrib.contenttypes import generic +from django.contrib import databrowse +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.contrib import admin + +# Create your models here. + + +class EventForm(ModelForm): + class Meta: + model = Event + +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') + +class TodoForm(ModelForm): + class Meta: + model = Todo + +class TodoCompletedForm(forms.Form): + pass + +class TodoCreateForm(forms.Form): + """ + Add the tasks that need to be done, even if you plan to do them yourself. + To have a list of things to be done will be great for sharing the information between the group + """ + title = forms.CharField(max_length=100) + 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?') + + +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?') + description = forms.CharField(max_length=300,required=False,widget=forms.TextInput(attrs={'size':'25'})) + due_date = forms.DateField(required=False,widget=forms.DateTimeInput) + + + +class AttendanceForm(ModelForm): + class Meta: + model = Attendance + + +class ConfirmForm(ModelForm): + exclude = ['person', 'update', 'event'] + class Meta: + model = Attendance + + + + + diff --git a/agenda/forms.pyc b/agenda/forms.pyc Binary files differnew file mode 100644 index 0000000..5b94202 --- /dev/null +++ b/agenda/forms.pyc diff --git a/agenda/models.py b/agenda/models.py new file mode 100755 index 0000000..634f583 --- /dev/null +++ b/agenda/models.py @@ -0,0 +1,266 @@ +#!/usr/bin/python +# -*- coding: utf -*- + +from django.db import models +from django.conf import settings +from infopoint.agenda import * +from infopoint.sites.models import Site +import datetime +from time import gmtime, strftime +from django.contrib.contenttypes import generic +from django.contrib import databrowse +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 +from django.template.loader import render_to_string +from datetime import datetime + +from django.contrib import admin + +# Create your models here. + +TIMESPAN_CHOICES = ( + ('1', 'Future events'), + ('2', 'Past events'), + ('3', 'All events'), + ('4', 'Today'), +) + + +EVENT_STATUS_CHOICES = ( + ('1', 'TENTATIVE'), + ('2', 'CONFIRMED'), + ('3', 'NEEDS ACTION'), + ('4', 'CANCELLED'), +) +EVENT_CLASS_CHOICES = ( + ('1', 'PUBLIC'), + ('2', 'PRIVATE'), + ('3', 'CONFIDENTIAL'), +) + +class Location(models.Model): + """ + This is the class for the different spaces we will handle. + the more information we get here, the less we will have to answer + later + """ + title = models.CharField(max_length=50) + description = models.TextField() + 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) + is_in = models.ForeignKey('self',null=True,blank=True) + places = models.Manager() + # inlines = ('AgendaInline',) + def __unicode__(self): + return self.title + + def colored_location(self): + return '<span style="color: #%s;">%s</span>' % (self.color, self.title) + colored_location.allow_tags = True + + +class EventManager(models.Manager): + def past_events(self): + return self.exclude(start_date__gte=datetime.now()) + + def next_events(self): + return self.filter(start_date__gte=datetime.now()) + + def missing_pixies(self): + return self.filter(start_date__gte=datetime.now()).filter(pixie__isnull=True) + def today_events(self): + today_start = strftime("%Y-%m-%d 0:0:0", gmtime()) + today_end = strftime("%Y-%m-%d 23:59:59", gmtime()) + return self.exclude(start_date__gte=today_end).filter(end_date__gte=today_start) + + + +class Event(models.Model): + """ + The Main Organizers class, where all the data reunites again. + it has some dificulties, anyway. But is a pretty table! + Fields: + Event(id, title, start_date, end_date, priority, location_id, link) + + """ + title = models.CharField(max_length=100) + public = 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') + 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') + picture = models.FileField(upload_to='events/', null=True,blank=True) + redes = models.ManyToManyField(Group, through='Network',null=True,blank=True, related_name='events') + atendees = models.ManyToManyField(User, through='Attendance', null=True,blank=True) + def __unicode__(self): + return self.title + + +class Network(models.Model): + """ + Relation between Groups and events + """ + event = models.ForeignKey(Event,related_name='group') + 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"),) + + +class PendingTodoManager(models.Manager): + def completed_todos(self): + return self.filter(done=True) + + def pending_todos(self): + return self.filter(done=False).order_by('due_date') + + +class Todo(models.Model): + """ + All the tasks that have to be done in the house, even if you dont know how to do them + """ + 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) + done = models.BooleanField(blank=True,null=True) + todos = PendingTodoManager() + network = models.ManyToManyField(Group, null=True,blank=True) + event = models.ManyToManyField(Event, null=True,blank=True, related_name='todo') + location = models.ManyToManyField(Location, null=True,blank=True, related_name='todolocation') + creator = models.ForeignKey(User, related_name='todocreator') + def __unicode__(self): + return self.title + + +class Attendance(models.Model): + """ + This object links the user table and the events table, + to check assistance to events + Attendance(id, person_id, event_id, attendance, update, reject_reason) + """ + 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)") + class Meta: + unique_together = (('person', 'event'),) + + + def __unicode__(self): + return self.person + + + +class LocationInline(admin.TabularInline): + model = Location + +class TodoInline(admin.TabularInline): + model = Todo + +class EventInline(admin.TabularInline): + model = Event + extra = 1 + +class GroupInline(admin.TabularInline): + model = Group + +class AttendanceInline(admin.TabularInline): + model = Attendance + +class NetworkInline(admin.TabularInline): + model = Network + +class AttendanceAdmin(admin.ModelAdmin): + pass +admin.site.register(Attendance,AttendanceAdmin) + +class LocationAdmin(admin.ModelAdmin): + list_display = ('title', 'description', 'size' , 'picture') + inlines = [EventInline] +admin.site.register(Location,LocationAdmin) + +class TodoAdmin(admin.ModelAdmin): + list_display = ('title', 'public','due_date','creator', 'done') + date_hierarchy = 'due_date' + +admin.site.register(Todo,TodoAdmin) + + +class EventAdmin(admin.ModelAdmin): + list_display = ('title', 'description', 'location', 'start_date', 'public') +admin.site.register(Event,EventAdmin) + +class NetworkAdmin(admin.ModelAdmin): + pass +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) + 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) + color1 = models.CharField(max_length=6) + color2 = models.CharField(max_length=6) + color3 = models.CharField(max_length=6) + color4 = models.CharField(max_length=6) + csstitle = models.TextField(max_length=500, help_text="decide the style of the title here",blank=True,default="padding: 30px;font-family: verdana, arial, sans-serif;text-transform: capitalize;BORder: 10px dotted;") + cssdate = models.TextField(max_length=500, help_text="decide the style of the date here",blank=True,default="padding: 30px;") + csslocation = models.TextField(max_length=500, help_text="decide the style of the location here",blank=True,default="padding: 30px;text-transform: capitalize;") + cssdescription = models.TextField(max_length=500, help_text="decide the style of the description here",blank=True) + + def __unicode__(self): + return self.title + +class BillboardInline(admin.TabularInline): + model = Billboard + +class BillboardAdmin(admin.ModelAdmin): + list_display = ('title', 'refresh','timespan','published') + fieldsets = ( + (None, { + 'fields': (('title', 'refresh'), ('published')) + }), + ('content', { + 'fields': (('groups', 'location'), ('timespan')) + }), + ('css', { + 'classes': ('collapse','small'), + 'fields': (('csstitle', 'cssdescription'),('cssdate', 'csslocation')) + }), + ('colors', { + 'fields': (('color1', 'color2'), ('color3', 'color4')) + }), + + ) + +admin.site.register(Billboard,BillboardAdmin) + + + +databrowse.site.register(Event) +databrowse.site.register(Location) +databrowse.site.register(Comment) +databrowse.site.register(Billboard) +databrowse.site.register(ContentType) +databrowse.site.register(Group) +databrowse.site.register(Todo) +databrowse.site.register(User) + diff --git a/agenda/models.pyc b/agenda/models.pyc Binary files differnew file mode 100644 index 0000000..3f5029e --- /dev/null +++ b/agenda/models.pyc diff --git a/agenda/templatetags/__init__.py b/agenda/templatetags/__init__.py new file mode 100755 index 0000000..e69de29 --- /dev/null +++ b/agenda/templatetags/__init__.py diff --git a/agenda/templatetags/__init__.pyc b/agenda/templatetags/__init__.pyc Binary files differnew file mode 100644 index 0000000..9c93547 --- /dev/null +++ b/agenda/templatetags/__init__.pyc diff --git a/agenda/templatetags/calendar.pyc b/agenda/templatetags/calendar.pyc Binary files differnew file mode 100755 index 0000000..610e762 --- /dev/null +++ b/agenda/templatetags/calendar.pyc diff --git a/agenda/templatetags/calendartable.py b/agenda/templatetags/calendartable.py new file mode 100755 index 0000000..0bca5f4 --- /dev/null +++ b/agenda/templatetags/calendartable.py @@ -0,0 +1,59 @@ +# Template tag +from datetime import date, timedelta +from django import template +from infopoint.agenda.models import Event # You need to change this if you like to add your own events to the calendar + +register = template.Library() + + +from datetime import date, timedelta + +def get_last_day_of_month(year, month): + if (month == 12): + year += 1 + month = 1 + else: + month += 1 + return date(year, month, 1) - timedelta(1) + + +def month_cal(year=date.today().year, month=date.today().month): + + event_list = Event.objects.filter(start_date__year=year, start_date__month=month) + + first_day_of_month = date(year, month, 1) + last_day_of_month = get_last_day_of_month(year, month) + first_day_of_calendar = first_day_of_month - timedelta(first_day_of_month.weekday()) + last_day_of_calendar = last_day_of_month + timedelta(7 - last_day_of_month.weekday()) + + month_cal = [] + week = [] + week_headers = [] + + i = 0 + day = first_day_of_calendar + while day <= last_day_of_calendar: + if i < 7: + week_headers.append(day) + cal_day = {} + cal_day['day'] = day + cal_day['event'] = False + for event in event_list: + if day >= event.start_date.date() and day <= event.end_date.date(): + cal_day['event'] = True + if day.month == month: + cal_day['in_month'] = True + else: + cal_day['in_month'] = False + week.append(cal_day) + if day.weekday() == 6: + month_cal.append(week) + week = [] + i += 1 + day += timedelta(1) + + return {'calendar': month_cal, 'headers': week_headers} + +register.inclusion_tag('agenda/month_cal.html')(month_cal) + + diff --git a/agenda/templatetags/calendartable.pyc b/agenda/templatetags/calendartable.pyc Binary files differnew file mode 100644 index 0000000..b4bfdd7 --- /dev/null +++ b/agenda/templatetags/calendartable.pyc diff --git a/agenda/templatetags/random_image.py b/agenda/templatetags/random_image.py new file mode 100755 index 0000000..cdb3d15 --- /dev/null +++ b/agenda/templatetags/random_image.py @@ -0,0 +1,27 @@ +import os +import random +import posixpath +import path +from django import template +from django.conf import settings + +register = template.Library() + +def is_image_file(filename): + """Does `filename` appear to be an image file?""" + img_types = [".jpg", ".jpeg", ".png", ".gif"] + ext = os.path.splitext(filename)[1] + return ext in img_types + +@register.simple_tag +def random_image(path): + """ + Select a random image file from the provided directory + and return its href. `path` should be relative to MEDIA_ROOT. + + Usage: <img src='{% random_image "images/whatever/" %}'> + """ + fullpath = os.path.join(settings.MEDIA_ROOT, path) + filenames = [f for f in os.listdir(fullpath) if is_image_file(f)] + pick = random.choice(filenames) + return path.join(settings.MEDIA_URL, path, pick) diff --git a/agenda/templatetags/random_image.pyc b/agenda/templatetags/random_image.pyc Binary files differnew file mode 100644 index 0000000..7ed44e6 --- /dev/null +++ b/agenda/templatetags/random_image.pyc diff --git a/agenda/urls.py b/agenda/urls.py new file mode 100755 index 0000000..dfe6593 --- /dev/null +++ b/agenda/urls.py @@ -0,0 +1,11 @@ +from django.conf.urls.defaults import * +from infopoint.agenda.models import Event + +info_dict = { + 'queryset': Event.calendar.all(), +} + +urlpatterns = patterns('', + (r'^group/(?P<object_id>\d+)/$', 'infopoint.agenda.views.justonegroup'), +) + diff --git a/agenda/urls.pyc b/agenda/urls.pyc Binary files differnew file mode 100644 index 0000000..b6294f8 --- /dev/null +++ b/agenda/urls.pyc diff --git a/agenda/views.py b/agenda/views.py new file mode 100755 index 0000000..3a4b3ba --- /dev/null +++ b/agenda/views.py @@ -0,0 +1,341 @@ +# Create your views here. +from __future__ import with_statement +from django.shortcuts import render_to_response, get_object_or_404, get_list_or_404 +from infopoint.agenda.models import * +from datetime import date +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 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 + +address = 'Gaona 3' +city = 'Malaga' + +today = date.today() + +def get_map(type,object_id): + map = open( '/var/www/media/maps/'+str(type)+'_'+str(object_id)+'.map' ) + info = str(map.read()) + return info + +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 + + +def justonegroup(request,object_id): + group = Group.objects.get(pk=object_id) + 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)) + +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] + 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)) + else: + event = Event.calendar.filter(public=True) + return render_to_response('agenda/event_list.html', {'log': log }) + +def render (request): + event = Event.events.today_events.filter(public=True) + + if request.user.is_authenticated(): + 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 calendar (request): + event = Event.events.next_events() + if request.user.is_authenticated(): + 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 random(request): + event = Event.events.next_events.order_by('?')[:1] + + return render_to_response('agenda/random.html', {'event': event },context_instance=RequestContext(request)) + + +def event(request,object_id): + event = get_object_or_404(Event, pk=object_id) + try: + attendance = Attendance.objects.get(event=object_id,person=request.user.id) + invite = 'confirm' + + except Attendance.DoesNotExist: + invite = 'True' + attendance = 'none' + newtodo = TodoRelatedCreateForm() + completed_todo = TodoCompletedForm() + map_coordinates = str(get_map('event',object_id)).encode() + 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)) + +def adoptevent(request,object_id): + 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)) + +def closetodo(request,todo_id,event_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) + +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) + + +def addtodo(request): + newtodo = TodoCreateForm() + return render_to_response('agenda/add_todo.html', {'f': newtodo },context_instance=RequestContext(request)) + +def addeventtogroup(request,event_id): + event = get_object_or_404(Event, pk=event_id) + addtogroup = GroupAddEventForm() + return render_to_response('agenda/add_event_to_group.html', {'f': addtogroup, 'event': event },context_instance=RequestContext(request)) + + +def addeventtogroupsave(request,event_id): + f = RedesForm(request.POST) + try: + f.save() + except: + pass + return HttpResponseRedirect('/agenda/'+event_id) + #return render_to_response('agenda/one_event.html', {'f': f, 'event': event},context_instance=RequestContext(request)) + +def addtodotoevent(request,event_id): + event = get_object_or_404(Event, pk=event_id) + newtodo = TodoRelatedCreateForm() + return render_to_response('agenda/add_todo_to_event.html', {'f': newtodo, 'event': event },context_instance=RequestContext(request)) + +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 render_to_response('agenda/one_event.html', {'f': f, 'event': event},context_instance=RequestContext(request)) + +def savegrouptodo(request,object_id): + group = get_object_or_404(Group, pk=object_id) + f = TodoForm(request.POST) + f.save() + return HttpResponseRedirect('/group/'+object_id) + +def location(request, object_id): + """ + This view helps you to get information about one of the places of the center + The information can be technical, about the programme, and about everything you + 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)) + else: + return render_to_response('agenda/location_events.html', {'location': location }) + +def attendance(request, object_id): + if request.user.is_authenticated(): + + event = get_object_or_404(Event, pk=object_id) + person = request.user.id() + attendance = request.POST['attendance'] + try: + unapersona = Attendance.objects.get(event=object_id,person=person) + unapersona.attendance = request.POST['attendance'] + attendance.save() + return render_to_response('agenda/one_event.html', {'event': event },context_instance=RequestContext(request)) + + except Attendance.DoesNotExist: + attendance = Attendance(event=event,person=person,attendance=1) + attendance.save() + + return render_to_response('agenda/wanna_join.html', {'event': event },context_instance=RequestContext(request)) + else: + return HttpResponseRedirect('django.contrib.auth.views.login') + + # Always return an HttpResponseRedirect after successfully dealing + # with POST data. This prevents data from being posted twice if a + # user hits the Back button. + +def confirmation_pending(request): + object_id=request.user.id + 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') + pending = user.attendance.filter(attendance='NULL') + rejected = user.attendance.filter(attendance='0') + return render_to_response('agenda/user_events.html', {'user': user, 'attendance': attendance, 'confirmed': confirmed, 'pending': pending, 'rejected': rejected},context_instance=RequestContext(request)) + + else: + return HttpResponseRedirect('django.contrib.auth.views.login') + +def attend(request,object_id): + event = Event.calendar.get(pk=object_id) + return render_to_response('agenda/one_event.html', {'event': event},context_instance=RequestContext(request)) + + +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/agenda/views.pyc b/agenda/views.pyc Binary files differnew file mode 100644 index 0000000..c8be176 --- /dev/null +++ b/agenda/views.pyc diff --git a/cal/__init__.py b/cal/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/cal/__init__.py diff --git a/cal/__init__.pyc b/cal/__init__.pyc Binary files differnew file mode 100644 index 0000000..ab340e4 --- /dev/null +++ b/cal/__init__.pyc diff --git a/cal/controller.py b/cal/controller.py new file mode 100644 index 0000000..2faab28 --- /dev/null +++ b/cal/controller.py @@ -0,0 +1,166 @@ +import datetime, calendar + +import models +import eventCalBase + +# +# TODO - should have used id to identify event, not rowid +# + +class CalendarController(object): + """Controller object for calendar""" + def __init__(self, owner, day=1): + """owner - owner of this calendar, day - day to shown""" + calendar.setfirstweekday(calendar.SUNDAY) + self.owner = owner + self.day = day + self.curr = None + self.db_cal = None + self.db_events = None + + ## database related operation (i.e. operation will sync with DB + def load(self, year, month): + """load calendar with data from database""" + temp = models.EventCalendar.objects.filter(owner=self.owner, + year=year, month=month) + if temp: # either 1 record or no record , check models.py + self.db_cal = temp[0] + self.db_events = models.Event.objects.filter(cal=self.db_cal, + when__year=year, when__month=month) + + self.curr = eventCalBase.monthCalendar(self.db_cal.id, + self.owner, year, month) + for db_e in self.db_events: + e = eventCalBase.event(db_e.id, db_e.name, db_e.when, + db_e.desc) + self.curr.addEvent(e, db_e.when.day) + else: + self.curr = eventCalBase.monthCalendar(None, self.owner, + year, month) + + def save(self): + """save current calendar to database""" + # there are no edit screen so far. Hence nothing to save. + # i.e. not tested. + + # insert or update EventCalendar + db_c = models.EventCalendar(owner=self.curr.owner, + year=self.curr.year, month=self.curr.month) + db_c.id = sself.curr.id + db_c.save() + + # insert or update Events + for d in self.curr.events: + for e in self.curr[d]: + db_e = models.Event(cal=db_c, name=e.name, desc=e.desc, + when=e.start) + db_e.id = e.id + db_e.save() + + def addEvent(self, day, name, when, desc): + """Add event to the calendar. For now change is sync to db at once.""" + if not self.db_cal: + # we are adding event to a month where no event exist, hence + # finally we need a EventCalendar record for the month in database + self.db_cal = models.EventCalendar(owner=self.curr.owner, + year=self.curr.year, month=self.curr.month) + self.db_cal.save() + db_e = models.Event(name=name, when=when, desc=desc, cal=self.db_cal) + db_e.save() + + # should have check the return above + e = eventCalBase.event(db_e.id, db_e.name, db_e.when, db_e.desc) + self.curr.addEvent(e, db_e.when.day) + + def delEvent(self, day, rowid): + """delete an event from calendar by it's order in the GUI""" + index = rowid - 1 + try: + e = self.curr.events[day][index] + db_e = models.Event.objects.get(id=e.id) + if db_e: + db_e.delete() + self.curr.events[day].remove(e) + else: + raise ValueError, 'event (id = %d) does not exist in database' + except KeyError: + raise KeyError, 'invalid rowid %d' % rowid + + def updEvent(self, day, rowid, name, when, desc): + """update an event from calendar""" + index = rowid - 1 + try: + e = self.curr.events[day][index] + db_e = models.Event.objects.get(id=e.id) + if db_e: + vlist = zip(('name', 'when', 'desc'), (name, when, desc)) + for key, value in vlist: + for o in (db_e, e): + setattr(o, key, value) + db_e.save() + except KeyError: + raise KeyError, 'invalid rowid %d' % rowid + + ## functions used by template + def next(self): + """return a tuple that contains next year and month""" + y = self.curr.year + m = self.curr.month + if m == 12: + m = 1 + y += 1 + else: + m += 1 + return (y,m) + + def prev(self): + """return a tuple that contains previous year and month""" + y = self.curr.year + m = self.curr.month + if m == 1: + m = 12 + y -= 1 + else: + m -= 1 + return (y,m) + + def getWeekHeader(self): + """return a list of week header""" + return calendar.weekheader(2).split() + + def getMonthHeader(self): + """return a tuple that contains abbv. month name and 4 digit year""" + return self.curr.getDate(1).strftime("%b"), self.curr.year + + def getMonthCalendar(self): + """return a matrix similar to calendar.monthCalendar(). Except + the element is replaced by (day, event exist)""" + res = [] + for dayline in calendar.monthcalendar(self.curr.year, self.curr.month): + res_line = [] + for day in dayline: + data = False + if day in self.curr.events: + data = True + res_line.append((day, data)) + res.append(res_line) + return res + + def getDailyEvents(self): + """return list of events for the day""" + return self.curr.getDailyEvents(self.day) + + def hasDailyEvents(self): + """return list of events for the day""" + return len(self.curr.getDailyEvents(self.day)) > 0 + + def getDayName(self): + result = 'th' + if self.day % 10 == 1 and self.day != 11: + result = 'st' + elif self.day % 10 == 2 and self.day != 12: + result = 'nd' + elif self.day % 10 == 3 and self.day != 13: + result = 'rd' + return result + diff --git a/cal/eventCalBase.py b/cal/eventCalBase.py new file mode 100644 index 0000000..8ee60ec --- /dev/null +++ b/cal/eventCalBase.py @@ -0,0 +1,150 @@ +#!/usr/bin/env python + +import calendar, datetime +import copy + +# +# This modules handles calendar events +# + +class monthCalendar(object): + """Month Calendar""" + def __init__(self, id, owner, year, month): + if self.checkYMD(year, month, 1): + self.id = id + self.owner = owner + self.year = year + self.month = month + self.calendar = calendar.monthcalendar(year, month) + self.events = {} + else: + raise ValueError, ('year (%s) or month (%s) out of range' % ( + year, month)) + + def getDate(self, day): + return datetime.date(self.year, self.month, day) + + def checkYMD(self, year, month, day): + """check range of year, month and day. Raise ValueError on error. + Return True otherwise""" + datetime.date(year, month, day) + return True + + def getDailyEvents(self, day=datetime.datetime.now().day): + """Return all events for 'day', default as today""" + result = [] + if day in self.events: + result = self.events[day] + return result + + def getEvents(self, day=datetime.datetime.now().day, + time=datetime.time()): + """Return a list of event in specific day and time, [] if no event + matches""" + dayEvents = self.getDailyEvents(day) + dayEventsDatetime = map(lambda x: x.start, dayEvents) + + result = [] + index = 0 + target = datetime.datetime.combine(self.getDate(day), time) + for c in xrange(dayEventsDatetime.count(target)): + index = dayEventsDatetime[index:].index(target) + result.append(dayEvents[index]) + return result + + def addEvent(self, event, day=datetime.datetime.now().day): + """add event to day. 'event' is expected to support interface + of event()""" + nevent = copy.deepcopy(event) + if self.checkYMD(1, 1, day): + if day in self.events: + self.events[day].append(nevent) + else: + self.events[day] = [nevent] + + # adjust date of nevent + date = self.getDate(day) + self.events[day][-1].setStart( + datetime.datetime.combine(date, nevent.getStart().time())) + # finally, sort events for 'day' + self.events[day].sort() + + def delEvent(self, day, time): + """Delete event(s). Return a list of event(s) deleted""" + result = self.getEvents(day, time) + for e in result: + self.events[day].remove(e) + if not self.events[day]: + del self.events[day] + return result + + +class event(object): + """A Event object that is time aware. Time resolution of event is + up to second.""" + def __init__(self, id, name, start=datetime.datetime.now(), desc=''): + """defailt date is now()""" + if self.checkDate(start): + self.id = id + self.name = name + self.desc = desc + self.start = self.adjustDatetime(start) + else: + raise ValueError, '%s. Expected datetime object' % start + + def __str__(self): + return '<Event (%s) starts at %s>' % (self.name, self.start) + + def __repr__(self): + return "event('%s', %s, '%s')" % (self.name, self.start, self.desc) + + def __eq__(self, other): + # Note: self.desc is not compared + result = False + try: + result = self.id == other.id + except: + pass + return result + + def __lt__(self, other): + return self.start < other.start + + def __gt__(self, other): + return not (self < other or self == other) + def __ge__(self, other): + return not (self < other) or self == other + def __le__(self, other): + return not self > other + def __ne__(self, other): + return not self == other + + def adjustDatetime(selfi, datetime): + """adjust datetime to second level (ignore microsecond)""" + return datetime.replace(microsecond=0) + + def checkDate(self, data): + """check True if data supports datetime.datetime interface, False + otherwise""" + try: + for attr in ['year', 'month', 'day', 'hour', 'minute', 'second']: + getattr(data, attr) + except AttributeError: + return False + return True + + datetime.date(year, month, day) + return True + + def getStart(self): + return self.start + def setStart(self, datetime): + """change start datetime of event""" + self.start = datetime + + def passDue(self, datetime): + """return True if date + time > self.date + self.time, False oterwise""" + # time can be datetime or date or time + return self < event(0, '', datetime) + + diff --git a/cal/eventCalBase.pyc b/cal/eventCalBase.pyc Binary files differnew file mode 100644 index 0000000..fb0dfc1 --- /dev/null +++ b/cal/eventCalBase.pyc diff --git a/cal/models.py b/cal/models.py new file mode 100644 index 0000000..ae46f3f --- /dev/null +++ b/cal/models.py @@ -0,0 +1,34 @@ +from django.db import models +from django.contrib.auth.models import User,Group +from infopoint.agenda import * +from infopoint.agenda.models import * + +import eventCalBase + +class EventCalendar(models.Model): + class Admin: + pass + + owner = models.ForeignKey(User) + year = models.IntegerField() + month = models.IntegerField() + + class Meta: + unique_together = (('owner', 'year', 'month'),) + + def __str__(self): + return 'of %s for %02d/%04d' % ( + self.owner, self.month, self.year) + + +class Event(models.Model): + class Admin: + pass + + title = models.ForeignKey(Event) + cal = models.ForeignKey(EventCalendar) + + def __str__(self): + return '%s @ %s' % (self.title, self.when) + + diff --git a/cal/models.pyc b/cal/models.pyc Binary files differnew file mode 100644 index 0000000..532dc60 --- /dev/null +++ b/cal/models.pyc diff --git a/cal/test/testEventCalBase.py b/cal/test/testEventCalBase.py new file mode 100755 index 0000000..299f895 --- /dev/null +++ b/cal/test/testEventCalBase.py @@ -0,0 +1,158 @@ +#!/usr/bin/env python + +# path manuiplation to include the directory above +import sys +sys.path.append('..') + +import unittest +import operator +import datetime + +import eventCalBase + +class testMonthCalendar(unittest.TestCase): + def setUp(self): + self.emsg = 'Expect %s, got %s' + self.now = datetime.datetime.now() + self.cal = eventCalBase.monthCalendar(1, 'someone', self.now.year, + self.now.month) + + def testGetDate(self): + """Test getDate()""" + day = 9 + expect = datetime.date(self.now.year, self.now.month, day) + got = self.cal.getDate(day) + self.failUnlessEqual(expect, got, self.emsg % (expect, got)) + + def testAddEvent(self): + """Test addEvent()""" + fixdate = datetime.datetime(2007,6,20,12,30,0) + event = eventCalBase.event(1, 'test', fixdate) + self.cal.addEvent(event, fixdate.day) + + expectdate = self.cal.getDate(fixdate.day) + event.setStart(datetime.datetime.combine(expectdate, fixdate.time())) + expect = [event] + got = self.cal.getDailyEvents(fixdate.day) + self.failUnlessEqual(expect, got, self.emsg % (expect, got)) + + def testGetEvents_multipleEvents(self): + """Test getEvents()""" + now = datetime.datetime.now() + event = eventCalBase.event(1, 'test', now) + for c in xrange(3): + self.cal.addEvent(event, now.day) + + expect = self.cal.events[now.day] + got = self.cal.getEvents(now.day, now.time().replace(microsecond=0)) + self.failUnlessEqual(expect, got, self.emsg % (expect, got)) + + def testDelEvent(self): + """Test delEvent()""" + daylist = [1,2,20] + timelist = [datetime.time(12,30,0), + datetime.time(13, 0,0), + datetime.time(14,45,0),] + # add event + id = 1 + for d in daylist: + for t in timelist: + date = datetime.date(self.now.year, self.now.month, d) + dt = datetime.datetime.combine(date, t) + event = eventCalBase.event(id, 'test', dt) + self.cal.addEvent(event, d) + id += 1 + # get event (before delete) + before = [] + for d in daylist: + before.append(self.cal.getDailyEvents(d)) + # del event and compare output + for d, b in zip(daylist, before): + b.pop(1) + self.cal.delEvent(d, timelist[1]) + expect = b + got = self.cal.getDailyEvents(d) + self.failUnlessEqual(expect, got, self.emsg % (expect, got)) + + +class testEvent(unittest.TestCase): + def setUp(self): + self.eDatetime = datetime.datetime.now() + self.e = eventCalBase.event(1, 'event', self.eDatetime, 'some event') + + def testEqual(self): + """Test ==operator""" + _other = eventCalBase.event(1, 'event', self.eDatetime,) + self.failUnlessEqual(self.e, _other, + 'a1 == a2 failed. a1=%s, a2=%s' % (self.e, _other)) + + def testLessThan(self): + """Test <operator""" + _dt = self.eDatetime + datetime.timedelta(1) + _other = eventCalBase.event(2, 'event', _dt) + self.failUnless(operator.lt(self.e, _other), + 'a1 < a2 failed. a1=%s, a2=%s' % (self.e, _other)) + self.failIf(operator.lt(_other, _other), + 'a1 < a2 failed. a1=%s, a2=%s' % (_other, _other)) + + def testLessThanEqual(self): + """Test <=operator""" + _dt = self.eDatetime + datetime.timedelta(1) + _other = eventCalBase.event(2, 'event', _dt) + self.failUnless(operator.le(self.e, _other), + 'a1 <= a2 failed. a1=%s, a2=%s' % (self.e, _other)) + self.failUnless(operator.le(_other, _other), + 'a1 <= a2 failed. a1=%s, a2=%s' % (_other, _other)) + + def testGreaterThan(self): + """Test >operator""" + _dt = self.eDatetime - datetime.timedelta(1) + _other = eventCalBase.event(2, 'event', _dt) + self.failUnless(operator.gt(self.e, _other), + 'a1 > a2 failed. a1=%s, a2=%s' % (self.e, _other)) + self.failIf(operator.gt(_other, _other), + 'a1 > a2 failed. a1=%s, a2=%s' % (_other, _other)) + + def testGreaterThanEqual(self): + """Test >=operator""" + _dt = self.eDatetime - datetime.timedelta(1) + _other = eventCalBase.event(2, 'event', _dt) + self.failUnless(operator.ge(self.e, _other), + 'a1 => a2 failed. a1=%s, a2=%s' % (self.e, _other)) + self.failUnless(operator.ge(_other, _other), + 'a1 => a2 failed. a1=%s, a2=%s' % (_other, _other)) + + def testNotEqual(self): + """Test !=operator""" + _dt = self.eDatetime - datetime.timedelta(1) + _other = eventCalBase.event(2, 'event', _dt) + self.failUnless(operator.ne(self.e, _other), + 'a1 != a2 failed. a1=%s, a2=%s' % (self.e, _other)) + self.failIf(operator.ne(_other, _other), + 'a1 != a2 failed. a1=%s, a2=%s' % (_other, _other)) + + def testPassDue(self): + """Test passDue()""" + _future = self.eDatetime + datetime.timedelta(1) + _past = self.eDatetime - datetime.timedelta(1) + self.failUnless(self.e.passDue(_future), + 'Expect passDue(%s) of %s to be True' % (_future, self.e)) + self.failIf(self.e.passDue(_past), + 'Expect passDue(%s) of %s to be False' % (_past, self.e)) + self.failIf(self.e.passDue(self.eDatetime), + 'Expect passDue(%s) of %s to be False' % ( + self.eDatetime, self.e)) + + def testStart(self): + """test setStart()""" + emsg = 'Expect %s, got %s' + f = datetime.datetime + expect = f.combine(datetime.date(2007,5,26), f.now().time()) + self.e.setStart(expect) + self.failUnlessEqual(expect, self.e.start, + emsg % (expect, self.e.start)) + +if __name__ == '__main__': + unittest.main() + + diff --git a/cal/urls.py b/cal/urls.py new file mode 100644 index 0000000..4151e98 --- /dev/null +++ b/cal/urls.py @@ -0,0 +1,14 @@ +from django.conf.urls.defaults import * + +from infopoint.cal.controller import CalendarController +from infopoint.cal.models import Event + +## calendar view +urlpatterns = patterns('infopoint.cal.views', + (r'^view/.*$', 'view'), + (r'^upd/.*$', 'updEvent'), + (r'^add/.*$', 'addEvent'), + (r'^del/.*$', 'delEvent'), + (r'^.*$', 'view'), +) + diff --git a/cal/views.py b/cal/views.py new file mode 100644 index 0000000..f2b7056 --- /dev/null +++ b/cal/views.py @@ -0,0 +1,139 @@ +import datetime, calendar +import copy + +from django.template.loader import get_template +from django.template import Context +from infopoint.agenda.models import Event +from django.http import HttpResponse, HttpResponseRedirect + +from controller import CalendarController + + +def view(request): + """Calendar view""" + user = request.user + date = datetime.datetime.now() + default = dict(month=date.month, year=date.year, day=1, rowid=1, + title="", description="", start_date="") + url = request.path + + p = getParams(request, default) + year, month, day = p['year'], p['month'], p['day'] + + # create calendar obj + cal = CalendarController(user, day) + cal.load(year, month) + + # template + t = get_template('cal/calendar.html') + c = Context(dict(username=user, cal=cal, url=url)) + html = t.render(c) + + return HttpResponse(html) + + +def addEvent(request): + """add event to calendar""" + user = request.user + default = dict(month=1, year=1, day=1, rowid=1, title="", desc="", when="") + p = getParams(request, default) + year, month, day = p['year'], p['month'], p['day'] + + # create calendar obj + cal = CalendarController(user, day) + cal.load(year, month) + + # parpare data for adding Event + whenDate = datetime.date(year, month, day) + whenTime = datetime.time(*map(int, p['when'].strip().split(':'))) + when = datetime.datetime.combine(whenDate, whenTime) + + # adding Event + cal.addEvent(day, p['title'], when, p['Event.description']) + + # show view with new result + return redirect2view(request.path, year, month, day) + + +def delEvent(request): + """delete event from calendar""" + user = request.user + default = dict(month=1, year=1, day=1, rowid=1, title="", desc="", when="") + p = getParams(request, default) + year, month, day = p['year'], p['month'], p['day'] + + # create calendar obj + cal = CalendarController(user, day) + cal.load(year, month) + + # delete Event + cal.delEvent(day, p['rowid']) + + # show view with new result + return redirect2view(request.path, year, month, day) + + +def updEvent(request): + """update selected event to calendar""" + user = request.user + default = dict(month=1, year=1, day=1, rowid=1, title="", description="", when="") + p = getParams(request, default) + year, month, day = p['year'], p['month'], p['day'] + + # create calendar obj + cal = CalendarController(user, day) + cal.load(year, month) + + # parpare data for adding Event + whenDate = datetime.date(year, month, day) + whenTime = datetime.time(*map(int, p['when'].strip().split(':'))) + when = datetime.datetime.combine(whenDate, whenTime) + + # update Event + cal.updEvent(day, p['rowid'], p['title'], when, p['desc']) + + # show view with new result + return redirect2view(request.path, year, month, day) + + +## helper function +def getParams(request, default): + """get parameter (case insensitive for key) (support both get and post) + param is updated as side effect (for now)""" + paramKeys = ['year', 'month', 'day', 'rowid', 'title', 'desc', 'when'] + paramFunc = [int, int, int, int, str, str, str ] + paramDef = dict(zip(paramKeys, paramFunc)) + + inputDict = getattr(request, request.method, {}) + result = copy.deepcopy(default) + for k in inputDict: + kl = k.lower() + if kl in default and kl in paramDef: + try: + result[kl] = paramDef[kl](getattr(request, request.method)[k]) + except KeyError: + pass + return result + + +def upOneLevelURL(url): + """eg1: upOneLevelURL('http://aaa/bbb/ccc') == 'http://aaa/bbb/' + eg2: upOneLevelURL('http://aaa/bbb/ccc/') == 'http://aaa/bbb/' + eg3: upOneLevelURL('http://aaa/bbb/ccc/?xyz') == 'http://aaa/bbb/' + eg4: upOneLevelURL('http://aaa/bbb/ccc?xyz') == 'http://aaa/bbb/' + """ + sep = '/' + result = url.split('?')[0] + if result[-1] == sep: + result = result[:-1].rsplit(sep, 1)[0] + else: + result = result.rsplit(sep, 1)[0] + return result + sep + + +def redirect2view(url, year, month, day): + url = upOneLevelURL(url) + qstr = '?year=%d&month=%d&day=%d' % (year, month, day) + url += qstr + return HttpResponseRedirect(url) + 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/__init__.pyc b/flatpages/__init__.pyc Binary files differnew file mode 100644 index 0000000..914c165 --- /dev/null +++ b/flatpages/__init__.pyc 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/models.pyc b/flatpages/models.pyc Binary files differnew file mode 100644 index 0000000..9022ffd --- /dev/null +++ b/flatpages/models.pyc 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/locale/ca/LC_MESSAGES/django.mo b/locale/ca/LC_MESSAGES/django.mo Binary files differnew file mode 100644 index 0000000..38a0365 --- /dev/null +++ b/locale/ca/LC_MESSAGES/django.mo diff --git a/locale/ca/LC_MESSAGES/django.po b/locale/ca/LC_MESSAGES/django.po new file mode 100755 index 0000000..4a0ab30 --- /dev/null +++ b/locale/ca/LC_MESSAGES/django.po @@ -0,0 +1,280 @@ +# English translation of Django Infopoint. +# Copyright (C) 2008 THE Django Infopoint'S COPYRIGHT HOLDER +# This file is distributed under the same license as the Django Infopoint package. +# root <(null)>, 2008. +# , fuzzy +# +# +msgid "" +msgstr "" +"Project-Id-Version: Django Infopoint 0.2\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2008-08-25 00:58+0200\n" +"PO-Revision-Date: 2008-08-31 22:42+0200\n" +"Last-Translator: root <(null)>\n" +"Language-Team: English <en@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit" + +#: templates/base.html:17 templates/admin/base.html:25 +#: templates/agenda/base.html:17 templates/blog/base.html:17 +#: templates/comments/base.html:17 templates/flatpages/base.html:24 +#: templates/polls/base.html:17 templates/sites/base.html:17 +msgid "Welcome," +msgstr "Benvingut," + +#: templates/base.html:17 templates/admin/base.html:25 +#: templates/admin_doc/bookmarklets.html:3 templates/agenda/base.html:17 +#: templates/blog/base.html:17 templates/comments/base.html:17 +#: templates/flatpages/base.html:24 templates/polls/base.html:17 +#: templates/sites/base.html:17 +msgid "Documentation" +msgstr "Documentació" + +#: templates/base.html:17 templates/admin/base.html:25 +#: templates/agenda/base.html:17 templates/blog/base.html:17 +#: templates/comments/base.html:17 templates/flatpages/base.html:24 +#: templates/polls/base.html:17 templates/sites/base.html:17 +msgid "Change password" +msgstr "Cambiar el password" + +#: templates/base.html:17 templates/admin/base.html:25 +#: templates/agenda/base.html:17 templates/blog/base.html:17 +#: templates/comments/base.html:17 templates/flatpages/base.html:24 +#: templates/polls/base.html:17 templates/sites/base.html:17 +msgid "Log out" +msgstr "Surt" + +#: templates/admin/base.html:30 templates/admin_doc/bookmarklets.html:3 +#: templates/flatpages/base.html:29 +msgid "Home" +msgstr "Inici" + +#: templates/admin/index.html:18 +#, python-format +msgid "Models available in the %(name)s application." +msgstr "·Models disponibles a l'aplicacio %(name)s·" + +#: templates/admin/index.html:19 +#, python-format +msgid "%(name)s" +msgstr "%(name)s" + +#: templates/admin/index.html:29 +msgid "Add" +msgstr "Afegir" + +#: templates/admin/index.html:35 templates/agenda/location_events.html:22 +msgid "Change" +msgstr "Cambia" + +#: templates/admin/index.html:45 +msgid "You don't have permission to edit anything." +msgstr "No tens permis per editar" + +#: templates/admin/index.html:84 templates/polls/poll_detail.html:35 +#: templates/polls/results.html:42 +msgid "Recent Actions" +msgstr "Accions recents" + +#: templates/admin/index.html:85 +msgid "My Actions" +msgstr "Las mevas accions" + +#: templates/admin/index.html:89 +msgid "None available" +msgstr "Ninguna disponible" + +#: templates/admin_doc/bookmarklets.html:3 +msgid "Bookmarklets" +msgstr "" + +#: templates/admin_doc/bookmarklets.html:4 +msgid "Documentation bookmarklets" +msgstr "Documentaci sobre bookmarklets" + +#: templates/admin_doc/bookmarklets.html:8 +msgid "" +"\n" +"<p class=\"help\">To install bookmarklets, drag the link to your bookmarks\n" +"toolbar, or right-click the link and add it to your bookmarks. Now you can\n" +"select the bookmarklet from any page in the site. Note that some of these\n" +"bookmarklets require you to be viewing the site from a computer designated\n" +"as \"internal\" (talk to your system administrator if you aren't sure if\n" +"your computer is \"internal\").</p>\n" +msgstr "" + +#: templates/admin_doc/bookmarklets.html:18 +msgid "Documentation for this page" +msgstr "Documentacio per aquesta pagina" + +#: templates/admin_doc/bookmarklets.html:19 +msgid "" +"Jumps you from any page to the documentation for the view that generates " +"that page." +msgstr "ves a la pagina de la documentacio per la vista que ha generat la pagina" + +#: templates/admin_doc/bookmarklets.html:21 +msgid "Show object ID" +msgstr "Mostrar la ID de l'objecte" + +#: templates/admin_doc/bookmarklets.html:22 +msgid "" +"Shows the content-type and unique ID for pages that represent a single " +"object." +msgstr "Mostra els tipus de continguts i les ID uniques per les pagines que representen un unic objecte" + +#: templates/admin_doc/bookmarklets.html:24 +msgid "Edit this object (current window)" +msgstr "Edita l'objecte (finestra actual)" + +#: templates/admin_doc/bookmarklets.html:25 +msgid "Jumps to the admin page for pages that represent a single object." +msgstr "Ves a la pagina d'administracio si aquesta representa un objecte." + +#: templates/admin_doc/bookmarklets.html:27 +msgid "Edit this object (new window)" +msgstr "Edita l'ojecte (nova finestra)" + +#: templates/admin_doc/bookmarklets.html:28 +msgid "As above, but opens the admin page in a new window." +msgstr "Com abans, pero obrint la pagina d'administracio en una nova finestra." + +#: templates/agenda/add_todo.html:3 templates/agenda/add_todo.html.py:4 +#: templates/agenda/success.html:4 templates/agenda/success.html.py:5 +msgid "Add ToDo" +msgstr "Afegir feina." + +#: templates/agenda/add_todo.html:5 templates/agenda/success.html:6 +msgid "Add another task to the pool" +msgstr "" + +#: templates/agenda/confirm.html:28 templates/agenda/one_event.html:33 +msgid "Person" +msgstr "Persona" + +#: templates/agenda/confirm.html:41 templates/sites/site_list.html:19 +msgid "I am attending" +msgstr "Vaig." + +#: templates/agenda/confirm.html:42 +msgid "I am not attending" +msgstr "No hi vaig." + +#: templates/agenda/confirm.html:43 +msgid "I dont know" +msgstr "No ho se." + +#: templates/agenda/event_list.html:14 templates/comments/posted.html:15 +msgid "Interested" +msgstr "Interesat." + +#: templates/agenda/event_list.html:15 +#: templates/agenda/location_events.html:32 templates/agenda/one_group.html:46 +#: templates/comments/posted.html:16 templates/sites/site_list.html:17 +#: templates/sites/site_list.html.py:35 +msgid "Comments" +msgstr "Comentaris." + +#: templates/agenda/event_list.html:18 templates/comments/posted.html:19 +#: templates/sites/site_list.html:20 +msgid "Modify" +msgstr "Modificar" + +#: templates/agenda/location_events.html:23 +msgid "Starts" +msgstr "Comencar" + +#: templates/agenda/location_events.html:24 +msgid "Ends" +msgstr "Fi" + +#: templates/agenda/location_events.html:25 +msgid "Groups" +msgstr "Grups" + +#: templates/agenda/one_event.html:26 +msgid "Description" +msgstr "Descripcio" + +#: templates/agenda/one_event.html:31 +msgid "Attending" +msgstr "Anant" + +#: templates/agenda/one_group.html:12 +msgid "Events" +msgstr "Actes" + +#: templates/agenda/one_group.html:21 +msgid "Leave comment" +msgstr " comantar" + +#: templates/agenda/one_group.html:31 templates/agenda/one_group.html.py:35 +msgid "To do" +msgstr "" + +#: templates/agenda/one_group.html:33 +msgid "New ToDo for this group" +msgstr "" + +#: templates/comments/form.html:6 +msgid "Ratings" +msgstr "" + +#: templates/comments/form.html:6 templates/comments/form.html.py:17 +msgid "Required" +msgstr "" + +#: templates/comments/form.html:6 templates/comments/form.html.py:17 +msgid "Optional" +msgstr "" + +#: templates/comments/form.html:17 +msgid "Post a photo" +msgstr "" + +#: templates/comments/form.html:22 +msgid "Headline:" +msgstr "" + +#: templates/comments/form.html:25 +msgid "Comment:" +msgstr "" + +#: templates/comments/form.html:34 +msgid "Preview comment" +msgstr "" + +#: templates/registration/login.html:19 +msgid "Username:" +msgstr "" + +#: templates/registration/login.html:22 +msgid "Password:" +msgstr "" + +#: templates/registration/login.html:27 +msgid "Log in" +msgstr "" + +#: templates/sites/site_list.html:4 +msgid "Infopoint website" +msgstr "" + +#: templates/sites/site_list.html:11 +msgid "Event" +msgstr "" + +#: templates/sites/site_list.html:16 +msgid "Asistencia confirmada" +msgstr "" + +#: templates/sites/site_list.html:18 +msgid "Location" +msgstr "" + +#: templates/sites/site_list.html:25 +msgid "Article" +msgstr "Article" + diff --git a/locale/en_US/LC_MESSAGES/django.mo b/locale/en_US/LC_MESSAGES/django.mo Binary files differnew file mode 100644 index 0000000..118c9f6 --- /dev/null +++ b/locale/en_US/LC_MESSAGES/django.mo diff --git a/locale/en_US/LC_MESSAGES/django.po b/locale/en_US/LC_MESSAGES/django.po new file mode 100644 index 0000000..b81037a --- /dev/null +++ b/locale/en_US/LC_MESSAGES/django.po @@ -0,0 +1,213 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2008-08-22 19:16+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: templates/admin/base.html:25 templates/agenda/base.html:17 +#: templates/blog/base.html:17 templates/comments/base.html:17 +#: templates/flatpages/base.html:24 templates/polls/base.html:17 +#: templates/sites/base.html:17 +msgid "Welcome," +msgstr "" + +#: templates/admin/base.html:25 templates/admin_doc/bookmarklets.html:3 +#: templates/agenda/base.html:17 templates/blog/base.html:17 +#: templates/comments/base.html:17 templates/flatpages/base.html:24 +#: templates/polls/base.html:17 templates/sites/base.html:17 +msgid "Documentation" +msgstr "" + +#: templates/admin/base.html:25 templates/agenda/base.html:17 +#: templates/blog/base.html:17 templates/comments/base.html:17 +#: templates/flatpages/base.html:24 templates/polls/base.html:17 +#: templates/sites/base.html:17 +msgid "Change password" +msgstr "" + +#: templates/admin/base.html:25 templates/agenda/base.html:17 +#: templates/blog/base.html:17 templates/comments/base.html:17 +#: templates/comments/form.html:6 templates/flatpages/base.html:24 +#: templates/polls/base.html:17 templates/sites/base.html:17 +msgid "Log out" +msgstr "" + +#: templates/admin/base.html:30 templates/admin_doc/bookmarklets.html:3 +#: templates/flatpages/base.html:29 +msgid "Home" +msgstr "" + +#: templates/admin/index.html:18 +#, python-format +msgid "Models available in the %(name)s application." +msgstr "" + +#: templates/admin/index.html:19 +#, python-format +msgid "%(name)s" +msgstr "" + +#: templates/admin/index.html:29 +msgid "Add" +msgstr "" + +#: templates/admin/index.html:35 templates/agenda/location_events.html:21 +msgid "Change" +msgstr "" + +#: templates/admin/index.html:45 +msgid "You don't have permission to edit anything." +msgstr "" + +#: templates/admin/index.html:84 templates/polls/poll_detail.html:35 +#: templates/polls/results.html:42 +msgid "Recent Actions" +msgstr "" + +#: templates/admin/index.html:85 +msgid "My Actions" +msgstr "" + +#: templates/admin/index.html:89 +msgid "None available" +msgstr "" + +#: templates/admin_doc/bookmarklets.html:3 +msgid "Bookmarklets" +msgstr "" + +#: templates/admin_doc/bookmarklets.html:4 +msgid "Documentation bookmarklets" +msgstr "" + +#: templates/admin_doc/bookmarklets.html:8 +msgid "" +"\n" +"<p class=\"help\">To install bookmarklets, drag the link to your bookmarks\n" +"toolbar, or right-click the link and add it to your bookmarks. Now you can\n" +"select the bookmarklet from any page in the site. Note that some of these\n" +"bookmarklets require you to be viewing the site from a computer designated\n" +"as \"internal\" (talk to your system administrator if you aren't sure if\n" +"your computer is \"internal\").</p>\n" +msgstr "" + +#: templates/admin_doc/bookmarklets.html:18 +msgid "Documentation for this page" +msgstr "" + +#: templates/admin_doc/bookmarklets.html:19 +msgid "" +"Jumps you from any page to the documentation for the view that generates " +"that page." +msgstr "" + +#: templates/admin_doc/bookmarklets.html:21 +msgid "Show object ID" +msgstr "" + +#: templates/admin_doc/bookmarklets.html:22 +msgid "" +"Shows the content-type and unique ID for pages that represent a single " +"object." +msgstr "" + +#: templates/admin_doc/bookmarklets.html:24 +msgid "Edit this object (current window)" +msgstr "" + +#: templates/admin_doc/bookmarklets.html:25 +msgid "Jumps to the admin page for pages that represent a single object." +msgstr "" + +#: templates/admin_doc/bookmarklets.html:27 +msgid "Edit this object (new window)" +msgstr "" + +#: templates/admin_doc/bookmarklets.html:28 +msgid "As above, but opens the admin page in a new window." +msgstr "" + +#: templates/agenda/confirm.html:28 templates/agenda/one_event.html:31 +msgid "Person" +msgstr "" + +#: templates/agenda/confirm.html:41 +msgid "I am attending" +msgstr "" + +#: templates/agenda/confirm.html:42 +msgid "I am not attending" +msgstr "" + +#: templates/agenda/confirm.html:43 +msgid "I dont know" +msgstr "" + +#: templates/agenda/location_events.html:22 +msgid "Starts" +msgstr "" + +#: templates/agenda/location_events.html:23 +msgid "Ends" +msgstr "" + +#: templates/comments/form.html:6 templates/comments/form.html.py:8 +#: templates/registration/login.html:19 +msgid "Username:" +msgstr "" + +#: templates/comments/form.html:8 templates/registration/login.html:22 +msgid "Password:" +msgstr "" + +#: templates/comments/form.html:8 +msgid "Forgotten your password?" +msgstr "" + +#: templates/comments/form.html:12 +msgid "Ratings" +msgstr "" + +#: templates/comments/form.html:12 templates/comments/form.html.py:23 +msgid "Required" +msgstr "" + +#: templates/comments/form.html:12 templates/comments/form.html.py:23 +msgid "Optional" +msgstr "" + +#: templates/comments/form.html:23 +msgid "Post a photo" +msgstr "" + +#: templates/comments/form.html:28 +msgid "Headline:" +msgstr "" + +#: templates/comments/form.html:31 +msgid "Comment:" +msgstr "" + +#: templates/comments/form.html:40 +msgid "Preview comment" +msgstr "" + +#: templates/registration/login.html:27 +msgid "Log in" +msgstr "" + +#: templates/sites/site_list.html:4 +msgid "Infopoint website" +msgstr "" diff --git a/locale/es/LC_MESSAGES/django.mo b/locale/es/LC_MESSAGES/django.mo Binary files differnew file mode 100644 index 0000000..5014028 --- /dev/null +++ b/locale/es/LC_MESSAGES/django.mo diff --git a/locale/es/LC_MESSAGES/django.po b/locale/es/LC_MESSAGES/django.po new file mode 100644 index 0000000..74a9f15 --- /dev/null +++ b/locale/es/LC_MESSAGES/django.po @@ -0,0 +1,333 @@ +# translation of Infopoint. +# Copyright (C) 2008 THE Infopoint'S COPYRIGHT HOLDER +# This file is distributed under the same license as the Infopoint package. +# <>, 2008. +# , fuzzy +# +# +msgid "" +msgstr "" +"Project-Id-Version: Infopoint 0.1\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2008-08-25 09:26+0200\n" +"PO-Revision-Date: 2008-08-25 09:32+0200\n" +"Last-Translator: <acracia>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit" + +#: templates/base.html:17 templates/admin/base.html:25 +#: templates/agenda/base.html:17 templates/blog/base.html:17 +#: templates/comments/base.html:17 templates/flatpages/base.html:24 +#: templates/polls/base.html:17 templates/sites/base.html:17 +msgid "Welcome," +msgstr "Bienvenida," + +#: templates/base.html:17 templates/admin/base.html:25 +#: templates/admin_doc/bookmarklets.html:3 templates/agenda/base.html:17 +#: templates/blog/base.html:17 templates/comments/base.html:17 +#: templates/flatpages/base.html:24 templates/polls/base.html:17 +#: templates/sites/base.html:17 +msgid "Documentation" +msgstr "Documentación" + +#: templates/base.html:17 templates/admin/base.html:25 +#: templates/agenda/base.html:17 templates/blog/base.html:17 +#: templates/comments/base.html:17 templates/flatpages/base.html:24 +#: templates/polls/base.html:17 templates/sites/base.html:17 +msgid "Change password" +msgstr "Cambiar contraseña" + +#: templates/base.html:17 templates/admin/base.html:25 +#: templates/agenda/base.html:17 templates/blog/base.html:17 +#: templates/comments/base.html:17 templates/flatpages/base.html:24 +#: templates/polls/base.html:17 templates/sites/base.html:17 +msgid "Log out" +msgstr "Salir" + +#: templates/admin/base.html:30 templates/admin_doc/bookmarklets.html:3 +#: templates/flatpages/base.html:29 +msgid "Home" +msgstr "Inicio" + +#: templates/admin/index.html:18 +#, python-format +msgid "Models available in the %(name)s application." +msgstr "Modelos disponibles en la aplicación %(name)s" + +#: templates/admin/index.html:19 +#, python-format +msgid "%(name)s" +msgstr "" + +#: templates/admin/index.html:29 +msgid "Add" +msgstr "Añadir" + +#: templates/admin/index.html:35 templates/agenda/location_events.html:40 +msgid "Change" +msgstr "Cambiar" + +#: templates/admin/index.html:45 +msgid "You don't have permission to edit anything." +msgstr "No tienes permiso para editar" + +#: templates/admin/index.html:84 templates/polls/poll_detail.html:35 +#: templates/polls/results.html:42 +msgid "Recent Actions" +msgstr "Acciones recientes" + +#: templates/admin/index.html:85 +msgid "My Actions" +msgstr "Mis Acciones" + +#: templates/admin/index.html:89 +msgid "None available" +msgstr "Ninguna disponible" + +#: templates/admin_doc/bookmarklets.html:3 +msgid "Bookmarklets" +msgstr "" + +#: templates/admin_doc/bookmarklets.html:4 +msgid "Documentation bookmarklets" +msgstr "" + +#: templates/admin_doc/bookmarklets.html:8 +msgid "" +"\n" +"<p class=\"help\">To install bookmarklets, drag the link to your bookmarks\n" +"toolbar, or right-click the link and add it to your bookmarks. Now you can\n" +"select the bookmarklet from any page in the site. Note that some of these\n" +"bookmarklets require you to be viewing the site from a computer designated\n" +"as \"internal\" (talk to your system administrator if you aren't sure if\n" +"your computer is \"internal\").</p>\n" +msgstr "" + +#: templates/admin_doc/bookmarklets.html:18 +msgid "Documentation for this page" +msgstr "Documentación para esta página" + +#: templates/admin_doc/bookmarklets.html:19 +msgid "" +"Jumps you from any page to the documentation for the view that generates " +"that page." +msgstr "" +"Te lleva desde cualquier página a la documentación de la vista que la genera" + +#: templates/admin_doc/bookmarklets.html:21 +msgid "Show object ID" +msgstr "Muestra ID del objeto" + +#: templates/admin_doc/bookmarklets.html:22 +msgid "" +"Shows the content-type and unique ID for pages that represent a single " +"object." +msgstr "" +"Muestra el contenido y las ID únicas de las páginas que representan un único " +"objeto" + +#: templates/admin_doc/bookmarklets.html:24 +msgid "Edit this object (current window)" +msgstr "Edita este objeto (ventana actual)" + +#: templates/admin_doc/bookmarklets.html:25 +msgid "Jumps to the admin page for pages that represent a single object." +msgstr "" +"Salta a la página de admin para las páginas que representan un objeto único" + +#: templates/admin_doc/bookmarklets.html:27 +msgid "Edit this object (new window)" +msgstr "Edita este objeto (nueva ventana)" + +#: templates/admin_doc/bookmarklets.html:28 +msgid "As above, but opens the admin page in a new window." +msgstr "Como el anterior, pero abre la página de admin en una nueva ventana." + +#: templates/agenda/add_todo.html:3 templates/agenda/add_todo.html.py:4 +#: templates/agenda/success.html:4 templates/agenda/success.html.py:5 +msgid "Add ToDo" +msgstr "Añade tarea" + +#: templates/agenda/add_todo.html:5 templates/agenda/success.html:6 +msgid "Add another task to the pool" +msgstr "Añade otra tarea a la lista" + +#: templates/agenda/confirm.html:28 templates/agenda/one_event.html:33 +msgid "Person" +msgstr "Persona" + +#: templates/agenda/confirm.html:41 templates/sites/site_list.html:19 +msgid "I am attending" +msgstr "Yo voy" + +#: templates/agenda/confirm.html:42 +msgid "I am not attending" +msgstr "Yo no voy" + +#: templates/agenda/confirm.html:43 +msgid "I dont know" +msgstr "No sé" + +#: templates/agenda/event_list.html:13 templates/comments/posted.html:15 +msgid "Interested" +msgstr "Interesados" + +#: templates/agenda/event_list.html:14 +#: templates/agenda/location_events.html:13 templates/agenda/one_event.html:53 +#: templates/agenda/one_group.html:21 templates/comments/posted.html:16 +#: templates/sites/site_list.html:17 templates/sites/site_list.html.py:35 +msgid "Comments" +msgstr "Comentarios" + +#: templates/agenda/event_list.html:17 templates/comments/posted.html:19 +#: templates/sites/site_list.html:20 +msgid "Modify" +msgstr "Modificar" + +#: templates/agenda/location_events.html:18 templates/agenda/one_event.html:58 +#: templates/comments/preview.html:15 +msgid "Posted by" +msgstr "Publicado por" + +#: templates/agenda/location_events.html:32 templates/agenda/one_event.html:26 +msgid "Description" +msgstr "Descripción" + +#: templates/agenda/location_events.html:36 +msgid "Events for this location" +msgstr "Eventos para este lugar" + +#: templates/agenda/location_events.html:41 templates/agenda/one_event.html:13 +msgid "Starts" +msgstr "Comienza" + +#: templates/agenda/location_events.html:42 templates/agenda/one_event.html:14 +msgid "Ends" +msgstr "Termina" + +#: templates/agenda/location_events.html:43 templates/agenda/one_event.html:44 +msgid "Groups" +msgstr "Grupos" + +#: templates/agenda/location_events.html:48 +msgid "Leave a comment on this location" +msgstr "Comenta sobre este lugar" + +#: templates/agenda/one_event.html:12 templates/sites/site_list.html:18 +msgid "Location" +msgstr "Lugar" + +#: templates/agenda/one_event.html:31 +#, fuzzy +msgid "Attending" +msgstr "Yo voy" + +#: templates/agenda/one_event.html:46 +msgid "Added" +msgstr "Añadido" + +#: templates/agenda/one_event.html:58 +msgid "on" +msgstr "en" + +#: templates/agenda/one_event.html:63 templates/agenda/one_group.html:23 +msgid "Leave comment" +msgstr "Deja un comentario" + +#: templates/agenda/one_group.html:12 +#, fuzzy +msgid "Events" +msgstr "Evento" + +#: templates/agenda/one_group.html:33 templates/agenda/one_group.html.py:37 +msgid "To do" +msgstr "Tarea" + +#: templates/agenda/one_group.html:35 +msgid "New ToDo for this group" +msgstr "Nueva Tarea para este grupo" + +#: templates/agenda/one_group.html:47 +msgid "Comments for this group" +msgstr "Añadir comentario a este grupo" + +#: templates/comments/form.html:6 +msgid "Ratings" +msgstr "Ratings" + +#: templates/comments/form.html:6 templates/comments/form.html.py:17 +msgid "Required" +msgstr "Requerido" + +#: templates/comments/form.html:6 templates/comments/form.html.py:17 +msgid "Optional" +msgstr "Opcional" + +#: templates/comments/form.html:17 +msgid "Post a photo" +msgstr "Publica una foto" + +#: templates/comments/form.html:22 +msgid "Headline:" +msgstr "Titular:" + +#: templates/comments/form.html:25 +msgid "Comment:" +msgstr "Comentario:" + +#: templates/comments/form.html:36 +msgid "Preview comment" +msgstr "Previsualizar comentario" + +#: templates/comments/preview.html:6 +msgid "Preview your comment" +msgstr "Previsualiza tu comentario" + +#: templates/comments/preview.html:10 +msgid "Please correct the following errors." +msgstr "Por favor, corrige los siguientes errores" + +#: templates/comments/preview.html:41 +msgid "Headline" +msgstr "Titulo" + +#: templates/comments/preview.html:47 +#, fuzzy +msgid "Comment" +msgstr "Comentarios" + +#: templates/registration/login.html:19 +msgid "Username:" +msgstr "Nombre de usuario:" + +#: templates/registration/login.html:22 +msgid "Password:" +msgstr "Contraseña:" + +#: templates/registration/login.html:27 +msgid "Log in" +msgstr "Entrar" + +#: templates/sites/site_list.html:4 +msgid "Infopoint website" +msgstr "" + +#: templates/sites/site_list.html:11 +msgid "Event" +msgstr "Evento" + +#: templates/sites/site_list.html:16 +msgid "Asistencia confirmada" +msgstr "Asistencia·confirmada" + +#: templates/sites/site_list.html:25 +msgid "Article" +msgstr "ArtÃculo" + +#~ msgid "Forgotten your password?" +#~ msgstr "¿Has olvidado tu contraseña?" + +#~ msgid "On" +#~ msgstr "En" diff --git a/locale/it/LC_MESSAGES/django.po b/locale/it/LC_MESSAGES/django.po new file mode 100644 index 0000000..ee894f1 --- /dev/null +++ b/locale/it/LC_MESSAGES/django.po @@ -0,0 +1,323 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2008-08-31 18:07+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: templates/base.html:17 templates/admin/base.html:25 +#: templates/agenda/base.html:17 templates/blog/base.html:17 +#: templates/flatpages/base.html:24 templates/polls/base.html:17 +#: templates/sites/base.html:17 +msgid "Welcome," +msgstr "" + +#: templates/base.html:17 templates/admin/base.html:25 +#: templates/admin_doc/bookmarklets.html:3 templates/agenda/base.html:17 +#: templates/blog/base.html:17 templates/flatpages/base.html:24 +#: templates/polls/base.html:17 templates/sites/base.html:17 +msgid "Documentation" +msgstr "" + +#: templates/base.html:17 templates/admin/base.html:25 +#: templates/agenda/base.html:17 templates/blog/base.html:17 +#: templates/flatpages/base.html:24 templates/polls/base.html:17 +#: templates/sites/base.html:17 +msgid "Change password" +msgstr "" + +#: templates/base.html:17 templates/admin/base.html:25 +#: templates/agenda/base.html:17 templates/blog/base.html:17 +#: templates/flatpages/base.html:24 templates/polls/base.html:17 +#: templates/sites/base.html:17 +msgid "Log out" +msgstr "" + +#: templates/admin/base.html:30 templates/admin_doc/bookmarklets.html:3 +#: templates/flatpages/base.html:29 +msgid "Home" +msgstr "" + +#: templates/admin/index.html:18 +#, python-format +msgid "Models available in the %(name)s application." +msgstr "" + +#: templates/admin/index.html:19 +#, python-format +msgid "%(name)s" +msgstr "" + +#: templates/admin/index.html:29 +msgid "Add" +msgstr "" + +#: templates/admin/index.html:35 templates/agenda/location_events.html:43 +msgid "Change" +msgstr "" + +#: templates/admin/index.html:45 +msgid "You don't have permission to edit anything." +msgstr "" + +#: templates/admin/index.html:84 templates/polls/poll_detail.html:35 +#: templates/polls/results.html:42 +msgid "Recent Actions" +msgstr "" + +#: templates/admin/index.html:85 +msgid "My Actions" +msgstr "" + +#: templates/admin/index.html:89 +msgid "None available" +msgstr "" + +#: templates/admin_doc/bookmarklets.html:3 +msgid "Bookmarklets" +msgstr "" + +#: templates/admin_doc/bookmarklets.html:4 +msgid "Documentation bookmarklets" +msgstr "" + +#: templates/admin_doc/bookmarklets.html:8 +msgid "" +"\n" +"<p class=\"help\">To install bookmarklets, drag the link to your bookmarks\n" +"toolbar, or right-click the link and add it to your bookmarks. Now you can\n" +"select the bookmarklet from any page in the site. Note that some of these\n" +"bookmarklets require you to be viewing the site from a computer designated\n" +"as \"internal\" (talk to your system administrator if you aren't sure if\n" +"your computer is \"internal\").</p>\n" +msgstr "" + +#: templates/admin_doc/bookmarklets.html:18 +msgid "Documentation for this page" +msgstr "" + +#: templates/admin_doc/bookmarklets.html:19 +msgid "" +"Jumps you from any page to the documentation for the view that generates " +"that page." +msgstr "" + +#: templates/admin_doc/bookmarklets.html:21 +msgid "Show object ID" +msgstr "" + +#: templates/admin_doc/bookmarklets.html:22 +msgid "" +"Shows the content-type and unique ID for pages that represent a single " +"object." +msgstr "" + +#: templates/admin_doc/bookmarklets.html:24 +msgid "Edit this object (current window)" +msgstr "" + +#: templates/admin_doc/bookmarklets.html:25 +msgid "Jumps to the admin page for pages that represent a single object." +msgstr "" + +#: templates/admin_doc/bookmarklets.html:27 +msgid "Edit this object (new window)" +msgstr "" + +#: templates/admin_doc/bookmarklets.html:28 +msgid "As above, but opens the admin page in a new window." +msgstr "" + +#: templates/agenda/add_todo.html:3 templates/agenda/add_todo.html.py:4 +#: templates/agenda/success.html:4 templates/agenda/success.html.py:5 +msgid "Add ToDo" +msgstr "" + +#: templates/agenda/add_todo.html:5 templates/agenda/success.html:6 +msgid "Add another task to the pool" +msgstr "" + +#: templates/agenda/base.html:28 templates/sites/base.html:28 +msgid "Links" +msgstr "" + +#: templates/agenda/billboard.html:75 templates/agenda/location_events.html:42 +msgid "When" +msgstr "" + +#: templates/agenda/billboard.html:78 templates/agenda/location_events.html:35 +#: templates/agenda/one_event.html:26 +msgid "Description" +msgstr "" + +#: templates/agenda/confirm.html:28 templates/agenda/one_event.html:33 +msgid "Person" +msgstr "" + +#: templates/agenda/confirm.html:41 templates/sites/site_list.html:19 +msgid "I am attending" +msgstr "" + +#: templates/agenda/confirm.html:42 +msgid "I am not attending" +msgstr "" + +#: templates/agenda/confirm.html:43 +msgid "I dont know" +msgstr "" + +#: templates/agenda/event_list.html:13 +msgid "Interested" +msgstr "" + +#: templates/agenda/event_list.html:14 templates/agenda/one_event.html:79 +#: templates/agenda/one_group.html:20 templates/sites/site_list.html:17 +#: templates/sites/site_list.html.py:35 +msgid "Comments" +msgstr "" + +#: templates/agenda/event_list.html:17 templates/sites/site_list.html:20 +msgid "Modify" +msgstr "" + +#: templates/agenda/location_events.html:13 +msgid "Comments about this location" +msgstr "" + +#: templates/agenda/location_events.html:18 +#: templates/agenda/one_comment.html:18 templates/agenda/one_event.html:82 +msgid "Posted by" +msgstr "" + +#: templates/agenda/location_events.html:19 +#: templates/agenda/one_comment.html:21 +msgid "Delete" +msgstr "" + +#: templates/agenda/location_events.html:38 +msgid "Events for this location" +msgstr "" + +#: templates/agenda/location_events.html:45 templates/agenda/one_event.html:61 +msgid "Groups" +msgstr "" + +#: templates/agenda/location_events.html:51 +msgid "Leave a comment on this location" +msgstr "" + +#: templates/agenda/one_comment.html:16 +msgid "Is coment public?" +msgstr "" + +#: templates/agenda/one_comment.html:18 templates/agenda/one_event.html:82 +msgid "on" +msgstr "" + +#: templates/agenda/one_comment.html:20 +msgid "Flag" +msgstr "" + +#: templates/agenda/one_comment.html:27 +msgid "Posted on" +msgstr "" + +#: templates/agenda/one_comment.html:35 templates/agenda/one_comment.html:39 +#: templates/agenda/one_group.html:31 +msgid "To do" +msgstr "" + +#: templates/agenda/one_comment.html:37 templates/agenda/one_group.html:33 +msgid "New ToDo" +msgstr "" + +#: templates/agenda/one_event.html:12 templates/sites/site_list.html:18 +msgid "Location" +msgstr "" + +#: templates/agenda/one_event.html:13 +msgid "Starts" +msgstr "" + +#: templates/agenda/one_event.html:14 +msgid "Ends" +msgstr "" + +#: templates/agenda/one_event.html:17 +msgid "New Event" +msgstr "" + +#: templates/agenda/one_event.html:18 +msgid "See location" +msgstr "" + +#: templates/agenda/one_event.html:19 +msgid "Edit" +msgstr "" + +#: templates/agenda/one_event.html:31 +msgid "Attending" +msgstr "" + +#: templates/agenda/one_event.html:49 templates/agenda/one_group.html:21 +msgid "Leave comment" +msgstr "" + +#: templates/agenda/one_event.html:70 +msgid "Todo" +msgstr "" + +#: templates/agenda/one_event.html:83 +msgid "delete" +msgstr "" + +#: templates/agenda/one_group.html:12 +msgid "Events" +msgstr "" + +#: templates/agenda/one_group.html:35 +msgid "Todo List" +msgstr "" + +#: templates/agenda/one_group.html:45 +msgid "Comments for this group" +msgstr "" + +#: templates/registration/login.html:19 +msgid "Username:" +msgstr "" + +#: templates/registration/login.html:22 +msgid "Password:" +msgstr "" + +#: templates/registration/login.html:27 +msgid "Log in" +msgstr "" + +#: templates/sites/site_list.html:4 +msgid "Infopoint website" +msgstr "" + +#: templates/sites/site_list.html:11 +msgid "Event" +msgstr "" + +#: templates/sites/site_list.html:16 +msgid "Asistencia confirmada" +msgstr "" + +#: templates/sites/site_list.html:25 +msgid "Article" +msgstr "" diff --git a/locale/nl/LC_MESSAGES/django.mo b/locale/nl/LC_MESSAGES/django.mo Binary files differnew file mode 100644 index 0000000..1396950 --- /dev/null +++ b/locale/nl/LC_MESSAGES/django.mo diff --git a/locale/nl/LC_MESSAGES/django.po b/locale/nl/LC_MESSAGES/django.po new file mode 100644 index 0000000..10465c0 --- /dev/null +++ b/locale/nl/LC_MESSAGES/django.po @@ -0,0 +1,278 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2008-08-25 00:59+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: templates/base.html:17 templates/admin/base.html:25 +#: templates/agenda/base.html:17 templates/blog/base.html:17 +#: templates/comments/base.html:17 templates/flatpages/base.html:24 +#: templates/polls/base.html:17 templates/sites/base.html:17 +msgid "Welcome," +msgstr "" + +#: templates/base.html:17 templates/admin/base.html:25 +#: templates/admin_doc/bookmarklets.html:3 templates/agenda/base.html:17 +#: templates/blog/base.html:17 templates/comments/base.html:17 +#: templates/flatpages/base.html:24 templates/polls/base.html:17 +#: templates/sites/base.html:17 +msgid "Documentation" +msgstr "" + +#: templates/base.html:17 templates/admin/base.html:25 +#: templates/agenda/base.html:17 templates/blog/base.html:17 +#: templates/comments/base.html:17 templates/flatpages/base.html:24 +#: templates/polls/base.html:17 templates/sites/base.html:17 +msgid "Change password" +msgstr "" + +#: templates/base.html:17 templates/admin/base.html:25 +#: templates/agenda/base.html:17 templates/blog/base.html:17 +#: templates/comments/base.html:17 templates/flatpages/base.html:24 +#: templates/polls/base.html:17 templates/sites/base.html:17 +msgid "Log out" +msgstr "" + +#: templates/admin/base.html:30 templates/admin_doc/bookmarklets.html:3 +#: templates/flatpages/base.html:29 +msgid "Home" +msgstr "" + +#: templates/admin/index.html:18 +#, python-format +msgid "Models available in the %(name)s application." +msgstr "" + +#: templates/admin/index.html:19 +#, python-format +msgid "%(name)s" +msgstr "" + +#: templates/admin/index.html:29 +msgid "Add" +msgstr "" + +#: templates/admin/index.html:35 templates/agenda/location_events.html:22 +msgid "Change" +msgstr "" + +#: templates/admin/index.html:45 +msgid "You don't have permission to edit anything." +msgstr "" + +#: templates/admin/index.html:84 templates/polls/poll_detail.html:35 +#: templates/polls/results.html:42 +msgid "Recent Actions" +msgstr "" + +#: templates/admin/index.html:85 +msgid "My Actions" +msgstr "" + +#: templates/admin/index.html:89 +msgid "None available" +msgstr "" + +#: templates/admin_doc/bookmarklets.html:3 +msgid "Bookmarklets" +msgstr "" + +#: templates/admin_doc/bookmarklets.html:4 +msgid "Documentation bookmarklets" +msgstr "" + +#: templates/admin_doc/bookmarklets.html:8 +msgid "" +"\n" +"<p class=\"help\">To install bookmarklets, drag the link to your bookmarks\n" +"toolbar, or right-click the link and add it to your bookmarks. Now you can\n" +"select the bookmarklet from any page in the site. Note that some of these\n" +"bookmarklets require you to be viewing the site from a computer designated\n" +"as \"internal\" (talk to your system administrator if you aren't sure if\n" +"your computer is \"internal\").</p>\n" +msgstr "" + +#: templates/admin_doc/bookmarklets.html:18 +msgid "Documentation for this page" +msgstr "" + +#: templates/admin_doc/bookmarklets.html:19 +msgid "" +"Jumps you from any page to the documentation for the view that generates " +"that page." +msgstr "" + +#: templates/admin_doc/bookmarklets.html:21 +msgid "Show object ID" +msgstr "" + +#: templates/admin_doc/bookmarklets.html:22 +msgid "" +"Shows the content-type and unique ID for pages that represent a single " +"object." +msgstr "" + +#: templates/admin_doc/bookmarklets.html:24 +msgid "Edit this object (current window)" +msgstr "" + +#: templates/admin_doc/bookmarklets.html:25 +msgid "Jumps to the admin page for pages that represent a single object." +msgstr "" + +#: templates/admin_doc/bookmarklets.html:27 +msgid "Edit this object (new window)" +msgstr "" + +#: templates/admin_doc/bookmarklets.html:28 +msgid "As above, but opens the admin page in a new window." +msgstr "" + +#: templates/agenda/add_todo.html:3 templates/agenda/add_todo.html.py:4 +#: templates/agenda/success.html:4 templates/agenda/success.html.py:5 +msgid "Add ToDo" +msgstr "" + +#: templates/agenda/add_todo.html:5 templates/agenda/success.html:6 +msgid "Add another task to the pool" +msgstr "" + +#: templates/agenda/confirm.html:28 templates/agenda/one_event.html:33 +msgid "Person" +msgstr "" + +#: templates/agenda/confirm.html:41 templates/sites/site_list.html:19 +msgid "I am attending" +msgstr "" + +#: templates/agenda/confirm.html:42 +msgid "I am not attending" +msgstr "" + +#: templates/agenda/confirm.html:43 +msgid "I dont know" +msgstr "" + +#: templates/agenda/event_list.html:14 templates/comments/posted.html:15 +msgid "Interested" +msgstr "" + +#: templates/agenda/event_list.html:15 +#: templates/agenda/location_events.html:32 templates/agenda/one_group.html:46 +#: templates/comments/posted.html:16 templates/sites/site_list.html:17 +#: templates/sites/site_list.html.py:35 +msgid "Comments" +msgstr "" + +#: templates/agenda/event_list.html:18 templates/comments/posted.html:19 +#: templates/sites/site_list.html:20 +msgid "Modify" +msgstr "" + +#: templates/agenda/location_events.html:23 +msgid "Starts" +msgstr "" + +#: templates/agenda/location_events.html:24 +msgid "Ends" +msgstr "" + +#: templates/agenda/location_events.html:25 +msgid "Groups" +msgstr "" + +#: templates/agenda/one_event.html:26 +msgid "Description" +msgstr "" + +#: templates/agenda/one_event.html:31 +msgid "Attending" +msgstr "" + +#: templates/agenda/one_group.html:12 +msgid "Events" +msgstr "" + +#: templates/agenda/one_group.html:21 +msgid "Leave comment" +msgstr "" + +#: templates/agenda/one_group.html:31 templates/agenda/one_group.html.py:35 +msgid "To do" +msgstr "" + +#: templates/agenda/one_group.html:33 +msgid "New ToDo for this group" +msgstr "" + +#: templates/comments/form.html:6 +msgid "Ratings" +msgstr "" + +#: templates/comments/form.html:6 templates/comments/form.html.py:17 +msgid "Required" +msgstr "" + +#: templates/comments/form.html:6 templates/comments/form.html.py:17 +msgid "Optional" +msgstr "" + +#: templates/comments/form.html:17 +msgid "Post a photo" +msgstr "" + +#: templates/comments/form.html:22 +msgid "Headline:" +msgstr "" + +#: templates/comments/form.html:25 +msgid "Comment:" +msgstr "" + +#: templates/comments/form.html:34 +msgid "Preview comment" +msgstr "" + +#: templates/registration/login.html:19 +msgid "Username:" +msgstr "" + +#: templates/registration/login.html:22 +msgid "Password:" +msgstr "" + +#: templates/registration/login.html:27 +msgid "Log in" +msgstr "" + +#: templates/sites/site_list.html:4 +msgid "Infopoint website" +msgstr "" + +#: templates/sites/site_list.html:11 +msgid "Event" +msgstr "" + +#: templates/sites/site_list.html:16 +msgid "Asistencia confirmada" +msgstr "" + +#: templates/sites/site_list.html:18 +msgid "Location" +msgstr "" + +#: templates/sites/site_list.html:25 +msgid "Article" +msgstr "" diff --git a/manage.pyc b/manage.pyc Binary files differnew file mode 100755 index 0000000..4a93ebf --- /dev/null +++ b/manage.pyc diff --git a/modelviz.py b/modelviz.py new file mode 100644 index 0000000..4b86e1b --- /dev/null +++ b/modelviz.py @@ -0,0 +1,280 @@ +#!/usr/bin/env python +"""Django model to DOT (Graphviz) converter +by Antonio Cavedoni <antonio@cavedoni.org> + +Make sure your DJANGO_SETTINGS_MODULE is set to your project or +place this script in the same directory of the project and call +the script like this: + +$ python modelviz.py [-h] [-a] [-d] [-g] [-i <model_names>] <app_label> ... <app_label> > <filename>.dot +$ dot <filename>.dot -Tpng -o <filename>.png + +options: + -h, --help + show this help message and exit. + + -a, --all_applications + show models from all applications. + + -d, --disable_fields + don't show the class member fields. + + -g, --group_models + draw an enclosing box around models from the same app. + + -i, --include_models=User,Person,Car + only include selected models in graph. +""" +__version__ = "0.9" +__svnid__ = "$Id$" +__license__ = "Python" +__author__ = "Antonio Cavedoni <http://cavedoni.com/>" +__contributors__ = [ + "Stefano J. Attardi <http://attardi.org/>", + "limodou <http://www.donews.net/limodou/>", + "Carlo C8E Miron", + "Andre Campos <cahenan@gmail.com>", + "Justin Findlay <jfindlay@gmail.com>", + "Alexander Houben <alexander@houben.ch>", + "Bas van Oostveen <v.oostveen@gmail.com>", +] + +import getopt, sys + +from django.core.management import setup_environ + +try: + import settings +except ImportError: + pass +else: + setup_environ(settings) + +from django.template import Template, Context +from django.db import models +from django.db.models import get_models +from django.db.models.fields.related import \ + ForeignKey, OneToOneField, ManyToManyField + +try: + from django.db.models.fields.generic import GenericRelation +except ImportError: + from django.contrib.contenttypes.generic import GenericRelation + +head_template = """ +digraph name { + fontname = "Helvetica" + fontsize = 8 + + node [ + fontname = "Helvetica" + fontsize = 8 + shape = "plaintext" + ] + edge [ + fontname = "Helvetica" + fontsize = 8 + ] + +""" + +body_template = """ +{% if use_subgraph %} +subgraph {{ cluster_app_name }} { + label=< + <TABLE BORDER="0" CELLBORDER="0" CELLSPACING="0"> + <TR><TD COLSPAN="2" CELLPADDING="4" ALIGN="CENTER" + ><FONT FACE="Helvetica Bold" COLOR="Black" POINT-SIZE="12" + >{{ app_name }}</FONT></TD></TR> + </TABLE> + > + color=olivedrab4 + style="rounded" +{% endif %} + + {% for model in models %} + {{ model.app_name }}_{{ model.name }} [label=< + <TABLE BGCOLOR="palegoldenrod" BORDER="0" CELLBORDER="0" CELLSPACING="0"> + <TR><TD COLSPAN="2" CELLPADDING="4" ALIGN="CENTER" BGCOLOR="olivedrab4" + ><FONT FACE="Helvetica Bold" COLOR="white" + >{{ model.name }}</FONT></TD></TR> + + {% if not disable_fields %} + {% for field in model.fields %} + <TR><TD ALIGN="LEFT" BORDER="0" + ><FONT {% if field.blank %}COLOR="#7B7B7B" {% endif %}FACE="Helvetica Bold">{{ field.name }}</FONT + ></TD> + <TD ALIGN="LEFT" + ><FONT {% if field.blank %}COLOR="#7B7B7B" {% endif %}FACE="Helvetica Bold">{{ field.type }}</FONT + ></TD></TR> + {% endfor %} + {% endif %} + </TABLE> + >] + {% endfor %} + +{% if use_subgraph %} +} +{% endif %} +""" + +rel_template = """ + {% for model in models %} + {% for relation in model.relations %} + {% if relation.needs_node %} + {{ relation.target }} [label=< + <TABLE BGCOLOR="palegoldenrod" BORDER="0" CELLBORDER="0" CELLSPACING="0"> + <TR><TD COLSPAN="2" CELLPADDING="4" ALIGN="CENTER" BGCOLOR="olivedrab4" + ><FONT FACE="Helvetica Bold" COLOR="white" + >{{ relation.target }}</FONT></TD></TR> + </TABLE> + >] + {% endif %} + {{ model.app_name }}_{{ model.name }} -> {{ relation.target_app }}_{{ relation.target }} + [label="{{ relation.name }}"] {{ relation.arrows }}; + {% endfor %} + {% endfor %} +""" + +tail_template = """ +} +""" + +def generate_dot(app_labels, **kwargs): + disable_fields = kwargs.get('disable_fields', False) + include_models = kwargs.get('include_models', []) + all_applications = kwargs.get('all_applications', False) + use_subgraph = kwargs.get('group_models', False) + + dot = head_template + + apps = [] + if all_applications: + apps = models.get_apps() + + for app_label in app_labels: + app = models.get_app(app_label) + if not app in apps: + apps.append(app) + + graphs = [] + for app in apps: + graph = Context({ + 'name': '"%s"' % app.__name__, + 'app_name': "%s" % app.__name__.rsplit('.', 1)[0], + 'cluster_app_name': "cluster_%s" % app.__name__.replace(".", "_"), + 'disable_fields': disable_fields, + 'use_subgraph': use_subgraph, + 'models': [] + }) + + for appmodel in get_models(app): + model = { + 'app_name': app.__name__.replace(".", "_"), + 'name': appmodel.__name__, + 'fields': [], + 'relations': [] + } + + # consider given model name ? + def consider(model_name): + return not include_models or model_name in include_models + + if not consider(appmodel._meta.object_name): + continue + + # model attributes + def add_attributes(): + model['fields'].append({ + 'name': field.name, + 'type': type(field).__name__, + 'blank': field.blank + }) + + for field in appmodel._meta.fields: + add_attributes() + + if appmodel._meta.many_to_many: + for field in appmodel._meta.many_to_many: + add_attributes() + + # relations + def add_relation(extras=""): + _rel = { + 'target_app': field.rel.to.__module__.replace('.','_'), + 'target': field.rel.to.__name__, + 'type': type(field).__name__, + 'name': field.name, + 'arrows': extras, + 'needs_node': True + } + if _rel not in model['relations'] and consider(_rel['target']): + model['relations'].append(_rel) + + for field in appmodel._meta.fields: + if isinstance(field, ForeignKey): + add_relation() + elif isinstance(field, OneToOneField): + add_relation('[arrowhead=none arrowtail=none]') + + if appmodel._meta.many_to_many: + for field in appmodel._meta.many_to_many: + if isinstance(field, ManyToManyField): + add_relation('[arrowhead=normal arrowtail=normal]') + elif isinstance(field, GenericRelation): + add_relation(mark_safe('[style="dotted"] [arrowhead=normal arrowtail=normal]')) + graph['models'].append(model) + graphs.append(graph) + + nodes = [] + for graph in graphs: + nodes.extend([e['name'] for e in graph['models']]) + + for graph in graphs: + # don't draw duplication nodes because of relations + for model in graph['models']: + for relation in model['relations']: + if relation['target'] in nodes: + relation['needs_node'] = False + # render templates + t = Template(body_template) + dot += '\n' + t.render(graph) + + for graph in graphs: + t = Template(rel_template) + dot += '\n' + t.render(graph) + + dot += '\n' + tail_template + + return dot + +def main(): + try: + opts, args = getopt.getopt(sys.argv[1:], "hadgi:", + ["help", "all_applications", "disable_fields", "group_models", "include_models="]) + except getopt.GetoptError, error: + print __doc__ + sys.exit(error) + + kwargs = {} + for opt, arg in opts: + if opt in ("-h", "--help"): + print __doc__ + sys.exit() + if opt in ("-a", "--all_applications"): + kwargs['all_applications'] = True + if opt in ("-d", "--disable_fields"): + kwargs['disable_fields'] = True + if opt in ("-g", "--group_models"): + kwargs['group_models'] = True + if opt in ("-i", "--include_models"): + kwargs['include_models'] = arg.split(',') + + if not args and not kwargs.get('all_applications', False): + print __doc__ + sys.exit() + + print generate_dot(args, **kwargs) + +if __name__ == "__main__": + main() diff --git a/otrotest.dot b/otrotest.dot new file mode 100644 index 0000000..d860d76 --- /dev/null +++ b/otrotest.dot @@ -0,0 +1,644 @@ + +digraph name { + fontname = "Helvetica" + fontsize = 8 + + node [ + fontname = "Helvetica" + fontsize = 8 + shape = "plaintext" + ] + edge [ + fontname = "Helvetica" + fontsize = 8 + ] + + + + +subgraph cluster_django_contrib_auth_models { + label=< + <TABLE BORDER="0" CELLBORDER="0" CELLSPACING="0"> + <TR><TD COLSPAN="2" CELLPADDING="4" ALIGN="CENTER" + ><FONT FACE="Helvetica Bold" COLOR="Black" POINT-SIZE="12" + >django.contrib.auth</FONT></TD></TR> + </TABLE> + > + color=olivedrab4 + style="rounded" + + + + django_contrib_auth_models_Permission [label=< + <TABLE BGCOLOR="palegoldenrod" BORDER="0" CELLBORDER="0" CELLSPACING="0"> + <TR><TD COLSPAN="2" CELLPADDING="4" ALIGN="CENTER" BGCOLOR="olivedrab4" + ><FONT FACE="Helvetica Bold" COLOR="white" + >Permission</FONT></TD></TR> + + + </TABLE> + >] + + django_contrib_auth_models_Group [label=< + <TABLE BGCOLOR="palegoldenrod" BORDER="0" CELLBORDER="0" CELLSPACING="0"> + <TR><TD COLSPAN="2" CELLPADDING="4" ALIGN="CENTER" BGCOLOR="olivedrab4" + ><FONT FACE="Helvetica Bold" COLOR="white" + >Group</FONT></TD></TR> + + + </TABLE> + >] + + django_contrib_auth_models_User [label=< + <TABLE BGCOLOR="palegoldenrod" BORDER="0" CELLBORDER="0" CELLSPACING="0"> + <TR><TD COLSPAN="2" CELLPADDING="4" ALIGN="CENTER" BGCOLOR="olivedrab4" + ><FONT FACE="Helvetica Bold" COLOR="white" + >User</FONT></TD></TR> + + + </TABLE> + >] + + django_contrib_auth_models_Message [label=< + <TABLE BGCOLOR="palegoldenrod" BORDER="0" CELLBORDER="0" CELLSPACING="0"> + <TR><TD COLSPAN="2" CELLPADDING="4" ALIGN="CENTER" BGCOLOR="olivedrab4" + ><FONT FACE="Helvetica Bold" COLOR="white" + >Message</FONT></TD></TR> + + + </TABLE> + >] + + + +} + + + + +subgraph cluster_django_contrib_admin_models { + label=< + <TABLE BORDER="0" CELLBORDER="0" CELLSPACING="0"> + <TR><TD COLSPAN="2" CELLPADDING="4" ALIGN="CENTER" + ><FONT FACE="Helvetica Bold" COLOR="Black" POINT-SIZE="12" + >django.contrib.admin</FONT></TD></TR> + </TABLE> + > + color=olivedrab4 + style="rounded" + + + + django_contrib_admin_models_LogEntry [label=< + <TABLE BGCOLOR="palegoldenrod" BORDER="0" CELLBORDER="0" CELLSPACING="0"> + <TR><TD COLSPAN="2" CELLPADDING="4" ALIGN="CENTER" BGCOLOR="olivedrab4" + ><FONT FACE="Helvetica Bold" COLOR="white" + >LogEntry</FONT></TD></TR> + + + </TABLE> + >] + + + +} + + + + +subgraph cluster_django_contrib_contenttypes_models { + label=< + <TABLE BORDER="0" CELLBORDER="0" CELLSPACING="0"> + <TR><TD COLSPAN="2" CELLPADDING="4" ALIGN="CENTER" + ><FONT FACE="Helvetica Bold" COLOR="Black" POINT-SIZE="12" + >django.contrib.contenttypes</FONT></TD></TR> + </TABLE> + > + color=olivedrab4 + style="rounded" + + + + django_contrib_contenttypes_models_ContentType [label=< + <TABLE BGCOLOR="palegoldenrod" BORDER="0" CELLBORDER="0" CELLSPACING="0"> + <TR><TD COLSPAN="2" CELLPADDING="4" ALIGN="CENTER" BGCOLOR="olivedrab4" + ><FONT FACE="Helvetica Bold" COLOR="white" + >ContentType</FONT></TD></TR> + + + </TABLE> + >] + + + +} + + + + +subgraph cluster_django_contrib_formtools_models { + label=< + <TABLE BORDER="0" CELLBORDER="0" CELLSPACING="0"> + <TR><TD COLSPAN="2" CELLPADDING="4" ALIGN="CENTER" + ><FONT FACE="Helvetica Bold" COLOR="Black" POINT-SIZE="12" + >django.contrib.formtools</FONT></TD></TR> + </TABLE> + > + color=olivedrab4 + style="rounded" + + + + + +} + + + + +subgraph cluster_django_contrib_sessions_models { + label=< + <TABLE BORDER="0" CELLBORDER="0" CELLSPACING="0"> + <TR><TD COLSPAN="2" CELLPADDING="4" ALIGN="CENTER" + ><FONT FACE="Helvetica Bold" COLOR="Black" POINT-SIZE="12" + >django.contrib.sessions</FONT></TD></TR> + </TABLE> + > + color=olivedrab4 + style="rounded" + + + + django_contrib_sessions_models_Session [label=< + <TABLE BGCOLOR="palegoldenrod" BORDER="0" CELLBORDER="0" CELLSPACING="0"> + <TR><TD COLSPAN="2" CELLPADDING="4" ALIGN="CENTER" BGCOLOR="olivedrab4" + ><FONT FACE="Helvetica Bold" COLOR="white" + >Session</FONT></TD></TR> + + + </TABLE> + >] + + + +} + + + + +subgraph cluster_django_contrib_comments_models { + label=< + <TABLE BORDER="0" CELLBORDER="0" CELLSPACING="0"> + <TR><TD COLSPAN="2" CELLPADDING="4" ALIGN="CENTER" + ><FONT FACE="Helvetica Bold" COLOR="Black" POINT-SIZE="12" + >django.contrib.comments</FONT></TD></TR> + </TABLE> + > + color=olivedrab4 + style="rounded" + + + + django_contrib_comments_models_Comment [label=< + <TABLE BGCOLOR="palegoldenrod" BORDER="0" CELLBORDER="0" CELLSPACING="0"> + <TR><TD COLSPAN="2" CELLPADDING="4" ALIGN="CENTER" BGCOLOR="olivedrab4" + ><FONT FACE="Helvetica Bold" COLOR="white" + >Comment</FONT></TD></TR> + + + </TABLE> + >] + + django_contrib_comments_models_CommentFlag [label=< + <TABLE BGCOLOR="palegoldenrod" BORDER="0" CELLBORDER="0" CELLSPACING="0"> + <TR><TD COLSPAN="2" CELLPADDING="4" ALIGN="CENTER" BGCOLOR="olivedrab4" + ><FONT FACE="Helvetica Bold" COLOR="white" + >CommentFlag</FONT></TD></TR> + + + </TABLE> + >] + + + +} + + + + +subgraph cluster_django_contrib_sites_models { + label=< + <TABLE BORDER="0" CELLBORDER="0" CELLSPACING="0"> + <TR><TD COLSPAN="2" CELLPADDING="4" ALIGN="CENTER" + ><FONT FACE="Helvetica Bold" COLOR="Black" POINT-SIZE="12" + >django.contrib.sites</FONT></TD></TR> + </TABLE> + > + color=olivedrab4 + style="rounded" + + + + django_contrib_sites_models_Site [label=< + <TABLE BGCOLOR="palegoldenrod" BORDER="0" CELLBORDER="0" CELLSPACING="0"> + <TR><TD COLSPAN="2" CELLPADDING="4" ALIGN="CENTER" BGCOLOR="olivedrab4" + ><FONT FACE="Helvetica Bold" COLOR="white" + >Site</FONT></TD></TR> + + + </TABLE> + >] + + + +} + + + + +subgraph cluster_django_contrib_webdesign_models { + label=< + <TABLE BORDER="0" CELLBORDER="0" CELLSPACING="0"> + <TR><TD COLSPAN="2" CELLPADDING="4" ALIGN="CENTER" + ><FONT FACE="Helvetica Bold" COLOR="Black" POINT-SIZE="12" + >django.contrib.webdesign</FONT></TD></TR> + </TABLE> + > + color=olivedrab4 + style="rounded" + + + + + +} + + + + +subgraph cluster_infopoint_flatpages_models { + label=< + <TABLE BORDER="0" CELLBORDER="0" CELLSPACING="0"> + <TR><TD COLSPAN="2" CELLPADDING="4" ALIGN="CENTER" + ><FONT FACE="Helvetica Bold" COLOR="Black" POINT-SIZE="12" + >infopoint.flatpages</FONT></TD></TR> + </TABLE> + > + color=olivedrab4 + style="rounded" + + + + infopoint_flatpages_models_FlatPage [label=< + <TABLE BGCOLOR="palegoldenrod" BORDER="0" CELLBORDER="0" CELLSPACING="0"> + <TR><TD COLSPAN="2" CELLPADDING="4" ALIGN="CENTER" BGCOLOR="olivedrab4" + ><FONT FACE="Helvetica Bold" COLOR="white" + >FlatPage</FONT></TD></TR> + + + </TABLE> + >] + + + +} + + + + +subgraph cluster_infopoint_sites_models { + label=< + <TABLE BORDER="0" CELLBORDER="0" CELLSPACING="0"> + <TR><TD COLSPAN="2" CELLPADDING="4" ALIGN="CENTER" + ><FONT FACE="Helvetica Bold" COLOR="Black" POINT-SIZE="12" + >infopoint.sites</FONT></TD></TR> + </TABLE> + > + color=olivedrab4 + style="rounded" + + + + infopoint_sites_models_Site [label=< + <TABLE BGCOLOR="palegoldenrod" BORDER="0" CELLBORDER="0" CELLSPACING="0"> + <TR><TD COLSPAN="2" CELLPADDING="4" ALIGN="CENTER" BGCOLOR="olivedrab4" + ><FONT FACE="Helvetica Bold" COLOR="white" + >Site</FONT></TD></TR> + + + </TABLE> + >] + + + +} + + + + +subgraph cluster_infopoint_agenda_models { + label=< + <TABLE BORDER="0" CELLBORDER="0" CELLSPACING="0"> + <TR><TD COLSPAN="2" CELLPADDING="4" ALIGN="CENTER" + ><FONT FACE="Helvetica Bold" COLOR="Black" POINT-SIZE="12" + >infopoint.agenda</FONT></TD></TR> + </TABLE> + > + color=olivedrab4 + style="rounded" + + + + infopoint_agenda_models_Location [label=< + <TABLE BGCOLOR="palegoldenrod" BORDER="0" CELLBORDER="0" CELLSPACING="0"> + <TR><TD COLSPAN="2" CELLPADDING="4" ALIGN="CENTER" BGCOLOR="olivedrab4" + ><FONT FACE="Helvetica Bold" COLOR="white" + >Location</FONT></TD></TR> + + + </TABLE> + >] + + infopoint_agenda_models_Event [label=< + <TABLE BGCOLOR="palegoldenrod" BORDER="0" CELLBORDER="0" CELLSPACING="0"> + <TR><TD COLSPAN="2" CELLPADDING="4" ALIGN="CENTER" BGCOLOR="olivedrab4" + ><FONT FACE="Helvetica Bold" COLOR="white" + >Event</FONT></TD></TR> + + + </TABLE> + >] + + infopoint_agenda_models_Network [label=< + <TABLE BGCOLOR="palegoldenrod" BORDER="0" CELLBORDER="0" CELLSPACING="0"> + <TR><TD COLSPAN="2" CELLPADDING="4" ALIGN="CENTER" BGCOLOR="olivedrab4" + ><FONT FACE="Helvetica Bold" COLOR="white" + >Network</FONT></TD></TR> + + + </TABLE> + >] + + infopoint_agenda_models_Todo [label=< + <TABLE BGCOLOR="palegoldenrod" BORDER="0" CELLBORDER="0" CELLSPACING="0"> + <TR><TD COLSPAN="2" CELLPADDING="4" ALIGN="CENTER" BGCOLOR="olivedrab4" + ><FONT FACE="Helvetica Bold" COLOR="white" + >Todo</FONT></TD></TR> + + + </TABLE> + >] + + infopoint_agenda_models_EventTaskpool [label=< + <TABLE BGCOLOR="palegoldenrod" BORDER="0" CELLBORDER="0" CELLSPACING="0"> + <TR><TD COLSPAN="2" CELLPADDING="4" ALIGN="CENTER" BGCOLOR="olivedrab4" + ><FONT FACE="Helvetica Bold" COLOR="white" + >EventTaskpool</FONT></TD></TR> + + + </TABLE> + >] + + infopoint_agenda_models_GroupTaskpool [label=< + <TABLE BGCOLOR="palegoldenrod" BORDER="0" CELLBORDER="0" CELLSPACING="0"> + <TR><TD COLSPAN="2" CELLPADDING="4" ALIGN="CENTER" BGCOLOR="olivedrab4" + ><FONT FACE="Helvetica Bold" COLOR="white" + >GroupTaskpool</FONT></TD></TR> + + + </TABLE> + >] + + infopoint_agenda_models_Attendance [label=< + <TABLE BGCOLOR="palegoldenrod" BORDER="0" CELLBORDER="0" CELLSPACING="0"> + <TR><TD COLSPAN="2" CELLPADDING="4" ALIGN="CENTER" BGCOLOR="olivedrab4" + ><FONT FACE="Helvetica Bold" COLOR="white" + >Attendance</FONT></TD></TR> + + + </TABLE> + >] + + infopoint_agenda_models_Billboard [label=< + <TABLE BGCOLOR="palegoldenrod" BORDER="0" CELLBORDER="0" CELLSPACING="0"> + <TR><TD COLSPAN="2" CELLPADDING="4" ALIGN="CENTER" BGCOLOR="olivedrab4" + ><FONT FACE="Helvetica Bold" COLOR="white" + >Billboard</FONT></TD></TR> + + + </TABLE> + >] + + + +} + + + + + + + django_contrib_auth_models_Permission -> django_contrib_contenttypes_models_ContentType + [label="content_type"] ; + + + + + django_contrib_auth_models_Group -> django_contrib_auth_models_Permission + [label="permissions"] [arrowhead=normal arrowtail=normal]; + + + + + django_contrib_auth_models_User -> django_contrib_auth_models_Group + [label="groups"] [arrowhead=normal arrowtail=normal]; + + + django_contrib_auth_models_User -> django_contrib_auth_models_Permission + [label="user_permissions"] [arrowhead=normal arrowtail=normal]; + + + + + django_contrib_auth_models_Message -> django_contrib_auth_models_User + [label="user"] ; + + + + + + + + django_contrib_admin_models_LogEntry -> django_contrib_auth_models_User + [label="user"] ; + + + django_contrib_admin_models_LogEntry -> django_contrib_contenttypes_models_ContentType + [label="content_type"] ; + + + + + + + + + + + + + + + + + + + + + django_contrib_comments_models_Comment -> django_contrib_contenttypes_models_ContentType + [label="content_type"] ; + + + django_contrib_comments_models_Comment -> django_contrib_sites_models_Site + [label="site"] ; + + + django_contrib_comments_models_Comment -> django_contrib_auth_models_User + [label="user"] ; + + + + + django_contrib_comments_models_CommentFlag -> django_contrib_auth_models_User + [label="user"] ; + + + django_contrib_comments_models_CommentFlag -> django_contrib_comments_models_Comment + [label="comment"] ; + + + + + + + + + + + + + + + + infopoint_flatpages_models_FlatPage -> django_contrib_sites_models_Site + [label="sites"] [arrowhead=normal arrowtail=normal]; + + + + + + + + + + + + + infopoint_agenda_models_Location -> infopoint_agenda_models_Location + [label="is_in"] ; + + + + + infopoint_agenda_models_Event -> infopoint_agenda_models_Location + [label="location"] ; + + + infopoint_agenda_models_Event -> django_contrib_sites_models_Site + [label="site"] [arrowhead=normal arrowtail=normal]; + + + infopoint_agenda_models_Event -> django_contrib_auth_models_User + [label="pixie"] [arrowhead=normal arrowtail=normal]; + + + infopoint_agenda_models_Event -> django_contrib_auth_models_Group + [label="redes"] [arrowhead=normal arrowtail=normal]; + + + infopoint_agenda_models_Event -> django_contrib_auth_models_User + [label="atendees"] [arrowhead=normal arrowtail=normal]; + + + + + infopoint_agenda_models_Network -> infopoint_agenda_models_Event + [label="event"] ; + + + infopoint_agenda_models_Network -> django_contrib_auth_models_Group + [label="group"] ; + + + infopoint_agenda_models_Network -> django_contrib_auth_models_User + [label="creator"] ; + + + + + infopoint_agenda_models_Todo -> django_contrib_auth_models_User + [label="creator"] ; + + + infopoint_agenda_models_Todo -> django_contrib_auth_models_Group + [label="network"] [arrowhead=normal arrowtail=normal]; + + + infopoint_agenda_models_Todo -> infopoint_agenda_models_Event + [label="event"] [arrowhead=normal arrowtail=normal]; + + + + + infopoint_agenda_models_EventTaskpool -> infopoint_agenda_models_Event + [label="event"] ; + + + infopoint_agenda_models_EventTaskpool -> infopoint_agenda_models_Todo + [label="todo"] ; + + + + + infopoint_agenda_models_GroupTaskpool -> django_contrib_auth_models_Group + [label="network"] ; + + + infopoint_agenda_models_GroupTaskpool -> infopoint_agenda_models_Todo + [label="todo"] ; + + + + + infopoint_agenda_models_Attendance -> django_contrib_auth_models_User + [label="person"] ; + + + infopoint_agenda_models_Attendance -> infopoint_agenda_models_Event + [label="event"] ; + + + + + infopoint_agenda_models_Billboard -> django_contrib_auth_models_Group + [label="groups"] [arrowhead=normal arrowtail=normal]; + + + infopoint_agenda_models_Billboard -> infopoint_agenda_models_Location + [label="location"] [arrowhead=normal arrowtail=normal]; + + + + +} + diff --git a/polls/__init__.py b/polls/__init__.py new file mode 100755 index 0000000..e69de29 --- /dev/null +++ b/polls/__init__.py diff --git a/polls/__init__.pyc b/polls/__init__.pyc Binary files differnew file mode 100755 index 0000000..e0f874e --- /dev/null +++ b/polls/__init__.pyc diff --git a/polls/models.py b/polls/models.py new file mode 100755 index 0000000..f8a1b17 --- /dev/null +++ b/polls/models.py @@ -0,0 +1,35 @@ +from django.db import models + +# Create your models here. + +class Poll(models.Model): + def __unicode__(self): + return self.question + question = models.CharField(max_length=200) + pub_date = models.DateTimeField('date published') + +class Choice(models.Model): + def __unicode__(self): + return self.choice + poll = models.ForeignKey(Poll) + choice = models.CharField(max_length=200) + votes = models.IntegerField() + +from django.contrib import admin + +class ChoiceInline(admin.TabularInline): + model = Choice + extra = 3 + +class PollAdmin(admin.ModelAdmin): + list_display = ('question', 'pub_date') + list_filter = ['pub_date'] + search_fields = ['question'] + date_hierarchy = 'pub_date' + fieldsets = [ + (None, {'fields': ['question']}), + ('Date information', {'fields': ['pub_date'], 'classes': ['collapse']}), + ] + inlines = [ChoiceInline] + +admin.site.register(Poll, PollAdmin) diff --git a/polls/models.pyc b/polls/models.pyc Binary files differnew file mode 100755 index 0000000..cbfcab8 --- /dev/null +++ b/polls/models.pyc diff --git a/polls/urls.py b/polls/urls.py new file mode 100755 index 0000000..81c2bbd --- /dev/null +++ b/polls/urls.py @@ -0,0 +1,14 @@ +from django.conf.urls.defaults import * +from infopoint.polls.models import Poll + +info_dict = { + 'queryset': Poll.objects.all(), +} + +urlpatterns = patterns('', + (r'^$', 'django.views.generic.list_detail.object_list', info_dict), + url(r'^(?P<object_id>\d+)/results/$', 'django.views.generic.list_detail.object_detail', dict(info_dict, template_name='polls/results.html'), 'poll_results'), + (r'^(?P<object_id>\d+)/$', 'django.views.generic.list_detail.object_list', dict(info_dict, template_name='polls/poll_list.html'), 'poll_results'), + (r'^(?P<poll_id>\d+)/vote/$', 'infopoint.polls.views.vote'), +) + diff --git a/polls/urls.pyc b/polls/urls.pyc Binary files differnew file mode 100755 index 0000000..077983b --- /dev/null +++ b/polls/urls.pyc diff --git a/polls/views.py b/polls/views.py new file mode 100755 index 0000000..18bf3ee --- /dev/null +++ b/polls/views.py @@ -0,0 +1,38 @@ +# Create your views here. + +from django.shortcuts import render_to_response, get_object_or_404 +from django.core.urlresolvers import reverse +from infopoint.polls.models import Poll +from django.http import Http404, HttpResponseRedirect + +def index(request): + object_list = Poll.objects.all().order_by('-pub_date')[:5] + return render_to_response('polls/index.html', {'object_list': object_list}) + +def detail(request, poll_id): + p = get_object_or_404(Poll, pk=poll_id) + return render_to_response('polls/detail.html', {'poll': p}) + + +def vote(request, poll_id): + p = get_object_or_404(Poll, pk=poll_id) + try: + selected_choice = p.choice_set.get(pk=request.POST['choice']) + except (KeyError, Choice.DoesNotExist): + # Redisplay the poll voting form. + return render_to_response('polls/detail.html', { + 'poll': p, + 'error_message': "You didn't select a choice.", + }) + else: + selected_choice.votes += 1 + selected_choice.save() + # Always return an HttpResponseRedirect after successfully dealing + # with POST data. This prevents data from being posted twice if a + # user hits the Back button. + return HttpResponseRedirect(reverse('infopoint.polls.views.results', args=(p.id,))) + +def results(request, poll_id): + p = get_object_or_404(Poll, pk=poll_id) + return render_to_response('polls/results.html', {'poll': p}) + diff --git a/polls/views.pyc b/polls/views.pyc Binary files differnew file mode 100755 index 0000000..9a093eb --- /dev/null +++ b/polls/views.pyc diff --git a/settings.py b/settings.py new file mode 100644 index 0000000..9f5ebac --- /dev/null +++ b/settings.py @@ -0,0 +1,98 @@ +# Django settings for infopoint project. + +DEBUG = True +TEMPLATE_DEBUG = True + +ADMINS = ( + # ('Your Name', 'your_email@domain.com'), + ('acracia', 'acracia@riseup.net'), +) + +MANAGERS = ADMINS + +DATABASE_ENGINE = 'mysql' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. +DATABASE_NAME = 'infopoint' # Or path to database file if using sqlite3. +DATABASE_USER = 'infopoint' # Not used with sqlite3. +DATABASE_PASSWORD = 'cucina' # Not used with sqlite3. +DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3. +DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3. + +# Local time zone for this installation. Choices can be found here: +# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name +# although not all choices may be available on all operating systems. +# If running in a Windows environment this must be set to the same as your +# system time zone. +TIME_ZONE = 'Europe/Amsterdam' + +# Language code for this installation. All choices can be found here: +# http://www.i18nguy.com/unicode/language-identifiers.html +LANGUAGE_CODE = 'en-us' + +SITE_ID = 1 + +# If you set this to False, Django will make some optimizations so as not +# to load the internationalization machinery. +USE_I18N = True + +# Absolute path to the directory that holds media. +# Example: "/home/media/media.lawrence.com/" +MEDIA_ROOT = '/var/www/media/' + +# URL that handles the media served from MEDIA_ROOT. Make sure to use a +# trailing slash if there is a path component (optional in other cases). +# Examples: "http://media.lawrence.com", "http://example.com/media/" +MEDIA_URL = '/media/' + +# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a +# trailing slash. +# Examples: "http://foo.com/media/", "/media/". +ADMIN_MEDIA_PREFIX = 'http://razorgirl/media/' + +# Make this unique, and don't share it with anybody. +SECRET_KEY = '#!df#6!!jyirh$f=dqsxy1e6pt5orkh9ceqpcs%@28y6(2%e*&' + +# List of callables that know how to import templates from various sources. +TEMPLATE_LOADERS = ( + 'django.template.loaders.filesystem.load_template_source', + 'django.template.loaders.app_directories.load_template_source', +) + +MIDDLEWARE_CLASSES = ( + 'django.middleware.common.CommonMiddleware', + 'django.middleware.gzip.GZipMiddleware', + 'django.middleware.locale.LocaleMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.middleware.doc.XViewMiddleware', + 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware', +) + +ROOT_URLCONF = 'infopoint.urls' + +TEMPLATE_DIRS = ( + # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". + # Always use forward slashes, even on Windows. + # Don't forget to use absolute paths, not relative paths. + "/home/django/infopoint/templates", +) + +INSTALLED_APPS = ( + 'django.contrib.auth', + 'django.contrib.admin', + 'django.contrib.contenttypes', + 'django.contrib.formtools', + 'django.contrib.sessions', + 'django.contrib.comments', + 'django.contrib.humanize', + 'django.contrib.sites', + 'django.contrib.sitemaps', + 'django.contrib.syndication', + 'django.contrib.webdesign', + 'django.contrib.databrowse', +# 'infopoint.polls', + 'infopoint.sites', +# 'infopoint.tags', + 'infopoint.agenda', + # 'infopoint.cal', + 'infopoint.flatpages', +) diff --git a/settings.pyc b/settings.pyc Binary files differnew file mode 100644 index 0000000..a96c622 --- /dev/null +++ b/settings.pyc 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/__init__.pyc b/sites/__init__.pyc Binary files differnew file mode 100644 index 0000000..82e2f1b --- /dev/null +++ b/sites/__init__.pyc diff --git a/sites/models.py b/sites/models.py new file mode 100755 index 0000000..6680c91 --- /dev/null +++ b/sites/models.py @@ -0,0 +1,31 @@ +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 +from infopoint.agenda.models import Todo + +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/models.pyc b/sites/models.pyc Binary files differnew file mode 100644 index 0000000..968c8af --- /dev/null +++ b/sites/models.pyc 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/urls.pyc b/sites/urls.pyc Binary files differnew file mode 100644 index 0000000..ab7285e --- /dev/null +++ b/sites/urls.pyc 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/sites/views.pyc b/sites/views.pyc Binary files differnew file mode 100755 index 0000000..933dabb --- /dev/null +++ b/sites/views.pyc diff --git a/templates/admin/base.html b/templates/admin/base.html new file mode 100755 index 0000000..62d49db --- /dev/null +++ b/templates/admin/base.html @@ -0,0 +1,56 @@ +<!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 %}css/base.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 %} +{% block blockbots %}<meta name="robots" content="NONE,NOARCHIVE" />{% 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 %}Infopoint{% 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 %} › {{ 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">Powered by Django and Delcorp</div>{% endblock %} + +</div> +<!-- END Container --> + +</body> +</html> diff --git a/templates/admin/base_site.html b/templates/admin/base_site.html new file mode 100755 index 0000000..1a33867 --- /dev/null +++ b/templates/admin/base_site.html @@ -0,0 +1,15 @@ +{% extends "admin/base.html" %} +{% load i18n %} + +{% block head %}{{ object.title }}{{ title }} {% endblock %} + +{% block branding %} +<h1 id="site-name">{% block title %}{{ title }} {% endblock %}</h1> +{% endblock %} + +{% block nav-global %}{% endblock %} + +{% if perms.polls %} +<div class="module"><h2>Polls</h2><table> +</table></div> +{% endif %} diff --git a/templates/admin/index.html b/templates/admin/index.html new file mode 100755 index 0000000..d65772a --- /dev/null +++ b/templates/admin/index.html @@ -0,0 +1,99 @@ +{% 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"> + +{% if app_list %} + {% for app in app_list %} + <div class="module"> + <table summary="{% blocktrans with app.name as name %}Models available in the {{ name }} application.{% endblocktrans %}"> + <caption>{% blocktrans with app.name as name %}{{ name }}{% endblocktrans %}</caption> + {% for model in app.models %} + <tr> + {% if model.perms.change %} + <th scope="row"><a href="{{ model.admin_url }}">{{ model.name }}</a></th> + {% else %} + <th scope="row">{{ model.name }}</th> + {% endif %} + + {% if model.perms.add %} + <td><a href="{{ model.admin_url }}add/" class="addlink">{% trans 'Add' %}</a></td> + {% else %} + <td> </td> + {% endif %} + + {% if model.perms.change %} + <td><a href="{{ model.admin_url }}" class="changelink">{% trans 'Change' %}</a></td> + {% else %} + <td> </td> + {% endif %} + </tr> + {% endfor %} + </table> + </div> + {% endfor %} +{% else %} + <p>{% trans "You don't have permission to edit anything." %}</p> +{% endif %} +</div> +{% if debug %} +<div id="debug"> + <h2>Queries</h2> + <p> + {{ sql_queries|length }} Quer{{ sql_queries|pluralize:"y,ies" }} + {% ifnotequal sql_queries|length 0 %} + (<span style="cursor: pointer;" onclick="var s=document.getElementById('debugQueryTable').style;s.display=s.display=='none'?'':'none';this.innerHTML=this.innerHTML=='Show'?'Hide':'Show';">Show</span>) + {% endifnotequal %} + </p> + <table id="debugQueryTable" style="display: none;"> + <col width="1"></col> + <col></col> + <col width="1"></col> + <thead> + <tr> + <th scope="col">#</th> + <th scope="col">SQL</th> + <th scope="col">Time</th> + </tr> + </thead> + <tbody> + {% for query in sql_queries %}<tr class="{% cycle odd,even %}"> + <td>{{ forloop.counter }}</td> + <td>{{ query.sql|escape }}</td> + <td>{{ query.time }}</td> + </tr>{% endfor %} + </tbody> + </table> +</div> +{% endif %} + +{% endblock %} + +{% block sidebar %} +<div id="content-related"> + <div class="module" id="recent-actions-module"> + <h2>{% trans 'Recent Actions' %}</h2> + <h3>{% trans 'My Actions' %}</h3> + {% load log %} + {% get_admin_log 10 as admin_log for_user user %} + {% if not admin_log %} + <p>{% trans 'None available' %}</p> + {% else %} + <ul class="actionlist"> + {% for entry in admin_log %} + <li class="{% if entry.is_addition %}addlink{% endif %}{% if entry.is_change %}changelink{% endif %}{% if entry.is_deletion %}deletelink{% endif %}">{% if not entry.is_deletion %}<a href="{{ entry.get_admin_url }}">{% endif %}{{ entry.object_repr|escape }}{% if not entry.is_deletion %}</a>{% endif %}<br /><span class="mini quiet">{% filter capfirst %}{% trans entry.content_type.name %}{% endfilter %}</span></li> + {% endfor %} + </ul> + {% endif %} +</div> +</div> +{% endblock %} diff --git a/templates/admin_doc/bookmarklets.html b/templates/admin_doc/bookmarklets.html new file mode 100755 index 0000000..6447529 --- /dev/null +++ b/templates/admin_doc/bookmarklets.html @@ -0,0 +1,31 @@ +{% extends "admin/base_site.html" %} + +{% block breadcrumbs %}{% load i18n %}<div class="breadcrumbs"><a href="../../">{% trans "Home" %}</a> › <a href="../">{% trans "Documentation" %}</a> › {% trans "Bookmarklets" %}</div>{% endblock %} +{% block title %}{% trans "Documentation bookmarklets" %}{% endblock %} + +{% block content %} + +{% blocktrans %} +<p class="help">To install bookmarklets, drag the link to your bookmarks +toolbar, or right-click the link and add it to your bookmarks. Now you can +select the bookmarklet from any page in the site. Note that some of these +bookmarklets require you to be viewing the site from a computer designated +as "internal" (talk to your system administrator if you aren't sure if +your computer is "internal").</p> +{% endblocktrans %} + +<div id="content-main"> + <h3><a href="javascript:(function(){if(typeof ActiveXObject!='undefined'){x=new ActiveXObject('Microsoft.XMLHTTP')}else if(typeof XMLHttpRequest!='undefined'){x=new XMLHttpRequest()}else{return;}x.open('HEAD',location.href,false);x.send(null);try{view=x.getResponseHeader('x-view');}catch(e){alert('No view found for this page');return;}if(view=='undefined'){alert('No view found for this page');}document.location='{{ admin_url }}doc/views/'+view+'/';})()">{% trans "Documentation for this page" %}</a></h3> + <p>{% trans "Jumps you from any page to the documentation for the view that generates that page." %}</p> + + <h3><a href="javascript:(function(){if(typeof ActiveXObject!='undefined'){x=new ActiveXObject('Microsoft.XMLHTTP')}else if(typeof XMLHttpRequest!='undefined'){x=new XMLHttpRequest()}else{return;}x.open('GET',location.href,false);x.send(null);try{type=x.getResponseHeader('x-object-type');id=x.getResponseHeader('x-object-id');}catch(e){type='(none)';id='(none)';}d=document;b=d.body;e=d.createElement('div');e.id='xxxhhh';s=e.style;s.position='absolute';s.left='10px';s.top='10px';s.font='10px monospace';s.border='1px black solid';s.padding='4px';s.backgroundColor='#eee';e.appendChild(d.createTextNode('Type: '+type));e.appendChild(d.createElement('br'));e.appendChild(d.createTextNode('ID: '+id));e.appendChild(d.createElement('br'));l=d.createElement('a');l.href='#';l.onclick=function(){b.removeChild(e);};l.appendChild(d.createTextNode('[close]'));l.style.textDecoration='none';e.appendChild(l);b.appendChild(e);})();">{% trans "Show object ID" %}</a></h3> + <p>{% trans "Shows the content-type and unique ID for pages that represent a single object." %}</p> + + <h3><a href="javascript:(function(){if(typeof ActiveXObject!='undefined'){var x=new ActiveXObject('Microsoft.XMLHTTP')}else if(typeof XMLHttpRequest!='undefined'){var x=new XMLHttpRequest()}else{return;}x.open('GET',location.href,false);x.send(null);try{var type=x.getResponseHeader('x-object-type');var id=x.getResponseHeader('x-object-id');}catch(e){return;}document.location='{{ admin_url }}'+type.split('.').join('/')+'/'+id+'/';})()">{% trans "Edit this object (current window)" %}</a></h3> + <p>{% trans "Jumps to the admin page for pages that represent a single object." %}</p> + + <h3><a href="javascript:(function(){if(typeof ActiveXObject!='undefined'){var x=new ActiveXObject('Microsoft.XMLHTTP')}else if(typeof XMLHttpRequest!='undefined'){var x=new XMLHttpRequest()}else{return;}x.open('GET',location.href,false);x.send(null);try{var type=x.getResponseHeader('x-object-type');var id=x.getResponseHeader('x-object-id');}catch(e){return;}window.open('{{ admin_url }}'+type.split('.').join('/')+'/'+id+'/');})()">{% trans "Edit this object (new window)" %}</a></h3> + <p>{% trans "As above, but opens the admin page in a new window." %}</p> +</div> + +{% endblock %} diff --git a/templates/admin_doc/index.html b/templates/admin_doc/index.html new file mode 100755 index 0000000..242fc73 --- /dev/null +++ b/templates/admin_doc/index.html @@ -0,0 +1,28 @@ +{% extends "admin/base_site.html" %} +{% load i18n %} +{% block breadcrumbs %}<div class="breadcrumbs"><a href="../">Home</a> › Documentation</div>{% endblock %} +{% block title %}Documentation{% endblock %} + +{% block content %} + +<h1>Documentation</h1> + +<div id="content-main"> + <h3><a href="tags/">Tags</a></h3> + <p>List of all the template tags and their functions.</p> + + <h3><a href="filters/">Filters</a></h3> + <p>Filters are actions which can be applied to variables in a template to alter the output.</p> + + <h3><a href="models/">Models</a></h3> + <p>Models are descriptions of all the objects in the system and their associated fields. Each model has a list of fields which can be accessed as template variables.</p> + + <h3><a href="views/">Views</a></h3> + <p>Each page on the public site is generated by a view. The view defines which template is used to generate the page and which objects are available to that template.</p> + + <h3><a href="bookmarklets/">Bookmarklets</a></h3> + <p>Tools for your browser to quickly access admin functionality.</p> +</div> + +{% endblock %} + diff --git a/templates/admin_doc/missing_docutils.html b/templates/admin_doc/missing_docutils.html new file mode 100755 index 0000000..97c9d47 --- /dev/null +++ b/templates/admin_doc/missing_docutils.html @@ -0,0 +1,16 @@ +{% extends "admin/base_site.html" %} +{% load i18n %} +{% block breadcrumbs %}<div class="breadcrumbs"><a href="../">Home</a> › Documentation</div>{% endblock %} +{% block title %}Please install docutils{% endblock %} + +{% block content %} + +<h1>Documentation</h1> + +<div id="content-main"> + <h3>The admin documentation system requires Python's <a href="http://docutils.sf.net/">docutils</a> library.</h3> + + <p>Please ask your administrators to install <a href="http://docutils.sf.net/">docutils</a>.</p> +</div> + +{% endblock %} diff --git a/templates/admin_doc/model_detail.html b/templates/admin_doc/model_detail.html new file mode 100755 index 0000000..414397f --- /dev/null +++ b/templates/admin_doc/model_detail.html @@ -0,0 +1,46 @@ +{% extends "admin/base_site.html" %} +{% load i18n %} +{% block extrahead %} +{{ block.super }} +<style type="text/css"> +.module table { width:100%; } +.module table p { padding: 0; margin: 0; } +</style> +{% endblock %} + +{% block breadcrumbs %}<div class="breadcrumbs"><a href="../../../">Home</a> › <a href="../../">Documentation</a> › <a href="../">Models</a> › {{ name }}</div>{% endblock %} + +{% block title %}Model: {{ name }}{% endblock %} + +{% block content %} +<div id="content-main"> +<h1>{{ summary }}</h1> + +{% if description %} + <p>{% filter linebreaksbr %}{% trans description %}{% endfilter %}</p> +{% endif %} + +<div class="module"> +<table class="model"> +<thead> +<tr> + <th>Field</th> + <th>Type</th> + <th>Description</th> +</tr> +</thead> +<tbody> +{% for field in fields|dictsort:"name" %} +<tr> + <td>{{ field.name }}</td> + <td>{{ field.data_type }}</td> + <td>{% if field.verbose %}{{ field.verbose }}{% endif %}{% if field.help_text %} - {{ field.help_text|safe }}{% endif %}</td> +</tr> +{% endfor %} +</tbody> +</table> +</div> + +<p class="small"><a href="../">‹ Back to Models Documentation</a></p> +</div> +{% endblock %} diff --git a/templates/admin_doc/model_index.html b/templates/admin_doc/model_index.html new file mode 100755 index 0000000..702fdff --- /dev/null +++ b/templates/admin_doc/model_index.html @@ -0,0 +1,44 @@ +{% extends "admin/base_site.html" %} +{% load i18n %} +{% block coltype %}colSM{% endblock %} +{% block breadcrumbs %}<div class="breadcrumbs"><a href="../../">Home</a> › <a href="../">Documentation</a> › Models</div>{% endblock %} + +{% block title %}Models{% endblock %} + +{% block content %} + +<h1>Model documentation</h1> + +{% regroup models by app_label as grouped_models %} + +<div id="content-main"> +{% for group in grouped_models %} +<div class="module"> +<h2 id="{{ group.grouper }}">{{ group.grouper|capfirst }}</h2> + +<table class="xfull"> +{% for model in group.list %} +<tr> +<th><a href="{{ model.app_label }}.{{ model.object_name.lower }}/">{{ model.object_name }}</a></th> +</tr> +{% endfor %} +</table> +</div> +{% endfor %} + +</div> +{% endblock %} + +{% block sidebar %} +<div id="content-related" class="sidebar"> +<div class="module"> +<h2>Model groups</h2> +<ul> +{% regroup models by app_label as grouped_models %} +{% for group in grouped_models %} + <li><a href="#{{ group.grouper }}">{{ group.grouper|capfirst }}</a></li> +{% endfor %} +</ul> +</div> +</div> +{% endblock %} diff --git a/templates/admin_doc/template_detail.html b/templates/admin_doc/template_detail.html new file mode 100755 index 0000000..a8b02bd --- /dev/null +++ b/templates/admin_doc/template_detail.html @@ -0,0 +1,21 @@ +{% extends "admin/base_site.html" %} +{% load i18n %} +{% block breadcrumbs %}<div class="breadcrumbs"><a href="../../../">Home</a> › <a href="../../">Documentation</a> › Templates › {{ name|escape }}</div>{% endblock %} + +{% block title %}Template: {{ name|escape }}{% endblock %} + +{% block content %} +<h1>Template: "{{ name|escape }}"</h1> + +{% regroup templates|dictsort:"site_id" by site as templates_by_site %} +{% for group in templates_by_site %} + <h2>Search path for template "{{ name|escape }}" on {{ group.grouper }}:</h2> + <ol> + {% for template in group.list|dictsort:"order" %} + <li><code>{{ template.file|escape }}</code>{% if not template.exists %} <em>(does not exist)</em>{% endif %}</li> + {% endfor %} + </ol> +{% endfor %} + +<p class="small"><a href="../../">‹ Back to Documentation</a></p> +{% endblock %} diff --git a/templates/admin_doc/template_filter_index.html b/templates/admin_doc/template_filter_index.html new file mode 100755 index 0000000..902396d --- /dev/null +++ b/templates/admin_doc/template_filter_index.html @@ -0,0 +1,47 @@ +{% extends "admin/base_site.html" %} +{% load i18n %} +{% block coltype %}colSM{% endblock %} +{% block breadcrumbs %}<div class="breadcrumbs"><a href="../../">Home</a> › <a href="../">Documentation</a> › filters</div>{% endblock %} +{% block title %}Template filters{% endblock %} + +{% block content %} + +<h1>Template filter documentation</h1> + +<div id="content-main"> +{% regroup filters|dictsort:"library" by library as filter_libraries %} +{% for library in filter_libraries %} +<div class="module"> + <h2>{% if library.grouper %}{{ library.grouper }}{% else %}Built-in filters{% endif %}</h2> + {% if library.grouper %}<p class="small quiet">To use these filters, put <code>{% templatetag openblock %} load {{ library.grouper }} {% templatetag closeblock %}</code> in your template before using the filter.</p><hr />{% endif %} + {% for filter in library.list|dictsort:"name" %} + <h3 id="{{ filter.name }}">{{ filter.name }}</h3> + <p>{{ filter.title }}</p> + <p>{{ filter.body }}</p> + {% if not forloop.last %}<hr />{% endif %} + {% endfor %} +</div> +{% endfor %} +</div> + +{% endblock %} + +{% block sidebar %} + +<div id="content-related"> + +{% regroup filters|dictsort:"library" by library as filter_libraries %} +{% for library in filter_libraries %} +<div class="module"> + <h2>{% if library.grouper %}{{ library.grouper }}{% else %}Built-in filters{% endif %}</h2> + <ul> + {% for filter in library.list|dictsort:"name" %} + <li><a href="#{{ filter.name }}">{{ filter.name }}</a></li> + {% endfor %} + </ul> +</div> +{% endfor %} + +</div> + +{% endblock %} diff --git a/templates/admin_doc/template_tag_index.html b/templates/admin_doc/template_tag_index.html new file mode 100755 index 0000000..ea49529 --- /dev/null +++ b/templates/admin_doc/template_tag_index.html @@ -0,0 +1,47 @@ +{% extends "admin/base_site.html" %} +{% load i18n %} +{% block coltype %}colSM{% endblock %} +{% block breadcrumbs %}<div class="breadcrumbs"><a href="../../">Home</a> › <a href="../">Documentation</a> › Tags</div>{% endblock %} +{% block title %}Template tags{% endblock %} + +{% block content %} + +<h1>Template tag documentation</h1> + +<div id="content-main"> +{% regroup tags|dictsort:"library" by library as tag_libraries %} +{% for library in tag_libraries %} +<div class="module"> + <h2>{% if library.grouper %}{{ library.grouper }}{% else %}Built-in tags{% endif %}</h2> + {% if library.grouper %}<p class="small quiet">To use these tags, put <code>{% templatetag openblock %} load {{ library.grouper }} {% templatetag closeblock %}</code> in your template before using the tag.</p><hr />{% endif %} + {% for tag in library.list|dictsort:"name" %} + <h3 id="{{ tag.name }}">{{ tag.name }}</h3> + <h4>{{ tag.title }}</h4> + <p>{{ tag.body }}</p> + {% if not forloop.last %}<hr />{% endif %} + {% endfor %} +</div> +{% endfor %} +</div> + +{% endblock %} + +{% block sidebar %} + +<div id="content-related"> + +{% regroup tags|dictsort:"library" by library as tag_libraries %} +{% for library in tag_libraries %} +<div class="module"> + <h2>{% if library.grouper %}{{ library.grouper }}{% else %}Built-in tags{% endif %}</h2> + <ul> + {% for tag in library.list|dictsort:"name" %} + <li><a href="#{{ tag.name }}">{{ tag.name }}</a></li> + {% endfor %} + </ul> +</div> +{% endfor %} + +</div> + +{% endblock %} diff --git a/templates/admin_doc/view_detail.html b/templates/admin_doc/view_detail.html new file mode 100755 index 0000000..d7415ab --- /dev/null +++ b/templates/admin_doc/view_detail.html @@ -0,0 +1,25 @@ +{% extends "admin/base_site.html" %} +{% load i18n %} +{% block breadcrumbs %}<div class="breadcrumbs"><a href="../../../">Home</a> › <a href="../../">Documentation</a> › <a href="../">Views</a> › {{ name }}</div>{% endblock %} +{% block title %}View: {{ name }}{% endblock %} + +{% block content %} + +<h1>{{ name }}</h1> + +<h2 class="subhead">{{ summary }}</h2> + +<p>{{ body }}</p> + +{% if meta.Context %} +<h3>Context:</h3> +<p>{{ meta.Context }}</p> +{% endif %} + +{% if meta.Templates %} +<h3>Templates:</h3> +<p>{{ meta.Templates }}</p> +{% endif %} + +<p class="small"><a href="../">‹ Back to Views Documentation</a></p> +{% endblock %} diff --git a/templates/admin_doc/view_index.html b/templates/admin_doc/view_index.html new file mode 100755 index 0000000..4099005 --- /dev/null +++ b/templates/admin_doc/view_index.html @@ -0,0 +1,43 @@ +{% extends "admin/base_site.html" %} +{% load i18n %} +{% block coltype %}colSM{% endblock %} +{% block breadcrumbs %}<div class="breadcrumbs"><a href="../../">Home</a> › <a href="../">Documentation</a> › Views</div>{% endblock %} +{% block title %}Views{% endblock %} + +{% block content %} + +<h1>View documentation</h1> + +{% regroup views|dictsort:"site_id" by site as views_by_site %} + +<div id="content-related" class="sidebar"> +<div class="module"> +<h2>Jump to site</h2> +<ul> + {% for site_views in views_by_site %} + <li><a href="#site{{ site_views.grouper.id }}">{{ site_views.grouper.name }}</a></li> + {% endfor %} +</ul> +</div> +</div> + +<div id="content-main"> + +{% for site_views in views_by_site %} +<div class="module"> +<h2 id="site{{ site_views.grouper.id }}">Views by URL on {{ site_views.grouper.name }}</h2> + +{% for view in site_views.list|dictsort:"url" %} +{% ifchanged %} +<h3><a href="{{ view.module }}.{{ view.name }}/">{{ view.url|escape }}</a></h3> +<p class="small quiet">View function: {{ view.module }}.{{ view.name }}</p> +<p>{{ view.title }}</p> +<hr /> +{% endifchanged %} +{% endfor %} +</div> +{% endfor %} +</div> +{% endblock %} + + diff --git a/templates/agenda/add_event_to_group.html b/templates/agenda/add_event_to_group.html new file mode 100755 index 0000000..c81bece --- /dev/null +++ b/templates/agenda/add_event_to_group.html @@ -0,0 +1,24 @@ +{% extends "sites/base.html" %} +{% load i18n %} +{% block title %}{% trans 'Add event to group' %}{% endblock %} +{% block content_title %} <h1>{% trans 'Add another task' %}</h1> {% endblock %} + +{% block content %} +<div id="content-main"> + <div class="module"> +{% if error_message %}<p><strong>{{ error_message }}</strong></p>{% endif %} +<form method="post" action="submit/"> +<dl> + {% for field in f %} + <dt>{{ field.label_tag }}{% if field.field.required %}*{% endif %}</dt> + {% if field.help_text %}<dd>{{ field.help_text }}</dd>{% endif %} + <dd>{{ field }}</dd> + {% if field.errors %}<dd class="myerrors">{{ field.errors }}</dd>{% endif %} + {% endfor %} +</dl> +<input type="hidden" name="creator" value="{{ user.id }}" /> +<input type="submit" /> +</form> +</div> +</div> +{% endblock %} diff --git a/templates/agenda/add_todo.html b/templates/agenda/add_todo.html new file mode 100755 index 0000000..e3a92ee --- /dev/null +++ b/templates/agenda/add_todo.html @@ -0,0 +1,25 @@ +{% extends "sites/base.html" %} +{% load i18n %} +{% block title %}{% trans 'Add ToDo' %}{% endblock %} +{% block branding %}{% trans 'Add ToDo' %}{% endblock %} +{% block content_title %} <h1>{% trans 'Add another task' %}</h1> {% endblock %} + +{% block content %} +<div id="content-main"> + <div class="module"> +{% if error_message %}<p><strong>{{ error_message }}</strong></p>{% endif %} +<form method="post" action="submit/"> +<dl> + {% for field in f %} + <dt>{{ field.label_tag }}{% if field.field.required %}*{% endif %}</dt> + {% if field.help_text %}<dd>{{ field.help_text }}</dd>{% endif %} + <dd>{{ field }}</dd> + {% if field.errors %}<dd class="myerrors">{{ field.errors }}</dd>{% endif %} + {% endfor %} +</dl> +<input type="hidden" name="creator" value="{{ user.id }}" /> +<input type="submit" /> +</form> +</div> +</div> +{% endblock %} diff --git a/templates/agenda/add_todo_to_event.html b/templates/agenda/add_todo_to_event.html new file mode 100755 index 0000000..858c12d --- /dev/null +++ b/templates/agenda/add_todo_to_event.html @@ -0,0 +1,26 @@ +{% extends "sites/base.html" %} +{% load i18n %} +{% block title %}{{ event.title }} {% endblock %} +{% block branding %}{{ event.title }}{% endblock %} +{% block content_title %} <h1>{% trans 'Add another task to this event' %}</h1> {% endblock %} + +{% block content %} +<div id="content-main"> + <div class="module"> +{% if error_message %}<p><strong>{{ error_message }}</strong></p>{% endif %} +<form method="post" action="submit/"> +<dl> + {% for field in f %} + <dt>{{ field.label_tag }}{% if field.field.required %}*{% endif %}</dt> + {% if field.help_text %}<dd>{{ field.help_text }}</dd>{% endif %} + <dd>{{ field }}</dd> + {% if field.errors %}<dd class="myerrors">{{ field.errors }}</dd>{% endif %} + {% endfor %} +</dl> +<input type="hidden" name="creator" value="{{ user.id }}" /> +<input type="hidden" name="event" value="{{ event.id }}" /> +<input type="submit" /> +</form> +</div> +</div> +{% endblock %} diff --git a/templates/agenda/base.html b/templates/agenda/base.html new file mode 100755 index 0000000..8ecf206 --- /dev/null +++ b/templates/agenda/base.html @@ -0,0 +1,54 @@ +<!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 %} + {% block map %}{% 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="/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> + </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/agenda/billboard.html b/templates/agenda/billboard.html new file mode 100755 index 0000000..f2498c9 --- /dev/null +++ b/templates/agenda/billboard.html @@ -0,0 +1,95 @@ +{% extends "agenda/billboard_base.html" %} +{% load i18n %} +{% load comments %} + +{% block refresh %}{{ style.refresh }}{% endblock %} +{% block body_style %}{% for event in event %}" background="/media/{{ event.picture }}{% endfor %}{% endblock %} +{% block style %} +body { + font-family: Verdana, Arial, sans-serif; +} +#title { + color: #{{ style.color1 }}; + background-color: #{{ style.color2 }}; + position: absolute; + left: 300px; + top: 100px; + {% if style.csstitle %}{{ style.csstitle }}{% endif %} + width: 500px; height: 90px; + z-index:3; +} +#location { + color: #{{ style.color2 }}; + background-color: #{{ style.color1 }}; + position: absolute; + right: 50px; + 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; + top: 100px; + {% if style.cssdate %}{{ style.cssdate }}{% endif %} + width: 180px; height: 50px; + display: block; + +} +#description { + color: #{{ style.color3 }}; + background-color: #{{ style.color1 }}; + position: absolute; + left: 150px; + {% if style.cssdescription %}{{ style.cssdescription }}{% endif %} + 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"> + {% endif %} +</div> +{% endif %} +<p><p><p><p> +{% if event.start_date %}<div id='date'>{% trans 'When' %}: {{ event.start_date|date }}</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 %} + {% 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.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"}); + {% endblock %} + diff --git a/templates/agenda/billboard_base.html b/templates/agenda/billboard_base.html new file mode 100755 index 0000000..e91b0ef --- /dev/null +++ b/templates/agenda/billboard_base.html @@ -0,0 +1,42 @@ +<!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> + <meta http-equiv="Refresh" content="{% block refresh %}18{% endblock %}"> + + <title>{% block title %}Infopoint{% endblock %}</title> + {% load adminmedia %} + <meta http-equiv="content-type" content="text/html; charset=utf-8" /> + + <script src="{% admin_media_prefix %}js/prototype.js" type="text/javascript"></script> + <script src="{% admin_media_prefix %}js/scriptaculous.js" type="text/javascript"></script> + <script src="{% admin_media_prefix %}js/unittest.js" type="text/javascript"></script> + + + <style type="text/css" media="screen"> + /* <![CDATA[ */ + + {% block style %}{% endblock %} + /* ]]> */ + + </style> + +</head> +{% load i18n %} +<body style="{% block body_style %}{% endblock %}" > + {% if not is_popup %} + + {% endif %} + {% block content %} + {% endblock %} +<script type="text/javascript" language="javascript" charset="utf-8"> + // <![CDATA[ + {% block endscript %} + {% endblock %} + +// ]]> +</script> + +</body> +</html> + diff --git a/templates/agenda/billboard_still.html b/templates/agenda/billboard_still.html new file mode 100755 index 0000000..6e6eb99 --- /dev/null +++ b/templates/agenda/billboard_still.html @@ -0,0 +1,89 @@ +{% extends "agenda/billboard_base.html" %} +{% load i18n %} +{% load comments %} + +{% block refresh %}{{ style.refresh }}{% endblock %} +{% block body_style %}" background="/media/{{ event.location.picture }}{% endblock %} +{% block style %} +body { + font-family: Verdana, Arial, sans-serif; +} +#title { + color: #{{ style.color1 }}; + background-color: #{{ style.color2 }}; + position: absolute; + left: 300px; + top: 100px; + {% if style.csstitle %}{{ style.csstitle }}{% endif %} + width: 500px; height: 90px; + z-index:3; +} +#location { + color: #{{ style.color2 }}; + background-color: #{{ style.color1 }}; + position: absolute; + right: 50px; + bottom: 50px; + {% if style.csslocation %} {{ style.csslocation }}{% endif %} + width: 210px; + {% if event.location.picture %}height: 190px;{% else %}height: 50px;{% endif %} + display: block; + z-index:4; + +} + +#date { + color: #{{ style.color1 }}; + background-color: #{{ style.color2 }}; + left: 200px; + top: 100px; + {% if style.cssdate %}{{ style.cssdate }}{% endif %} + width: 180px; height: 50px; + display: block; + +} +#description { + color: #{{ style.color3 }}; + background-color: #{{ style.color1 }}; + position: absolute; + left: 150px; + {% if style.cssdescription %}{{ style.cssdescription }}{% endif %} + top: 280px; + width: 300px; height: 150px; + display: block; + z-index:2; + +} + + {% endblock %} + +{% block content %} +{% if location %} location: {{ location }} {% endif %} +{% 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"> +<map name="ismap"> + {{ map_coordinates|safe }} +</map> + + +{% if event.location %}<div id='location'>{{ event.location }} + + {% if event.location.picture %} + <img src="/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 %} + +{% 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="300px"><br>{% endif %} + {% endblock %} + {% block endscript %} + {% endblock %} + + {{ event.group.all.iterator.networkevent.all }} diff --git a/templates/agenda/color.html b/templates/agenda/color.html new file mode 100755 index 0000000..d2ddee8 --- /dev/null +++ b/templates/agenda/color.html @@ -0,0 +1,11 @@ +{% load common %} +<script type="text/javascript" charset="utf-8"> + var picker_{{ name }} = new ColorPicker('window'); +</script> +<input type="text" readonly="true" tabindex="-1" size="2" style="background-color: {{ value }};" id="{{ attrs.id }}-sample"/> +<input type="text" name="{{ name }}" size="8" value="{{ value }}" id="{{ attrs.id }}" onChange="alert('changed');"/> +<a href="#" onclick="picker_{{ name }}.select(document.getElementById('{{ attrs.id }}'),document.getElementById('{{ attrs.id }}-sample'),'{{ attrs.id }}-pick');return false;" name="{{ attrs.id }}-pick" id="{{ attrs.id }}-pick">Pick</a> +<script type="text/javascript" charset="utf-8"> + picker_{{ name }}.writeDiv(); +</script> + diff --git a/templates/agenda/confirm.html b/templates/agenda/confirm.html new file mode 100755 index 0000000..642df78 --- /dev/null +++ b/templates/agenda/confirm.html @@ -0,0 +1,48 @@ +{% extends "agenda/base.html" %} +{% load i18n %} +{% block info %} {% endblock %} +{% block title %}{{ event.title }}{% endblock %} +{% block content_title %} <h1>{{ event.title }}</h1> {% endblock %} + +{% block content %} + +{% if error_message %}<p><strong>{{ error_message }}</strong></p>{% endif %} +<ul class="object-tools"> +<li><a href="/admin/agenda/event/add">New Event</a></li> + + + + <li><a href="/agenda/location/{{ event.location_id }}" class="viewsitelink">See location</a><li> +<li><a href="/admin/agenda/event/{{ event.id }}">Edit</a><li> +</ul> + +<div id="content-main"> +<div class="module"> + +Location: {{ event.location }}<br> +Starts: {{ event.start_date|date }}<br> +Ends: {{ event.end_date }}<br> + +<h4>Invitados:</h4> +<table border='1px'> +<tr><td>{% trans 'Person' %}</td><td>Att.</td></tr> +{% for person_id in event.attendance_set.all %} +<tr> + <td>{{ person_id.person }}</td> + <td> {{ person_id.attendance|yesno }}</td> +</tr> +{% endfor %} +</table><br> + + +<form action="/agenda/{{ event.id }}/confirm/" method="post"> +<div class="modules"> +<div class="form-row"> + <input type="radio" name="attend" id="attend" value="True" /> <label for="attend">{% trans 'I am attending' %} </label><br /> + <input type="radio" name="attend" id="attend" value="False" /> <label for="attend">{% trans 'I am not attending' %}</label><br /> + <input type="radio" name="attend" id="attend" value="NULL" /> <label for="attend">{% trans 'I dont know' %}</label><br /></div> +<input type="submit" value="Submit" /> +</form> +</div> +</div> +{% endblock %} diff --git a/templates/agenda/event_calendar.html b/templates/agenda/event_calendar.html new file mode 100755 index 0000000..b991549 --- /dev/null +++ b/templates/agenda/event_calendar.html @@ -0,0 +1,15 @@ +<table class="cal_month_calendar"> +<tr> +{% for day in headers %} +<th>{{ day|date:"D"|slice:":2" }}</hd> +{% endfor %} +</tr> +{% for week in calendar %} +<tr> +{% for day in week %} +<td{% if not day.in_month %} class="cal_not_in_month"{% endif %}>{% if day.event %}<a href="/calendar/{{ day.day|date:"Y/m" }}/">{{ day.day|date:"j" }}</a>{% else %}{{ day.day|date:"j" }}{% endif %}</td> +{% endfor %} +</tr> +{% endfor %} +</table> + diff --git a/templates/agenda/event_list.html b/templates/agenda/event_list.html new file mode 100755 index 0000000..b9517b8 --- /dev/null +++ b/templates/agenda/event_list.html @@ -0,0 +1,29 @@ +{% extends 'agenda/base.html' %} +{% load i18n %} +{% 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 %} +{% 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 new file mode 100755 index 0000000..04ca158 --- /dev/null +++ b/templates/agenda/event_map_view.html @@ -0,0 +1,5 @@ +<img src="/media/maps/event_{{ event.id }}.png" USEMAP="#ismap" border="0"> +<map name="ismap"> + {{ map_coordinates|safe }} + +</map> diff --git a/templates/agenda/group_map_view.html b/templates/agenda/group_map_view.html new file mode 100755 index 0000000..ea63534 --- /dev/null +++ b/templates/agenda/group_map_view.html @@ -0,0 +1,5 @@ +<img src="/media/maps/group_{{ group.id }}.png" USEMAP="#ismap" border="0"> +<map name="ismap"> + {{ map_coordinates|safe }} + +</map> diff --git a/templates/agenda/location_events.html b/templates/agenda/location_events.html new file mode 100755 index 0000000..d8fd595 --- /dev/null +++ b/templates/agenda/location_events.html @@ -0,0 +1,61 @@ +{% 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 %} +{% if comment_list %} +<h2>{% trans 'Comments about this location' %}:</h2> +{% for comment in comment_list %} +{% if comment.is_public %} +<h3>{{ comment.headline }}</h3> +<p>{{ comment.comment }} +<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> +{% endblock %} +{% block content %} + +<div id="content-main"> + +<div class="module"> + +{% if error_message %}<p><strong>{{ error_message }}</strong></p>{% endif %} +<img src="/media/{{ location.picture }}" width="450px"><br> +{% if location.description %} +{% trans 'Description' %}:<br>{{ location.description }}{% 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 %} + +{% 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 %} + + +</div> +{% endblock %} diff --git a/templates/agenda/location_map_view.html b/templates/agenda/location_map_view.html new file mode 100755 index 0000000..c0ee077 --- /dev/null +++ b/templates/agenda/location_map_view.html @@ -0,0 +1,5 @@ +<img src="/media/maps/location_{{ location.id }}.png" USEMAP="#ismap" border="0"> +<map name="ismap"> + {{ map_coordinates|safe }} + +</map> diff --git a/templates/agenda/map_view.html b/templates/agenda/map_view.html new file mode 100755 index 0000000..6e6eb99 --- /dev/null +++ b/templates/agenda/map_view.html @@ -0,0 +1,89 @@ +{% extends "agenda/billboard_base.html" %} +{% load i18n %} +{% load comments %} + +{% block refresh %}{{ style.refresh }}{% endblock %} +{% block body_style %}" background="/media/{{ event.location.picture }}{% endblock %} +{% block style %} +body { + font-family: Verdana, Arial, sans-serif; +} +#title { + color: #{{ style.color1 }}; + background-color: #{{ style.color2 }}; + position: absolute; + left: 300px; + top: 100px; + {% if style.csstitle %}{{ style.csstitle }}{% endif %} + width: 500px; height: 90px; + z-index:3; +} +#location { + color: #{{ style.color2 }}; + background-color: #{{ style.color1 }}; + position: absolute; + right: 50px; + bottom: 50px; + {% if style.csslocation %} {{ style.csslocation }}{% endif %} + width: 210px; + {% if event.location.picture %}height: 190px;{% else %}height: 50px;{% endif %} + display: block; + z-index:4; + +} + +#date { + color: #{{ style.color1 }}; + background-color: #{{ style.color2 }}; + left: 200px; + top: 100px; + {% if style.cssdate %}{{ style.cssdate }}{% endif %} + width: 180px; height: 50px; + display: block; + +} +#description { + color: #{{ style.color3 }}; + background-color: #{{ style.color1 }}; + position: absolute; + left: 150px; + {% if style.cssdescription %}{{ style.cssdescription }}{% endif %} + top: 280px; + width: 300px; height: 150px; + display: block; + z-index:2; + +} + + {% endblock %} + +{% block content %} +{% if location %} location: {{ location }} {% endif %} +{% 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"> +<map name="ismap"> + {{ map_coordinates|safe }} +</map> + + +{% if event.location %}<div id='location'>{{ event.location }} + + {% if event.location.picture %} + <img src="/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 %} + +{% 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="300px"><br>{% endif %} + {% endblock %} + {% block endscript %} + {% endblock %} + + {{ event.group.all.iterator.networkevent.all }} diff --git a/templates/agenda/one_comment.html b/templates/agenda/one_comment.html new file mode 100755 index 0000000..9ad4fed --- /dev/null +++ b/templates/agenda/one_comment.html @@ -0,0 +1,46 @@ +{% extends "agenda/base.html" %} +{% load i18n %} +{% load comments %} +{% block title %}{{ comment.headline }}{% endblock %} +{% block branding %}{% if comment.headline %}Comment on {{ comment.get_content_object.title }}{% endif %}{% endblock %} +{% block content_title %} <h1>{{ group.name }}</h1> {% endblock %} +{% block content %} +<div id="content-main"> + + <div class="module"> + {% if error_message %}<p><strong>{{ error_message }}</strong></p>{% endif %} + {% if comment.headline %}<h2>{{ comment.headline }}</h2> {% endif %} + + {% if comment.get_karma_total %}<p>Karma: {{ comment.get_karma_total }}{% endif %} + + <p>{% trans 'Is coment public?' %}: {{ comment.is_public|yesno }} + + <p>{% trans 'Posted by' %} {{ comment.user }} {% trans 'on' %} {{ comment.submit_date|date }}</p> + <ul class="object-tools"> + <li><a href="{{ comment.get_flag_url }}" class="changelink">{% trans 'Flag' %}</a> </li> + <li><a href="{{ comment.get_deletion_url }}" class="deletelink">{% trans 'Delete' %}</a></li> + </ul> + <p>{{ comment.comment }} + +</div> +<div class="module"> + <h2>{% trans 'Posted on' %} {{ comment.get_content_object.title }} {{ comment.get_content_object.name }}</h2> + <p> {{ comment.get_content_object.description }} +</div> +{% endblock %} + +{% block sidebar %}{{ block.super }} + +<div class="module"> +<h2>{% trans 'To do' %}</h2> +<ul class="actionlist"> + <li><a href="/todo/add">{% trans 'New ToDo' %}</a></li> + {% if group.grouptaskpool_set.count %} + <h3>{% trans 'To do' %}</h3> + {% for event_link in group.grouptaskpool_set.all %} + <li>{{ event_link.todo }}</li> + {% endfor %} + {% endif %} +</ul> +</div> +{% endblock %} diff --git a/templates/agenda/one_event.html b/templates/agenda/one_event.html new file mode 100755 index 0000000..cf43fcb --- /dev/null +++ b/templates/agenda/one_event.html @@ -0,0 +1,145 @@ +{% 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 %} +<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> + + +{% 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> +</ul> + + + +{% 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> +</div> +<div class="module"> +{% if event.attendance_set.count %} +<h4>{% trans 'Attending' %}:</h4> +<table > +<tr><td>{% trans 'Person' %}</td><td>Att.</td></tr> +{% for person_id in event.attendance_set.all %} +<tr> + <td>{{ person_id.person }}</td> + {% for attendance in person.attendance_set.all %} + + <td> {{ person_id.attendance|yesno }}</td> + {% endfor %} + +</tr> +{% endfor %} +</table><br> +{% endif %} +</div> +</div> +<div class="module"> + <h2>{% trans 'Leave comment' %}:</h2> + + {% get_comment_form for agenda.event event.id as form %} + {% render_comment_form for agenda.event event.id %} + +</div> +</div> +</div> +</div> + +{% endblock %} + +{% block map %} +<div class="map" style="float: right;"> +{% include "agenda/event_map_view.html" %} +</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> +{% 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 %} + </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> + {% 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> + <input type="hidden" name="event" value="{{ event.id }}" id="id_event" /> + <input type="hidden" name="creator" value="{{ user.id }}" id="id_creator" /> + </form> + +</div> +<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" /> + <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"> + <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> +{% get_comment_list for agenda.event event.id as comment_list %} +{% if comment_list %} + <div class="module"> + <h2>{% trans 'Comments' %}:</h2> + {% for comment in comment_list %} + <p><a href="/comment/{{ comment.id }}">{{ comment.comment }}</a> + <p>{% trans 'Posted by' %} {{ comment.user }} {% trans 'on' %} {{ comment.submit_date|date }} + {% if user.is_authenticated and user.is_staff %}<a href="/admin/comments/comment/{{ comment.id }}/delete" class="deletelink">{% trans 'delete' %}</a> {% endif %} + {% endfor %} + </div> +{% endif %} +{% endblock %} diff --git a/templates/agenda/one_group.html b/templates/agenda/one_group.html new file mode 100755 index 0000000..6f0adfb --- /dev/null +++ b/templates/agenda/one_group.html @@ -0,0 +1,73 @@ +{% extends "agenda/base.html" %} +{% load i18n %} +{% load comments %} +{% block title %}{{ group.name }}{% 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 %} +<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 }} + {% endfor %} +</div> +{% endif %} +<div class="module"> + <h2>{% trans 'Comments' %}</h2> + <h4>{% trans 'Leave comment' %}:</h4> + {% render_comment_form for auth.group group.id %} + +</div> +</div> +</div> +</div> +{% endblock %} +{% block sidebar %}{{ block.super }} + +<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> +<input type="hidden" name="network" value="{{ group.id }}" id="id_group" /> +<input type="hidden" name="creator" value="{{ user.id }}" id="id_creator" /> +</form> + + {% if todos %} + <h3>{% trans 'Todo List' %}</h3> + {% for todo in todos %} + <form action="todo/{{ todo.id }}/close/" class="collapse" method="POST"><input type="hidden" name="todo" value="{{ todo.id }}" id="id_todo" /> + <p><a href="/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 %} + {% endif %} +</div> +<div class="module"> +{% get_comment_list for auth.group group.id as comment_list %} +{% if comment_list %} +<h2>{% trans 'Comments for this group' %}</h2> +<ul class="actionlist"> +{% for comment in comment_list %} +{% if comment.is_public %} +<li><a href="/comment/{{ comment.id }}">{{ comment.headline }} +<p>{{ comment.comment|truncatewords_html:"10" }}</a> + + <p>Posted by {{ comment.user }} on {{ comment.submit_date|date }}</li> + {% endif %} + +{% endfor %} +</ul> +{% endif %} +</div> +{% endblock %} diff --git a/templates/agenda/random.html b/templates/agenda/random.html new file mode 100755 index 0000000..c519b25 --- /dev/null +++ b/templates/agenda/random.html @@ -0,0 +1,27 @@ +<html> + <head> + <meta http-equiv="Refresh" content="5"> + <title>Calendar</title> + <link rel="stylesheet" type="text/css" href="/media/style.css" media="screen" /> + +</head> +{% for comment in event %} +<body background="/media/{{ comment.picture }}"> +{% block title %}{{ location.title }} {% endblock %} +{% block content %} +<div id="content-main"> + <pre> +</pre> +<div class="module"> +<h4>{{ comment.title }}</h4> + + +<p>{{ comment.description }} +{% load comments %} + +{#% get_comment_form for agenda.event event.id with is_public yes photos_optional thumbs,200,400 %#} +</div> +{% endblock %} +{% endfor %} +</body> +</html> diff --git a/templates/agenda/success.html b/templates/agenda/success.html new file mode 100755 index 0000000..e937cab --- /dev/null +++ b/templates/agenda/success.html @@ -0,0 +1,26 @@ +{% extends "sites/base.html" %} +{% load i18n %} +{% block info %} {% endblock %} +{% block title %}{% trans 'Add ToDo' %}{% endblock %} +{% block branding %}{% trans 'Add ToDo' %}{% endblock %} +{% block content_title %} <h1>{% trans 'Add another task to the pool' %}</h1> {% endblock %} + +{% block content %} +<div id="content-main"> + <div class="module"> +{% if error_message %}<p><strong>{{ error_message }}</strong></p>{% endif %} +<form method="post" action="submit/"> +<dl> + {% for field in f %} + <dt>{{ field.label_tag }}{% if field.field.required %}*{% endif %}</dt> + {% if field.help_text %}<dd>{{ field.help_text }}</dd>{% endif %} + <dd>{{ field }}</dd> + {% if field.errors %}<dd class="myerrors">{{ field.errors }}</dd>{% endif %} + {% endfor %} +</dl> +<input type="hidden" name="creator" value="{{ user.id }}" /> +<input type="submit" /> +</form> +</div> +</div> +{% endblock %} diff --git a/templates/agenda/user_events.html b/templates/agenda/user_events.html new file mode 100755 index 0000000..498fba5 --- /dev/null +++ b/templates/agenda/user_events.html @@ -0,0 +1,71 @@ +{% extends 'agenda/base.html' %} +{% load i18n %} +{% load calendartable %} +{% block title %} +{% if user.first_name %} +{{ user.first_name|escape }}{% else %}{{ user.username }} +{% endif %} +{% endblock %} +{% block branding %}My events{% endblock %} +{% block content_title %}<h1>{{ user.full_name|escape }} events</h1>{% endblock %} +{% block content %} +broken! is not showing the pending or the confirmed events for the user... +{% if pending %} + + <div class="module"> + <h3>pending events</h3> + {% for object in pending %} + <table summary="blogs"> + <caption><a href="/agenda/{{ object.id }}">{{ object.event.start_date|date }}</a></caption> + <tr><th colspan="3"><a href="/agenda/{{ object.id }}">{{ object.event.title|upper }}</a></th></tr> + <tr><td colspan="3">{{ object.event.description }}</td></tr> + <tr>{% if object.event.comment_set.count %}Comments: {{ object.event.comment_set.count }}{% endif %}</td> + <td bgcolor="#{{ object.event.location.color }}"><a href="location/{{ object.event.location_id }}" class="changelink">Location: {{ object.event.location }}</a></td> + <td>{% if object.event.attendance_set.count %}Asistencia confirmada: {{ object.event.attendance_set.count }}{% endif %} + <td><a href="{{ object.event.id }}/attend/" class="addlink">I'm attending</a></td> + <td><a href="/admin/agenda/event/{{ object.event.id }}" class="changelink">Modificar</a></td> + </tr> + + </table> + {% endfor %} + </div> + {% endif %} +{% if confirmed %} + <div class="module"> + <h3>confirmed events</h3> + {% for object in confirmed %} + + <table summary="blogs"> + <caption><a href="agenda/">{{ object.event.start_date|date }}</a></caption> + <tr><th colspan="3"><a href="{{ object.id }}">{{ object.event.title|upper }}</a></th></tr> + <tr><td colspan="3">{{ object.event.description }}</td></tr> + <tr> + {% if object.event.comment_set.count %}Comments: {{ object.event.comment_set.count }}{% endif %}</td> + <td bgcolor="#{{ object.event.location.color }}"><a href="location/{{ object.event.location_id }}" class="changelink">Location: {{ object.event.location }}</a></td> + <td>{% if object.event.attendance_set.count %}Asistencia confirmada: {{ object.event.attendance_set.count }}{% endif %} + <td><a href="{{ object.event.id }}/confirm/" class="addlink">I'm attending</a></td> + <td><a href="/admin/agenda/event/{{ object.event.id }}" class="changelink">Modificar</a></td> + {{ calendartable }} + </tr> + + </table> + {% endfor %} + {% endif %} + <div class="module"> + Todo: Events of my groups + + </div> + + <div class="module"> + Todo: Dismissed events + + </div> + + + </div> + +{% endblock %} +{% block info %} +template: "agenda/user_events.html" +{% endblock %} + diff --git a/templates/agenda/user_map_view.html b/templates/agenda/user_map_view.html new file mode 100755 index 0000000..483f86b --- /dev/null +++ b/templates/agenda/user_map_view.html @@ -0,0 +1,5 @@ +<img src="/media/maps/user_{{ user.id }}.png" USEMAP="#ismap" border="0"> +<map name="ismap"> + {{ map_coordinates|safe }} + +</map> diff --git a/templates/agenda/user_page.html b/templates/agenda/user_page.html new file mode 100755 index 0000000..335baa9 --- /dev/null +++ b/templates/agenda/user_page.html @@ -0,0 +1,96 @@ +{% extends 'agenda/base.html' %} +{% load i18n %} +{% if name %}{% block content_title %}<h1>{{ name|escape }}</h1>{% endblock %} +{% endif %} +{% load calendartable %} +{% block sidebar %}{{ block.super }} +{% if missing_pixies.count %} +<div class="module"> + <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 %} + </form></li> + {% endfor %} + </ul> + </div> + {% endif %} +{% 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 %} + </form></li> + {% endfor %} + </ul> + </div> + {% endif %} +<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> + <ul class="actionlist"> + {% for event in user.event_set.all %} + <li><a href="/agenda/{{ event.id }}/">{{ event.title }}</a> - {{ event.start_date|date }}</li> + {% endfor %} + </ul> + {% endif %} + </div> + {% if user.userflag_set.count %} + <div class="module"> + <h2>{% trans 'User flags' %}:</h2> + {% for flag in user.userflag_set.all %} + {{ flag.comment }}<br> + {% 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> + <ul class="actionlist"> + {% for logentry in user.messages_set.all %} + <li>{{ logentry }}</li> + {% endfor %} + </ul></div> + {% endif %} + {% if user.comment_set.count %}<div class="module"> + <h2>{% trans 'Comments' %}:</h2> + <ul class="actionlist"> + {% for comment in user.comment_set.all %} + <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" +{% endblock %} diff --git a/templates/base.html b/templates/base.html new file mode 100755 index 0000000..5e981d9 --- /dev/null +++ b/templates/base.html @@ -0,0 +1,37 @@ +<!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-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/blog/author_posts.html b/templates/blog/author_posts.html new file mode 100755 index 0000000..ede500d --- /dev/null +++ b/templates/blog/author_posts.html @@ -0,0 +1,25 @@ +{% 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 new file mode 100755 index 0000000..3e51236 --- /dev/null +++ b/templates/blog/base.html @@ -0,0 +1,47 @@ +<!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 new file mode 100755 index 0000000..55c8c6f --- /dev/null +++ b/templates/blog/blog_list.html @@ -0,0 +1,22 @@ +{% 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 new file mode 100755 index 0000000..06a353e --- /dev/null +++ b/templates/blog/directory.html @@ -0,0 +1,29 @@ +{% 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 new file mode 100755 index 0000000..cf0f956 --- /dev/null +++ b/templates/blog/one_blog.html @@ -0,0 +1,16 @@ +{% 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 new file mode 100755 index 0000000..cae6605 --- /dev/null +++ b/templates/blog/post_alone.html @@ -0,0 +1,17 @@ +{% 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 new file mode 100755 index 0000000..5a89652 --- /dev/null +++ b/templates/blog/post_list.html @@ -0,0 +1,35 @@ +{% 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/cal/calendar.html b/templates/cal/calendar.html new file mode 100644 index 0000000..934785a --- /dev/null +++ b/templates/cal/calendar.html @@ -0,0 +1,257 @@ +<!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="style.css" /> + <title>Daily of {{ username }}</title> + <style type="text/css"> + body { + font-family: Verdana, Tahoma, Arial, sans-serif; + font-size: 10pt; + } + h2, h3 { + color: blue; + } + .allCalendar { + vertical-align: top; + padding-left: 1em; + padding-right: 1em; + } + .allCalendar td { + padding-left: 0.5em; + vertical-align: top; + } + .calendar { + border-style: solid; + border-width: 1px; + background-color: #fff7ef; + } + .calendar th { + border-style: solid; + border-width: 1px; + text-align: center; + } + .calendar td { + border-style: none; + border-width: 1px; + text-align: right; + color: gray; + } + .event { + border-collapse: collapse; + border-style: solid; + border-width: 1px; + text-align: left; + margin-bottom: 1em; + } + .event th { + border-style: solid; + border-width: 1px; + border-color: gray; + padding-left: 0.5em; + padding-right: 0.5em; + } + .event td { + border-style: solid; + border-width: 1px; + color: gray; + } + .eventHead { + font-size: large; + font-weight: bold; + color: blue; + } + .inputLabel { + padding-right: 0.5em; + } + </style> + <script type="text/javascript"> + function changeEvent(button, rowid) { + var formObj = button.form; + var nameObj = formObj.elements.namedItem("name" + rowid); + var whenObj = formObj.elements.namedItem("when" + rowid); + var descObj = formObj.elements.namedItem("desc" + rowid); + var rmObj = formObj.elements.namedItem("rmbutt" + rowid); + + if (button.value == "Change") + { + /* enable fields, change background color, etc for update */ + nameObj.readOnly = false; + whenObj.readOnly = false; + descObj.readOnly = false; + + nameObj.style.background = "#FF6A6A"; + whenObj.style.background = "#FF6A6A"; + descObj.style.background = "#FF6A6A"; + + if (rmObj.value != "Remove") { + rmObj.value = "Remove"; + rmObj.style.background = ""; + } + button.style.background = "#FF6A6A"; + button.value = "Save Changes"; + + return false; + } + else + { + /* clear files for database update */ + formObj.elements.namedItem("rowid").value = ""; + formObj.elements.namedItem("name").value = ""; + formObj.elements.namedItem("when").value = ""; + formObj.elements.namedItem("desc").value = ""; + + /* submit changes */ + formObj.elements.namedItem("rowid").value = rowid; + formObj.elements.namedItem("name").value = nameObj.value; + formObj.elements.namedItem("when").value = whenObj.value; + formObj.elements.namedItem("desc").value = descObj.value; + formObj.action += "upd/"; + formObj.submit(); + return true; + } + } + + function deleteEvent(button, rowid) { + var formObj = button.form; + var nameObj = formObj.elements.namedItem("name" + rowid); + var whenObj = formObj.elements.namedItem("when" + rowid); + var descObj = formObj.elements.namedItem("desc" + rowid); + var chgObj = formObj.elements.namedItem("chgbutt" + rowid); + + if (button.value == "Remove") + { + nameObj.style.background = "#FF6A00"; + whenObj.style.background = "#FF6A00"; + descObj.style.background = "#FF6A00"; + + if (chgObj.value != "Change") { + chgObj.value = "Change" + chgObj.style.background = ""; + } + button.style.background = "#FF6A00"; + button.value = "Confirm Delete"; + + return false; + } + else + { + /* submit removal request */ + formObj.elements.namedItem("rowid").value = ""; + formObj.elements.namedItem("rowid").value = rowid; + formObj.action += "del/"; + formObj.submit(); + } + return true; + } + + function addEvent(button) { + var formObj = button.form; + var nameObj = formObj.elements.namedItem("new_name"); + var whenObj = formObj.elements.namedItem("new_when"); + var descObj = formObj.elements.namedItem("new_desc"); + var dayObj = formObj.elements.namedItem("new_day"); + + /* reset fields */ + formObj.elements.namedItem("name").value = ""; + formObj.elements.namedItem("when").value = ""; + formObj.elements.namedItem("desc").value = ""; + + /* submit add request (when there are things to add) */ + if (nameObj.value != "" && whenObj.value != "") { + formObj.elements.namedItem("rowid").value = 0; + formObj.elements.namedItem("name").value = nameObj.value; + formObj.elements.namedItem("when").value = whenObj.value; + formObj.elements.namedItem("desc").value = descObj.value; + formObj.elements.namedItem("day").value = dayObj.value; + formObj.action += "add/"; + formObj.submit(); + return true; + } + return false; + } + </script> +</head> + +<body> + <h2>Calendar of {{ username }}</h2> + <table class="allCalendar"> + <tr> + <td> + <table class="calendar"> + <tr> + <th><a href="?year={{ cal.prev.0 }}&month={{ cal.prev.1 }}">«</a></th> + <th colspan="5">{{ cal.getMonthHeader.0 }} {{ cal.getMonthHeader.1 }}</th> + <th><a href="?year={{ cal.next.0 }}&month={{ cal.next.1 }}">»</a></th> + </tr> + <tr> + {% for wk in cal.getWeekHeader %} + <th>{{ wk }}</th> + {% endfor %} + </tr> + {% for line in cal.getMonthCalendar %} + <tr> + {% for day in line %} + <td> + {% if day.1 %} + <a href="?year={{ cal.curr.year }}&month={{ cal.curr.month }}&day={{ day.0 }}">{{ day.0 }}</a> + {% else %} + {% if day.0 %} + {{ day.0 }} + {% endif %} + {% endif %} + </td> + {% endfor %} + </tr> + {% endfor %} + </table> + </td> + <td> + <span class="eventHead">Events on the {{ cal.day }}{{ cal.getDayName }}</span> + <form action="{{ url }}" method="post"> + <table class="event"> + <tr> + <th>Name</th> + <th>When</th> + <th>Description</th> + <th>Action</th> + </tr> + {% for event in cal.getDailyEvents %} + <tr> + <td><input name="name{{ forloop.counter }}" type="text" + value="{{ event.name }}" readonly size="15" maxlength="50"/></td> + <td><input name="when{{ forloop.counter }}" type="text" + value="{{ event.start.time }}" readonly size="8" maxlength="8"/></td> + <td><input name="desc{{ forloop.counter }}" type="text" + value="{{ event.desc }}" readonly size="30" maxlength="200"/></td> + <td> + <input name="chgbutt{{ forloop.counter }}" type="button" value="Change" + onclick="changeEvent(this, {{ forloop.counter }});" /> + <input name="rmbutt{{ forloop.counter }}" type="button" value="Remove" + onclick="deleteEvent(this, {{ forloop.counter }});" /> + </td> + </tr> + {% endfor %} + <tr> + <td><input name="new_name" type="text" size="15" maxlength="50"/></td> + <td><input name="new_when" type="text" size="8" maxlength="8"/></td> + <td><input name="new_desc" type="text" size="30" maxlength="200"/></td> + <td><input type="button" value="Add" onclick="addEvent(this)" /> event to day + <input name="new_day" type="text" value="{{ cal.day }}" + size="2" maxlength="2"/> + </td> + </tr> + </table> + <input name="rowid" type="hidden" value=""/> + <input name="name" type="hidden" value=""/> + <input name="when" type="hidden" value=""/> + <input name="desc" type="hidden" value=""/> + <input name="year" type="hidden" value="{{ cal.curr.year }}"/> + <input name="month" type="hidden" value="{{ cal.curr.month }}"/> + <input name="day" type="hidden" value="{{ cal.day }}"/> + </form> + </td> + </tr> + </table> +</body> +</html> diff --git a/templates/comments/.svn/all-wcprops b/templates/comments/.svn/all-wcprops new file mode 100644 index 0000000..5d40796 --- /dev/null +++ b/templates/comments/.svn/all-wcprops @@ -0,0 +1,89 @@ +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/!svn/ver/8557/django/trunk/django/contrib/comments/templates/comments +END +approve.html +K 25 +svn:wc:ra_dav:version-url +V 87 +/svn/!svn/ver/8557/django/trunk/django/contrib/comments/templates/comments/approve.html +END +reply_preview.html +K 25 +svn:wc:ra_dav:version-url +V 93 +/svn/!svn/ver/8557/django/trunk/django/contrib/comments/templates/comments/reply_preview.html +END +posted.html +K 25 +svn:wc:ra_dav:version-url +V 86 +/svn/!svn/ver/8557/django/trunk/django/contrib/comments/templates/comments/posted.html +END +approved.html +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/!svn/ver/8557/django/trunk/django/contrib/comments/templates/comments/approved.html +END +preview.html +K 25 +svn:wc:ra_dav:version-url +V 87 +/svn/!svn/ver/8557/django/trunk/django/contrib/comments/templates/comments/preview.html +END +delete.html +K 25 +svn:wc:ra_dav:version-url +V 86 +/svn/!svn/ver/8557/django/trunk/django/contrib/comments/templates/comments/delete.html +END +form.html +K 25 +svn:wc:ra_dav:version-url +V 84 +/svn/!svn/ver/8557/django/trunk/django/contrib/comments/templates/comments/form.html +END +moderation_queue.html +K 25 +svn:wc:ra_dav:version-url +V 96 +/svn/!svn/ver/8557/django/trunk/django/contrib/comments/templates/comments/moderation_queue.html +END +deleted.html +K 25 +svn:wc:ra_dav:version-url +V 87 +/svn/!svn/ver/8557/django/trunk/django/contrib/comments/templates/comments/deleted.html +END +400-debug.html +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/!svn/ver/8557/django/trunk/django/contrib/comments/templates/comments/400-debug.html +END +flag.html +K 25 +svn:wc:ra_dav:version-url +V 84 +/svn/!svn/ver/8557/django/trunk/django/contrib/comments/templates/comments/flag.html +END +flagged.html +K 25 +svn:wc:ra_dav:version-url +V 87 +/svn/!svn/ver/8557/django/trunk/django/contrib/comments/templates/comments/flagged.html +END +base.html +K 25 +svn:wc:ra_dav:version-url +V 84 +/svn/!svn/ver/8557/django/trunk/django/contrib/comments/templates/comments/base.html +END +reply.html +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/!svn/ver/8557/django/trunk/django/contrib/comments/templates/comments/reply.html +END diff --git a/templates/comments/.svn/entries b/templates/comments/.svn/entries new file mode 100644 index 0000000..3fbfbf5 --- /dev/null +++ b/templates/comments/.svn/entries @@ -0,0 +1,197 @@ +8 + +dir +8620 +http://code.djangoproject.com/svn/django/trunk/django/contrib/comments/templates/comments +http://code.djangoproject.com/svn + + + +2008-08-25T22:14:22.691388Z +8557 +jacob + + +svn:special svn:externals svn:needs-lock + + + + + + + + + + + +bcc190cf-cafb-0310-a4f2-bffc1f526a37 + +approve.html +file + + + + +2008-08-27T09:09:21.000000Z +f7248344bdc6c71a5cc487ed7bf0e416 +2008-08-25T22:14:22.691388Z +8557 +jacob + +reply_preview.html +file + + + + +2008-08-27T09:09:21.000000Z +de7bb706b0f622a1f79295bdb3ed0c49 +2008-08-25T22:14:22.691388Z +8557 +jacob + +posted.html +file + + + + +2008-08-27T09:09:21.000000Z +fe13f94eaeb1b925ad005995bf0d668f +2008-08-25T22:14:22.691388Z +8557 +jacob + +approved.html +file + + + + +2008-08-27T09:09:21.000000Z +6aa1b58a6045be20db8b852fc1522f43 +2008-08-25T22:14:22.691388Z +8557 +jacob + +preview.html +file + + + + +2008-08-27T09:09:21.000000Z +3c514ae51c5febd638c16205eb0f9f0e +2008-08-25T22:14:22.691388Z +8557 +jacob + +delete.html +file + + + + +2008-08-27T09:09:21.000000Z +d59687ef020ee6069aedcfa08c858eed +2008-08-25T22:14:22.691388Z +8557 +jacob + +form.html +file + + + + +2008-08-27T09:09:21.000000Z +37e8b88a298ab232d9076c76120f5b40 +2008-08-25T22:14:22.691388Z +8557 +jacob +has-props + +moderation_queue.html +file + + + + +2008-08-27T09:09:21.000000Z +6c75f8ce0174ee6aa87bccc8a7b3b109 +2008-08-25T22:14:22.691388Z +8557 +jacob + +deleted.html +file + + + + +2008-08-27T09:09:21.000000Z +42f9461f2a2b6bbc082612789a10ddcd +2008-08-25T22:14:22.691388Z +8557 +jacob + +400-debug.html +file + + + + +2008-08-27T09:09:21.000000Z +fcb85ff389d98906dce2188f760afa7c +2008-08-25T22:14:22.691388Z +8557 +jacob + +flag.html +file + + + + +2008-08-27T09:09:21.000000Z +badc4e1abbe90fecfc638862b27f0896 +2008-08-25T22:14:22.691388Z +8557 +jacob + +flagged.html +file + + + + +2008-08-27T09:09:21.000000Z +72eca519e8091097cb9cb6bfc6282917 +2008-08-25T22:14:22.691388Z +8557 +jacob + +base.html +file + + + + +2008-08-27T09:09:21.000000Z +a87f733dc5e44abe2b090369681c2cdd +2008-08-25T22:14:22.691388Z +8557 +jacob + +reply.html +file + + + + +2008-08-27T09:09:21.000000Z +7161b270e0d0437407a69e43494b8eab +2008-08-25T22:14:22.691388Z +8557 +jacob + diff --git a/templates/comments/.svn/format b/templates/comments/.svn/format new file mode 100644 index 0000000..45a4fb7 --- /dev/null +++ b/templates/comments/.svn/format @@ -0,0 +1 @@ +8 diff --git a/templates/comments/.svn/prop-base/form.html.svn-base b/templates/comments/.svn/prop-base/form.html.svn-base new file mode 100644 index 0000000..bdbd305 --- /dev/null +++ b/templates/comments/.svn/prop-base/form.html.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:eol-style +V 6 +native +END diff --git a/templates/comments/.svn/text-base/400-debug.html.svn-base b/templates/comments/.svn/text-base/400-debug.html.svn-base new file mode 100644 index 0000000..adb08a1 --- /dev/null +++ b/templates/comments/.svn/text-base/400-debug.html.svn-base @@ -0,0 +1,53 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html lang="en"> +<head> + <meta http-equiv="content-type" content="text/html; charset=utf-8" /> + <title>Comment post not allowed (400)</title> + <meta name="robots" content="NONE,NOARCHIVE" /> + <style type="text/css"> + html * { padding:0; margin:0; } + body * { padding:10px 20px; } + body * * { padding:0; } + body { font:small sans-serif; background:#eee; } + body>div { border-bottom:1px solid #ddd; } + h1 { font-weight:normal; margin-bottom:.4em; } + h1 span { font-size:60%; color:#666; font-weight:normal; } + table { border:none; border-collapse: collapse; width:100%; } + td, th { vertical-align:top; padding:2px 3px; } + th { width:12em; text-align:right; color:#666; padding-right:.5em; } + #info { background:#f6f6f6; } + #info ol { margin: 0.5em 4em; } + #info ol li { font-family: monospace; } + #summary { background: #ffc; } + #explanation { background:#eee; border-bottom: 0px none; } + </style> +</head> +<body> + <div id="summary"> + <h1>Comment post not allowed <span>(400)</span></h1> + <table class="meta"> + <tr> + <th>Why:</th> + <td>{{ why }}</td> + </tr> + </table> + </div> + <div id="info"> + <p> + The comment you tried to post to this view wasn't saved because something + tampered with the security information in the comment form. The message + above should explain the problem, or you can check the <a + href="http://www.djangoproject.com/documentation/comments/">comment + documentation</a> for more help. + </p> + </div> + + <div id="explanation"> + <p> + You're seeing this error because you have <code>DEBUG = True</code> in + your Django settings file. Change that to <code>False</code>, and Django + will display a standard 400 error page. + </p> + </div> +</body> +</html> diff --git a/templates/comments/.svn/text-base/approve.html.svn-base b/templates/comments/.svn/text-base/approve.html.svn-base new file mode 100644 index 0000000..18157b7 --- /dev/null +++ b/templates/comments/.svn/text-base/approve.html.svn-base @@ -0,0 +1,14 @@ +{% extends "comments/base.html" %} + +{% block title %}Approve a comment{% endblock %} + +{% block content %} + <h1>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> + </p> + </form> +{% endblock %}
\ No newline at end of file diff --git a/templates/comments/.svn/text-base/approved.html.svn-base b/templates/comments/.svn/text-base/approved.html.svn-base new file mode 100644 index 0000000..1ff5c42 --- /dev/null +++ b/templates/comments/.svn/text-base/approved.html.svn-base @@ -0,0 +1,7 @@ +{% extends "comments/base.html" %} + +{% block title %}Thanks for approving.{% endblock %} + +{% block content %} + <h1>Thanks for taking the time to improve the quality of discussion on our site.</h1> +{% endblock %}
\ No newline at end of file diff --git a/templates/comments/.svn/text-base/base.html.svn-base b/templates/comments/.svn/text-base/base.html.svn-base new file mode 100644 index 0000000..36fc66f --- /dev/null +++ b/templates/comments/.svn/text-base/base.html.svn-base @@ -0,0 +1,10 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> +<html lang="en"> +<head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> + <title>{% block title %}{% endblock %}</title> +</head> +<body> + {% block content %}{% endblock %} +</body> +</html> diff --git a/templates/comments/.svn/text-base/delete.html.svn-base b/templates/comments/.svn/text-base/delete.html.svn-base new file mode 100644 index 0000000..6486951 --- /dev/null +++ b/templates/comments/.svn/text-base/delete.html.svn-base @@ -0,0 +1,14 @@ +{% extends "comments/base.html" %} + +{% block title %}Remove a comment{% endblock %} + +{% block content %} + <h1>Really remove this comment?</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="Remove"> or <a href="{{ comment.permalink }}">cancel</a> + </p> + </form> +{% endblock %}
\ No newline at end of file diff --git a/templates/comments/.svn/text-base/deleted.html.svn-base b/templates/comments/.svn/text-base/deleted.html.svn-base new file mode 100644 index 0000000..9c0fc42 --- /dev/null +++ b/templates/comments/.svn/text-base/deleted.html.svn-base @@ -0,0 +1,7 @@ +{% extends "comments/base.html" %} + +{% block title %}Thanks for removing.{% endblock %} + +{% block content %} + <h1>Thanks for taking the time to improve the quality of discussion on our site.</h1> +{% endblock %}
\ No newline at end of file diff --git a/templates/comments/.svn/text-base/flag.html.svn-base b/templates/comments/.svn/text-base/flag.html.svn-base new file mode 100644 index 0000000..b6090e6 --- /dev/null +++ b/templates/comments/.svn/text-base/flag.html.svn-base @@ -0,0 +1,14 @@ +{% extends "comments/base.html" %} + +{% block title %}Flag this comment{% endblock %} + +{% block content %} + <h1>Really flag this comment?</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="Flag"> or <a href="{{ comment.permalink }}">cancel</a> + </p> + </form> +{% endblock %}
\ No newline at end of file diff --git a/templates/comments/.svn/text-base/flagged.html.svn-base b/templates/comments/.svn/text-base/flagged.html.svn-base new file mode 100644 index 0000000..7d2dc11 --- /dev/null +++ b/templates/comments/.svn/text-base/flagged.html.svn-base @@ -0,0 +1,7 @@ +{% extends "comments/base.html" %} + +{% block title %}Thanks for flagging.{% endblock %} + +{% block content %} + <h1>Thanks for taking the time to improve the quality of discussion on our site.</h1> +{% endblock %}
\ No newline at end of file diff --git a/templates/comments/.svn/text-base/form.html.svn-base b/templates/comments/.svn/text-base/form.html.svn-base new file mode 100644 index 0000000..5c43c62 --- /dev/null +++ b/templates/comments/.svn/text-base/form.html.svn-base @@ -0,0 +1,19 @@ +{% load comments %} +<form action="{% comment_form_target %}" method="POST"> + {% 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 %} + <p class="submit"> + <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 diff --git a/templates/comments/.svn/text-base/moderation_queue.html.svn-base b/templates/comments/.svn/text-base/moderation_queue.html.svn-base new file mode 100644 index 0000000..b5519df --- /dev/null +++ b/templates/comments/.svn/text-base/moderation_queue.html.svn-base @@ -0,0 +1,75 @@ +{% extends "admin/change_list.html" %} +{% load adminmedia %} + +{% block title %}Comment moderation queue{% endblock %} + +{% block extrahead %} + {{ block.super }} + <style type="text/css" media="screen"> + p#nocomments { font-size: 200%; text-align: center; border: 1px #ccc dashed; padding: 4em; } + td.actions { width: 11em; } + td.actions form { display: inline; } + td.actions form input.submit { width: 5em; padding: 2px 4px; margin-right: 4px;} + td.actions form input.approve { background: green; color: white; } + td.actions form input.remove { background: red; color: white; } + </style> +{% endblock %} + +{% block branding %} +<h1 id="site-name">Comment moderation queue</h1> +{% endblock %} + +{% block breadcrumbs %}{% endblock %} + +{% block content %} +{% if empty %} + <p id="nocomments">No comments to moderate.</div> +{% else %} +<div id="content-main"> + <div class="module" id="changelist"> + <table cellspacing="0"> + <thead> + <tr> + <th>Action</th> + <th>Name</th> + <th>Comment</th> + <th>Email</th> + <th>URL</th> + <th>Authenticated?</th> + <th>IP Address</th> + <th class="sorted desc">Date posted</th> + </tr> + </thead> + <tbody> + {% for comment in comments %} + <tr class="{% cycle 'row1' 'row2' %}"> + <td class="actions"> + <form action="{% url comments-approve comment.pk %}" method="POST"> + <input type="hidden" name="next" value="{% url comments-moderation-queue %}"> + <input class="approve submit" type="submit" name="submit" value="Approve"> + </form> + <form action="{% url comments-delete comment.pk %}" method="POST"> + <input type="hidden" name="next" value="{% url comments-moderation-queue %}"> + <input class="remove submit" type="submit" name="submit" value="Remove"> + </form> + </td> + <td>{{ comment.name|escape }}</td> + <td>{{ comment.comment|truncatewords:"50"|escape }}</td> + <td>{{ comment.email|escape }}</td> + <td>{{ comment.url|escape }}</td> + <td> + <img + src="{% admin_media_prefix %}img/admin/icon-{% if comment.user %}yes{% else %}no{% endif %}.gif" + alt="{% if comment.user %}yes{% else %}no{% endif %}" + /> + </td> + <td>{{ comment.ip_address|escape }}</td> + <td>{{ comment.submit_date|date:"F j, P" }}</td> + </tr> + {% endfor %} + </tbody> + </table> + </div> +</div> +{% endif %} +{% endblock %} diff --git a/templates/comments/.svn/text-base/posted.html.svn-base b/templates/comments/.svn/text-base/posted.html.svn-base new file mode 100644 index 0000000..2833c11 --- /dev/null +++ b/templates/comments/.svn/text-base/posted.html.svn-base @@ -0,0 +1,7 @@ +{% extends "comments/base.html" %} + +{% block title %}Thanks for commenting.{% endblock %} + +{% block content %} + <h1>Thank you for your comment.</h1> +{% endblock %}
\ No newline at end of file diff --git a/templates/comments/.svn/text-base/preview.html.svn-base b/templates/comments/.svn/text-base/preview.html.svn-base new file mode 100644 index 0000000..50ed6d6 --- /dev/null +++ b/templates/comments/.svn/text-base/preview.html.svn-base @@ -0,0 +1,34 @@ +{% extends "comments/base.html" %} + +{% block title %}Preview your comment{% endblock %} + +{% block content %} + {% load comments %} + <form action="{% comment_form_target %}" method="POST"> + {% if form.errors %} + <h1>Please correct the error{{ form.errors|pluralize }} below</h1> + {% else %} + <h1>Preview your comment</h1> + <blockquote>{{ comment|escape|linebreaks }}</blockquote> + <p> + and <input type="submit" name="submit" value="Post your comment" id="submit"> or make changes: + </p> + {% endif %} + {% 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 %} + <p class="submit"> + <input type="submit" name="submit" class="submit-post" value="Post"> + <input type="submit" name="submit" class="submit-preview" value="Preview"> + </p> + </form> +{% endblock %}
\ No newline at end of file diff --git a/templates/comments/.svn/text-base/reply.html.svn-base b/templates/comments/.svn/text-base/reply.html.svn-base new file mode 100644 index 0000000..4291a90 --- /dev/null +++ b/templates/comments/.svn/text-base/reply.html.svn-base @@ -0,0 +1,19 @@ +{% load comments %} +<form action="{% comment_form_target %}" method="POST"> + {% 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 %} + <p class="submit"> + <input type="submit" name="submit" class="submit-post" value="Reply"> + <input type="submit" name="submit" class="submit-preview" value="Preview"> + </p> +</form> diff --git a/templates/comments/.svn/text-base/reply_preview.html.svn-base b/templates/comments/.svn/text-base/reply_preview.html.svn-base new file mode 100644 index 0000000..b566110 --- /dev/null +++ b/templates/comments/.svn/text-base/reply_preview.html.svn-base @@ -0,0 +1,34 @@ +{% extends "comments/base.html" %} + +{% block title %}Preview your comment{% endblock %} + +{% block content %} + {% load comments %} + <form action="{% comment_form_target %}" method="POST"> + {% if form.errors %} + <h1>Please correct the error{{ form.errors|pluralize }} below</h1> + {% else %} + <h1>Preview your comment</h1> + <blockquote>{{ comment|escape|linebreaks }}</blockquote> + <p> + and <input type="submit" name="submit" value="Post your comment" id="submit"> or make changes: + </p> + {% endif %} + {% 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 %} + <p class="submit"> + <input type="submit" name="submit" class="submit-post" value="Post"> + <input type="submit" name="submit" class="submit-preview" value="Preview"> + </p> + </form> +{% endblock %} diff --git a/templates/comments/400-debug.html b/templates/comments/400-debug.html new file mode 100644 index 0000000..adb08a1 --- /dev/null +++ b/templates/comments/400-debug.html @@ -0,0 +1,53 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html lang="en"> +<head> + <meta http-equiv="content-type" content="text/html; charset=utf-8" /> + <title>Comment post not allowed (400)</title> + <meta name="robots" content="NONE,NOARCHIVE" /> + <style type="text/css"> + html * { padding:0; margin:0; } + body * { padding:10px 20px; } + body * * { padding:0; } + body { font:small sans-serif; background:#eee; } + body>div { border-bottom:1px solid #ddd; } + h1 { font-weight:normal; margin-bottom:.4em; } + h1 span { font-size:60%; color:#666; font-weight:normal; } + table { border:none; border-collapse: collapse; width:100%; } + td, th { vertical-align:top; padding:2px 3px; } + th { width:12em; text-align:right; color:#666; padding-right:.5em; } + #info { background:#f6f6f6; } + #info ol { margin: 0.5em 4em; } + #info ol li { font-family: monospace; } + #summary { background: #ffc; } + #explanation { background:#eee; border-bottom: 0px none; } + </style> +</head> +<body> + <div id="summary"> + <h1>Comment post not allowed <span>(400)</span></h1> + <table class="meta"> + <tr> + <th>Why:</th> + <td>{{ why }}</td> + </tr> + </table> + </div> + <div id="info"> + <p> + The comment you tried to post to this view wasn't saved because something + tampered with the security information in the comment form. The message + above should explain the problem, or you can check the <a + href="http://www.djangoproject.com/documentation/comments/">comment + documentation</a> for more help. + </p> + </div> + + <div id="explanation"> + <p> + You're seeing this error because you have <code>DEBUG = True</code> in + your Django settings file. Change that to <code>False</code>, and Django + will display a standard 400 error page. + </p> + </div> +</body> +</html> diff --git a/templates/comments/approve.html b/templates/comments/approve.html new file mode 100644 index 0000000..18157b7 --- /dev/null +++ b/templates/comments/approve.html @@ -0,0 +1,14 @@ +{% extends "comments/base.html" %} + +{% block title %}Approve a comment{% endblock %} + +{% block content %} + <h1>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> + </p> + </form> +{% endblock %}
\ No newline at end of file diff --git a/templates/comments/approved.html b/templates/comments/approved.html new file mode 100644 index 0000000..1ff5c42 --- /dev/null +++ b/templates/comments/approved.html @@ -0,0 +1,7 @@ +{% extends "comments/base.html" %} + +{% block title %}Thanks for approving.{% endblock %} + +{% block content %} + <h1>Thanks for taking the time to improve the quality of discussion on our site.</h1> +{% endblock %}
\ No newline at end of file diff --git a/templates/comments/base.html b/templates/comments/base.html new file mode 100644 index 0000000..36fc66f --- /dev/null +++ b/templates/comments/base.html @@ -0,0 +1,10 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> +<html lang="en"> +<head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> + <title>{% block title %}{% endblock %}</title> +</head> +<body> + {% block content %}{% endblock %} +</body> +</html> diff --git a/templates/comments/delete.html b/templates/comments/delete.html new file mode 100644 index 0000000..6486951 --- /dev/null +++ b/templates/comments/delete.html @@ -0,0 +1,14 @@ +{% extends "comments/base.html" %} + +{% block title %}Remove a comment{% endblock %} + +{% block content %} + <h1>Really remove this comment?</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="Remove"> or <a href="{{ comment.permalink }}">cancel</a> + </p> + </form> +{% endblock %}
\ No newline at end of file diff --git a/templates/comments/deleted.html b/templates/comments/deleted.html new file mode 100644 index 0000000..9c0fc42 --- /dev/null +++ b/templates/comments/deleted.html @@ -0,0 +1,7 @@ +{% extends "comments/base.html" %} + +{% block title %}Thanks for removing.{% endblock %} + +{% block content %} + <h1>Thanks for taking the time to improve the quality of discussion on our site.</h1> +{% endblock %}
\ No newline at end of file diff --git a/templates/comments/flag.html b/templates/comments/flag.html new file mode 100644 index 0000000..b6090e6 --- /dev/null +++ b/templates/comments/flag.html @@ -0,0 +1,14 @@ +{% extends "comments/base.html" %} + +{% block title %}Flag this comment{% endblock %} + +{% block content %} + <h1>Really flag this comment?</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="Flag"> or <a href="{{ comment.permalink }}">cancel</a> + </p> + </form> +{% endblock %}
\ No newline at end of file diff --git a/templates/comments/flagged.html b/templates/comments/flagged.html new file mode 100644 index 0000000..7d2dc11 --- /dev/null +++ b/templates/comments/flagged.html @@ -0,0 +1,7 @@ +{% extends "comments/base.html" %} + +{% block title %}Thanks for flagging.{% endblock %} + +{% block content %} + <h1>Thanks for taking the time to improve the quality of discussion on our site.</h1> +{% endblock %}
\ No newline at end of file diff --git a/templates/comments/form.html b/templates/comments/form.html new file mode 100644 index 0000000..5c43c62 --- /dev/null +++ b/templates/comments/form.html @@ -0,0 +1,19 @@ +{% load comments %} +<form action="{% comment_form_target %}" method="POST"> + {% 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 %} + <p class="submit"> + <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 diff --git a/templates/comments/moderation_queue.html b/templates/comments/moderation_queue.html new file mode 100644 index 0000000..b5519df --- /dev/null +++ b/templates/comments/moderation_queue.html @@ -0,0 +1,75 @@ +{% extends "admin/change_list.html" %} +{% load adminmedia %} + +{% block title %}Comment moderation queue{% endblock %} + +{% block extrahead %} + {{ block.super }} + <style type="text/css" media="screen"> + p#nocomments { font-size: 200%; text-align: center; border: 1px #ccc dashed; padding: 4em; } + td.actions { width: 11em; } + td.actions form { display: inline; } + td.actions form input.submit { width: 5em; padding: 2px 4px; margin-right: 4px;} + td.actions form input.approve { background: green; color: white; } + td.actions form input.remove { background: red; color: white; } + </style> +{% endblock %} + +{% block branding %} +<h1 id="site-name">Comment moderation queue</h1> +{% endblock %} + +{% block breadcrumbs %}{% endblock %} + +{% block content %} +{% if empty %} + <p id="nocomments">No comments to moderate.</div> +{% else %} +<div id="content-main"> + <div class="module" id="changelist"> + <table cellspacing="0"> + <thead> + <tr> + <th>Action</th> + <th>Name</th> + <th>Comment</th> + <th>Email</th> + <th>URL</th> + <th>Authenticated?</th> + <th>IP Address</th> + <th class="sorted desc">Date posted</th> + </tr> + </thead> + <tbody> + {% for comment in comments %} + <tr class="{% cycle 'row1' 'row2' %}"> + <td class="actions"> + <form action="{% url comments-approve comment.pk %}" method="POST"> + <input type="hidden" name="next" value="{% url comments-moderation-queue %}"> + <input class="approve submit" type="submit" name="submit" value="Approve"> + </form> + <form action="{% url comments-delete comment.pk %}" method="POST"> + <input type="hidden" name="next" value="{% url comments-moderation-queue %}"> + <input class="remove submit" type="submit" name="submit" value="Remove"> + </form> + </td> + <td>{{ comment.name|escape }}</td> + <td>{{ comment.comment|truncatewords:"50"|escape }}</td> + <td>{{ comment.email|escape }}</td> + <td>{{ comment.url|escape }}</td> + <td> + <img + src="{% admin_media_prefix %}img/admin/icon-{% if comment.user %}yes{% else %}no{% endif %}.gif" + alt="{% if comment.user %}yes{% else %}no{% endif %}" + /> + </td> + <td>{{ comment.ip_address|escape }}</td> + <td>{{ comment.submit_date|date:"F j, P" }}</td> + </tr> + {% endfor %} + </tbody> + </table> + </div> +</div> +{% endif %} +{% endblock %} diff --git a/templates/comments/posted.html b/templates/comments/posted.html new file mode 100644 index 0000000..2833c11 --- /dev/null +++ b/templates/comments/posted.html @@ -0,0 +1,7 @@ +{% extends "comments/base.html" %} + +{% block title %}Thanks for commenting.{% endblock %} + +{% block content %} + <h1>Thank you for your comment.</h1> +{% endblock %}
\ No newline at end of file diff --git a/templates/comments/preview.html b/templates/comments/preview.html new file mode 100644 index 0000000..50ed6d6 --- /dev/null +++ b/templates/comments/preview.html @@ -0,0 +1,34 @@ +{% extends "comments/base.html" %} + +{% block title %}Preview your comment{% endblock %} + +{% block content %} + {% load comments %} + <form action="{% comment_form_target %}" method="POST"> + {% if form.errors %} + <h1>Please correct the error{{ form.errors|pluralize }} below</h1> + {% else %} + <h1>Preview your comment</h1> + <blockquote>{{ comment|escape|linebreaks }}</blockquote> + <p> + and <input type="submit" name="submit" value="Post your comment" id="submit"> or make changes: + </p> + {% endif %} + {% 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 %} + <p class="submit"> + <input type="submit" name="submit" class="submit-post" value="Post"> + <input type="submit" name="submit" class="submit-preview" value="Preview"> + </p> + </form> +{% endblock %}
\ No newline at end of file diff --git a/templates/comments/reply.html b/templates/comments/reply.html new file mode 100644 index 0000000..4291a90 --- /dev/null +++ b/templates/comments/reply.html @@ -0,0 +1,19 @@ +{% load comments %} +<form action="{% comment_form_target %}" method="POST"> + {% 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 %} + <p class="submit"> + <input type="submit" name="submit" class="submit-post" value="Reply"> + <input type="submit" name="submit" class="submit-preview" value="Preview"> + </p> +</form> diff --git a/templates/comments/reply_preview.html b/templates/comments/reply_preview.html new file mode 100644 index 0000000..b566110 --- /dev/null +++ b/templates/comments/reply_preview.html @@ -0,0 +1,34 @@ +{% extends "comments/base.html" %} + +{% block title %}Preview your comment{% endblock %} + +{% block content %} + {% load comments %} + <form action="{% comment_form_target %}" method="POST"> + {% if form.errors %} + <h1>Please correct the error{{ form.errors|pluralize }} below</h1> + {% else %} + <h1>Preview your comment</h1> + <blockquote>{{ comment|escape|linebreaks }}</blockquote> + <p> + and <input type="submit" name="submit" value="Post your comment" id="submit"> or make changes: + </p> + {% endif %} + {% 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 %} + <p class="submit"> + <input type="submit" name="submit" class="submit-post" value="Post"> + <input type="submit" name="submit" class="submit-preview" value="Preview"> + </p> + </form> +{% endblock %} diff --git a/templates/flatpages/base.html b/templates/flatpages/base.html new file mode 100755 index 0000000..5f28f76 --- /dev/null +++ b/templates/flatpages/base.html @@ -0,0 +1,54 @@ +<!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 %} › {{ 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 new file mode 100755 index 0000000..2c5df19 --- /dev/null +++ b/templates/flatpages/default.html @@ -0,0 +1,10 @@ +{% 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 new file mode 100755 index 0000000..73884c0 --- /dev/null +++ b/templates/flatpages/left_menu.html @@ -0,0 +1,11 @@ +<!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 new file mode 100755 index 0000000..8017736 --- /dev/null +++ b/templates/polls/base.html @@ -0,0 +1,47 @@ +<!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 new file mode 100755 index 0000000..35b7757 --- /dev/null +++ b/templates/polls/poll_detail.html @@ -0,0 +1,39 @@ +{% 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 new file mode 100755 index 0000000..2888cf2 --- /dev/null +++ b/templates/polls/poll_list.html @@ -0,0 +1,14 @@ +{% 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 new file mode 100755 index 0000000..57c6d6b --- /dev/null +++ b/templates/polls/results.html @@ -0,0 +1,46 @@ +{% 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/registration/login.html b/templates/registration/login.html new file mode 100644 index 0000000..5dd953b --- /dev/null +++ b/templates/registration/login.html @@ -0,0 +1,35 @@ +{% extends "admin/base_site.html" %} +{% load i18n %} + +{% block stylesheet %}{% load adminmedia %}{% admin_media_prefix %}css/login.css{% endblock %} + +{% block bodyclass %}login{% endblock %} + +{% block content_title %}{% endblock %} + +{% block breadcrumbs %}{% endblock %} + +{% block content %} +{% if error_message %} +<p class="errornote">{{ error_message }}</p> +{% endif %} +<div id="content-main"> +<form action="{{ app_path }}" method="post" id="login-form"> + <div class="form-row"> + <label for="id_username">{% trans 'Username:' %}</label> <input type="text" name="username" id="id_username" /> + </div> + <div class="form-row"> + <label for="id_password">{% trans 'Password:' %}</label> <input type="password" name="password" id="id_password" /> + <input type="hidden" name="this_is_the_login_form" value="1" /> + <input type="hidden" name="post_data" value="{{ post_data }}" /> {#<span class="help">{% trans 'Have you <a href="/password_reset/">forgotten your password</a>?' %}</span>#} + </div> + <div class="submit-row"> + <label> </label><input type="submit" value="{% trans 'Log in' %}" /> + </div> +</form> + +<script type="text/javascript"> +document.getElementById('id_username').focus() +</script> +</div> +{% endblock %} diff --git a/templates/sites/base.html b/templates/sites/base.html new file mode 100755 index 0000000..dca2129 --- /dev/null +++ b/templates/sites/base.html @@ -0,0 +1,52 @@ +<!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 new file mode 100755 index 0000000..371e4dd --- /dev/null +++ b/templates/sites/base_site.html @@ -0,0 +1,23 @@ +{% 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 new file mode 100755 index 0000000..80392ad --- /dev/null +++ b/templates/sites/default.html @@ -0,0 +1,13 @@ +<!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 new file mode 100755 index 0000000..06a353e --- /dev/null +++ b/templates/sites/directory.html @@ -0,0 +1,29 @@ +{% 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 new file mode 100755 index 0000000..980083b --- /dev/null +++ b/templates/sites/site_list.html @@ -0,0 +1,49 @@ +{% 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/test.dot b/test.dot new file mode 100644 index 0000000..073acbe --- /dev/null +++ b/test.dot @@ -0,0 +1,289 @@ + +digraph name { + fontname = "Helvetica" + fontsize = 8 + + node [ + fontname = "Helvetica" + fontsize = 8 + shape = "plaintext" + ] + edge [ + fontname = "Helvetica" + fontsize = 8 + ] + + + + +subgraph cluster_infopoint_agenda_models { + label=< + <TABLE BORDER="0" CELLBORDER="0" CELLSPACING="0"> + <TR><TD COLSPAN="2" CELLPADDING="4" ALIGN="CENTER" + ><FONT FACE="Helvetica Bold" COLOR="Black" POINT-SIZE="12" + >infopoint.agenda</FONT></TD></TR> + </TABLE> + > + color=olivedrab4 + style="rounded" + + + + infopoint_agenda_models_Location [label=< + <TABLE BGCOLOR="palegoldenrod" BORDER="0" CELLBORDER="0" CELLSPACING="0"> + <TR><TD COLSPAN="2" CELLPADDING="4" ALIGN="CENTER" BGCOLOR="olivedrab4" + ><FONT FACE="Helvetica Bold" COLOR="white" + >Location</FONT></TD></TR> + + + </TABLE> + >] + + infopoint_agenda_models_Event [label=< + <TABLE BGCOLOR="palegoldenrod" BORDER="0" CELLBORDER="0" CELLSPACING="0"> + <TR><TD COLSPAN="2" CELLPADDING="4" ALIGN="CENTER" BGCOLOR="olivedrab4" + ><FONT FACE="Helvetica Bold" COLOR="white" + >Event</FONT></TD></TR> + + + </TABLE> + >] + + infopoint_agenda_models_Network [label=< + <TABLE BGCOLOR="palegoldenrod" BORDER="0" CELLBORDER="0" CELLSPACING="0"> + <TR><TD COLSPAN="2" CELLPADDING="4" ALIGN="CENTER" BGCOLOR="olivedrab4" + ><FONT FACE="Helvetica Bold" COLOR="white" + >Network</FONT></TD></TR> + + + </TABLE> + >] + + infopoint_agenda_models_Todo [label=< + <TABLE BGCOLOR="palegoldenrod" BORDER="0" CELLBORDER="0" CELLSPACING="0"> + <TR><TD COLSPAN="2" CELLPADDING="4" ALIGN="CENTER" BGCOLOR="olivedrab4" + ><FONT FACE="Helvetica Bold" COLOR="white" + >Todo</FONT></TD></TR> + + + </TABLE> + >] + + infopoint_agenda_models_Attendance [label=< + <TABLE BGCOLOR="palegoldenrod" BORDER="0" CELLBORDER="0" CELLSPACING="0"> + <TR><TD COLSPAN="2" CELLPADDING="4" ALIGN="CENTER" BGCOLOR="olivedrab4" + ><FONT FACE="Helvetica Bold" COLOR="white" + >Attendance</FONT></TD></TR> + + + </TABLE> + >] + + infopoint_agenda_models_Billboard [label=< + <TABLE BGCOLOR="palegoldenrod" BORDER="0" CELLBORDER="0" CELLSPACING="0"> + <TR><TD COLSPAN="2" CELLPADDING="4" ALIGN="CENTER" BGCOLOR="olivedrab4" + ><FONT FACE="Helvetica Bold" COLOR="white" + >Billboard</FONT></TD></TR> + + + </TABLE> + >] + + + +} + + + + +subgraph cluster_django_contrib_sites_models { + label=< + <TABLE BORDER="0" CELLBORDER="0" CELLSPACING="0"> + <TR><TD COLSPAN="2" CELLPADDING="4" ALIGN="CENTER" + ><FONT FACE="Helvetica Bold" COLOR="Black" POINT-SIZE="12" + >django.contrib.sites</FONT></TD></TR> + </TABLE> + > + color=olivedrab4 + style="rounded" + + + + django_contrib_sites_models_Site [label=< + <TABLE BGCOLOR="palegoldenrod" BORDER="0" CELLBORDER="0" CELLSPACING="0"> + <TR><TD COLSPAN="2" CELLPADDING="4" ALIGN="CENTER" BGCOLOR="olivedrab4" + ><FONT FACE="Helvetica Bold" COLOR="white" + >Site</FONT></TD></TR> + + + </TABLE> + >] + + + +} + + + + + + + infopoint_agenda_models_Location -> infopoint_agenda_models_Location + [label="is_in"] ; + + + + + infopoint_agenda_models_Event -> infopoint_agenda_models_Location + [label="location"] ; + + + infopoint_agenda_models_Event -> django_contrib_sites_models_Site + [label="site"] [arrowhead=normal arrowtail=normal]; + + + User [label=< + <TABLE BGCOLOR="palegoldenrod" BORDER="0" CELLBORDER="0" CELLSPACING="0"> + <TR><TD COLSPAN="2" CELLPADDING="4" ALIGN="CENTER" BGCOLOR="olivedrab4" + ><FONT FACE="Helvetica Bold" COLOR="white" + >User</FONT></TD></TR> + </TABLE> + >] + + infopoint_agenda_models_Event -> django_contrib_auth_models_User + [label="pixie"] [arrowhead=normal arrowtail=normal]; + + + Group [label=< + <TABLE BGCOLOR="palegoldenrod" BORDER="0" CELLBORDER="0" CELLSPACING="0"> + <TR><TD COLSPAN="2" CELLPADDING="4" ALIGN="CENTER" BGCOLOR="olivedrab4" + ><FONT FACE="Helvetica Bold" COLOR="white" + >Group</FONT></TD></TR> + </TABLE> + >] + + infopoint_agenda_models_Event -> django_contrib_auth_models_Group + [label="redes"] [arrowhead=normal arrowtail=normal]; + + + User [label=< + <TABLE BGCOLOR="palegoldenrod" BORDER="0" CELLBORDER="0" CELLSPACING="0"> + <TR><TD COLSPAN="2" CELLPADDING="4" ALIGN="CENTER" BGCOLOR="olivedrab4" + ><FONT FACE="Helvetica Bold" COLOR="white" + >User</FONT></TD></TR> + </TABLE> + >] + + infopoint_agenda_models_Event -> django_contrib_auth_models_User + [label="atendees"] [arrowhead=normal arrowtail=normal]; + + + + + infopoint_agenda_models_Network -> infopoint_agenda_models_Event + [label="event"] ; + + + Group [label=< + <TABLE BGCOLOR="palegoldenrod" BORDER="0" CELLBORDER="0" CELLSPACING="0"> + <TR><TD COLSPAN="2" CELLPADDING="4" ALIGN="CENTER" BGCOLOR="olivedrab4" + ><FONT FACE="Helvetica Bold" COLOR="white" + >Group</FONT></TD></TR> + </TABLE> + >] + + infopoint_agenda_models_Network -> django_contrib_auth_models_Group + [label="group"] ; + + + User [label=< + <TABLE BGCOLOR="palegoldenrod" BORDER="0" CELLBORDER="0" CELLSPACING="0"> + <TR><TD COLSPAN="2" CELLPADDING="4" ALIGN="CENTER" BGCOLOR="olivedrab4" + ><FONT FACE="Helvetica Bold" COLOR="white" + >User</FONT></TD></TR> + </TABLE> + >] + + infopoint_agenda_models_Network -> django_contrib_auth_models_User + [label="creator"] ; + + + + + User [label=< + <TABLE BGCOLOR="palegoldenrod" BORDER="0" CELLBORDER="0" CELLSPACING="0"> + <TR><TD COLSPAN="2" CELLPADDING="4" ALIGN="CENTER" BGCOLOR="olivedrab4" + ><FONT FACE="Helvetica Bold" COLOR="white" + >User</FONT></TD></TR> + </TABLE> + >] + + infopoint_agenda_models_Todo -> django_contrib_auth_models_User + [label="creator"] ; + + + Group [label=< + <TABLE BGCOLOR="palegoldenrod" BORDER="0" CELLBORDER="0" CELLSPACING="0"> + <TR><TD COLSPAN="2" CELLPADDING="4" ALIGN="CENTER" BGCOLOR="olivedrab4" + ><FONT FACE="Helvetica Bold" COLOR="white" + >Group</FONT></TD></TR> + </TABLE> + >] + + infopoint_agenda_models_Todo -> django_contrib_auth_models_Group + [label="network"] [arrowhead=normal arrowtail=normal]; + + + infopoint_agenda_models_Todo -> infopoint_agenda_models_Event + [label="event"] [arrowhead=normal arrowtail=normal]; + + + infopoint_agenda_models_Todo -> infopoint_agenda_models_Location + [label="location"] [arrowhead=normal arrowtail=normal]; + + + + + User [label=< + <TABLE BGCOLOR="palegoldenrod" BORDER="0" CELLBORDER="0" CELLSPACING="0"> + <TR><TD COLSPAN="2" CELLPADDING="4" ALIGN="CENTER" BGCOLOR="olivedrab4" + ><FONT FACE="Helvetica Bold" COLOR="white" + >User</FONT></TD></TR> + </TABLE> + >] + + infopoint_agenda_models_Attendance -> django_contrib_auth_models_User + [label="person"] ; + + + infopoint_agenda_models_Attendance -> infopoint_agenda_models_Event + [label="event"] ; + + + + + Group [label=< + <TABLE BGCOLOR="palegoldenrod" BORDER="0" CELLBORDER="0" CELLSPACING="0"> + <TR><TD COLSPAN="2" CELLPADDING="4" ALIGN="CENTER" BGCOLOR="olivedrab4" + ><FONT FACE="Helvetica Bold" COLOR="white" + >Group</FONT></TD></TR> + </TABLE> + >] + + infopoint_agenda_models_Billboard -> django_contrib_auth_models_Group + [label="groups"] [arrowhead=normal arrowtail=normal]; + + + infopoint_agenda_models_Billboard -> infopoint_agenda_models_Location + [label="location"] [arrowhead=normal arrowtail=normal]; + + + + + + + + + +} + @@ -0,0 +1,93 @@ +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, 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.sites.models import * +from infopoint.agenda.models import * +from infopoint.flatpages.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 * + +admin.autodiscover() + +info_dict = { + 'queryset': Site.objects.all(), +} + +update = { + 'login_required': True, + 'model': 'location', + +} + + +urlpatterns = patterns('', +# Uncomment the next line to enable admin documentation: + (r'^group/(?P<object_id>\d+)/$', 'infopoint.agenda.views.justonegroup'), + (r'^group/(?P<object_id>\d+)/todo/(?P<todo_id>\d+)/close/$', 'infopoint.agenda.views.closegrouptodo'), + (r'^group/(?P<object_id>\d+)/todo/add/$', 'infopoint.agenda.views.savegrouptodo'), + (r'^agenda/group/(?P<object_id>\d+)/todo/add/$', 'infopoint.agenda.views.savegrouptodo'), + (r'^agenda/(?P<object_id>\d+)/(?P<billboard_id>\d+)$', 'infopoint.agenda.billboardviews.one_still_event'), + (r'^agenda/random/(?P<billboard_id>\d+)$', 'infopoint.agenda.billboardviews.billboard'), + (r'^agenda/(?P<object_id>\d+)/map/$', 'infopoint.agenda.billboardviews.event_galaxy'), + (r'^agenda/(?P<object_id>\d+)/cal/$', 'infopoint.agenda.views.ical_one_event'), + (r'^agenda/user/(?P<object_id>\d+)/cal/$', 'infopoint.agenda.views.ical_user_events'), + (r'^agenda/user/(?P<object_id>\d+)/busy/$', 'infopoint.agenda.views.ical_user_busytime'), + (r'^agenda/user/(?P<object_id>\d+)/map/$', 'infopoint.agenda.billboardviews.user_galaxymap'), + (r'^agenda/location/(?P<object_id>\d+)/map/$', 'infopoint.agenda.billboardviews.location_galaxymap'), + (r'^agenda/group/(?P<object_id>\d+)/map/$', 'infopoint.agenda.billboardviews.group_galaxymap'), + (r'^agenda/group/(?P<object_id>\d+)/$', 'infopoint.agenda.views.justonegroup'), + (r'^agenda/next_events_cal/$', 'infopoint.agenda.views.ical_next_events'), + (r'^agenda/me/$', 'infopoint.agenda.views.mismensajes'), + (r'^todo/add/$', 'infopoint.agenda.views.addtodo'), + (r'^agenda/(?P<event_id>\d+)/todo/(?P<todo_id>\d+)/close/$','infopoint.agenda.views.closetodo'), + (r'^agenda/(?P<event_id>\d+)/todo/submit/$','infopoint.agenda.views.saveeventtodo'), + (r'^agenda/(?P<event_id>\d+)/group/add/$','infopoint.agenda.views.addeventtogroupsave'), + #(r'^todo/create/$',TodoCreateForm(TodoForm)), + (r'^admin/doc/', include('django.contrib.admindocs.urls')), + (r'^comments/', include('django.contrib.comments.urls.comments')), + (r'^comment/(?P<object_id>\d+)/$', 'infopoint.agenda.views.one_comment'), + (r'^user/login/$', 'django.contrib.auth.views.login'), +# Uncomment the next line for to enable the admin: + (r'^admin/(.*)', admin.site.root), + (r'^$', 'django.views.generic.list_detail.object_list', info_dict), + (r'^site/', include('infopoint.sites.urls')), + (r'^calendar/', include('infopoint.agenda.urls')), + (r'^databrowse/(.*)', login_required(databrowse.site.root)), + (r'^test/(.*)', login_required(databrowse.site.root)), + # (r'^comments/post/$', CommentFormPreview(CommentForm)), + #(r'^tasks/add/$', (CommentForm)), +) + +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'^random/$', 'random'), +) |