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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
def groups_view(hotel_id, group_id): facade = groups_facade.view(group_id) return render_template('helpdesk/groups/view.html', **facade)
def navigators_view(hotel_id, navigator_id): facade = navigators_facade.view(navigator_id) return render_template('helpdesk/navigators/view.html', **facade)
def stays_search(hotel_id): facade = stays_facade.search() return render_template('admin/hotel/stays/search.html', **facade)
def search(hotel_id): facade = stays_facade.search() return render_template('helpdesk/search.html', **facade)
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)
def stays_purchases(hotel_id, stay_id): facade = stays_facade.purchases(stay_id) return render_template('helpdesk/stays/purchases.html', **facade)
def service_options_index(hotel_id, page): facade = service_options_facade.index(page) return render_template('helpdesk/service_options/index.html', **facade)
def stays_print_queue(hotel_id, stay_id): facade = stays_facade.print_queue(stay_id) return render_template('helpdesk/stays/print_queue.html', **facade)
def stays_index(hotel_id): facade = stays_facade.index(page) return render_template('helpdesk/stays/index.html', **facade)
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)
def service_groups_index(hotel_id, page): facade = service_groups_facade.index(page) return render_template('helpdesk/service_groups/index.html', **facade)
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)
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)
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)
def technicians_index(hotel_id): technicians = g.proxies.Technicians.index() return render_template('admin/hotel/technicians/index.html', technicians=technicians)
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)
def home(): hotels = Hotel.query.order_by('name') return render_template('helpdesk/home.html', hotels=hotels)
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)
def stays_index(hotel_id, page): facade = stays_facade.index(page) return render_template('admin/hotel/stays/index.html', **facade)
def groups_view(hotel_id, group_id): facade=groups_facade.view(group_id) return render_template('helpdesk/groups/view.html', **facade)
def groups_index(hotel_id): groups = g.proxies.Groups.index() return render_template('helpdesk/groups/index.html', groups=groups)
def guests_view(hotel_id, guest_id): facade = guests_facade.view(guest_id) return render_template('helpdesk/guests/view.html', **facade)
def users_index(): users = User.query.order_by('name') form = UserDeleteForm() return render_template('admin/users/index.html', users=users, form=form)
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)
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)