Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 70 additions & 8 deletions src/templates/table.j2
Original file line number Diff line number Diff line change
Expand Up @@ -43,33 +43,80 @@
.tabulator .tabulator-tableHolder .tabulator-row:hover {
background-color: #ddd;
}

/* Apply styles only to the filter section selects */
.filter-section select {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
padding: 8px;
border: 1px solid #DBDDE1;
border-radius: 4px;
font-family: 'DM Mono', monospace;
font-size: 12px;
color: #0E1013;
background-repeat: no-repeat;
background-position: right 10px center;
background-size: 10px;
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 5"><path fill="%230E1013" d="M2 0L0 2h4z"/></svg>');
}

/* Specific styles for each select element */
.filter-section #filter-field {
background-color: #F0F0F0;
}

.filter-section #filter-type {
background-color: #E8E8E8;
border: 1px solid #C0C0C0;
}

.filter-section #filter-value {
background-color: #FFFFFF;
border: 1px solid #DBDDE1;
}

</style>
<body style="margin: 0; padding: 0;">
<!-- Header Bar -->
<div style="position: relative; width: 1648px; height: 48px; margin: 32px auto 0 auto; background-color: #282A2D; color: white;">
<div style="position: relative; width: 1648px; height: 48px; margin: 32px auto 0 auto; background-color: white; color: #282A2D;">
<!-- Tao Symbol on the Left -->
<div style="position: absolute; width: 48px; height: 48px; left: 16px; top: 0; text-align: center;
font-family: 'GFS Neohellenic', serif; font-weight: 400; font-size: 48px; line-height: 48px; color: #ffffff;">
font-family: 'GFS Neohellenic', serif; font-weight: 400; font-size: 48px; line-height: 48px; color: #282A2D;">
τ
</div>
<!-- Table Info slightly off-center and constrained to one line -->
<div style="position: absolute; left: 25%; transform: translateX(-25%); top: 12px; width: 60%;
font-family: 'DM Mono', monospace; font-weight: 400; font-size: 12px; letter-spacing: 0.05em;
text-transform: uppercase; color: #ffffff; white-space: nowrap;">
text-transform: uppercase; color: #282A2D; white-space: nowrap;">
{{ table_info }}
</div>
</div>

<!-- Filter Section -->
<div style="margin: 20px auto; text-align: center;">
<div style="display: inline-block;">
<div class="filter-section"
style="display: flex; flex-direction: row; align-items: center; gap: 16px; padding: 16px; border: 1px dashed #0E1013; border-radius: 5px; width: fit-content; margin: 20px auto; box-sizing: border-box;">

<!-- Filter Field -->
<div style="display: flex; flex-direction: column; gap: 4px; flex-grow: 0;">
<label for="filter-field"
style="font-family: 'DM Mono'; font-size: 12px; text-transform: uppercase; color: #0E1013;">
Filter Field
</label>
<select id="filter-field">
<option></option>
{% for col in column_names %}
<option value="{{ col }}">{{ col }}</option>
{% endfor %}
</select>
</div>

<!-- Filter Type -->
<div style="display: flex; flex-direction: column; gap: 4px; flex-grow: 0;">
<label for="filter-type"
style="font-family: 'DM Mono'; font-size: 12px; text-transform: uppercase; color: #0E1013;">
Filter Type
</label>
<select id="filter-type">
<option value="=">=</option>
<option value="<"><</option>
Expand All @@ -79,11 +126,26 @@
<option value="!=">!=</option>
<option value="like">like</option>
</select>
</div>

<input id="filter-value" type="text" placeholder="value to filter">
<!-- Filter Value -->
<div style="display: flex; flex-direction: column; gap: 4px; flex-grow: 0;">
<label for="filter-value"
style="font-family: 'DM Mono'; font-size: 12px; text-transform: uppercase; color: #0E1013;">
Filter Value
</label>
<input id="filter-value" type="text" placeholder="value to filter"
style="padding: 8px; border: 1px solid #DBDDE1; border-radius: 4px; background: #FFFFFF; font-family: 'DM Mono'; font-size: 12px; color: #0E1013;">
</div>

<button id="filter-clear">Clear Filter</button>
<!-- Clear Button -->
<div style="display: flex; align-items: flex-end; flex-grow: 0;">
<button id="filter-clear"
style="padding: 8px 16px; border: 1px solid #DBDDE1; border-radius: 4px; background: #FFFFFF; font-family: 'DM Mono'; font-size: 12px; text-transform: uppercase; color: #0E1013;">
Clear Filter
</button>
</div>

</div>

<!-- Table Placeholder (for reference) -->
Expand Down Expand Up @@ -119,7 +181,7 @@
movableColumns: true,
paginationCounter: "rows",
layout: "fitColumns",
{% if tree %} dataTree:true, {% endif %}
{% if tree %} dataTree: true, {% endif %}
}
)
//Define variables for input elements
Expand Down
4 changes: 2 additions & 2 deletions src/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -604,8 +604,8 @@ def update_metadata_table(table_name: str, values: dict[str, str]) -> None:
)
for key, value in values.items():
cursor.execute(
"UPDATE metadata SET TableName = ?, Value = ? WHERE Key = ?",
(table_name, value, key),
"UPDATE metadata SET Value = ? WHERE Key = ? AND TableName = ?",
(value, key, table_name),
)
if cursor.rowcount == 0:
cursor.execute(
Expand Down