Пример #1
0
def dashboard(request):
    club, club_entity = get_club_and_club_entity(request)
    stripe_controller = get_stripe_recipient_controller_for_club(club)
    if not stripe_controller:
        if EventController.PopEvent(request, EventController.CLUB_REGISTERED):
            messages.success(
                request,
                "You are almost finished registering %s, just one more step to go." % club_entity.name)
        return redirect('/club/dashboard/stripe-connect')
    template_data = {
        'stripe': stripe_controller,
        'club_entity': club_entity}
    return render(request, 'spudderspuds/clubs/pages/dashboard.html', template_data)
def tracking_pixel_code_context(request):
    """
    Looks for a TRACKING_PIXEL_CONF dict in the events file
    and if the event (dict key) has a list of template names
    then these are added to the context as {{ tracking_pixel_code }}
    """
    tracking_pixel_code = ""
    if feature_is_enabled('tracking_pixels'):
        for event in TRACKING_PIXEL_CONF.keys():
            if EventController.PopEvent(request, event):
                templates = TRACKING_PIXEL_CONF.get(event, [])
                for template in templates:
                    tracking_pixel_code += render_to_string(template)
    return {'tracking_pixel_code': tracking_pixel_code}