Permalink
Browse files

pull in the rules live and memcache them for 1 day on new and confirm…

… actions
  • Loading branch information...
1 parent a62c108 commit cb7a9d14cfd290f69f3aeb10c17b4b3d486e4fae jonathan committed Mar 2, 2011
Showing with 14 additions and 43 deletions.
  1. +8 −0 main.py
  2. +5 −20 templates/confirmation.html
  3. +1 −23 templates/new.html
View
8 main.py
@@ -376,6 +376,10 @@ def get(self):
else:
login_url = users.create_login_url('/')
rooms = ROOM_OPTIONS
+ rules = memcache.get("rules")
+ if(rules is None):
+ rules = urlfetch.fetch("http://wiki.hackerdojo.com/api_v2/op/GetPage/page/Event+Rules+Summary/_type/html", "GET").content
+ memcache.add("rules", rules, 86400)
self.response.out.write(template.render('templates/new.html', locals()))
@@ -444,6 +448,10 @@ def post(self):
class ConfirmationHandler(webapp.RequestHandler):
def get(self, id):
event = Event.get_by_id(int(id))
+ rules = memcache.get("rules")
+ if(rules is None):
+ rules = urlfetch.fetch("http://wiki.hackerdojo.com/api_v2/op/GetPage/page/Event+Rules+Summary/_type/html", "GET").content
+ memcache.add("rules", rules, 86400)
self.response.out.write(template.render('templates/confirmation.html', locals()))
class LogsHandler(webapp.RequestHandler):
View
25 templates/confirmation.html
@@ -3,35 +3,20 @@
<div id="primary">
-<h3>Thanks for registering an event at Hacker Dojo!</h3>
+<h1>Application Successful</h1>
+
+<h2>Thanks for registering an event at Hacker Dojo!</h2>
<p>Remember, your event has to be approved before becoming active.
Please contact <a href="mailto:events@hackerdojo.com">events@hackerdojo.com</a> if it has been over 48 hours with no response.</p>
-<h1>{{event.name}}</h1>
+<h3>{{event.name}}</h3>
<div class='b-block'><div class='b-label'>Date:</div><div class='b-data'>{{event.start_time|date:"l, F j Y"}}</div></div>
<div class='b-block'><div class='b-label'>Time:</div><div class='b-data'>{{event.start_time|date:"g:iA"|lower}} to {{event.end_time|date:"g:iA"|lower}}</div></div>
<div class='b-block'><div class='b-label'>Rooms:</div><div class='b-data'>{{event.roomlist}}</div></div>
-<h4>Responsibilities of a Member Who Would Like to Host an Event</h4>
-<p>Failure to follow these rules may result in the event no longer being welcome at the dojo and/or suspension of the host's rights to host events.</p>
-
-<ul>
-<li>Schedule - Dojo resources are allocated on a first come, first serve basis</li>
-<li>Presence - Your member host or one of your host's delegates must be physically present to host the entire event. Delegates must also be members of Hacker Dojo, and must be arranged prior to the event's submission. Your member host takes full responsibility for ensuring the event runs smoothly and the rules are enforced.</li>
-<li>Cancelation - If the event is cancelled, your event host is responsible for cancelling the event on this system and posting notice to all forums in which you advertised the event. If your event host is submitting this application on behalf of someone else, we will still hold the event host responsible.</li>
-<li>Approval - The event must be approved by Event Coordinators. We reserve the right to refuse approval of events that are not considered in the spirit of Hacker Dojo.</li>
-<li>Setup - You are responsible for your event setup. This may require setting up a day early (or at least an hour or two early!), finding projectors, moving furniture, etc. - In order to prepare you may book a separate event for the same space, just create a new event and select Setup Time as the event type.</li>
-<li>Parking - We have strict parking rules that you need to convey to guests. If your event is large enough, you may need a staff member to direct parking.</li>
-<li>Sign-in - We require your guests to sign in with our sign-in kiosks for liability reasons. This information also helps support the Dojo by giving insight into member conversions from your event.</li>
-<li>Blurb - You or another member should give an introduction to Hacker Dojo before the event starts. This may include mentioning Hacker Dojo sponsors but shouldn't be longer than a couple minutes.</li>
-<li>Cleanup - Please clean up after your event! Return it to the way you found it at the very least. Consider getting guests to pitch in. Excess trash which does not fit in the dumpster must be hauled away.</li>
-<li>Supplies - Please refill supplies consumed. If you have a large event, your guests will consume shared resources such as snacks, toilet paper and other consumables.</li>
-<li>Damages - You are held responsible for damages to Dojo facilities and equipment during your event.</li>
-</ul>
-
-<p>Please print this page for your records.</p>
+<div id="rules">{{rules}}</div>
</div>
View
24 templates/new.html
@@ -9,29 +9,7 @@
<div style="margin:4px; margin-bottom:1.5em; padding:8px; color: black; display:none; border:1px solid red; background:#fee; " id="error"></div>
<div style="width: 46%; float: right; font-size: smaller; padding: 8px; -moz-border-radius: 8px; -webkit-border-radius: 8px; background: #eee; line-height: normal;" id="terms">
- <h3 style="margin-top: 0px;">Member Terms as Event Host:</h3>
- <ol>
- <li><strong>Schedule</strong>
- <div>Dojo resources are allocated on a first come, first serve basis. Avoid scheduling major events on the same day. Otherwise, expect an Events Coordinator to suggest an alternate time or room.</div></li>
- <li><strong>Presence</strong>
- <div>{{human}} or one of your delegates must be physically present to host the entire event. Delegates must also be members of Hacker Dojo, and must be arranged prior to the event's submission. As event host, you take full responsibility for ensuring the event runs smoothly and the rules are enforced. If the event is cancelled, you are responsible for cancelling the event on this system and posting notice to all forums in which you advertised the event. <p>If you are submitting this application on behalf of someone else, you will still be held responsible.</div></li>
- <li><strong>Approval</strong>
- <div>The event must be approved by Event Coordinators. We reserve the right to refuse approval of events that are not considered in the spirit of Hacker Dojo.</div></li>
- <li><strong>Setup</strong>
- <div>You are responsible for your event setup. This may require setting up a day early (or at least an hour or two early!), finding projectors, moving furniture, etc.<p>In order to prepare you may book a separate event for the same space, just create a new event and select Setup Time as the event type.</div></li>
- <li><strong>Parking</strong>
- <div>We have <a href="http://wiki.hackerdojo.com/Directions#Parking" target="_blank">strict parking rules</a> that you need to convey to guests. If large enough, you may need a staff member to direct parking.</div></li>
- <li><strong>Sign-in</strong>
- <div>We require your guests to sign in with our sign-in kiosks for liability reasons. This information also helps support the Dojo by giving insight into member conversions from your event.</div></li>
- <li><strong>Blurb</strong>
- <div>You or another member should give an introduction to Hacker Dojo before the event starts. This may include mentioning Hacker Dojo sponsors but shouldn't be longer than a couple minutes.</div></li>
- <li><strong>Cleanup</strong>
- <div>Please clean up after your event! Return it to the way you found it at the very least. Consider getting guests to pitch in.</div></li>
- <li><strong>Supplies</strong>
- <div>Please refill supplies consumed. If you have a large event, your guests will consume shared resources such as snacks, toilet paper and other consumables.</div></li>
- <li><strong>Damages</strong>
- <div>You are held responsible for damages to Dojo facilities and equipment during your event.</div></li>
- </ol>
+ {{rules}}
</div>
<form method="post" style="width: 49%;">

0 comments on commit cb7a9d1

Please sign in to comment.