コード例 #1
0
def whereabouts():
    dates = []

    today = datetime.datetime.today()
    monday = today - datetime.timedelta(int(today.strftime("%w")))

    for i in range(35):
        day = monday + datetime.timedelta(i)
        if day.strftime("%a") != "Sat" and day.strftime("%a") != "Sun":
            dates.append(day)

    date_from = str(dates[0].strftime("%Y-%m-%d"))
    # database doesn't return final date
    date_to = dates[-1] + datetime.timedelta(1)
    date_to = str(date_to.strftime("%Y-%m-%d"))

    table_date_headings = get_date_headings(today, dates)

    table_data = generate_table_data(date_from, date_to)

    return lifeguard_render(
        "whereabouts.html",
        title="Whereabouts",
        table_date_headings=table_date_headings,
        table_data=table_data,
        image="/static/images/whereabouts.png",
    )
コード例 #2
0
def kit_status():
    clearwater_form = ClearwaterKitBookingForm()
    perimeta_form = PerimetaKitBookingForm()
    volte_form = VolteKitBookingForm()
    ccf_form = CCFKitBookingForm()
    bookings = get_kit_bookings()
    cc_deployment_names = sorted(bookings["clearwater"].keys())
    vt_deployment_names = sorted(bookings["volte"].keys())
    ccf_deployment_names = sorted(bookings["ccf"].keys())
    return lifeguard_render(
        "kit_management.html",
        title="Kit Management",
        clearwater_form=clearwater_form,
        perimeta_form=perimeta_form,
        volte_form=volte_form,
        ccf_form=ccf_form,
        bookings=bookings,
        vt_deployment_names=vt_deployment_names,
        cc_deployment_names=cc_deployment_names,
        ccf_deployment_names=ccf_deployment_names,
    )
コード例 #3
0
def perimeta_control():
    # Clever Python stuff goes here
    return lifeguard_render("perimeta_control.html")
コード例 #4
0
ファイル: index.py プロジェクト: RPaterson-meta/Lifeguard
def index():
    return lifeguard_render(homepage(), title="Home")
コード例 #5
0
ファイル: EE.py プロジェクト: RPaterson-meta/Lifeguard
def lifeguards():
    return lifeguard_render('lifeguards.html',
                            title='Lifeguards')