class SupportItemTableEdit(Table): in_id = Col('Request-ID', attr_list=['input', 'id']) in_timestamp = Col('Zeitstempel', attr_list=['input', 'timestamp']) in_message = Col('Nachricht', attr_list=['input', 'message']) in_user_name = Col('Name', attr_list=['input', 'user_name']) #in_contact_details = Col('Kontakt-ID', attr_list=[ # 'input', 'contact_details']) #out_timestamp = Col('Time processed', attr_list=['output', 'timestamp']) out_extreme_negative = Col('Beschwerde - Warnung', attr_list=['output', 'extreme_negative']) out_category = Col('Kategorie', attr_list=['output', 'category']) out_category_score = Col('Kategorie Score', attr_list=['output', 'category_score']) out_assignee = Col('Mitarbeiter', attr_list=['output', 'assignee']) #out_answers = Col('Answers', attr_list=['output', 'answers']) action_del = ButtonCol('Löschen', 'deleteRequestCallback', url_kwargs=dict(id=['input', 'user_name'])) action_reply = ButtonCol('Antworten', 'replyRequestCallback', url_kwargs=dict(id=['input', 'id']))
class SensorTable(Table): classes = ['table', 'table-striped'] id = Col('ID') mac = Col('MAC Address') device = SensorDeviceCol(name = 'Device', attr = 'id') raspi = SensorRaspiCol(name = 'Raspberry Pi', attr = 'id') battery = SensorBatteryCol(name = 'Battery', attr = 'id') edit = ButtonCol('', 'sen.edit_sensor', url_kwargs=dict(id='id'), button_attrs={'class':'btn btn-secondary btn-sm btn-side'}, text_fallback='Edit')
class BookResults(Table): classes = ['table'] id = Col('Id', show=False) title = Col(lazy_gettext(u'Title')) publisher = Col(lazy_gettext(u'Publisher')) author = Col(lazy_gettext(u'Author')) isbn10 = Col('ISBN 10') isbn13 = Col('ISBN 13') category = CategoryCol(lazy_gettext(u'Category')) renter_name = Col(lazy_gettext(u'Renter')) rented_time = DatetimeCol(lazy_gettext(u'Rented time')) rent = ButtonCol(lazy_gettext(u'Rent / Give Back'), '.rent', url_kwargs=dict(id='id'))
class DeviceTable(Table): classes = ['table', 'table-striped'] no_items = 'No items!' status = DeviceStatusCol(name = 'Status', attr = 'id') id = Col('ID') type = Col('Type') group = Col('Group') room = Col('Room') details = ButtonCol('', 'dev.device', url_kwargs=dict(id='id'), button_attrs={'class':'btn btn-secondary btn-sm btn-side'}, text_fallback='Details')
class InternshipTable(Table): classes = ['table', 'table-hover', 'internship-table'] company = Col('Company') medium = Col('Medium') position = Col('Position') location = Col('Location') notes = Col('Notes') #documents = Col('Documents') #deadline = DateCol('Deadline', column_html_attrs={'class' : 'deadline-col'}) edit = ButtonCol('','edit', url_kwargs=dict(_id='_id'), button_attrs={'class' : 'glyphicon glyphicon-pencil'}, column_html_attrs={'class' : 'button-col'}) remove = ButtonCol('','remove', url_kwargs=dict(_id='_id'), button_attrs={'class' : 'glyphicon glyphicon-trash'}, column_html_attrs={'class' : 'button-col'}) def get_tr_attrs(self, internship): if internship.watch_list(): return {'class': 'warning'} if internship.not_applicable(): return {'class': 'info'} if internship.received_offer(): return {'class': 'success'} else: return {}
class ItemTable(Table): ''' This is a itemTable class that generates text/html automatically to create a table for created reservations ''' html_attrs = {'class': 'table table-striped'} name = Col('Name') guests = Col('Guests') phone = Col('Phone') time = Col('Starting Time') table = Col('Table') cancel = ButtonCol('Cancel', 'reservationH.cancel', url_kwargs=dict(id='id'), button_attrs={'class': 'btn btn-danger'})
class TonerInventory(Table): classes = [ 'table', 'table-striped', 'table-bordered', 'table-condensed', 'table-hover' ] id = Col('Id', show=False) toner_model = Col('Printer Model') toner_cartridge = Col('Cartridge Type') toner_color = Col('Color') toner_quantity = Col('Quantity') edit = LinkCol('Edit', 'edit_toner', url_kwargs=dict(ids='toner_id')) delete = ButtonCol('Delete', 'delete_toner', url_kwargs=dict(ids='toner_id'))
class BrewersTable(Table): classes = ['table-hover'] beer_id = Col('beer_id', show=False) name = LinkCol('Name', '.beers', url_kwargs=dict(beer_id='beer_id'), attr='name') abv = Col('ABV') style = Col('Style') route = Col('route', show=False) rmBeer = ButtonCol('', 'rmBeerDB', url_kwargs=dict(beer_id='beer_id', route='route'), attr='rmBeer', button_attrs={'class': 'btn btn-danger'})
class ImageAnalysisTable(Table): image_id = LinkCol("Image id", endpoint="image_analysis", url_kwargs=dict(image_url='image_id'), attr='image_id') segment = LinkCol("Segmentation", endpoint="show_image", url_kwargs=dict(image_url='segment'), allow_sort=False) tumor = Col('Tumor Analysis') diagnosis = Diagnosis("Tumor Type") confidence = Col( "Confidence" ) #LinkCol("Image Location", endpoint="images", url_kwargs=dict(image_url='image'), attr='image') dt = Col('Datetime') recommendations = Col("Recommendations") verified = BoolCol("Verified") change = ButtonCol("Change Image analysis", endpoint="edit_analysis", url_kwargs=dict(image_url='image_id'), td_html_attrs={"class": "change-button"}) delete = ButtonCol("Delete", endpoint="image_analysis", url_kwargs=dict(delete_id='image_id'), allow_sort=False, td_html_attrs={"class": "dbutton"}) allow_sort = True def sort_url(self, col_key, reverse=False): if reverse: direction = 'desc' else: direction = 'asc' return url_for('image_analysis', sort=col_key, direction=direction)
class Checkout(Table): classes = [ 'table', 'table-striped', 'table-bordered', 'table-condensed', 'table-hover' ] id = Col('Id', show=False) checkout_timestamp = DatetimeCol('Checkout Time', datetime_format="YYYY-MM-dd") checkout_username = Col('Username') checkout_item_name = Col('Item') checkout_serial_number = Col('Serial Number') checkout_asset_tag = Col('Asset Tag') check_in = ButtonCol('Check in', 'delete_record', url_kwargs=dict(item='checkout_asset_tag'))
class ItemTable(Table): classes = ["table"] itag = Col('itag') res = Col('Resolution') bitrate = Col('bitrate') file_type = Col('Filetype') size = Col('size') button = ButtonCol('Download', endpoint="index", button_attrs={ 'id': 'dl_button', 'name': 'dl_button', 'onclick': 'update_form_info(this)', 'type': 'button' })
class UniqueTable(Table): ''' This UniqueTable class generates a table of the claimed shifts for a specific user. It also has a button to post a shift ''' role = Col('Role', column_html_attrs={'class': 'spaced-table-col'}) shift_time_start = Col('Starting Time', column_html_attrs={'class': 'spaced-table-col'}) shift_time_end = Col('Ending Time', column_html_attrs={'class': 'spaced-table-col'}) post = ButtonCol('Post Shift', 'shift_manager.post', url_kwargs=dict(id='id'), button_attrs={'class': 'btn btn-warning'}, column_html_attrs={'class': 'spaced-table-col'})
class biddingCaretakerTable(Table): pcontact = Col('Owner Contact') ccontact = Col('Caretaker Contact') petname = Col('Pet name') startday = Col('Start date') endday = Col('End date') paymentmode = Col('Payment mode') deliverymode = Col('Delivery mode') status = Col('Status') accept = ButtonCol('Accept', 'view.render_caretaker_biddings_accept', url_kwargs=dict(ownerContact='pcontact', ccontact='ccontact', petName='petname', startDay='startday', endDay='endday'))
class Results(Table): classes = [ 'table', 'table-striped', 'table-bordered', 'table-condensed', 'table-hover' ] id = Col('Id', show=False) employee_id = Col('Employee Code') username = Col('Username') first_name = Col('First Name') last_name = Col('Last Name') email = Col('Email') room_number = Col('Room Number') edit = LinkCol('View/Edit', 'edit', url_kwargs=dict(id='employee_id')) delete = ButtonCol('Delete', 'delete_users', url_kwargs=dict(id='employee_id'))
class UsersTable(Table): classes = ['table', 'table-striped'] #id = Col('#') name = Col('Name') surname = Col('Surname') email = Col('Email') user_type = OptCol('Type of user', choices={ 1: 'Admin', 2: 'User', 3: 'Other' }) remove = ButtonCol('Remove', 'remove_user', url_kwargs=dict(id='id'), button_attrs={'class': 'remove-btn'})
class RandomTable(Table): classes = ['table-hover'] beer_id = Col('beer_id', show=False) name = LinkCol('Name', '.beers', url_kwargs=dict(beer_id='beer_id'), attr='name') abv = Col('ABV') style = Col('Style') brewer = Col('Brewer') route = Col('route', show=False) order = ButtonCol('', 'addToOrder', url_kwargs=dict(beer_id='beer_id', route='route'), attr='order', button_attrs={'class': 'btn btn-success'})
class SearchResultsTable2(Table): beer_id = Col('beer_id', show=False) name = LinkCol('Name', '.beers', url_kwargs=dict(beer_id='beer_id'), attr='name') style = Col('Style') brewer = Col('Brewer') city = Col('City') country = Col('Country') route = Col('route', show=False) order = ButtonCol('', 'addToOrder', url_kwargs=dict(beer_id='beer_id', route='route'), attr='order', button_attrs={'class': 'btn btn-success'})
class RequestTable(Table): classes = ['table', 'table-bordered', 'table-hover'] approve_button = ButtonCol('Approve', 'dash.approve', url_kwargs=dict(id='id'), button_attrs={'class': 'btn btn-success'}) id = Col('id') crm_app_no = Col('crm_app_no') reason = Col('reason') requester_name = Col('requester_name') requester_id = Col('requester_id') requester_designation = Col('requester_designation') request_date = LocalTimeCol('request_date') closed_by_name = Col('closed_by_name') closed_by_id = Col('closed_by_id') assign_to_name = Col('assign_to_name') assign_to_id = Col('assign_to_id') is_approved_by_teamlead = Col('is_approved_by_teamlead') approving_teamlead_name = Col('approving_teamlead_name') approving_teamlead_id = Col('approving_teamlead_id') teamlead_approve_date = LocalTimeCol('teamlead_approve_date') is_approved_by_teammanager = Col('is_approved_by_teammanager') approving_teammanager_name = Col('approving_teammanager_name') approving_teammanager_id = Col('approving_teammanager_id') teammanager_approve_date = LocalTimeCol('teammanager_approve_date') is_approved_by_saleshead = Col('is_approved_by_saleshead') approving_saleshead_name = Col('approving_saleshead_name') approving_saleshead_id = Col('approving_saleshead_id') saleshead_approve_date = LocalTimeCol('saleshead_approve_date') def get_tr_attrs(self, item): if item.is_approved_by_saleshead: return {'class': 'table-success'} elif item.is_approved_by_teammanager: return {'class': 'table-warning'} elif item.is_approved_by_teamlead: return {'class': 'table-danger'} else: return {}
class SortableTable(Table): id = Col('ID') tool = Col('Tool') work_role = Col('Work Role') user_story = Col('User Story', allow_sort=False) vote = ButtonCol('Vote', 'upvote', text_fallback='+', allow_sort=False) allow_sort = True def sort_url(self, col_key, reverse=False): if reverse: direction = 'desc' else: direction = 'asc' return url_for('previous_submissions', sort=col_key, direction=direction)
class ManageUsersTable(Table): classes = ["table", "table-hover"] thead_classes = ["table-dark"] user_type = OptCol("User Type", choices=dict((choice, choice.value) for choice in UserTypes)) first_name = Col("First Name") last_name = Col("Last Name") email = Col("Email") account = LinkCol("", "account", url_kwargs=dict(id="id"), allow_sort=False, text_fallback="Edit") delete = ButtonCol("", "remove_user", text_fallback="Remove", url_kwargs=dict(id="id"), button_attrs={"class": "btn btn-danger btn-sm"}, allow_sort=False) allow_sort = True def sort_url(self, col_key, reverse=False): if reverse: direction = "desc" else: direction = "asc" return url_for("manage_users", sort_by=col_key, sort_reverse=direction)
class UserTable(Table): allow_sort = True classes = ['table', 'usertable'] id = Col('id') username = Col('TXState ID') link = ButtonCol('Edit', 'admin.useredit', url_kwargs=dict(id='id')) nickname = Col('Name') email = Col('e-mail') roles = RolesCol('Roles') active = BoolCol('Active') def sort_url(self, col_key, reverse=False): if reverse: direction = 'desc' else: direction = 'asc' return url_for('admin.home', sort=col_key, direction=direction)
class ShowCurrentAcceptedMaches(Table): id = Col('Id') match_creator_id = Col('Id - Criador Partida') competitor_id = Col('Id - Competidor') game_name = Col('Nome Jogo') platform = Col('Nome da Plataforma') bet_value = Col('Valor Aposta') match_creator_gametag = Col('gametag Criador Partida') competitor_gametag = Col('gametag Competidor') comment = Col('Comentários') game_rules = Col('Regras') game_mode = Col('Modo de Jogo') match_creator_username = Col('Nome Usuário Criador Partida') competitor_username = Col('Nome Usuário Competidor') match_status = Col('Status da Partida') match_accepting = ButtonCol('Inserir Resultados', 'insert_results', url_kwargs=dict(id='id'))
class SearchMatchTable(Table): id = Col('Id') match_creator_id = Col('Id - Criador Partida') competitor_id = Col('Id - Competidor') game_name = Col('Nome Jogo') # platform = Col('Nome da Plataforma') # bet_value = Col('Valor Aposta') # match_creator_gametag = Col('gametag Criador Partida') # competitor_gametag = Col('gametag Competidor') # comment = Col('Comentários') # game_rules = Col('Regras') # game_mode = Col('Modo de Jogo') # match_creator_username = Col('Nome Usuário Criador Partida') # competitor_username = Col('Nome Usuário Competidor') # match_status = Col('Status da Partida') match_accepting = ButtonCol('Aceitar', 'accept_match', url_kwargs=dict(id='id'))
class LocationTable(Table): classes = ['table', 'table-striped', 'table-bordered', 'table-condensed'] id = Col('Id', show=False) timeStamp = Col('Timestamp (device local time)') latitude = Col('Latitude (Decimal Degree WGS84)') longitude = Col('Longitude (Decimal Degree WGS84)') positionAccuracy = Col('Position Accuracy (M)') altitude = Col('Altitude (M above WGS84)') altitudeAccuracy = Col('Altitude Accuracy (M)') speed = Col('Speed (M/S)') heading = Col('Heading (Deg)') w3w = Col('What3words') ip = Col('IP') showTrackButton = ButtonCol('Show point', 'dashboard', url_kwargs=dict(location_id='id'))
class ItemTable(Table): ''' This is a itemTable class that generates text/html automatically to create a table for created reservations ''' html_attrs = {'class': 'table table-striped'} room_no = Col('Room Number') max_guests = Col('Max Guests') description = Col('Description') price = Col('Price') r_type = Col('Room Type') order = ButtonCol('Order', 'reservation.order', url_kwargs=dict(rn='room_no', hid='hotel_id', checkin='checkin', checkout='checkout', price='price_num'), button_attrs={'class': 'btn btn-success'})
class Results(Table): #if Req_URL == "None" or not Req_URL: Req_URL = Col('Request Title (or URL)') #elif TITLE == "None" or not TITLE: TITLE = Col('Request Title') Key = Col('Request Id') Date_Submitted = Col('Date Submitted') Req_Due_Date = Col('Due Date') Req_Name = Col('Requested By') Req_Title = Col('Requestor Title') Req_Affiliation = Col('Requestor Affiliation') Req_Phone = Col('Requestor Phone') Req_Email = Col('Requestor Email') ASSIGNED_TO = Col('Assigned to') PRIORITY = PriorityCol('Priority') REQ_STATUS = Col('Request Status') FOLDER_LOCATION = ExternalURLCol('Folder Location') form = ButtonCol('Form to Update Request', 'statusUpdateForm', url_kwargs=dict(form='Key'))
class PatientsTable(Table): pid = Col("Patient's id") fullname = Col("Full Name") #first_name = Col('First Name') #last_name = Col('Last Name') ssn = Col('SSN') gender = Col("Geder") age = Col('Age') delete = ButtonCol("Delete", endpoint="patients", url_kwargs=dict(delete_id='pid'), allow_sort=False) allow_sort = True def sort_url(self, col_key, reverse=False): if reverse: direction = 'desc' else: direction = 'asc' return url_for('patients', sort=col_key, direction=direction)
class ItemTable(Table): '''Converts a list of Item objects into a flask_table.Table object. Attributes: classes: HTML class names to be given to table when generated into HTML. task: flask_table.Col object that creates a column of all Item.task attributes and gives them an HTML class of 'task_row.' date: flask_table.Col object that creates a column of all Item.date attributes. clear: flask_table.ButtonCol object that creates a column of HTML buttons used to clear a table row by passing its ID to the 'remove_task' app endpoint. ''' classes = ['tasks_table'] task = Col(name='Task', column_html_attrs={'class': 'task_row'}) date = Col(name='Remind Me @') clear = ButtonCol( name='Clear Task', endpoint='remove_task', url_kwargs=dict(id='id'), button_attrs={'class': 'btn btn-default task-btn'} )
def url_kwargs(self, item): url_kwargs_out = _ButtonCol.url_kwargs(self, item) url_kwargs_out.update(self._url_extra_kwargs) return url_kwargs_out
class MyTable(Table): name = Col('Name') view = ButtonCol('Delete', 'delete', url_kwargs=dict(id_='id'), button_attrs={'class': 'myclass'})
class MyTable(Table): name = Col('Name') view = ButtonCol('Delete', 'delete', url_kwargs=dict(id_='id'))
def __init__(self, *args, **kwargs): url_extra_kwargs = kwargs.pop('url_extra_kwargs', {}) _ButtonCol.__init__(self, *args, **kwargs) self._url_extra_kwargs = url_extra_kwargs