Permalink
Browse files

clean display

  • Loading branch information...
unknown unknown
unknown authored and unknown committed May 9, 2012
1 parent 9bdf5a9 commit 01a745ebd55285cd2451db180832f96eeb1484e7
Showing with 20 additions and 21 deletions.
  1. +13 −13 main.py
  2. +3 −3 models.py
  3. BIN models.pyc
  4. +4 −5 templates/issue.html
View
26 main.py
@@ -131,16 +131,14 @@ def post(self,urlcode):
class IssueHandler(webapp.RequestHandler):
def get(self,urlcode):
- self.response.out.write(urlcode + '4')
-
- #user = users.get_current_user()
- #if user:
- # logout_url = users.create_logout_url('/')
- #else:
- # self.redirect(users.create_login_url(self.request.uri))
- # return
+ 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(urlcode))
+ issue = Issue.get_by_id(int(urlcode))
#issue = Issue.get_issue_by_urlcode(urlcode)
#issue = Issue.get_by_urlcode(urlcode)
#issue.update_status()
@@ -149,16 +147,18 @@ def get(self,urlcode):
#issueUrl = self.request.uri
+ #self.response.out.write(urlcode + '4')
self.response.out.write(template.render('templates/issue.html', locals()))
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
+ 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(urlcode))
+ issue = Issue.get_by_id(int(urlcode))
#issue = Issue.get_by_url(urlcode)
#issue = Issue.get_issue_by_urlcode(urlcode)
#vote = issue.vote_for_member()
View
@@ -132,9 +132,9 @@ def recent_results(cls, member=None,limit=20):#*** Need to fix, limit will be in
#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()
+# @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.
View
@@ -1,16 +1,14 @@
{% extends 'base.html' %}
+
{% block content %}
+<!--
<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 %}
<form method="get" action="/edit/{{issue.urlcode}}"><input type = "submit" value="edit"/></form>
- <!--
- <form method="post">
- <input type = "submit" value="stop voting early"/>(coming soon)
- </form>
- -->
+
{% endif %}
{% endif %}
@@ -68,5 +66,6 @@ <h3>Results:</h3>
</div>
+-->
{% endblock %}

0 comments on commit 01a745e

Please sign in to comment.