Ejemplo n.º 1
0
class Results(Table):
    classes = ['table table-striped']
    user_id = Col('Id', show=False)
    user_name = Col('Name')
    user_location = Col('Location')
    edit = LinkCol('Edit', 'edit_view', url_kwargs=dict(id='user_id'))
    delete = LinkCol('Delete', 'delete_user', url_kwargs=dict(id='user_id'))
Ejemplo n.º 2
0
class Results(Table):
    classes = ['table', 'table-stripped', 'table-hover', 'table-condensed']
    id = Col('ID', show=False)
    environment = Col('Environment')
    requestedby = Col('Requested By')
    version = Col('Version')
    swp_number = Col('SWP Number')
    zones = Col('# Zones')
    start_date = Col('Start Date')
    delivery_date = Col('Delivery Date')
    backup_db = Col('Backup Database?')
    keep_data = Col('Keep Environment Data?')
    keep_ld = Col('Keep Logical Date?')
    osb_integration = Col('OSB Integration')
    ods_integration = Col('ODS Integration')
    oss_integration = Col('OSS Integration')
    source_uat_ref = Col('Source UAT REF')
    delivery_notification = Col('Delivery Notification to')
    edit = LinkCol('Edit',
                   'edit_req',
                   url_kwargs=dict(id='id'),
                   anchor_attrs={'class': 'btn btn-warning'})
    delete = LinkCol('Delete',
                     'delete_req',
                     url_kwargs=dict(id='id'),
                     anchor_attrs={'class': 'btn btn-danger'})
Ejemplo n.º 3
0
class HolidayResults(Table):
    c_acdcode = Col('c_acdcode')
    c_date = Col('c_date')
    c_datetype = Col('c_datetype')
    c_desc = Col('c_desc')
    edit = LinkCol('  Modify  ', 'holiday_edit', url_kwargs=dict(edit_date='c_date'))
    delete = LinkCol('  Delete  ', 'holiday_del', url_kwargs=dict(del_date='c_date'))
Ejemplo n.º 4
0
class HostTable(Table):
    hostname = Col('Hostname')
    domain = Col('Domain')
    stage = Col('Stage')
    role = Col('Role')
    view = LinkCol('Edit', '.edit_host', url_kwargs=dict(host_id='id'))
    delete = LinkCol('Delete', '.delete_host', url_kwargs=dict(host_id='id'))
Ejemplo n.º 5
0
class AdminPropertyTable(PropertyTable):
    update = LinkCol('Update',
                     'admin.maintain_property',
                     url_kwargs=dict(id='property_id'))
    delete = LinkCol('Delete',
                     'admin.delete_property',
                     column_html_attrs={'class': 'delete'})
Ejemplo n.º 6
0
class ProcessGroup_Table(Table):
    classes = ["table table-hover"]
    id = Col('Id', show=False)
    description = Col('Description')
    edit = LinkCol('Edit', 'edit_process_group', url_kwargs=dict(id='id'))
    delete = LinkCol('Delete', 'delete_process_group', url_kwargs=dict(id='id'), 
                    anchor_attrs={'id': 'warning'})
Ejemplo n.º 7
0
def index():
    # get list of accounts from database
    u = User.query.get(current_user.id)
    TableCls = create_table(base=BaseTable).add_column('account',
                                                       Col('Account'))
    TableCls.add_column('otp', Col('One-Time Password'))
    TableCls.add_column(
        'delete',
        LinkCol('Remove',
                'main.confirm_remove_account',
                attr='remove_symbol',
                url_kwargs=dict(id='id')))
    TableCls.add_column(
        'reveal',
        LinkCol(u'Show key',
                'main.show_key',
                attr='show_symbol',
                url_kwargs=dict(id='id')))
    try:
        table = TableCls([
            dict(account=a.name,
                 otp=get_otp(decrypt_key(a.key)),
                 id=a.id,
                 remove_symbol='\u274E',
                 show_symbol='\U0001F441') for a in u.accounts
        ])
    except TypeError:
        flash('Session expired - please log in again.', 'warning')
        return redirect(url_for('auth.login'))
    # calculate time (in ms) before OTPs expire
    now = time()
    time_to_expiry = (30 - round(now) % 30) * 1000
    return render_template('index.html', table=table, t=time_to_expiry)
Ejemplo n.º 8
0
class ResultsObs(Table):
    groupId = Col('Group Id', show=True)
    fileId = Col('File Id', show=True)
    endTime = Col('endTime')
    startTime = Col('StartTime')
    edit = LinkCol('Edit', 'edit_file_view', url_kwargs=dict(id='fileId'))
    delete = LinkCol('Delete', 'delete_file', url_kwargs=dict(id='fileId'))
Ejemplo n.º 9
0
class Results(Table):
    user_id = Col('Id', show=False)
    user_name = Col('Name')
    user_email = Col('Email')
    user_password = Col('_password', show=False)
    edit = LinkCol('Edit', 'edit_view', url_kwargs=dict(id='user_id'))
    delete = LinkCol('Delete', 'delete_user', url_kwargs=dict(id='user_id'))
Ejemplo n.º 10
0
class ProjectsResults(Table):
    id = Col('id', show=False)
    name = Col('name')
    address = Col('address')
    currency = Col('currency')
    time_zone_name = Col('time_zone_name')
    plan_name = Col('plan_name')
    man_power_unit = Col('man_power_unit')
    measurement_unit = Col('measurement_unit')
    is_premium = Col('is_premium')
    is_forms_enabled = Col('is_forms_enabled')
    is_email_notifications_enabled = Col('is_email_notifications_enabled')
    is_analytics_enabled = Col('is_analytics_enabled')
    should_prompt_effort_on_complete = Col('hould_prompt_effort_on_complete')
    max_fresh_sheets_count = Col('max_fresh_sheets_count')
    min_verified_at_days = Col('min_verified_at_days')
    created_at = Col('created_at')
    updated_at = Col('updated_at')
    device_created_at = Col('device_created_at')
    device_updated_at = Col('device_updated_at')
    archived_at = Col('archived_at')
    blocked_at = Col('blocked_at')
    deleted_at = Col('deleted_at')
    edit = LinkCol('Edit', 'projectedit', url_kwargs=dict(id='id'))
    delete = LinkCol('Delete', 'projectdelete', url_kwargs=dict(id='id'))
Ejemplo n.º 11
0
class SheetsResults(Table):
    id = Col('id', show=False)
    name = Col('name')
    version = Col('version ')
    description = Col('description')
    notes = Col('notes')
    has_conflicts = Col('has_conflicts')
    has_errors = Col('has_errors')
    thumb_url = Col('thumb_url')
    full_file_url = Col('full_file_url')
    file_width = Col('file_width')
    file_height = Col('file_height')
    original_width = Col('original_width')
    original_height = Col('original_height')
    meters_per_pixel = Col('meters_per_pixel')
    tile_size = Col('tile_size')
    tiles_base_url = Col('tiles_base_url')
    tiles_package_url = Col('tiles_package_url')
    project_id = Col('project_id')
    floorplan_id = Col('floorplan_id')
    created_at = Col('created_at')
    updated_at = Col('updated_at')
    device_updated_at = Col('device_updated_at')
    deleted_at = Col('deleted_at')
    edit = LinkCol('Edit', 'sheetedit', url_kwargs=dict(id='id'))
    delete = LinkCol('Delete', 'sheetdelete', url_kwargs=dict(id='id'))
Ejemplo n.º 12
0
class CarsTable(Table):
    car_id = Col('CarId', show=False)
    car_registration_number = Col('RegistrationNumber')
    car_type = Col('CarType')
    car_model = Col('CarModel')
    edit = LinkCol('Edit', '.edit_car', url_kwargs=dict(id='car_id'))
    delete = LinkCol('Delete', '.delete_car', url_kwargs=dict(id='car_id'))
Ejemplo n.º 13
0
class Archived(Table):
    work_number = Col(
        'WO')  #  LinkCol('WO', 'group', url_kwargs=dict(wo='work_number'))
    job_number = Col('Job')
    part_number = Col('Part')
    revision = Col('Rev.')
    finish = Col('Finish')
    part_quantity = Col('Qty.')
    quantity_complete = Col('QCP')
    part_description = Col('Description')
    part_location = Col('Location')
    priority = Col('Priority')
    entry_date = Col('Date')
    due_date = Col('Due Date')
    entry_time = Col('Time')
    material_status = Col('Mtl Status')
    machine_center = Col('Center')
    original_estimated_time = Col('Est.')
    actual_time = Col('Act.')
    comments = Col('Notes')
    pdf = Col('PDF')
    edit = LinkCol('Edit', 'edit', url_kwargs=dict(id='id'))
    delete = LinkCol('Delete', 'delete', url_kwargs=dict(id='id'))
    location_deleted = Col('Loc. Deleted')
    date_deleted = Col('Date Deleted')

    def sort_url(self, col_id, reverse=False):
        if reverse:
            direction = 'desc'
        else:
            direction = 'asc'
        return url_for('index', sort=col_id, direction=direction)
Ejemplo n.º 14
0
class ResultsWD(Table):
    dayId = Col('Date', show=True)
    sunriseTime = Col('Sunrise Time')
    sundownTime = Col('Sundown Time')
    moonPhase = Col('Moon Phase')
    edit = LinkCol('Edit', 'edit_wd_view', url_kwargs=dict(id='dayId'))
    delete = LinkCol('Delete', 'delete_file', url_kwargs=dict(id='dayId'))
Ejemplo n.º 15
0
class SpendsTable(Table):
    id = Col('Id', show=False)
    date = Col('Date')
    value = Col('Value')
    item = Col('Item')
    edit = LinkCol('Edit', 'edit_spe', url_kwargs=dict(id='id'))
    delete = LinkCol('Del', 'del_spe', url_kwargs=dict(id='id'))
Ejemplo n.º 16
0
class UserTable(Table):

    classes = ['table', 'table-hover', 'table-bordered']
    no_items = ("There are no users matching your criteria! "
                "Please check your search terms.")

    username = LinkCol('Username',
                       endpoint='show_user',
                       url_kwargs=dict(_id='_id'),
                       attr_list='_id')
    score = Col('Score')
    following = LinkCol('Following',
                        endpoint='toggle_follow',
                        url_kwargs=dict(_id='_id'),
                        attr_list='follow_label',
                        allow_sort=False)
    challenge = LinkCol('Challenge',
                        endpoint='challenge_user',
                        text_fallback='Challenge!',
                        url_kwargs=dict(_id='_id'),
                        allow_sort=False)

    allow_sort = True

    def sort_url(self, col_key, reverse=False):
        direction = 'desc' if reverse else 'asc'

        kwargs = {key: value for key, value in request.args.items()}
        kwargs.update(direction=direction, sort=col_key)

        return url_for('user_list', **kwargs)
Ejemplo n.º 17
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'}
    )
Ejemplo n.º 18
0
class CardBoxTable(Table):

    classes = ['table', 'table-hover', 'table-bordered']
    no_items = ("There are no CardBoxes matching your criteria! "
                "Please check your search terms.")

    name = LinkCol('Name',
                   endpoint='show_box',
                   url_kwargs=dict(_id='_id'),
                   attr_list='name')
    tags = Col('Tags', allow_sort=False)
    owner = LinkCol('Owner',
                    endpoint='show_user',
                    url_kwargs=dict(_id='owner'),
                    attr_list='owner')
    rating = Col('Rating')

    allow_sort = True

    def sort_url(self, col_key, reverse=False):
        direction = 'desc' if reverse else 'asc'

        kwargs = {key: value for key, value in request.args.items()}
        kwargs.update(direction=direction, sort=col_key)

        return url_for('huge_list', **kwargs)
Ejemplo n.º 19
0
class ChooseBoxTable(Table):
    def __init__(self, items, partner_id, **kwargs):
        super().__init__(items, **kwargs)

        self.partner_id = partner_id

    classes = ['table', 'table-hover', 'table-bordered']
    no_items = ("There are no CardBoxes matching your criteria! "
                "Please check your search terms.")

    start = ButtonCol('Choose',
                      endpoint='confirm_challenge',
                      url_kwargs=dict(user_id='partner_id', box_id='_id'),
                      text_fallback='Go!',
                      allow_sort=False,
                      button_attrs=dict(formmethod="get"))
    name = LinkCol('Name',
                   endpoint='show_box',
                   url_kwargs=dict(_id='_id'),
                   attr_list='name')
    owner = LinkCol('Owner',
                    endpoint='show_user',
                    url_kwargs=dict(_id='owner'),
                    attr_list='owner')
    rating = Col('Rating')

    allow_sort = True

    def sort_url(self, col_key, reverse=False):
        direction = 'desc' if reverse else 'asc'

        kwargs = {key: value for key, value in request.args.items()}
        kwargs.update(direction=direction, sort=col_key)

        return url_for('challenge_user', _id=self.partner_id, **kwargs)
Ejemplo n.º 20
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)
Ejemplo n.º 21
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)
Ejemplo n.º 22
0
class Results(Table):
    sn = Col('SN')
    word1 = Col('Word1')
    word2 = Col('Word2')
    fullword = Col('Fullword')
    edit = LinkCol('Edit', 'edit_view', url_kwargs=dict(sn='sn'))
    delete = LinkCol('Delete', 'delete_word', url_kwargs=dict(sn='sn'))
Ejemplo n.º 23
0
class wishlistresult(Table):
    eid = Col('eid')
    jid = Col('jid')
    # Called edit_wishlist() when the link is clicked.
    edit = LinkCol('Edit', 'edit_wishlist', url_kwargs=dict(eid='eid'))
    # Called delete_wishlist() when the link is clicked.
    delete = LinkCol('Delete', 'delete_wishlist', url_kwargs=dict(eid='eid'))
class MortuariesTable(Table):
    mortuary_id = Col('MortuaryId', show=False)
    name = Col('Name')
    address = Col('Address')
    edit = LinkCol('Edit', '.edit_mortuary', url_kwargs=dict(id='mortuary_id'))
    delete = LinkCol('Delete',
                     '.delete_mortuary',
                     url_kwargs=dict(id='mortuary_id'))
Ejemplo n.º 25
0
class Strain(Table):
    classes = ['main', 'chart', 'strain']
    id = Col('id', show=False)
    name = Col('Name')
    type = Col('Type')
    notes = Col('Notes')
    edit = LinkCol('Edit', 'edit_strain', url_kwargs=dict(id='id'))
    delete = LinkCol('Delete', 'delete_strain', url_kwargs=dict(id='id'))
Ejemplo n.º 26
0
class Details(Table):
    productId = Col('productId',show=False)
    orderId = Col('OrderId')
    quantity = Col('Tabletquantity')
    ordercost = Col('TabletCost')
    productname = Col('Tabletname')
    delete = LinkCol('DeletefromCART', 'delete', url_kwargs=dict(id='orderId'))  
    returnback = LinkCol('Exit', 'returnback',url_kwargs=dict(id='orderId'))
Ejemplo n.º 27
0
class Results(Table):
    id = Col('Id', show=False)
    article = Col('Article')
    url = Col('URL')
    release_date = Col('Release Date')
    publisher = Col('Publisher')
    edit = LinkCol('Edit', 'edit', url_kwargs=dict(id='id'))
    delete = LinkCol('Delete', 'delete', url_kwargs=dict(id='id'))
Ejemplo n.º 28
0
class IndexTable(Table):
    classes = ['table', 'table-striped']
    id = Col('Id', show=False)
    unit_name = Col("Unit Name")
    strat_no = Col("SA strat unit number")
    map_symbol = Col("Map symbol")
    view = LinkCol('View record', 'user.view', url_kwargs=dict(id='id'))
    edit = LinkCol('Edit record', 'user.edit', url_kwargs=dict(id='id'))
Ejemplo n.º 29
0
class WorkersTable(Table):
    worker_id = Col('WorkerId', show=False)
    fullname = Col('Fullname')
    passport_number = Col('PassportNumber')
    edit = LinkCol('Edit', '.edit_worker', url_kwargs=dict(id='worker_id'))
    delete = LinkCol('Delete',
                     '.delete_worker',
                     url_kwargs=dict(id='worker_id'))
Ejemplo n.º 30
0
class Results(Table):
    id = Col('Id', show=False)
    first_name = Col('First Name')
    last_name = Col('Last Name')
    email = Col('Email')
    password = Col('Password', show=False)
    edit = LinkCol('Edit', 'edit_view', url_kwargs=dict(id='id'))
    delete = LinkCol('Delete', 'delete_user', url_kwargs=dict(id='id'))
Ejemplo n.º 31
0
 def url_kwargs(self, item):
     url_kwargs_out = _LinkCol.url_kwargs(self, item)
     url_kwargs_out.update(self._url_extra_kwargs)
     return url_kwargs_out
Ejemplo n.º 32
0
 def __init__(self, *args, **kwargs):
     url_extra_kwargs = kwargs.pop('url_extra_kwargs', {})
     _LinkCol.__init__(self, *args, **kwargs)
     self._url_extra_kwargs = url_extra_kwargs