tidying some stuff up, added elections page
authorJacob Parker <j3parker@csclub.uwaterloo.ca>
Thu, 23 Feb 2012 05:21:50 +0000 (00:21 -0500)
committerJacob Parker <j3parker@csclub.uwaterloo.ca>
Thu, 23 Feb 2012 05:21:50 +0000 (00:21 -0500)
bin/exec_positions.py [new file with mode: 0755]
bin/member_info.py
bin/members.py
src/config.d
src/web.d
srv/About/Constitution/index.md

diff --git a/bin/exec_positions.py b/bin/exec_positions.py
new file mode 100755 (executable)
index 0000000..2c7489b
--- /dev/null
@@ -0,0 +1,47 @@
+#!/usr/bin/python
+import ldap, time, operator
+
+#
+# globals
+#
+cscUri = "http://csclub.uwaterloo.ca/xsltproc"
+cscTerms = ["Winter", "Spring", "Fall"]
+cscShortTerms = ['w', 's', 'f']
+cscLdapUri = "ldap://ldap1.csclub.uwaterloo.ca ldap://ldap2.csclub.uwaterloo.ca"
+cscLdap = None
+cscPeopleBase = 'ou=People,dc=csclub,dc=uwaterloo,dc=ca'
+
+def cscLdapConnect():
+    global cscLdap
+    cscLdap = ldap.initialize(cscLdapUri)
+    cscLdap.simple_bind_s("", "")
+
+cscLdapConnect()
+
+def showExec(pretty, short):
+    print "<p><b>" + pretty + "</b><br>"
+    members = cscLdap.search_s(cscPeopleBase, ldap.SCOPE_SUBTREE,
+             '(&(objectClass=member)(position=%s))' % short)
+    if len(members) > 0:
+      (_, user) = members[0]
+      print user['cn'][0]
+    else:
+      print 'Seat Empty'
+    print "</p>"
+
+print "<h1>The Executive</h1>"
+showExec("President", "president")
+showExec("Vice-President", "vice-president")
+showExec("Treasurer", "treasurer")
+showExec("Secretary", "secretary")
+showExec("Systems Administrator", "sysadmin")
+
+print "<h1>Other Positions</h1>"
+showExec("Chief Returning Officer", "cro")
+showExec("Office Manager", "offsck")
+showExec("Librarian", "librarian")
+
+print "<h1>Elections</h1>"
+print "<p>Each term the CSC holds elections to determine the executive council. To find out when and where the next elections will be held, check the homepage and the <a href=\"http://csclub.uwaterloo.ca/newsgroup/thread.php?group=uw.csc\">uw.csc</a> newsgroup.<br>"
+print "</p><p>For details on the election rules, see the <a href=\"../Constitution\">constitution</a>."
+print "</p>"
index 72e8274..f285648 100755 (executable)
@@ -28,6 +28,11 @@ print "<h1>Profile for " + user['cn'][0] + "</h1>"
 
 print "<p>"
 print "<ul>"
+if "position" in user:
+    print "<li>Executive Position: "
+    for x in user['position']:
+        print x # edge case - could hold multiple positions!
+    print "</li>"
 print "<li>Terms: "
 for t in sorted(user['term']):
     print t + " "
index 7dec816..5b949a3 100755 (executable)
@@ -24,6 +24,7 @@ term2 = cscTerms[int(time.localtime().tm_mon - 1) / 4]
 members = cscLdap.search_s(cscPeopleBase, ldap.SCOPE_SUBTREE,
           '(&(objectClass=member)(term=%s%d))' % (term, year))
 members.sort(key=lambda (_, y): y['cn'][0])
+print "<h1>Members This Term</h1>"
 print "<p>The members for " + term2 + " " + str(year) + " are listed here. We currently have " + str(len(members)) + " members.<br>"
 print "Use of this list for solicitation of any form is prohibited. If you wish to get in touch with the membership as a whole please contact <a href=\"mailto:exec@csclub.uwaterloo.ca\">the Executive</a>.</p>"
 print "<center>"
index 92d331a..348caa1 100644 (file)
@@ -14,4 +14,5 @@ void init_handlers() {
   handlers["changelog"] = "changelog.sh";
   handlers["About/Members/"] = "members.py";
   handlers["About/Members/?*"] = "member_info.py";
+  handlers["About/Executive/"] = "exec_positions.py";
 }
index e94b520..044704e 100755 (executable)
--- a/src/web.d
+++ b/src/web.d
@@ -71,7 +71,9 @@ void do_header() {
   html("<a href=\"http://git.csclub.uwaterloo.ca/\">git</a>");
   html("<a href=\"http://mirror.csclub.uwaterloo.ca/\">mirror</a>");
   html("<a href=\"http://csclub.uwaterloo.ca/stats\">stats</a>");
-  html("<a href=\"http://mail.csclub.uwaterloo.ca/\">mail</a>");
+  html("<a href=\"http://mail.csclub.uwaterloo.ca/\">webmail</a>");
+  html("<a href=\"http://csclub.uwaterloo.ca/newsgroup/\">newsgroups</a>");
+  html("<a href=\"http://csclub.uwaterloo.ca/mailman/\">mailing lists</a>");
   html_pop("</div>"); 
   
   html_push("<div class=\"right\">");
index a6c011d..f00acd2 100644 (file)
@@ -1,4 +1,4 @@
-<h2>1. </h2>
+<h2>1. Name</h2>
 The name of this organization shall be the "Computer Science Club
 of the University of Waterloo".