from pygotham.frontend import direct_to_template, route from pygotham.models import Day, Talk __all__ = ('blueprint',) blueprint = Blueprint( 'talks', __name__, subdomain='<event_slug>', url_prefix='/talks', ) direct_to_template( blueprint, '/call-for-proposals/', template='talks/call-for-proposals.html', endpoint='call_for_proposals', navbar_kwargs={'path': ('Speaking', 'Call for Proposals')}, ) # This route is being kept around for backward compatibility. It should # never be used directly. @route( blueprint, '/<int:pk>/', defaults={'slug': None}, endpoint='old_detail') @route(blueprint, '/<int:pk>/<slug>/') def detail(pk, slug): """Return the talk detail view.""" event = g.current_event if not event.talks_are_published: abort(404)
from pygotham.frontend import direct_to_template, route from pygotham.models import Day, Talk __all__ = ('blueprint', ) blueprint = Blueprint( 'talks', __name__, subdomain='<event_slug>', url_prefix='/talks', ) direct_to_template( blueprint, '/call-for-proposals/', template='talks/call-for-proposals.html', endpoint='call_for_proposals', navbar_kwargs={'path': ('Speaking', 'Call for Proposals')}, ) # This route is being kept around for backward compatibility. It should # never be used directly. @route(blueprint, '/<int:pk>/', defaults={'slug': None}, endpoint='old_detail') @route(blueprint, '/<int:pk>/<slug>/') def detail(pk, slug): """Return the talk detail view.""" event = g.current_event if not (event.talks_are_published or current_user.has_role('admin')): abort(404)
"""PyGotham registration information.""" from flask import Blueprint, g, url_for from pygotham.frontend import direct_to_template __all__ = ('blueprint', 'get_nav_links') blueprint = Blueprint( 'registration', __name__, url_prefix='/<event_slug>/registration', ) direct_to_template(blueprint, '/information/', template='registration/information.html') def get_nav_links(): """Return registration-related menu items.""" links = { 'Information': url_for('registration.information'), } if g.current_event.is_registration_active: links['Register'] = g.current_event.registration_url return {'Registration': links}
form.populate_obj(sponsor) db.session.commit() flash("Your application has been updated.", "success") return redirect(url_for("profile.dashboard")) return render_template("sponsors/edit.html", form=form, sponsor=sponsor) @route(blueprint, "/", navbar_kwargs={"path": ("Sponsors", "Sponsors")}) def index(): """Return the sponsors.""" levels = Level.query.current.order_by(Level.order) sponsors = Sponsor.query.join(Level).filter(Sponsor.accepted == True, Level.event == g.current_event) has_sponsors = db.session.query(sponsors.exists()).scalar() return render_template("sponsors/index.html", levels=levels, has_sponsors=has_sponsors) @route(blueprint, "/prospectus/", navbar_kwargs={"path": ("Sponsors", "Sponsorship Prospectus")}) def prospectus(): """Return the sponsorship prospectus.""" levels = Level.query.current.order_by(Level.order) return render_template("sponsors/prospectus.html", levels=levels) # TODO: Add this to the navbar. # FIXME: This content seems to be missing. Probably a template issue. # This is a good candidate for switching to an AboutPage. direct_to_template(blueprint, "/terms/", template="sponsors/terms.html")
return render_template('sponsors/edit.html', form=form, sponsor=sponsor) @route(blueprint, '/', navbar_kwargs={'path': ('Sponsors', 'Sponsors')}) def index(): """Return the sponsors.""" levels = Level.query.current.order_by(Level.order) sponsors = Sponsor.query.join(Level).filter( Sponsor.accepted == True, # NOQA Level.event == g.current_event, ) has_sponsors = db.session.query(sponsors.exists()).scalar() return render_template( 'sponsors/index.html', levels=levels, has_sponsors=has_sponsors) @route( blueprint, '/prospectus/', navbar_kwargs={'path': ('Sponsors', 'Sponsorship Prospectus')}) def prospectus(): """Return the sponsorship prospectus.""" levels = Level.query.current.order_by(Level.order) return render_template('sponsors/prospectus.html', levels=levels) # TODO: Add this to the navbar. # FIXME: This content seems to be missing. Probably a template issue. # This is a good candidate for switching to an AboutPage. direct_to_template(blueprint, '/terms/', template='sponsors/terms.html')
"""PyGotham registration information.""" from flask import Blueprint, g, url_for from pygotham.frontend import direct_to_template __all__ = ('blueprint', 'get_nav_links') blueprint = Blueprint( 'registration', __name__, url_prefix='/<event_slug>/registration', ) direct_to_template( blueprint, '/information/', template='registration/information.html', navbar_kwargs={'path': ('Registration', 'Information')}, ) def get_nav_links(): """Return registration-related menu items.""" links = { 'Information': url_for('registration.information'), } if g.current_event.is_registration_active: links['Register'] = g.current_event.registration_url return {'Registration': links}
return render_template('sponsors/edit.html', form=form, sponsor=sponsor) @route(blueprint, '/', navbar_kwargs={'path': ('Sponsors', 'Sponsors')}) def index(): """Return the sponsors.""" levels = Level.query.current.order_by(Level.order) sponsors = Sponsor.query.join(Level).filter( Sponsor.accepted == True, Level.event == g.current_event, ) has_sponsors = db.session.query(sponsors.exists()).scalar() return render_template('sponsors/index.html', levels=levels, has_sponsors=has_sponsors) @route(blueprint, '/prospectus/', navbar_kwargs={'path': ('Sponsors', 'Sponsorship Prospectus')}) def prospectus(): """Return the sponsorship prospectus.""" levels = Level.query.current.order_by(Level.order) return render_template('sponsors/prospectus.html', levels=levels) # TODO: Add this to the navbar. # FIXME: This content seems to be missing. Probably a template issue. # This is a good candidate for switching to an AboutPage. direct_to_template(blueprint, '/terms/', template='sponsors/terms.html')
"""PyGotham registration information.""" from flask import Blueprint, g, url_for from pygotham.frontend import direct_to_template __all__ = ("blueprint", "get_nav_links") blueprint = Blueprint("registration", __name__, url_prefix="/<event_slug>/registration") direct_to_template(blueprint, "/information/", template="registration/information.html") def get_nav_links(): """Return registration-related menu items.""" links = {"Information": url_for("registration.information")} if g.current_event.is_registration_active: links["Register"] = g.current_event.registration_url return {"Registration": links}
from flask import (abort, Blueprint, g, flash, redirect, render_template, url_for) from flask_login import current_user from flask_security import login_required from pygotham.core import db from pygotham.frontend import direct_to_template, route from pygotham.models import Day, Talk __all__ = ('blueprint', 'get_nav_links') blueprint = Blueprint('talks', __name__, url_prefix='/<event_slug>/talks') direct_to_template( blueprint, '/call-for-proposals/', template='talks/call-for-proposals.html', endpoint='call_for_proposals', ) # This route is being kept around for backward compatibility. It should # never be used directly. @route( blueprint, '/<int:pk>/', defaults={'slug': None}, endpoint='old_detail') @route(blueprint, '/<int:pk>/<slug>/') def detail(pk, slug): """Return the talk detail view.""" event = g.current_event if not event.talks_are_published: abort(404)