Permalink
Browse files

the logo is displayed

  • Loading branch information...
1 parent 7bc3dd0 commit 3cb829c463c2f024a9bc67daa503840d0c3bb53f unknown committed May 9, 2012
Showing with 31 additions and 20 deletions.
  1. +25 −19 main.py
  2. +4 −0 models.py
  3. BIN models.pyc
  4. +2 −1 templates/issue.html
View
@@ -73,28 +73,30 @@ def post(self):
self.redirect('/issue/%s' % issue.urlcode)
class EditHandler(webapp.RequestHandler):
- def get(self,id):
+ def get(self,urlcode):
user = users.get_current_user()
if user:
logout_url = users.create_logout_url('/')
else:
self.redirect(users.create_login_url(self.request.uri))
return
#issue = Issue.get_by_id(int(id))
- issue = Issue.get_by_urlcode(urlcode)
+ #issue = Issue.get_by_urlcode(urlcode)
+ #issue = Issue.get_issue_by_urlcode(urlcode)
choices = issue.choices
self.response.out.write(template.render('templates/edit.html', locals()))
- def post(self,id):
+ def post(self,urlcode):
user = users.get_current_user()
if user:
logout_url = users.create_logout_url('/')
else:
self.redirect(users.create_login_url(self.request.uri))
return
#issue = Issue.get_by_id(int(id))
- issue = Issue.get_by_urlcode(urlcode)
-
+ #issue = Issue.get_by_urlcode(urlcode)
+ #issue = Issue.get_issue_by_urlcode(urlcode)
+
if self.request.get('extend'):#if extending vote
choices = issue.choices
extend_amount = int(self.request.get('extend_amount')) * int(self.request.get('extend_multiplier'))
@@ -128,32 +130,36 @@ def post(self,id):
class IssueHandler(webapp.RequestHandler):
- def get(self,id):
- user = users.get_current_user()
- if user:
- logout_url = users.create_logout_url('/')
- else:
- self.redirect(users.create_login_url(self.request.uri))
- return
+ def get(self,urlcode):
+# user = users.get_current_user()
+ # if user:
+ # logout_url = users.create_logout_url('/')
+ #else:
+ # self.redirect(users.create_login_url(self.request.uri))
+ # return
#issue = Issue.get_by_id(int(id))
- issue = Issue.get_by_urlcode(urlcode)
- issue.update_status()
+ #issue = Issue.get_issue_by_urlcode(urlcode)
+ #issue = Issue.get_by_urlcode(urlcode)
+ #issue.update_status()
- vote = issue.vote_for_member(user)
+ #vote = issue.vote_for_member(user)
- issueUrl = self.request.uri
- self.response.out.write(template.render('templates/Issue.html', locals()))
+ #issueUrl = self.request.uri
+ #self.response.out.write(urlcode + '4')
+
+ self.response.out.write(template.render('templates/issue.html', locals()))
- def post(self,id):
+ def post(self,urlcode):
user = users.get_current_user()
if not user: #don't want someone who is not authenticated to be able to vote
self.redirect(users.create_login_url(self.request.uri))
return
#issue = Issue.get_by_id(int(id))
- issue = Issue.get_by_url(urlcode)
+ #issue = Issue.get_by_url(urlcode)
+ #issue = Issue.get_issue_by_urlcode(urlcode)
#vote = issue.vote_for_member()
new_choice = Choice.get_by_id(int(self.request.get('choice')))
View
@@ -131,6 +131,10 @@ def recent_results(cls, member=None,limit=20):#*** Need to fix, limit will be in
return [issue for issue in recent if issue.vote_for_member()] #***this is probably slow
#member_votes = Vote.all().filter('member =',member).fetch(limit)
#return [vote.issue for vote in member_votes if vote.issue.has_results()]
+
+ @classmethod
+ def get_issue_by_urlcode(cls, urlcode):
+ return cls.all().filter('urlcode =',urlcode).get()
class Choice(db.Model):
"""Represents a possible response to an issue (e.g. Yes)"""
View
Binary file not shown.
@@ -1,8 +1,9 @@
{% extends 'base.html' %}
{% block content %}
-<div id="primary">
+{{issue.urlcode}}
+<div id="primary">
{% if issue.member_is_creator %}
This issue is currently private. You may share it by copy and pasting the following url into an email: <b>{{issueUrl}}</b>
{% if issue.is_active %}

0 comments on commit 3cb829c

Please sign in to comment.