Exemplo n.º 1
0
def stays_view(hotel_id, stay_id):
    facade = stays_facade.view(stay_id)
    if not facade:
        return render_template('admin/hotel/stays/no_stay.html')
    facade["hotel_id"] = hotel_id
    #raise Exception(str( facade))
    return render_template('admin/hotel/stays/view.html', **facade)
Exemplo n.º 2
0
def stays_view(hotel_id, stay_id):
    facade = stays_facade.view(stay_id)
    if not facade:
        return render_template('admin/hotel/stays/no_stay.html')
    facade["hotel_id"] = hotel_id
    #raise Exception(str( facade))
    return render_template('admin/hotel/stays/view.html', **facade)
Exemplo n.º 3
0
def stays_by_room_number(hotel_id):

    facade = stays_facade.by_room_number()
    if facade.empty_results:
        return redirect(url_for('.search', hotel_id=hotel_id))
    if not facade.successful:
        return render_template('helpdesk/search.html', **facade)
    if len(facade['stays']) == 1:
        return redirect(url_for('.stays_view', hotel_id=hotel_id, stay_id=facade['stays'][0]['Stay']['id']))

    return render_template('helpdesk/stays/by_room_number.html', **facade)
Exemplo n.º 4
0
def stays_by_room_number(hotel_id):

    facade = stays_facade.by_room_number()
    if facade.empty_results:
        return redirect(url_for('.search', hotel_id=hotel_id))
    if not facade.successful:
        return render_template('helpdesk/search.html', **facade)
    if len(facade['stays']) == 1:
        return redirect(
            url_for('.stays_view',
                    hotel_id=hotel_id,
                    stay_id=facade['stays'][0]['Stay']['id']))

    return render_template('helpdesk/stays/by_room_number.html', **facade)
Exemplo n.º 5
0
def service_coupons_edit(hotel_id, service_coupon_id):
    facade = service_coupons_facade.edit(service_coupon_id)

    if facade.successful:
        return redirect(url_for('.service_coupons_view', hotel_id=hotel_id, service_coupon_id=facade['service_coupon_id']))

    return render_template('admin/hotel/service_coupons/edit.html', **facade)
Exemplo n.º 6
0
def printer_disable(hotel_id, printer_id):
    g.proxies.Printers.disable_printer(printer_id)
    printers = g.proxies.Printers.index()
    printer = printers[printer_id]
    return render_template('admin/hotel/printers/view.html',
                           printer_id=printer_id,
                           printer=printer)
Exemplo n.º 7
0
def printer_cancel_print_jobs(hotel_id, printer_id):
    g.proxies.Printers.cancel_all_jobs(printer_id)
    printers = g.proxies.Printers.index()
    printer = printers[printer_id]
    return render_template('admin/hotel/printers/view.html',
                           printer_id=printer_id,
                           printer=printer)
Exemplo n.º 8
0
def printer_view(hotel_id, printer_id):
    printers = g.proxies.Printers.index()
    printer = printers[printer_id]
    print printer
    return render_template('admin/hotel/printers/view.html',
                           printer_id=printer_id,
                           printer=printer)
Exemplo n.º 9
0
def hotels_view(hotel_id):
    hotel = Hotel.query.filter_by(id=hotel_id).first()
    if not hotel:
        abort(404)

    form = HotelDeleteForm(id=hotel.id)
    return render_template('admin/hotels/view.html', hotel=hotel, form=form)
Exemplo n.º 10
0
def hotels_view(hotel_id):
    hotel = Hotel.query.filter_by(id=hotel_id).first()
    if not hotel:
        abort(404)

    form = HotelDeleteForm(id = hotel.id)
    return render_template('admin/hotels/view.html', hotel=hotel, form=form)
Exemplo n.º 11
0
def service_options_edit(hotel_id, service_option_id):
    facade = service_options_facade.edit(service_option_id)
    if facade.successful:
        return redirect(
            url_for('.service_options_view',
                    hotel_id=hotel_id,
                    service_option_id=facade['service_option_id']))
    return render_template('admin/hotel/service_options/edit.html', **facade)
Exemplo n.º 12
0
def service_groups_add(hotel_id):
    facade = service_groups_facade.add()
    if facade.successful:
        return redirect(
            url_for('.service_groups_view',
                    hotel_id=hotel_id,
                    service_group_id=service_group_id))
    return render_template('admin/hotel/service_groups/add.html', **facade)
Exemplo n.º 13
0
def rooms_add(hotel_id):
    facade = rooms_facade.add()
    if facade.successful:
        return redirect(
            url_for('.rooms_view',
                    hotel_id=hotel_id,
                    room_id=facade['room_id']))
    return render_template('admin/hotel/rooms/add.html', **facade)
Exemplo n.º 14
0
def navigators_edit(hotel_id, navigator_id):
    facade = navigators_facade.edit(navigator_id)
    if facade.successful:
        return redirect(
            url_for('.navigators_view',
                    hotel_id=hotel_id,
                    navigator_id=navigator_id))
    return render_template('admin/hotel/navigators/edit.html', **facade)
Exemplo n.º 15
0
def navigators_room_move(hotel_id, navigator_id):
    facade = navigators_facade.room_move(navigator_id)
    if facade.successful:
        return redirect(
            url_for('.navigators_view',
                    hotel_id=hotel_id,
                    navigator_id=navigator_id))
    return render_template('helpdesk/navigators/room_move.html', **facade)
Exemplo n.º 16
0
def printer_configurations_add(hotel_id):
    facade = printer_configurations_facade.add()

    if 'printer_configuration_id' in facade:
        flash("Printer configuration added.", 'success')
        return redirect(url_for('.printer_configurations_index', hotel_id=hotel_id))

    return render_template('admin/hotel/printer_configurations/add.html', **facade)
Exemplo n.º 17
0
def navigators_add(hotel_id):
    facade = navigators_facade.add()
    if facade.successful:
        return redirect(
            url_for('.navigators_view',
                    hotel_id=hotel_id,
                    navigator_id=facade['navigator_id']))
    return render_template('admin/hotel/navigators/add.html', **facade)
Exemplo n.º 18
0
def printer_configurations_edit(hotel_id, printer_configuration_id):
    facade = printer_configurations_facade.edit(printer_configuration_id)

    if facade.successful:
        flash("Printer configuration updated.", 'success')
        return redirect(url_for('.printer_configurations_index', hotel_id=hotel_id))

    return render_template('admin/hotel/printer_configurations/edit.html', **facade)
Exemplo n.º 19
0
def mails_add(hotel_id):
    facade = mails_facade.add()
    if facade.successful:
        return redirect(
            url_for('.mails_view',
                    hotel_id=hotel_id,
                    mail_id=facade['mail_id']))
    return render_template('admin/hotel/mails/add.html', **facade)
Exemplo n.º 20
0
def printer_configurations_edit(hotel_id, printer_configuration_id):
    facade = printer_configurations_facade.edit(printer_configuration_id)

    if facade.successful:
        flash("Printer configuration updated.", 'success')
        return redirect(
            url_for('.printer_configurations_index', hotel_id=hotel_id))

    return render_template('admin/hotel/printer_configurations/edit.html',
                           **facade)
Exemplo n.º 21
0
def printer_configurations_add(hotel_id):
    facade = printer_configurations_facade.add()

    if 'printer_configuration_id' in facade:
        flash("Printer configuration added.", 'success')
        return redirect(
            url_for('.printer_configurations_index', hotel_id=hotel_id))

    return render_template('admin/hotel/printer_configurations/add.html',
                           **facade)
Exemplo n.º 22
0
def hotels_add():
    form = HotelForm()
    if form.validate_on_submit():
        hotel = Hotel()
        form.populate_obj(hotel)
        db_session.add(hotel)
        db_session.commit()
        flash('Hotel added.', 'success')
        return redirect(url_for('.hotels_index'))

    return render_template('admin/hotels/add.html', form=form)
Exemplo n.º 23
0
def hotels_add():
    form = HotelForm()
    if form.validate_on_submit():
        hotel = Hotel()
        form.populate_obj(hotel)
        db_session.add(hotel)
        db_session.commit()
        flash('Hotel added.', 'success')
        return redirect(url_for('.hotels_index'))

    return render_template('admin/hotels/add.html', form=form)
Exemplo n.º 24
0
def hotels_edit(hotel_id):
    hotel = Hotel.query.filter_by(id=hotel_id).first()
    if not hotel:
        abort(404)

    form = HotelForm(obj=hotel)
    if form.validate_on_submit():
        form.populate_obj(hotel)
        db_session.commit()
        flash('Hotel information updated.', 'success')
        return redirect(url_for('.hotels_view', hotel_id=hotel.id))
    return render_template('admin/hotels/edit.html', form=form, hotel=hotel)
Exemplo n.º 25
0
def hotels_edit(hotel_id):
    hotel = Hotel.query.filter_by(id=hotel_id).first()
    if not hotel:
        abort(404)

    form = HotelForm(obj=hotel)
    if form.validate_on_submit():
        form.populate_obj(hotel)
        db_session.commit()
        flash('Hotel information updated.', 'success')
        return redirect(url_for('.hotels_view', hotel_id=hotel.id))
    return render_template('admin/hotels/edit.html', form=form,hotel=hotel)
Exemplo n.º 26
0
def users_edit(user_id):
    user = User.query.filter_by(id=user_id).first()
    if not user:
        abort(404)

    user_form = UserForm(obj=user)

    verification_form = UserSendVerificationForm(obj=user)
    if user_form.validate_on_submit():
        user_form.populate_obj(user)
        db_session.commit()
        return redirect(url_for('.users_index'))

    return render_template('admin/users/edit.html', user=user, user_form=user_form, verification_form=verification_form)
Exemplo n.º 27
0
def users_edit(user_id):
    user = User.query.filter_by(id=user_id).first()
    if not user:
        abort(404)

    user_form = UserForm(obj=user)

    verification_form = UserSendVerificationForm(obj=user)
    if user_form.validate_on_submit():
        user_form.populate_obj(user)
        db_session.commit()
        return redirect(url_for('.users_index'))

    return render_template('admin/users/edit.html',
                           user=user,
                           user_form=user_form,
                           verification_form=verification_form)
Exemplo n.º 28
0
def groups_view(hotel_id, group_id):
    facade = groups_facade.view(group_id)
    return render_template('helpdesk/groups/view.html', **facade)
Exemplo n.º 29
0
def navigators_view(hotel_id, navigator_id):
    facade = navigators_facade.view(navigator_id)
    return render_template('helpdesk/navigators/view.html', **facade)
Exemplo n.º 30
0
def stays_search(hotel_id):
    facade = stays_facade.search()
    return render_template('admin/hotel/stays/search.html', **facade)
Exemplo n.º 31
0
def search(hotel_id):
    facade = stays_facade.search()
    return render_template('helpdesk/search.html', **facade)
Exemplo n.º 32
0
def stays_view(hotel_id, stay_id):

    facade = stays_facade.view(stay_id)
    if not facade:
        return render_template('helpdesk/stays/index_no_stays.html', **facade)
    return render_template('helpdesk/stays/view.html', **facade)
Exemplo n.º 33
0
def stays_purchases(hotel_id, stay_id):
    facade = stays_facade.purchases(stay_id)
    return render_template('helpdesk/stays/purchases.html', **facade)
Exemplo n.º 34
0
def stays_purchases(hotel_id, stay_id):
    facade = stays_facade.purchases(stay_id)
    return render_template('helpdesk/stays/purchases.html', **facade)
Exemplo n.º 35
0
def service_options_index(hotel_id, page):
    facade = service_options_facade.index(page)
    return render_template('helpdesk/service_options/index.html', **facade)
Exemplo n.º 36
0
def stays_view(hotel_id, stay_id):

    facade = stays_facade.view(stay_id)
    if not facade:
        return render_template('helpdesk/stays/index_no_stays.html', **facade)
    return render_template('helpdesk/stays/view.html', **facade)
Exemplo n.º 37
0
def stays_print_queue(hotel_id, stay_id):
    facade = stays_facade.print_queue(stay_id)

    return render_template('helpdesk/stays/print_queue.html', **facade)
Exemplo n.º 38
0
def stays_index(hotel_id):
    facade = stays_facade.index(page)
    return render_template('helpdesk/stays/index.html', **facade)
Exemplo n.º 39
0
def technicians_add(hotel_id):
    facade = technicians_facade.add()
    if facade.successful:
        return redirect(url_for('.technicians_index'))

    return render_template('admin/hotel/technicians/add.html', **facade)
Exemplo n.º 40
0
def service_groups_index(hotel_id, page):
    facade = service_groups_facade.index(page)
    return render_template('helpdesk/service_groups/index.html', **facade)
Exemplo n.º 41
0
def technicians_edit(hotel_id, technician_id):
    facade = technicians_facade.edit(technician_id)
    if facade.successful:
        return redirect(url_for('.technicians_index', hotel_id=hotel_id))

    return render_template('admin/hotel/technicians/edit.html', **facade)
Exemplo n.º 42
0
def stays_add_purchase(hotel_id, stay_id):
    facade = stays_facade.add_purchase(stay_id)
    if facade.successful:
        return redirect(url_for('.stays_purchases', hotel_id=hotel_id, stay_id=stay_id))
    return render_template('helpdesk/stays/add_purchase.html', **facade)
Exemplo n.º 43
0
def navigators_room_move(hotel_id, navigator_id):
    facade = navigators_facade.room_move(navigator_id)
    if facade.successful:
        return redirect(url_for('.navigators_view', hotel_id=hotel_id, navigator_id=navigator_id))
    return render_template('helpdesk/navigators/room_move.html', **facade)
Exemplo n.º 44
0
def technicians_index(hotel_id):
    technicians = g.proxies.Technicians.index()
    return render_template('admin/hotel/technicians/index.html', technicians=technicians)
Exemplo n.º 45
0
def service_options_view(hotel_id, service_option_id):
    facade = service_options_facade.view(service_option_id)
    return render_template('helpdesk/service_options/view.html', **facade)
Exemplo n.º 46
0
def home():
    hotels = Hotel.query.order_by('name')
    return render_template('helpdesk/home.html', hotels=hotels)
Exemplo n.º 47
0
def stays_print_queue(hotel_id, stay_id):
    facade = stays_facade.print_queue(stay_id)

    return render_template('helpdesk/stays/print_queue.html', **facade)
Exemplo n.º 48
0
def search(hotel_id):
    facade = stays_facade.search()
    return render_template('helpdesk/search.html', **facade)
Exemplo n.º 49
0
def stays_add_purchase(hotel_id, stay_id):
    facade = stays_facade.add_purchase(stay_id)
    if facade.successful:
        return redirect(
            url_for('.stays_purchases', hotel_id=hotel_id, stay_id=stay_id))
    return render_template('helpdesk/stays/add_purchase.html', **facade)
Exemplo n.º 50
0
def stays_index(hotel_id, page):
    facade = stays_facade.index(page)
    return render_template('admin/hotel/stays/index.html', **facade)
Exemplo n.º 51
0
def home():
    hotels = Hotel.query.order_by('name')
    return render_template('helpdesk/home.html', hotels=hotels)
Exemplo n.º 52
0
def groups_view(hotel_id, group_id):
    facade=groups_facade.view(group_id)
    return render_template('helpdesk/groups/view.html', **facade)
Exemplo n.º 53
0
def groups_index(hotel_id):
    groups = g.proxies.Groups.index()
    return render_template('helpdesk/groups/index.html', groups=groups)
Exemplo n.º 54
0
def guests_view(hotel_id, guest_id):
    facade = guests_facade.view(guest_id)
    return render_template('helpdesk/guests/view.html', **facade)
Exemplo n.º 55
0
def guests_view(hotel_id, guest_id):
    facade = guests_facade.view(guest_id)
    return render_template('helpdesk/guests/view.html', **facade)
Exemplo n.º 56
0
def navigators_view(hotel_id, navigator_id):
    facade = navigators_facade.view(navigator_id)
    return render_template('helpdesk/navigators/view.html', **facade)
Exemplo n.º 57
0
def groups_index(hotel_id):
    groups = g.proxies.Groups.index()
    return render_template('helpdesk/groups/index.html', groups=groups)
Exemplo n.º 58
0
def users_index():
    users = User.query.order_by('name')
    form = UserDeleteForm()
    return render_template('admin/users/index.html', users=users, form=form)
Exemplo n.º 59
0
def service_groups_view(hotel_id, service_group_id):
    facade = service_groups_facade.view(service_group_id)
    return render_template('helpdesk/service_groups/view.html', **facade)
Exemplo n.º 60
0
def hotel_home(hotel_id):
    hotel = Hotel.query.filter_by(id=hotel_id).first()
    if not hotel:
        abort(404)

    return render_template('admin/hotel/home.html', hotel=hotel)