def dashboard_view(request, show_widgets=True, show_expired=False, ignore_dashboard_types=None, show_welcome=False):
    """Process and show the dashboard, which includes activities, events, and widgets."""

    user = request.user

    announcements_admin = user.has_admin_permission("announcements")
    events_admin = user.has_admin_permission("events")

    if not show_expired:
        show_expired = ("show_expired" in request.GET)

    show_all = (request.GET.get("show_all", "0") != "0")
    if "show_all" not in request.GET and request.user.is_eighthoffice:
        # Show all by default to 8th period office
        show_all = True

    # Include show_all postfix on next/prev links
    paginate_link_suffix = "&show_all=1" if show_all else ""
    is_index_page = (request.path_info in ["/", ""])

    context = {
        "prerender_url": get_prerender_url(request),
        "user": user,
        "announcements_admin": announcements_admin,
        "events_admin": events_admin,
        "is_index_page": is_index_page,
        "show_all": show_all,
        "paginate_link_suffix": paginate_link_suffix,
        "show_expired": show_expired
    }

    # Get list of announcements
    items = get_announcements_list(request, context)

    # Paginate announcements list
    context, items = paginate_announcements_list(request, context, items)

    user_hidden_announcements = (Announcement.objects.hidden_announcements(user).values_list("id", flat=True))
    user_hidden_events = (Event.objects.hidden_events(user).values_list("id", flat=True))

    if ignore_dashboard_types is None:
        ignore_dashboard_types = []

    context.update({
        "hide_announcements": True,
        "hide_events": True,
        "user_hidden_announcements": user_hidden_announcements,
        "user_hidden_events": user_hidden_events,
        "ignore_dashboard_types": ignore_dashboard_types
    })

    is_student = user.is_student
    is_teacher = user.is_teacher
    is_senior = user.is_senior
    is_global_admin = user.member_of("admin_all") and user.is_superuser
    show_admin_widget = is_global_admin or announcements_admin or user.is_eighth_admin
    eighth_sponsor = user.get_eighth_sponsor()

    # the URL path for forward/back buttons
    view_announcements_url = "index"

    if show_widgets:
        dashboard_title = "Dashboard"
        dashboard_header = "Dashboard"
    elif show_expired:
        dashboard_title = dashboard_header = "Announcement Archive"
        view_announcements_url = "announcements_archive"
    else:
        dashboard_title = dashboard_header = "Announcements"

    num_senior_destinations = len(Senior.objects.filled())

    try:
        dash_warning = settings.DASH_WARNING
    except Exception:
        dash_warning = None

    # TODO: resolve circular dependency
    from ..auth.views import get_ap_week_warning
    fcps_emerg = get_fcps_emerg(request)
    ap_week = get_ap_week_warning(request)
    if fcps_emerg:
        dash_warning = fcps_emerg
    elif ap_week:
        dash_warning = ap_week

    context.update({
        "dash_warning": dash_warning,
        "show_widgets": show_widgets,
        "show_expired": show_expired,
        "view_announcements_url": view_announcements_url,
        "dashboard_title": dashboard_title,
        "dashboard_header": dashboard_header,
        "is_student": is_student,
        "is_teacher": is_teacher,
        "is_senior": is_senior,
        "is_global_admin": is_global_admin,
        "show_admin_widget": show_admin_widget,
        "eighth_sponsor": eighth_sponsor,
        "num_senior_destinations": num_senior_destinations
    })

    if settings.TJSTAR_MAP:
        context.update(get_tjstar_mapping(request.user))

    if show_widgets:
        context = add_widgets_context(request, context)

    if announcements_admin:
        all_waiting = AnnouncementRequest.objects.filter(posted=None, rejected=False).this_year()
        awaiting_teacher = all_waiting.filter(teachers_approved__isnull=True)
        awaiting_approval = all_waiting.filter(teachers_approved__isnull=False)

        context.update({"awaiting_teacher": awaiting_teacher, "awaiting_approval": awaiting_approval})

    self_awaiting_teacher = AnnouncementRequest.objects.filter(posted=None, rejected=False, teachers_requested=request.user).this_year()
    context.update({"self_awaiting_teacher": self_awaiting_teacher})

    if show_welcome:
        return render(request, "welcome/student.html", context)
    else:
        return render(request, "dashboard/dashboard.html", context)