Added my talks list page.
authorMadhusudan.C.S <madhusudancs@gmail.com>
Mon, 23 Nov 2009 12:01:22 +0530
changeset 40 c8414e2b34ce
parent 39 a09d54338547
child 41 cf02d105aea2
Added my talks list page.
project/kiwipycon/talk/views.py
project/static/css/styles.css
project/templates/_menu.html
project/urls.py
--- a/project/kiwipycon/talk/views.py	Wed Nov 18 15:52:42 2009 +0530
+++ b/project/kiwipycon/talk/views.py	Mon Nov 23 12:01:22 2009 +0530
@@ -182,3 +182,14 @@
         'login_form' : login_form
     }))
 
+@login_required
+def list_talks(request, id, template_name='talk/list-talks.html'):
+    '''List all the tasks submitted by a user.
+    '''
+
+    speaker = User.objects.get(pk=id)
+    talks = Talk.objects.filter(speaker=speaker)
+
+    return render_to_response(template_name, RequestContext(request, {
+        'talk_list': talks,
+    }))
--- a/project/static/css/styles.css	Wed Nov 18 15:52:42 2009 +0530
+++ b/project/static/css/styles.css	Mon Nov 23 12:01:22 2009 +0530
@@ -126,6 +126,32 @@
     vertical-align: top;
 }
 
+/* list my talks table layout */
+table.list-talks
+{
+    border: 1px solid #ddd;
+    font-size: 1.1em;
+}
+
+table.list-talks td
+{
+	  border: 1px solid #ddd;
+    padding: 5px 15px;
+}
+
+table.list-talks th
+{
+	  border: 1px solid #ddd;
+    font-weight: bold;
+    align: center;
+    padding: 5px 15px;
+}
+
+table.list-talks a
+{
+    text-decoration: none;
+}
+
 .important
 {
     color: #337799;
@@ -307,7 +333,7 @@
 {
 	  font-weight: bold;
 	  font-family: Verdana, Arial, "Bitstream Vera Sans", Helvetica, sans-serif;
-    font-size: 1.3em;
+    font-size: 1em;
     padding-bottom: 15px;
 }
 /* forms */
--- a/project/templates/_menu.html	Wed Nov 18 15:52:42 2009 +0530
+++ b/project/templates/_menu.html	Mon Nov 23 12:01:22 2009 +0530
@@ -7,7 +7,10 @@
       <ul>
         <li><a href="/talks-cfp/schedule/">Conference Schedule</a></li>
         <li><a href="/talks-cfp/speakers/">Speakers</a></li>
-        <li><a href="/talks/">Talks</a></li>
+        {% if user.is_authenticated %}
+          <li><a href="/talks-cfp/list-talks/{{ user.id }}">My talks</a></li>
+        {% endif %}
+        <li><a href="/talks/">Scheduled talks</a></li>
       </ul>
     </li>
     <li>
--- a/project/urls.py	Wed Nov 18 15:52:42 2009 +0530
+++ b/project/urls.py	Mon Nov 23 12:01:22 2009 +0530
@@ -18,9 +18,7 @@
 # Blog & Admin
 urlpatterns = patterns(
     '',
-    url(r'^$', 
-        direct_to_template, {"template": "home.html"},
-        name='home'),
+    url(r'^$',  direct_to_template, {"template": "home.html"}, name='home'),
     (r'^feeds/(?P<url>.*)/$', 'django.contrib.syndication.views.feed', {'feed_dict': feeds}),
     (r'^comments/', include('django.contrib.comments.urls')),
     (r'^admin/(.*)', admin.site.root),
@@ -32,6 +30,8 @@
     url(r'^talks/talk/(?P<id>\d+)/$',  'talk', name='talk_detail'),
     url(r'^submit-talk/$',  'submit_talk', name='kiwipycon_submit_talk'),
     url(r'^edit-talk/(?P<id>\d+)/$',  'edit_talk', name='kiwipycon_edit_talk'),
+    url(r'^talks-cfp/list-talks/(?P<id>\d+)/$',  'list_talks',
+        name='kiwipycon_list_talk'),
     )
 
 # Registration