2020-06-10 12:25:57 +00:00
|
|
|
from flask_table import Table, Col, LinkCol
|
|
|
|
|
|
|
|
|
|
|
|
class JobInputTable(Table):
|
|
|
|
"""
|
|
|
|
Declares the table describing colum by column.
|
|
|
|
"""
|
|
|
|
classes = ['highlight', 'responsive-table']
|
|
|
|
filename = Col('Filename', column_html_attrs={'class': 'filename'},
|
|
|
|
th_html_attrs={'class': 'sort',
|
|
|
|
'data-sort': 'filename'})
|
|
|
|
url = LinkCol('Download', 'jobs.download_job_input',
|
|
|
|
url_kwargs=dict(job_id='job.id',
|
|
|
|
job_input_id='input_id'),
|
2020-06-10 13:10:23 +00:00
|
|
|
anchor_attrs={'class': 'waves-effect waves-light btn-floating',
|
|
|
|
'download': ''},
|
|
|
|
text_fallback='<i class="material-icons">file_download</i>')
|
2020-06-10 12:25:57 +00:00
|
|
|
|
|
|
|
|
|
|
|
class JobInputItem(object):
|
|
|
|
"""
|
|
|
|
Describes one item like one row per table.
|
|
|
|
"""
|
|
|
|
|
|
|
|
def __init__(self, filename, job, input_id):
|
|
|
|
self.filename = filename
|
|
|
|
self.job = job
|
|
|
|
self.input_id = input_id
|