def renderInventoryListings(itemType='ALL', status='ALL', quality='ALL', searchSerial=None, searchModal=None): deviceList = models.getDevicesWithLog(itemType, status, quality) length = models.getDevices() error = None if 'error' in session: error = session['error'] session.pop('error', None) return render_template("page/PageIndex_Inventory.html", filter_Type=itemType, filter_Status=status, filter_quality=quality, query=deviceList, types=models.getDeviceTypes(), states=models.getStates(), totalItems=len(length), totalSignedOut=len( models.getDevicesWithLog('ALL', 'out', 'ALL')), data_id=searchSerial, queueModal=searchModal, name=escape(getName()), error=error)
def renderInventoryListings(itemType = 'ALL', status = 'ALL', quality = 'ALL', searchSerial = None, searchModal = None): deviceList = models.getDevicesWithLog(itemType, status, quality) length = models.getDevices() error = None if 'error' in session: error = session['error'] session.pop('error', None) return render_template("page/PageIndex_Inventory.html", filter_Type = itemType, filter_Status = status, filter_quality = quality, query = deviceList, types = models.getDeviceTypes(), states = models.getStates(), totalItems = len(length), totalSignedOut = len(models.getDevicesWithLog('ALL', 'out', 'ALL')), data_id = searchSerial, queueModal = searchModal, name = escape(getName()), error = error )
def viewItem(serial): item = models.Device.select().where(models.Device.serialNumber == serial) types = models.getDeviceTypes() states = models.getStates() return render_template('viewItem.html', item=item, types=types, states=states, logoutURL=url_for('logout') )
def renderPage_View(serial, error=None): device = models.Device.select().where( models.Device.SerialNumber == serial).get() log = models.getDeviceLog(serial) if len(log) > 0: device.statusIsOut = not log.get().DateIn else: device.statusIsOut = False return render_template("page/PageViewItem.html", device=device, types=models.getDeviceTypes(), states=models.getStates(), log=log, error=error)
def renderPage_View(serial, error = None): device = models.Device.select().where(models.Device.SerialNumber == serial).get() log = models.getDeviceLog(serial) if len(log) > 0: device.statusIsOut = not log.get().DateIn else: device.statusIsOut = False return render_template("page/PageViewItem.html", device = device, types = models.getDeviceTypes(), states = models.getStates(), log = log, error = error )
def renderMainPage(serialNumber = '', itemType = 'ALL', state = 'ALL', status = 'All'): # TODO filter results, set page form filters, and remove prints print(serialNumber) print(itemType) print(state) print(status) query = models.Device.select().order_by(models.Device.serialNumber) types = models.getDeviceTypes() states = models.getStates() return render_template('index.html', query=query, types=types, states=states, totalItems=len(query), name=escape(session['displayName']), logoutURL=url_for('logout'), indexURL=url_for('index'), hasEditAccess=True )