def create(self): user = users.get_current_user() if user: c.title = " | Create a New Deck" return render('/create_deck.mako') else: c.login_url = users.create_login_url(h.url_for(controller="Deck", action="create")) return render('/login.mako')
def delete(self, deck_id=None): if users.is_current_user_admin(): c.deck = Deck.get_current_by_id_base30(deck_id) c.cards = Card.get(c.deck.cards) c.title = " | " + c.deck.name return render('/delete_deck.mako') else: #XXX Proper http error here raise 'error'
def quiz(self, deck_id=None): c.deck = Deck.get_current_by_id_base30(deck_id) c.cards = Card.get(c.deck.cards) c.title = "| " + c.deck.name + " Quiz" c.reverse = bool(request.params.get('reverse', False)) return render('quiz_deck.mako')
def xml(self, deck_id=None): response.headers['Content-type'] = "Content-Type: application/xml; charset=utf-8" c.deck = Deck.get_current_by_id_base30(deck_id) c.cards = Card.get(c.deck.cards) return render('/xml_deck.mako')
def view(self, deck_id=None): c.is_admin = users.is_current_user_admin() c.deck = Deck.get_current_by_id_base30(deck_id) c.cards = Card.get(c.deck.cards) c.title = " | " + c.deck.name return render('/show_deck.mako')
def index(self): c.decks = Deck.all().filter("show =", True) return render('/show_decks.mako')
def index(self): return render('/about.mako')