Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

This commit adds the dynamic page (meta) title for user-facing pages #23

Closed
wants to merge 3 commits into from

2 participants

@billsaysthis
Owner

No description provided.

@dustball

I tried merging this in and it broke my brain :(

It might be simpler to make the changes a second time since they are small.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 1, 2011
  1. @billsaysthis
Commits on Feb 4, 2011
  1. @billsaysthis
  2. @billsaysthis
This page is out of date. Refresh to see the latest.
Showing with 29 additions and 21 deletions.
  1. +9 −0 main.py
  2. +19 −19 models.py
  3. +1 −2  templates/base.html
View
9 main.py
@@ -138,6 +138,7 @@ def get(self, id):
logout_url = users.create_logout_url('/')
rooms = ROOM_OPTIONS
hours = [1,2,3,4,5,6,7,8,9,10,11,12]
+ page_title = event.name
self.response.out.write(template.render('templates/edit.html', locals()))
else:
self.response.out.write("Access denied")
@@ -212,6 +213,7 @@ def get(self, id):
event.details = db.Text(event.details.replace('\n','<br/>'))
show_all_nav = user
event.notes = db.Text(event.notes.replace('\n','<br/>'))
+ page_title = event.name
self.response.out.write(template.render('templates/event.html', locals()))
def post(self, id):
@@ -264,6 +266,7 @@ def get(self):
today = local_today()
show_all_nav = user
events = Event.get_approved_list()
+ page_title = 'Approved Events'
tomorrow = today + timedelta(days=1)
whichbase = 'base.html'
if self.request.get('base'):
@@ -281,6 +284,7 @@ def get(self):
login_url = users.create_login_url('/')
events = Event.all().filter('member = ', user).order('start_time')
show_all_nav = user
+ page_title = 'My Events'
today = local_today()
tomorrow = today + timedelta(days=1)
self.response.out.write(template.render('templates/myevents.html', locals()))
@@ -296,6 +300,7 @@ def get(self):
today = local_today()
show_all_nav = user
events = Event.all().filter('start_time < ', today).order('-start_time')
+ page_title = 'Past Events'
self.response.out.write(template.render('templates/past.html', locals()))
@@ -317,6 +322,7 @@ def get(self):
events = Event.get_all_future_list()
today = local_today()
tomorrow = today + timedelta(days=1)
+ page_title = 'All Future Events'
self.response.out.write(template.render('templates/all_future.html', locals()))
@@ -329,6 +335,7 @@ def get(self):
login_url = users.create_login_url('/')
events = Event.get_pending_list()
show_all_nav = user
+ page_title = 'Pending Events'
today = local_today()
tomorrow = today + timedelta(days=1)
self.response.out.write(template.render('templates/pending.html', locals()))
@@ -344,6 +351,7 @@ def get(self):
else:
login_url = users.create_login_url('/')
rooms = ROOM_OPTIONS
+ page_title = 'Adding New Event'
self.response.out.write(template.render('templates/new.html', locals()))
@@ -417,6 +425,7 @@ def get(self):
else:
login_url = users.create_login_url('/')
show_all_nav = user
+ page_title = 'Event Logs'
self.response.out.write(template.render('templates/logs.html', locals()))
class FeedbackHandler(webapp.RequestHandler):
View
38 models.py
@@ -19,29 +19,29 @@
PENDING_LIFETIME = 30 # days
class Event(db.Model):
- status = db.StringProperty(required=True, default='pending', choices=set(
+ status = db.StringProperty(required=True, default='pending', choices=set(
['pending', 'understaffed', 'approved', 'canceled', 'onhold', 'expired', 'deleted']))
- member = db.UserProperty(auto_current_user_add=True)
- name = db.StringProperty(required=True)
- start_time = db.DateTimeProperty(required=True)
- end_time = db.DateTimeProperty()
- staff = db.ListProperty(users.User)
- rooms = db.StringListProperty() #choices=set(ROOM_OPTIONS)
-
- details = db.TextProperty()
- url = db.StringProperty()
- fee = db.StringProperty()
- notes = db.TextProperty()
- type = db.StringProperty(required=True)
+ member = db.UserProperty(auto_current_user_add=True)
+ name = db.StringProperty(required=True)
+ start_time = db.DateTimeProperty(required=True)
+ end_time = db.DateTimeProperty()
+ staff = db.ListProperty(users.User)
+ rooms = db.StringListProperty() #choices=set(ROOM_OPTIONS)
+
+ details = db.TextProperty()
+ url = db.StringProperty()
+ fee = db.StringProperty()
+ notes = db.TextProperty()
+ type = db.StringProperty(required=True)
estimated_size = db.StringProperty(required=True)
- reminded = db.BooleanProperty(default=False)
+ reminded = db.BooleanProperty(default=False)
- contact_name = db.StringProperty()
- contact_phone = db.StringProperty()
+ contact_name = db.StringProperty()
+ contact_phone = db.StringProperty()
- expired = db.DateTimeProperty()
- created = db.DateTimeProperty(auto_now_add=True)
- updated = db.DateTimeProperty(auto_now=True)
+ expired = db.DateTimeProperty()
+ created = db.DateTimeProperty(auto_now_add=True)
+ updated = db.DateTimeProperty(auto_now=True)
@classmethod
def check_conflict(cls,proposed_start_time,proposed_end_time,proposed_rooms,optional_existing_event_id = 0):
View
3  templates/base.html
@@ -1,6 +1,6 @@
<html>
<head>
- <title>Events at Hacker Dojo</title>
+ <title>{% if page_title %} {{page_title}} : {% endif %}Events at Hacker Dojo</title>
<link href="/static/style.css" type="text/css" rel="stylesheet" />
{% block feed %}
<link rel="alternate" type="application/xml" title="Hacker Dojo events feed" href="/events.rss" />
@@ -36,6 +36,5 @@ <h2 style="font-size: x-large;">at Hacker Dojo</h2>
{% block content %}{% endblock %}
</div>
</div>
-
</body>
</html>
Something went wrong with that request. Please try again.