Esempio n. 1
0
def get_common_context(request):
    context_dict=get_message_dict(request)
    context_dict.update({
        'request':request,
        'main_nav':'publications',
        'new_bootstrap':True,
    })
    return context_dict
Esempio n. 2
0
def get_common_context(request):
    context_dict=get_message_dict(request)
    context_dict.update({
        'request':request,
        'main_nav':'about',
        'new_bootstrap':True,
        })
    return context_dict
Esempio n. 3
0
def get_common_context(request):
    context_dict = get_message_dict(request)
    context_dict.update({
        'request': request,
        'subnav': 'electees',
        'new_bootstrap': True,
    })
    return context_dict
Esempio n. 4
0
def get_common_context(request):
    context_dict=get_message_dict(request)
    context_dict.update({
        'request':request,
        'subnav':'electees',
        'new_bootstrap':True,
    })
    return context_dict
Esempio n. 5
0
def get_common_context(request):
    """ Get the context bits that are common across many/all views.

    These often include things like the request object or model objects that
    are needed in several views.
    """
    context_dict = get_message_dict(request)
    context_dict.update({'request': request})
    return context_dict
Esempio n. 6
0
def get_common_context(request):
    context_dict = get_message_dict(request)
    contact_text = CorporateTextField.objects.filter(section='CT')
    context_dict.update({
        'request': request,
        'contact_text': contact_text,
        'main_nav': 'corporate',
        })
    return context_dict
Esempio n. 7
0
def get_common_context(request):
    context_dict = get_message_dict(request)
    context_dict.update({
        'request': request,
        'main_nav': 'members',
        'elections': Election.get_current_elections(),
        'subnav': 'elections',
        })
    return context_dict
Esempio n. 8
0
def get_common_context(request):
    """ Get the context bits that are common across many/all views.

    These often include things like the request object or model objects that
    are needed in several views.
    """
    context_dict = get_message_dict(request)
    context_dict.update({'request': request})
    return context_dict
Esempio n. 9
0
def get_common_context(request):
    context_dict = get_message_dict(request)
    contact_text = CorporateTextField.objects.filter(section='CT')
    context_dict.update({
        'request': request,
        'contact_text': contact_text,
        'main_nav': 'corporate',
    })
    return context_dict
Esempio n. 10
0
def get_common_context(request):
    context_dict = get_message_dict(request)
    pending_stories = WebsiteArticle.objects.filter(approved=False)
    context_dict.update({
        'request': request,
        'main_nav': 'publications',
        'new_bootstrap': True,
        'num_pending_stories': pending_stories.count(),
    })
    return context_dict
Esempio n. 11
0
def get_common_context(request):
    """
    Standardized way of providing context that will be needed by every or nearly every page within a module/section. Adds the request and other necessary context to a dictionary that later gets merged with the template context.
    """
    context_dict=get_message_dict(request)
    context_dict.update({
        'request':request,
        'main_nav':'about',
        })
    return context_dict
Esempio n. 12
0
def get_common_context(request):
    links=[]
    links.append({'name':'Submit Affirmation','link':reverse('member_resources:submit_praise')})
    context_dict=get_message_dict(request)
    context_dict.update({
        'subnav':'playground',
        'links':links,
        'profile':request.user.userprofile.memberprofile if (hasattr(request.user, 'userprofile') and request.user.userprofile.is_member()) else None,
        })
    return context_dict
Esempio n. 13
0
def get_common_context(request):
    """
    Standardized way of providing context that will be needed by every
    or nearly every page within a module/section. Adds the request and
    other necessary context to a dictionary that later gets merged with
    the template context.
    """
    context_dict = get_message_dict(request)
    context_dict.update({
        'request': request,
        'main_nav': 'about',
    })
    return context_dict
Esempio n. 14
0
def get_common_context(request):
    context_dict = get_message_dict(request)
    user_is_member = False
    has_profile = False
    event_signed_up = request.session.pop('event_signed_up', None)
    if hasattr(request.user, 'userprofile'):
        has_profile = True
        if request.user.userprofile.is_member():
            user_is_member = True
    context_dict.update({
        'request': request,
        'term': AcademicTerm.get_current_term(),
        'user_is_member': user_is_member,
        'has_profile': has_profile,
        'event_signed_up': event_signed_up,
        'now': timezone.now(),
        'main_nav': 'outreach',
    })
    return context_dict
Esempio n. 15
0
def get_common_context(request):
    context_dict = get_message_dict(request)
    user_is_member = False
    has_profile = False
    event_signed_up = request.session.pop('event_signed_up', None)
    if hasattr(request.user, 'userprofile'):
        has_profile = True
        if request.user.userprofile.is_member():
            user_is_member = True
    context_dict.update({
        'request': request,
        'term': AcademicTerm.get_current_term(),
        'user_is_member': user_is_member,
        'has_profile': has_profile,
        'event_signed_up': event_signed_up,
        'now': timezone.now(),
        'main_nav': 'outreach',
    })
    return context_dict
Esempio n. 16
0
def get_common_context(request):
    links = [
        {
            'name': 'Submit Affirmation',
            'link': reverse('member_resources:submit_praise')
        },
    ]
    user = request.user
    profile = None
    if hasattr(user, 'userprofile') and user.userprofile.is_member():
        links.append({
                'name': 'View Member Map',
                'link': reverse('fora:view_map')
            }
        )
        profile = user.userprofile.memberprofile
    context_dict = get_message_dict(request)
    context_dict.update({
        'subnav': 'playground',
        'links': links,
        'profile': profile,
    })
    return context_dict
Esempio n. 17
0
def get_common_context(request):
    context_dict = get_message_dict(request)
    context_dict.update({
        'main_nav': 'bookswap',
    })
    return context_dict
Esempio n. 18
0
def get_common_context(request):
    context_dict = get_message_dict(request)
    context_dict.update({"request": request, "subnav": "electees", "new_bootstrap": True})
    return context_dict
Esempio n. 19
0
def get_common_context(request):
    context_dict=get_message_dict(request)
    return context_dict
Esempio n. 20
0
def get_common_context(request):
    context_dict = get_message_dict(request)
    context_dict.update({
        'main_nav': 'bookswap',
    })
    return context_dict
Esempio n. 21
0
def get_common_context(request):
    context_dict=get_message_dict(request)
    context_dict.update({'request':request})
    return context_dict
Esempio n. 22
0
def get_common_context(request):
    context_dict=get_message_dict(request)
    context_dict.update({'request':request})
    return context_dict