Exemplo n.º 1
0
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)
Exemplo n.º 2
0
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)
Exemplo n.º 3
0
class UserDetailsTable(Table):
    """Build a users details table."""

    thead_attrs = {'style': 'font-size:11px'}
    classes = [
        'table table-striped', 'table table-hover', 'table table-condensed'
    ]

    user_name_id = LinkCol('Edit Details',
                           'users.users_processing',
                           url_kwargs=dict(user_name='user_name'),
                           anchor_attrs={'style': 'font-size:12px'})
    user_name = Col('User Name',
                    allow_sort=True,
                    td_html_attrs={'style': 'font-size:12px'})
    full_name = Col('Employee Name',
                    allow_sort=False,
                    td_html_attrs={'style': 'font-size:12px'})
    email = Col('Email',
                allow_sort=True,
                td_html_attrs={'style': 'font-size:12px'})
    confirmation_sent_at = Col('Confirmed Date',
                               allow_sort=True,
                               td_html_attrs={'style': 'font-size:12px'})
    is_confirmed = BoolCol('Confirmed Email',
                           allow_sort=True,
                           td_html_attrs={'style': 'font-size:12px'})
    confirmed_at = Col('Confirmed Date',
                       allow_sort=True,
                       td_html_attrs={'style': 'font-size:12px'})
    is_active = BoolCol('User Active',
                        allow_sort=True,
                        td_html_attrs={'style': 'font-size:12px'})
    created_datetime = Col('User Created',
                           allow_sort=True,
                           td_html_attrs={'style': 'font-size:12px'})
    login_datetime = Col('Last Logged In',
                         allow_sort=True,
                         td_html_attrs={'style': 'font-size:12px'})
    password_last_change_datetime = \
        Col('Last Password Change',
            allow_sort=True, td_html_attrs={'style': 'font-size:12px'})
    allow_sort = True

    def sort_url(self, col_key, reverse=False):
        """Process sort url for the columns of the tables."""
        if reverse:
            direction = 'desc'
        else:
            direction = 'asc'
        return url_for('users.users_processing',
                       sort=col_key,
                       direction=direction)
Exemplo n.º 4
0
class PaperOverviewTable(Table):
    title = Col('Papertitle   ')
    abstract = Col('   Abstract   ')
    authors = Col('   Authors   ')
    score = Col('   Ratings   ')
    is_accepted = BoolCol('   Accepted   ')
    accept = LinkCol('   Assess   ', 'score_overview', url_kwargs=dict(id='id'))
Exemplo n.º 5
0
class NodesTable(Table):
    classes = ['pure-table', 'stretch']
    allow_sort = True
    unique_id = Col('Unique ID')
    api_key = Col('API Key')
    owner = Col('Owner')
    active = BoolCol('Active')
    # created = DateTimeStringCol('Create Date')
    # updated = DateTimeStringCol('Updated Date')
    delete = ButtonCol('Delete',
                       'delete_node',
                       url_kwargs=dict(id='id'),
                       button_attrs={'class': 'pure-button button-error'})
    disable = ButtonCol('Disable',
                        'disable_node',
                        url_kwargs=dict(id='id'),
                        button_attrs={'class': 'pure-button button-secondary'})
    regen = ButtonCol('Regen API Key',
                      'regen_node_api',
                      url_kwargs=dict(id='id'),
                      button_attrs={'class': 'pure-button button-secondary'})

    def sort_url(self, col_key, reverse=False):
        if col_key == 'delete' or col_key == 'regen' or col_key == 'disable':
            col_key = 'id'
        if reverse:
            direction = 'desc'
        else:
            direction = 'asc'
        return url_for('nodes', sort=col_key, direction=direction)
Exemplo n.º 6
0
class MenusDetailsTable(Table):
    """Build a menus details table."""

    thead_attrs = {'style': 'font-size:11px'}
    classes = ['table table-striped', 'table table-hover',
               'table table-condensed']

    role_name_id = LinkCol('Edit Details',
                           'navigation.navmenus',
                           url_kwargs=dict(menu='menu_url'),
                           anchor_attrs={'style': 'font-size:12px'})
    menu_name = Col('Menu Name', allow_sort=True,
                    td_html_attrs={'style': 'font-size:12px'})
    menu_text = Col('Menu Details', allow_sort=True,
                    td_html_attrs={'style': 'font-size:12px'})
    menu_url = Col('Menu URL', allow_sort=True,
                   td_html_attrs={'style': 'font-size:12px'})
    is_active = BoolCol('Menu Active', allow_sort=True,
                        td_html_attrs={'style': 'font-size:12px'})
    created_datetime = Col('Menu Created', allow_sort=True,
                           td_html_attrs={'style': 'font-size:12px'})
    last_modified_datetime = Col('Menu Last Modified', allow_sort=True,
                                 td_html_attrs={'style': 'font-size:12px'})
    allow_sort = True

    def sort_url(self, col_key, reverse=False):
        """Process sort url for the columns of the tables."""
        if reverse:
            direction = 'desc'
        else:
            direction = 'asc'
        return url_for('navigation.navmenus', sort=col_key,
                       direction=direction)
Exemplo n.º 7
0
class UsersTable(Table):
    classes = ['pure-table']
    allow_sort = True
    username = Col('Invite Code')
    role = Col('Created By')
    active = BoolCol('Active')
    created = DatetimeCol('Create Date')
    updated = DatetimeCol('Updated Date')
    delete = ButtonCol('Delete',
                       'delete_user',
                       url_kwargs=dict(id='id'),
                       button_attrs={'class': 'pure-button button-error'})
    disable = ButtonCol('Disable',
                        'disable_user',
                        url_kwargs=dict(id='id'),
                        button_attrs={'class': 'pure-button button-secondary'})
    gen_pass = ButtonCol(
        'New Password',
        'regen_password',
        url_kwargs=dict(id='id'),
        button_attrs={'class': 'pure-button button-secondary'})

    def sort_url(self, col_key, reverse=False):
        if col_key == 'delete' or col_key == 'disable' or col_key == 'gen_pass':
            col_key = 'id'
        if reverse:
            direction = 'desc'
        else:
            direction = 'asc'
        return url_for('invites', sort=col_key, direction=direction)
Exemplo n.º 8
0
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'})
Exemplo n.º 9
0
class StudyTable(Table):
    def sort_url(self, col_id, reverse=False):
        pass
    edit = LinkCol(
        'edit', 'edit_study', url_kwargs=dict(study_id='STUDYID'),
        anchor_attrs={'class': 'btn btn-icon btn-primary', 'title': 'Edit Study'},
        th_html_attrs={'class': 'mat-icon text-center', 'title': 'Edit Study'}
    )
    details = LinkCol(
        'ballot', 'study_details', url_kwargs=dict(study_id='STUDYID'),
        anchor_attrs={'class': 'btn btn-icon btn-default', 'title': 'Edit Questions'},
        th_html_attrs={'class': 'mat-icon text-center', 'title': 'Edit Questions'}
    )
    add_inv = LinkCol(
        'person_add', 'new_investigator', url_kwargs=dict(study_id='STUDYID'),
        anchor_attrs={'class': 'btn btn-icon btn-accent', 'title': 'Add Investigator'},
        th_html_attrs={'class': 'mat-icon text-center', 'title': 'Add Investigator'}
    )
    STUDYID = Col('Study Id')
    TITLE = Col('Title')
    NETBADGEID = Col('User')
    DATE_MODIFIED = DatetimeCol('Last Update', "medium")
    Q_COMPLETE = BoolCol('Complete?')
    requirements = NestedTableCol('Requirements', RequirementsTable)
    investigators = NestedTableCol('Investigators', InvestigatorsTable)
    delete = LinkCol(
        'delete', 'del_study', url_kwargs=dict(study_id='STUDYID'),
        anchor_attrs={'class': 'btn btn-icon btn-warn', 'title': 'Delete Study'},
        th_html_attrs={'class': 'mat-icon text-center', 'title': 'Delete Study'}
    )
Exemplo n.º 10
0
class CurrentModelsTable(Table):
    classes = ["table", "table-striped"]
    name = Col("Model name")
    active = BoolCol('Active', yes_display='Yes', no_display='No')
    link = LinkCol('Activate',
                   'activate_model',
                   url_kwargs=dict(id='id'),
                   anchor_attrs={'class': 'myclass'})
Exemplo n.º 11
0
class Result(Table):
    id = Col('Id', show=False)
    #numb=Col('Number')
    typename = Col('Type')
    itemname = Col('Name')
    size_i = Col('Size')
    price = Col('Price')
    day = Col('Date')
    isold = BoolCol('Sold')
    edit = LinkCol('Edit', 'edit', url_kwargs=dict(id='id'))
Exemplo n.º 12
0
class BlockchainTable(Table):
    # Class to format the table
    classes = ['table', 'table-striped']

    from_user = Col('From')
    to_user = Col('To')
    amount = Col('Amount')
    timestamp = DatetimeCol('Timestamp', datetime_format='full')
    nonce = Col('Nonce')
    miner_verify = BoolCol('Transaction Verified')
Exemplo n.º 13
0
class DirectoryTableForClone(Table):
    classes = [
        'table', 'table-light', 'table-bordered', 'thead-light', 'tbody-light',
        'my-table'
    ]

    is_dir = BoolCol('isFolder', yes_display='yes', no_display='no')
    name = LinkCol(name='name',
                   endpoint='repository_command_route',
                   attr='name',
                   url_kwargs=dict(command='name'))
Exemplo n.º 14
0
class ItemTable(Table):
    classes = ['table table-striped']
    thead_classes = ['thead-dark']
    _id = Col('Name')
    art = Col('Klasse')
    kind = Col('Art')
    haveit = BoolCol('Vorhanden', yes_display='ja', no_display='nein')
    changeit = ButtonCol('ändern',
                         'update',
                         url_kwargs=dict(id="_id", richtung="haveit"))
    deleteit = ButtonCol('löschen', 'deleteit', url_kwargs=dict(id="_id"))
Exemplo n.º 15
0
class RegistrationTable(Table):
    classes = [
        "table", "table-bordered", "table-striped", "mb-0", "compact",
        "fixed-bottom"
    ]
    first_name = Col('First Name')
    last_name = Col('Last Name')
    is_member = BoolCol("Is a Member", no_display='')  # Show nots as blank
    sale_type = Col('Entry Type ')
    pay_method = Col("Payment Method")
    payment = Col("Payment Amount")
    event_name = Col('event_name')
Exemplo n.º 16
0
class DirectoryTable(Table):
    classes = [
        'table', 'table-light', 'table-bordered', 'thead-light', 'tbody-light',
        'my-table'
    ]
    is_dir = BoolCol(
        '',
        yes_display='<img class="my-image" src="static/folder_icon.png">',
        no_display='<img class="my-image" src="static/file_icon.png">',
        show=True)
    name = LinkCol(name='name',
                   endpoint='github_command_route',
                   attr='name',
                   url_kwargs=dict(command='name'))
Exemplo n.º 17
0
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)
Exemplo n.º 18
0
class OrderTable(Table):
    classes = ['table', 'table-hover',
               'table-condensed', 'table-striped']
    id = LinkCol('ID', 'order_summary',
                 url_kwargs=dict(id='id'), attr_list=['id'])
    user = Col('Created By')
    order_name = Col('Name')
    timestamp = DatetimeCol('Created On')
    archived = BoolCol('Archived')

    def __init__(self, orders, **kwargs):
        items = []
        for order in orders:
            items.append({'id': order.id,
                          'user': order.user.name,
                          'order_name': order.order_name,
                          'timestamp': order.timestamp,
                          'archived': order.archived})
        super().__init__(items, **kwargs)
Exemplo n.º 19
0
class PropertyTable(Table):
    classes = [
        'table', 'table-striped', 'table-bordered', 'table-hover', 'table-sm'
    ]
    thead_classes = ['thead-dark']
    property_id = Col('ID')
    district = Col('District')
    estate = Col('Estate')
    block = Col('Block')
    floor = Col('Floor')
    flat = Col('Flat')
    area = Col('Gross area sq. ft.')
    bedrooms = Col('Bedrooms')
    hascarpark = BoolCol('Provide Car Park', yes_display='Y', no_display='N')
    selling_price = PriceCol('Selling Price',
                             column_html_attrs={'class': 'price'})
    rental_price = PriceCol('Rental Price',
                            column_html_attrs={'class': 'price'})
    for_transaction_type = Col('Transaction Type')
    owner = Col('Owner')
Exemplo n.º 20
0
class RolesDetailsTable(Table):
    """Build a role details table."""

    thead_attrs = {'style': 'font-size:11px'}
    classes = [
        'table table-striped', 'table table-hover', 'table table-condensed'
    ]

    role_name_id = LinkCol('Edit Details',
                           'users.roles_processing',
                           url_kwargs=dict(role_name='role_name'),
                           anchor_attrs={'style': 'font-size:12px'})
    role_name = Col('Role Name',
                    allow_sort=True,
                    td_html_attrs={'style': 'font-size:12px'})
    role_description = Col('Role Description',
                           allow_sort=False,
                           td_html_attrs={'style': 'font-size:12px'})
    is_active = BoolCol('Role Active',
                        allow_sort=True,
                        td_html_attrs={'style': 'font-size:12px'})
    created_datetime = Col('Role Created',
                           allow_sort=True,
                           td_html_attrs={'style': 'font-size:12px'})
    last_modified_datetime = Col('Role Modified',
                                 allow_sort=True,
                                 td_html_attrs={'style': 'font-size:12px'})
    allow_sort = True

    def sort_url(self, col_key, reverse=False):
        """Process sort url for the columns of the tables."""
        if reverse:
            direction = 'desc'
        else:
            direction = 'asc'
        return url_for('users.users_processing',
                       sort=col_key,
                       direction=direction)
Exemplo n.º 21
0
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)
Exemplo n.º 22
0
class SourdoughTable(Table):
    name = Col('Sourdough')
    birthday = Col('Birthday')
    alive = BoolCol('Alive', yes_display='Yes', no_display='No')
    id = Col('Id')
Exemplo n.º 23
0
 class MyTable(Table):
     yesno = BoolCol('YesNo Heading')
Exemplo n.º 24
0
class AccountTable(Table):
    id = Col("#")
    username = Col("Username")
    password = Col("Password (hash)")
    is_admin = BoolCol("Admin?")
Exemplo n.º 25
0
 class MyTable(Table):
     yesno = BoolCol('YesNo Heading',
                     yes_display='Affirmative',
                     no_display='Negatory')
Exemplo n.º 26
0
class NotificationTable(Table):
    type = Col('type')
    date = BetterDatetimeCol('Date', "medium", tzinfo=get_timezone('US/Eastern'), locale='en')
    successful = BoolCol('Success?')
    error_message = Col('error')