Changeset - 13bc9ffacb95
[Not reviewed]
0 2 1
Luke Hatcher - 12 years ago 2012-08-31 05:52:45
lukeman@gmail.com
add schedule list
3 files changed with 29 insertions and 1 deletions:
0 comments (0 inline, 0 general)
symposion/schedule/urls.py
Show inline comments
...
 
@@ -4,7 +4,8 @@ from django.conf.urls.defaults import url, patterns
 
urlpatterns = patterns("symposion.schedule.views",
 
    url(r"^$", "schedule_detail", name="schedule_detail_singleton"),
 
    url(r"^edit/$", "schedule_edit", name="schedule_edit_singleton"),
 
    url(r"^(\w+)/edit/$", "schedule_detail", name="schedule_detail"),
 
    url(r"^(\w+)/edit/$", "schedule_edit", name="schedule_edit"),
 
    url(r"^edit/slot/(?P<slot_pk>\d+)/", "schedule_slot_edit", name="schedule_slot_edit"),
 
    url(r"^list/$", "schedule_list", name="schedule_list"),
 
)
symposion/schedule/views.py
Show inline comments
 
from django.http import Http404
 
from django.shortcuts import render, get_object_or_404, redirect
 

	
 
from django.contrib.auth.decorators import login_required
 

	
 
from symposion.schedule.forms import SlotEditForm
 
from symposion.schedule.models import Schedule, Day, Slot
 
from symposion.schedule.models import Schedule, Day, Slot, Presentation
 
from symposion.schedule.timetable import TimeTable
 

	
 

	
 
def schedule_detail(request, slug=None):
 
    qs = Schedule.objects.all()
 
    
...
 
@@ -21,12 +21,20 @@ def schedule_detail(request, slug=None):
 
    ctx = {
 
        "schedule": schedule,
 
    }
 
    return render(request, "schedule/schedule_detail.html", ctx)
 

	
 

	
 
def schedule_list(request):
 
    presentations = Presentation.objects.order_by("id")
 
    ctx = {
 
        "presentations": presentations,
 
    }
 
    return render(request, "schedule/schedule_list.html", ctx)
 

	
 

	
 
@login_required
 
def schedule_edit(request, slug=None):
 
    
 
    if not request.user.is_staff:
 
        raise Http404()
 
    
symposion/templates/schedule/schedule_list.html
Show inline comments
 
new file 100644
 
{% extends "site_base.html" %}
 

	
 
{% load i18n %}
 

	
 
{% block head_title %}Presentation Listing{% endblock %}
 

	
 
{% block body %}
 
    {% for presentation in presentations %}
 
        <div class="row">
 
            <div class="span8 well">
 
                <h3>{{ presentation.title }}</h3>
 
                <h4>{{ presentation.speaker }} in {{ presentation.proposal.track }}</h4>
 
                <p>
 
                    {{ presentation.description }}
 
                </p>
 
            </div>
 
        </div>
 
    {% endfor %}
 
{% endblock %}
0 comments (0 inline, 0 general)