class CodesTable(Table): classes = ['table', 'table-sm'] code = LCodeCol('Code') sent_by = Col('From') sent_to = Col('To') created_on = DateCol('Created', date_format='d.MM.yyyy') sent_on = DateCol('Sent', date_format='d.MM.yyyy')
class PetitionTable(Table): html_attrs = {'table-layout': 'fixed'} title = Col('Petition Title') url = ExternalURLCol('Link to Petition', url_attr='url') created_date = DateCol('Created', th_html_attrs={'data-type': 'date'}) deadline_date = DateCol('Deadline', th_html_attrs={'data-type': 'date'}) signature_count = Col('Signatures Collected') status = Col('Status') def get_td_attrs(self, item): return {'word-wrap': 'break-word'}
class PackageItemTable(Table): classes = ['table', "table-dark"] name = Col('Name') planetary_body = Col("Body") creation_date = DateCol('Creation Date') # creator_id = Col('Creator') creator = UserCol("Creator") # allow_sort = True tools = ToolCol("Tools") # def __init__(self, items): # super(PackageItemTable, self).__init__(items) # if not current_user.is_anonymous: # self.add_column("editable", BoolCol("Editable")) # self.add_column("edit_url", EditCol("Edit", "blog.update", url_kwargs=dict(id='id') , button_attrs={"class": "btn btn-outline-danger"})) # def sort_url(self, col_key, reverse=False): if reverse: direction = 'desc' else: direction = 'asc' return url_for('blog.index', sort=col_key, direction=direction)
class AdmTasksTable(Table): #allow_sort = True #Done over javascript classes = ['table', 'taskstable', 'admin'] html_attrs = {'id': 'TaskTable'} id = Col('Id') active = BoolCol('Active') equipment = NameCol('Equipment', th_html_attrs={'class': 'col-md-2'}) name = TaskTagCol('Task', th_html_attrs={'class': 'col-md-3'}) priority = Col('Priority') facility = Col('Facility', attr_list=['equipment', 'facility'], th_html_attrs={'class': 'col-md-1'}) cycle = Col('Ccl') cycletype = OptCol('CType', th_html_attrs={'class': 'col-md-1'}, choices=cycletypes.table_choices()) logging = OptCol('Logging', th_html_attrs={'class': 'col-md-1'}, choices=logtypes.table_choices()) link = LinkCol('Edit', 'tasks.edit', url_kwargs=dict(id='id'), th_html_attrs={'class': 'col-md-1'}) ddate = DateCol('DueDate', th_html_attrs={'class': 'col-md-1'})
class PlantLog(Table): table_id = 'daily_log' classes = ['main', 'chart', 'log'] id = Col('id', show=False) plant_name = LinkCol('Plant Name', 'view_plant', url_kwargs=dict(id='plant_ID'), attr='plant_name') logdate = DateCol('Log Date', date_format='short') stage = AddIconCol('Stage') water = BoolCol('Water', yes_display='Yes', no_display='No') height = Col('Height') span = Col('Span') nodes = Col('Nodes') nutrient_name = Col('Nutrient') repellent_name = Col('Repellent') environment_name = Col('Environment') lux = Col('Lux', td_html_attrs={'class': 'luxlevel'}, show=False) soil_pH = Col('Soil pH') trim = Col('Trim') transplant = BoolCol('Transplant', yes_display='Yes', no_display='No') notes = Col('Notes') edit = LinkCol('Edit', 'edit_log', url_kwargs=dict(id='id'), show=False) delete = LinkCol('Delete', 'delete_log', url_kwargs=dict(id='id'), show=False)
class RequestsTable(Table): classes = ['table', 'table-sm'] created_on = DateCol('Created', date_format='d.MM.yyyy') req_by = Col('By') req_from = Col('From') is_hidden = BoolNaCol('Hidden?') is_active = BoolNaCol('Active?')
class Orders(Table): table_id = 'orders' classes = ['main', 'chart', 'order'] id = Col('id', show=False) customer_name = LinkCol('Customer Name', 'view_customer', url_kwargs=dict(id='customer_ID'), attr='customer_name') orderdate = DateCol('Order Date', date_format='short') stage = AddIconCol('Stage') water = BoolCol('Water', yes_display='Yes', no_display='No') height = Col('Height') span = Col('Span') nodes = Col('Nodes') nutrient_name = Col('Nutrient') repellent_name = Col('Repellent') product_name = Col('Product') lux = Col('Lux', td_html_attrs={'class': 'luxlevel'}, show=False) soil_pH = Col('Soil pH') trim = Col('Trim') transcustomer = BoolCol('Transcustomer', yes_display='Yes', no_display='No') notes = Col('Notes') edit = LinkCol('Edit', 'edit_order', url_kwargs=dict(id='id'), show=False) delete = LinkCol('Delete', 'delete_order', url_kwargs=dict(id='id'), show=False)
class BlogEntryTable(Table): entry_id = Col('ID') title = Col('Title') date_posted = DateCol('Date Posted') is_published = Col('published') publish = LinkCol('Publish', 'blogs.publish_entry', url_kwargs=dict(id='entry_id')) unpublish = LinkCol('Unpublish', 'blogs.unpublish_entry', url_kwargs=dict(id='entry_id')) delete = LinkCol('Delete', 'blogs.delete_entry', url_kwargs=dict(id='entry_id'))
class EventsTable(Table): classes = ['table', 'table-hover'] thead_classes = ['thead-light'] no_items = "Sorry, no events found" date = DateCol('Date') artist = URLCol('Artist', url_attr='artist_url', attr='artist') venue = URLCol('Venue', url_attr='venue_url', attr='venue') genre = Col('Genre') meetup = Col('Meetup Groups')
class Results(Table): tool_name = Col("title") modelNo = Col("modelNo") list_price = Col("price") category = Col("category") desc = Col("description") brand = Col("brand") date_created = DateCol("date") sold_status = Col("sold")
class Mag_table(Table): id = Col("Id", show=False) title = Col("Title") owner_id = Col("Owner Id", show=False) owner_name = Col("Owner") borrower_name = Col("Borrower") date_borrowed = DateCol("Borrowed", date_format="long") borrow_mag = ButtonCol("Borrow", "borrow_mag", url_kwargs=dict(id="id")) return_mag = ButtonCol("Return", "return_mag", url_kwargs=dict(id="id"))
def main_table(data, years): options = dict(classes=['table', 'table-hover'], thead_classes=['thead-light'], no_items='N/A') TableCls = create_table(options=options) for year in years: TableCls.add_column(str(year), DateCol(year)) table = TableCls(data) return table
class TabelaClientes(Table): """Tabela para exibição de resultados de consultas de Clientes.""" classes = ['table', 'table-striped', 'col-lg-3'] no_items = 'Nenhum cliente encontrado.' id = Col('ID', show=False) nome = Col('Nome') documento = Col('Documento') data_nascimento = DateCol('Data de nasc.') endereco = Col('Endereço') telefone = Col('Telefone') email = Col('E-mail')
class EventsTable(Table): classes = [ "table", "table-bordered", "table-striped", "mb-0", "compact", "fixed-bottom" ] event_name = Col('Event Name') event_date = DateCol( 'Event Date') # , date_format=(d, format='short', locale='en_AU')) event_type = Col("Event Type") edit_event = LinkCol('Edit', 'update_event', url_kwargs=dict(id='edit_event'))
class DVD_table(Table): id = Col("Id", show=False) title = Col("Title") owner_id = Col("Owner Id", show=False) owner_name = Col("Owner") format_dvd = Col("DVD") format_bluray = Col("Blu Ray") format_4k = Col("4K") rating = Col("Rating") borrower_name = Col("Borrower") date_borrowed = DateCol("Borrowed", date_format="long") borrow_dvd = ButtonCol("Borrow", "borrow_dvd", url_kwargs=dict(id="id")) return_dvd = ButtonCol("Return", "return_dvd", url_kwargs=dict(id="id"))
class InternshipTableNA(Table): classes = ['table', 'table-hover', 'internship-table-na'] 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'})
class gen_table(Table): update = LinkCol('', 'booking_bp.update_booking', url_kwargs=dict(id='id'), anchor_attrs={'type': 'button', 'class': 'btn btn-primary'}) delete = LinkCol('Delete', 'booking_bp.delete_booking', url_kwargs=dict(id='id'), anchor_attrs={'type': 'button', 'class': 'btn btn-danger'}) classes = ['table', 'table-bordered', 'table-striped'] film = Col('') start_date = DateCol('Start Date') end_date = DateCol('End Date') program = Col('Program') guarantee = Col('Guarantee') percentage = Col('Percentage') gross = Col('Gross') view_results = LinkCol('View Results', 'booking_bp.booking_results', url_kwargs=dict(id='id')) distributor = Col('Distributor') enter_payment = LinkCol('Enter Payment', 'payments_bp.new_payment', url_kwargs=dict(id='id')) view_payments = LinkCol('View Payments', 'payments_bp.view_payments', url_kwargs=dict(id='id'))
def dashboard(): form = MemberAccountForm() form.tav.data = 159231 form.remit_date.data = datetime.strptime('3/20/2020', '%m/%d/%Y') form.remit_amount.data = 20009 class DaysAgoCol(Col): def td_format(self, content): today = datetime.now() age = relativedelta(today, content) years = age.years months = age.months days = age.days hours = age.hours minutes = age.minutes if years: s = str(years) + (' years' if years > 1 else ' year') elif months: s = str(months) + (' months' if months > 1 else ' month') elif days: s = str(days) + (' days' if days > 1 else ' day') elif hours: s = str(hours) + (' hours' if hours > 1 else ' hour') elif minutes: s = str(minutes) + (' minutes' if minutes > 1 else ' minute') else: s = 'A few seconds ' return content.strftime('%Y-%m-%d') + ' (' + s + ' ago)' LoanTable = create_table('LoanTable')\ .add_column('date_filed', DateCol('Date Filed', date_format='YYYY-MM-dd'))\ .add_column('date_filed', DaysAgoCol('Date Filed'))\ .add_column('amount', Col('Principal'))\ .add_column('terms', Col('Terms')) LoanTable.classes = ['table', 'table-condensed', 'table-striped'] loans = Loan.query.filter_by(user_id=current_user.id)\ .order_by(Loan.date_filed.desc()).limit(5).all() table = LoanTable(loans) services = Service.query.order_by(Service.id).all() return render_template('main/dashboard.html', form=form, services=services, loans=loans, table=table)
class UsersTable(Table): classes = ['table', 'table-sm'] id = Col('id') created_on = DateCol('Created', date_format='d.MM.yyyy') name = LinkCol('Name', 'c.profile', attr='name', url_kwargs={'pcode': 'code'}) osm_name = Col('OSM Name') country = Col('Country') privacy = OptCol('Privacy', { 2: 'Open', 4: 'Confirmed', 6: 'Profile', 8: 'Ask', 10: 'Closed' }) does_requests = BoolNaCol('Requests?') is_active = BoolNaCol('Active?')
class MyTable(Table): date = DateCol('Date Heading', date_format="YYYY-MM-dd")
class MyTable(Table): date = DateCol('Date Heading')