community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgard...@apache.org
Subject svn commit: r1693181 - in /comdev/tools/events_list: templates/people/index.html templates/people/view.html urls.py views.py
Date Wed, 29 Jul 2015 06:02:01 GMT
Author: rgardler
Date: Wed Jul 29 06:02:00 2015
New Revision: 1693181

URL: http://svn.apache.org/r1693181
Log:
Add a basic person view

Added:
    comdev/tools/events_list/templates/people/view.html
Modified:
    comdev/tools/events_list/templates/people/index.html
    comdev/tools/events_list/urls.py
    comdev/tools/events_list/views.py

Modified: comdev/tools/events_list/templates/people/index.html
URL: http://svn.apache.org/viewvc/comdev/tools/events_list/templates/people/index.html?rev=1693181&r1=1693180&r2=1693181&view=diff
==============================================================================
--- comdev/tools/events_list/templates/people/index.html (original)
+++ comdev/tools/events_list/templates/people/index.html Wed Jul 29 06:02:00 2015
@@ -28,7 +28,7 @@
       <tbody>
 	{% for person in person_list %}
 	<tr>
-	  <td>{{ person.name }}</td>
+	  <td><a href="{% url 'viewPerson' person.id %}">{{ person.name }}</a></td>
 	  <td>{{ person.city }}</td>
 	  <td>{{ person.state }}</td>
 	  <td>{{ person.country }}</td>

Added: comdev/tools/events_list/templates/people/view.html
URL: http://svn.apache.org/viewvc/comdev/tools/events_list/templates/people/view.html?rev=1693181&view=auto
==============================================================================
--- comdev/tools/events_list/templates/people/view.html (added)
+++ comdev/tools/events_list/templates/people/view.html Wed Jul 29 06:02:00 2015
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+<head>
+  <title>{{ person.name }}</title>
+</head>
+<body>
+  <h1>{{ person.name }}</h1>
+  <p>{{ person.city }}, {{ person.state }}, {{ person.country }}</p>
+
+  <p>
+  <a href="{{ person.url }}">Source</a>
+  </p>  
+
+  <p>Last Active: {{ person.lastVisit }}</p>
+</body>
+</html>

Modified: comdev/tools/events_list/urls.py
URL: http://svn.apache.org/viewvc/comdev/tools/events_list/urls.py?rev=1693181&r1=1693180&r2=1693181&view=diff
==============================================================================
--- comdev/tools/events_list/urls.py (original)
+++ comdev/tools/events_list/urls.py Wed Jul 29 06:02:00 2015
@@ -13,4 +13,5 @@ urlpatterns = [
     url(r'^groups/(?P<group_id>[0-9]+)/importMembers/$', views.importMembers, name='importMembers'),
 
     url(r'^people$', views.personIndex, name='personIndex'),
+    url(r'^people/(?P<person_id>[0-9]+)/$', views.viewPerson, name='viewPerson'),
 ]

Modified: comdev/tools/events_list/views.py
URL: http://svn.apache.org/viewvc/comdev/tools/events_list/views.py?rev=1693181&r1=1693180&r2=1693181&view=diff
==============================================================================
--- comdev/tools/events_list/views.py (original)
+++ comdev/tools/events_list/views.py Wed Jul 29 06:02:00 2015
@@ -97,6 +97,16 @@ def personIndex(request):
     })
     return HttpResponse(template.render(context))    
 
+def viewPerson(request, person_id):
+    person = get_object_or_404(Person, pk = person_id)
+
+    template = loader.get_template('people/view.html')
+    context = RequestContext(request, {
+                             'person': person
+    })
+    return HttpResponse(template.render(context))
+
+
 def _canImport():
     if settings.DEBUG:
         td = timedelta(microseconds = 1)



Mime
View raw message