intranet.apps.dashboard package

Submodules

intranet.apps.dashboard.tests module

class intranet.apps.dashboard.tests.DashboardTest(methodName='runTest')[source]

Bases: IonTestCase

Test for dashboard module

setUp() None[source]
test_gen_schedule()[source]

Tests the gen_schedule method.

test_gen_sponsor_schedule()[source]

Test cases for the gen_sponsor_schedule method.

intranet.apps.dashboard.views module

intranet.apps.dashboard.views.add_widgets_context(request, context)[source]

WIDGETS: * Eighth signup (STUDENT) * Eighth attendance (TEACHER or ADMIN) * Enrichment activities (ALL if enrichment activity today) * Bell schedule (ALL) * Administration (ADMIN) * Links (ALL) * Seniors (STUDENT; graduation countdown if senior, link to destinations otherwise) if settings.ENABLE_SENIOR_DESTINATIONS

intranet.apps.dashboard.views.dashboard_view(request, show_widgets=True, show_expired=False, ignore_dashboard_types=None, show_welcome=False)[source]

Process and show the dashboard, which includes activities, events, and widgets.

intranet.apps.dashboard.views.gen_schedule(user, num_blocks=6, surrounding_blocks=None)[source]

Generate a list of information about a block and a student’s current activity signup.

Returns:

schedule no_signup_today

intranet.apps.dashboard.views.gen_sponsor_schedule(user, sponsor=None, num_blocks=6, surrounding_blocks=None, given_date=None)[source]

Return a list of EighthScheduledActivitys in which the given user is sponsoring.

Returns:

activities no_attendance_today num_acts

Return type:

Dictionary with

intranet.apps.dashboard.views.get_announcements_list(request, context)[source]

An announcement will be shown if: * It is not expired

  • unless ?show_expired=1

  • It is visible to the user

    • There are no groups on the announcement (so it is public)

    • The user’s groups are in union with the groups on the announcement (at least one matches)

    • The user submitted the announcement directly

    • The user submitted the announcement through a request

    • The user approved the announcement through a request

    • …unless ?show_all=1

An event will be shown if: * It is not expired

  • unless ?show_expired=1

  • It is approved

    • unless an events admin

  • It is visible to the user

    • There are no groups

    • The groups are in union

intranet.apps.dashboard.views.get_prerender_url(request)[source]
intranet.apps.dashboard.views.get_tjstar_mapping(user)[source]
intranet.apps.dashboard.views.paginate_announcements_list(request, context, items)[source]

*TODO* Migrate to django Paginator (see lostitems)

Module contents