Permalink
Browse files

multiline for details and notes fields

  • Loading branch information...
billsaysthis committed Jun 23, 2010
1 parent 0072972 commit 84143502eda57e821df6464dec81fb6420fb8132
Showing with 8 additions and 5 deletions.
  1. +5 −2 main.py
  2. +2 −2 models.py
  3. +1 −1 templates/event.html
View
@@ -1,3 +1,4 @@
+import cgi
from google.appengine.ext import webapp, db
from google.appengine.ext.webapp import util, template
from google.appengine.api import urlfetch, memcache, users, mail
@@ -58,6 +59,8 @@ def get(self, id):
logout_url = users.create_logout_url('/')
else:
login_url = users.create_login_url('/')
+ event.details = event.details.replace("\n","<br/>")
+ event.notes = event.notes.replace("\n","<br/>")
self.response.out.write(template.render('templates/event.html', locals()))
def post(self, id):
@@ -173,10 +176,10 @@ def post(self):
estimated_size = self.request.get('estimated_size'),
contact_name = self.request.get('contact_name'),
contact_phone = self.request.get('contact_phone'),
- details = self.request.get('details'),
+ details = cgi.escape(self.request.get('details')),
url = self.request.get('url'),
fee = self.request.get('fee'),
- notes = self.request.get('notes'),
+ notes = cgi.escape(self.request.get('notes')),
rooms = self.request.get_all('rooms'),
expired = local_today() + timedelta(days=PENDING_LIFETIME), # Set expected expiration date
)
View
@@ -38,10 +38,10 @@ class Event(db.Model):
staff = db.ListProperty(users.User)
rooms = db.StringListProperty() #choices=set(ROOM_OPTIONS)
- details = db.StringProperty()
+ details = db.StringProperty(multiline=True)
url = db.StringProperty()
fee = db.StringProperty()
- notes = db.StringProperty()
+ notes = db.StringProperty(multiline=True)
type = db.StringProperty(required=True)
estimated_size = db.StringProperty(required=True)
View
@@ -42,7 +42,7 @@ <h3>{{event.name|title}}</h3>
<div class='thin-border'></div>
<div class='b-block'><div class='b-label'>Details:</div><div class='b-data'>{{event.details}}</div></div>
<br />
- {% if is_staff %}<div class='b-block'><div class='b-label'>Notes:</div><div class='b-data'>{{event.notes}}</div></div>{% endif %}
+ <div class='b-block'><div class='b-label'>Notes:</div><div class='b-data'>{{event.notes}}</div></div>
{% if event.feedback_set.count %}
<div class='thin-border'></div>
<div id='secondary'>

0 comments on commit 8414350

Please sign in to comment.