Add a list of organisatoins, and link this one from the accounts page
authorMagnus Hagander <magnus@hagander.net>
Thu, 18 Aug 2011 08:01:39 +0000 (10:01 +0200)
committerMagnus Hagander <magnus@hagander.net>
Thu, 18 Aug 2011 08:01:39 +0000 (10:01 +0200)
pgweb/account/urls.py
pgweb/account/views.py
templates/account/index.html
templates/account/orglist.html [new file with mode: 0644]

index fc1fd33f44542d870f31b486d388a8fe9c6522b2..a3129915b12d43597b006843a7c68c0e76ca9bc7 100644 (file)
@@ -15,6 +15,9 @@ urlpatterns = patterns('',
     (r'^organisations/(.*)/$', 'core.views.organisationform'),
     (r'^products/(.*)/$', 'downloads.views.productform'),
 
+    # Organisation information
+       (r'^orglist/$', 'account.views.orglist'),
+
     # Docs comments
     (r'^comments/(new)/(.*)/(.*)/$', 'docs.views.commentform'),
 
index 1713842a597d29ea993f136ee402355438f19d47..27f8630d125e1e26a4924d5652c8e24da19634d9 100644 (file)
@@ -65,6 +65,15 @@ def listobjects(request, objtype):
                'suburl': objtype,
        }, NavContext(request, 'account'))
 
+@ssl_required
+@login_required
+def orglist(request):
+       orgs = Organisation.objects.filter(approved=True)
+
+       return render_to_response('account/orglist.html', {
+                       'orgs': orgs,
+       }, NavContext(request, 'account'))
+
 @ssl_required
 def login(request):
        return authviews.login(request, template_name='account/login.html')
index d7ad20b21ddd658475e0af07ab445e3c91b9bfd6..acba8cb7fb1e52e2c4dc08eb17288fdbd626926e 100644 (file)
@@ -20,7 +20,8 @@ News, Events, Products and Professional Services are attached to an
 Organisation. One or more persons can be given permissions to manage
 the data for an organisation. If you do not have permissions for an
 organisation and think you should have, you need to contact the current
-managers for that organisation.
+managers for that organisation. You can find a list of organisations
+and managers <a href="orglist/">here</a>.
 </p>
 
 <h2>Migrated data</h2>
diff --git a/templates/account/orglist.html b/templates/account/orglist.html
new file mode 100644 (file)
index 0000000..5ff750a
--- /dev/null
@@ -0,0 +1,21 @@
+{%extends "base/page.html"%}
+{%block title%}Organisatoins{%endblock%}
+{%block contents%}
+<h1>Organisations</h1>
+<p>
+The following organisations are registered in our database:
+</p>
+<table>
+ <tr>
+  <th>Organisation</th>
+  <th>Manager</th>
+ </tr>
+{%for o in orgs%}
+ <tr>
+  <td>{{o.name}}</td>
+  <td>{%for m in o.managers.all%}{{m.first_name}} {{m.last_name}}{%if not forloop.last%}<br/>{%endif%}{%endfor%}</td>
+ </tr>
+{%endfor%}
+</table>
+{%endblock%}
+