Skip to content
Browse files

Remove testing stub, add fixes for CC

  • Loading branch information...
1 parent 8b5267c commit 99da473ab12c7b28cf90495111717d139acef203 @dustball committed May 9, 2012
Showing with 63 additions and 3 deletions.
  1. +16 −0 main.py
  2. +2 −2 static/signin.js
  3. +44 −0 templates/donations.html
  4. +1 −1 templates/main.html
View
16 main.py
@@ -167,6 +167,10 @@ def signin(cls, email, type):
s = Signin(email=email, type=type, image_url=image, name=name)
DailyCount.increment_and_get()
s.put()
+ if "mark.hutsell" in email or "some.other.evilguy" in email:
+ mail.send_mail(sender="Signin Machine <signin@hackerdojo.com>", to="Emergency Paging System <page@hackerdojo.com>",
+ subject="Sign-in: " + email, body="Sign in")
+ urlfetch.fetch("http://www.dustball.com/call/call.php?str=Sign+in+"+email)
return s
# Unlike the signin log, this table is one row per e-mail address.
@@ -341,6 +345,17 @@ class StatHandler(webapp.RequestHandler):
def get(self):
self.response.out.write(template.render('templates/stats.html', locals()))
+# Used by /report/donations
+class DonationReportHandler(webapp.RequestHandler):
+ def get(self):
+ donations = Donation.all().order("-amount")
+ total = 0
+ for d in donations:
+ if d.status_code == 1 and int(d.transaction_id) > 0:
+ total += d.amount
+ self.response.out.write(template.render('templates/donations.html', locals()))
+
+
# Used by /stats/*
class StatsHandler(webapp.RequestHandler):
def get(self,format):
@@ -455,6 +470,7 @@ def main():
('/', MainHandler),
(r'^/_ah/mail/there.*', MailHandler),
('/eventmode', EventModeHandler),
+ ('/report/donations', DonationReportHandler),
('/ministaff', MiniStaffHandler),
('/signin', SigninHandler),
('/staff', StaffHandler),
View
4 static/signin.js
@@ -90,14 +90,14 @@ function stopRKey(evt) {
raw = $("input[name=email]").val();
- if (m = raw.match(/^;([0-9]{16})=([0-9]{2})([0-9]{2})[0-9]{11}\?/)) {
+ if (m = raw.match(/^;([0-9]{14,16})=([0-9]{2})([0-9]{2})[0-9]{11}\?/)) {
var month = m[3];
var year = m[2];
var cc = m[1];
charge(cc,month,year,"","");
return;
}
- if (m = raw.match(/^%B([0-9]{16})\^(.+)\/(.+)\^([0-9]{2})([0-9]{2}).+\?/)) {
+ if (m = raw.match(/^%B([0-9]{14,16})\^(.+)\/(.*)\^([0-9]{2})([0-9]{2}).+\?/)) {
var month = m[5];
var year = m[4];
var first = m[3];
View
44 templates/donations.html
@@ -0,0 +1,44 @@
+<html>
+<head>
+ <link rel="stylesheet" type="text/css" href="/static/kiosk.css" />
+ <title>Donation log</title>
+</head>
+<body>
+
+<h1>Donations Log</h1>
+
+<style>
+td {padding:6px 12px; font-size:18px}
+tr.even td {
+ background-color: #eee;
+}
+tr.odd td {
+ background-color: #fff;
+}
+.ago {
+ color:#999;
+}
+.picheight {
+ height:28px;
+}
+</style>
+
+<table cellspacing="0" cellpadding="0" border="0" align="center" >
+{% for d in donations %}
+ {% ifnotequal d.transaction_id "0" %}
+ <tr class="{% cycle even,odd %}">
+ <td>&nbsp;</td>
+ <td><div class="type">{{ d.name }}</div></td>
+ <td><div class="type">{{ d.amount }}</div></td>
+ <td><div class="type">{{ d.status }}</div></td>
+ <td><div class="type">{{ d.transaction_id }}</div></td>
+ </tr>
+ {% endifnotequal %}
+{% endfor %}
+</table>
+
+
+<h4>Total of non-test & approved txns: {{total}}</h4>
+
+</body>
+</html>
View
2 templates/main.html
@@ -4,7 +4,7 @@
<title>Sign in</title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="/static/md5.js"></script>
- <script type="text/javascript" src="/static/signin.js?v=8"></script>
+ <script type="text/javascript" src="/static/signin.js?v=9"></script>
<link rel="stylesheet" type="text/css" href="/static/signin.css" />
</head>
<body id="body">

0 comments on commit 99da473

Please sign in to comment.
Something went wrong with that request. Please try again.