Skip to content

Loading…

#11 #26

Merged
5 commits merged into from

2 participants

@mdks

made a confirmation page

added rules, location and date information

thanks them, shows rules and asks them to print it. i can edit to say whatever. it's my first GAE action.. but nevertheless i tried to make it look pro :)

let me know where to go next. working on getting the signup application running as well

@dustball

Don't comment code out ... just remove it.

kk

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 1, 2011
  1. issue 11 add a confirmation page

    jonathan committed
  2. issue 11 confirmation page rules

    jonathan committed
  3. issue 11 print this page for your record

    jonathan committed
Commits on Mar 2, 2011
Showing with 63 additions and 37 deletions.
  1. +21 −9 main.py
  2. +10 −1 static/style.css
  3. +23 −0 templates/confirmation.html
  4. +2 −2 templates/edit.html
  5. +6 −2 templates/event.html
  6. +1 −23 templates/new.html
View
30 main.py
@@ -213,13 +213,9 @@ def post(self, id):
log_desc = log_desc + "<strong>Notes:</strong> " + previous_object.notes + " to " + event.notes + "<br />"
event.rooms = self.request.get_all('rooms')
if (previous_object.rooms != event.rooms):
- log_desc = log_desc + "<strong>Rooms changed</strong>" + "<br />"
- log_desc = log_desc + "<strong>Old room</strong>" + "<br />"
- for room in previous_object.rooms:
- log_desc = log_desc + room + ' '
- log_desc = log_desc + "<br /><strong>New room(s)</strong><br />"
- for room in event.rooms:
- log_desc = log_desc + room + ' '
+ log_desc = log_desc + "<strong>Rooms changed</strong><br />"
+ log_desc = log_desc + "<strong>Old room:</strong> " + previous_object.roomlist + "<br />"
+ log_desc = log_desc + "<strong>New room:</strong> " + event.roomlist + "<br />"
event.put()
log = HDLog(event=event,description=log_desc)
log.put()
@@ -380,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()))
@@ -429,7 +429,9 @@ def post(self):
notify_owner_confirmation(event)
notify_new_event(event)
set_cookie(self.response.headers, 'formvalues', None)
- self.redirect('/event/%s-%s' % (event.key().id(), slugify(event.name)))
+ #self.redirect('/event/%s-%s' % (event.key().id(), slugify(event.name)))
+ self.redirect('/confirm/%s-%s' % (event.key().id(), slugify(event.name)))
+
except Exception, e:
message = str(e)
if 'match format' in message:
@@ -442,7 +444,16 @@ def post(self):
#self.redirect('/new')
error = message
self.response.out.write(template.render('templates/error.html', locals()))
-
+
+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):
@util.login_required
def get(self):
@@ -494,6 +505,7 @@ def main():
('/cronbugowners', CronBugOwnersHandler),
('/myevents', MyEventsHandler),
('/new', NewHandler),
+ ('/confirm/(\d+).*', ConfirmationHandler),
('/edit/(\d+).*', EditHandler),
# single event views
('/event/(\d+).*', EventHandler),
View
11 static/style.css
@@ -86,4 +86,13 @@ input.dp-applied {
/* menu */
#menu {float: right; margin: 10px; font-size: smaller;}
.emph {font-weight: bold;}
-#menu .current {text-decoration: none; color: #000; cursor: tex;}
+#menu .current {text-decoration: none; color: #000; cursor: tex;}
+
+#edit-approve-btns, #cancel-delete-btns {
+ display: inline;
+
+}
+
+#edit-approve-btns {
+ padding-right: 50px;
+}
View
23 templates/confirmation.html
@@ -0,0 +1,23 @@
+{% extends 'base.html' %}
+{% block content %}
+
+<div id="primary">
+
+<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>
+
+<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>
+
+<div id="rules">{{rules}}</div>
+
+</div>
+
+{% endblock %}
View
4 templates/edit.html
@@ -5,8 +5,8 @@
<form method=POST>
<div id="primary">
- <h3>Edit: {{event.name|title}}</h3>
- <div class='b-block'><div class='b-label'>Title:</div><div class='b-data'><input type="text" name="name" value="{{event.name|title}}"/></div></div>
+ <h3>Edit: {{event.name}}</h3>
+ <div class='b-block'><div class='b-label'>Title:</div><div class='b-data'><input type="text" name="name" value="{{event.name}}"/></div></div>
<div class='b-block' id="message">
</div>
<div class='b-block'>
View
8 templates/event.html
@@ -9,11 +9,15 @@
{% if access_rights.is_admin %}<input type="submit" name="state" value="Undelete" />{% endif %}
(This will return the event to the &ldquo;pending&rdquo; status.)
{% else %}
- {% if access_rights.can_approve %}<input type="submit" name="state" value="Approve" />{% endif %}
+ <div id="edit-approve-btns">
{% if access_rights.can_cancel and not event.is_onhold %}<input type="submit" name="state" value="OnHold" />{% endif %}
+ {% if access_rights.can_approve %}<input type="submit" name="state" value="Approve" />{% endif %}
+ {% if access_rights.can_edit %}<input type="button" value="Edit" onclick="document.location.href='/edit/{{event.key.id}}';" />{% endif %}
+ </div>
+ <div id="cancel-delete-btns">
{% if access_rights.can_cancel and not event.is_canceled %}<input type="submit" name="state" value="Cancel" />{% endif %}
{% if access_rights.is_admin %}<input type="submit" name="state" value="Delete" />{% endif %}
- {% if access_rights.can_edit %}<input type="button" value="Edit" onclick="document.location.href='/edit/{{event.key.id}}';" />{% endif %}
+ </div>
<!--{% if access_rights.can_staff %}<input type="submit" name="state" value="Staff" />{% endif %}
{% if access_rights.can_unstaff %}<input type="submit" name="state" value="Unstaff" />{% endif %}-->
{% endif %}
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%;">
Something went wrong with that request. Please try again.