Skip to content

Commit

Permalink
Update site_template
Browse files Browse the repository at this point in the history
- Add tileset search filter
  • Loading branch information
past-due committed Aug 19, 2023
1 parent 7a95816 commit 92d6b27
Showing 1 changed file with 23 additions and 6 deletions.
29 changes: 23 additions & 6 deletions site_template/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ <h1 class="mb-0 text-white lh-1"><i class="bi bi-map-fill" style="padding-right:
<form class="row gy-2 gx-3 pt-1 align-items-center">
<div class="col-auto">
<div class="input-group">
<span class="input-group-text" id="basic-addon1">Players:</span>
<span class="input-group-text" id="basic-players">Players:</span>
<select id="filter-players-mode" class="form-select">
<option value="<=">&lt;=</option>
<option value="==" selected>==</option>
Expand All @@ -374,7 +374,7 @@ <h1 class="mb-0 text-white lh-1"><i class="bi bi-map-fill" style="padding-right:
</div>
<div class="col-auto">
<div class="input-group">
<span class="input-group-text" id="basic-addon1">Size:</span>
<span class="input-group-text" id="basic-size">Size:</span>
<select id="filter-size-mode" class="form-select">
<option value="<=">&lt;=</option>
<option value="==">==</option>
Expand All @@ -387,7 +387,7 @@ <h1 class="mb-0 text-white lh-1"><i class="bi bi-map-fill" style="padding-right:
</div>
<div class="col-auto">
<div class="input-group">
<span class="input-group-text" id="basic-addon1">Oil by player:</span>
<span class="input-group-text" id="basic-oilbyplayer">Oil by player:</span>
<select id="filter-oil-by-player-mode" class="form-select">
<option value="<=">&lt;=</option>
<option value="==">==</option>
Expand All @@ -398,7 +398,7 @@ <h1 class="mb-0 text-white lh-1"><i class="bi bi-map-fill" style="padding-right:
</div>
<div class="col-auto">
<div class="input-group">
<span class="input-group-text" id="basic-addon1">Scavengers:</span>
<span class="input-group-text" id="basic-scavengers">Scavengers:</span>
<select id="filter-scavengers" class="form-select">
<option value="*" selected>*</option>
<option value="yes">Yes</option>
Expand All @@ -408,7 +408,7 @@ <h1 class="mb-0 text-white lh-1"><i class="bi bi-map-fill" style="padding-right:
</div>
<div class="col-auto">
<div class="input-group">
<span class="input-group-text" id="basic-addon1">Balance:</span>
<span class="input-group-text" id="basic-balance">Balance:</span>
<select id="filter-balance" class="form-select">
<option value="*" selected>*</option>
<option value="==">==</option>
Expand All @@ -418,14 +418,25 @@ <h1 class="mb-0 text-white lh-1"><i class="bi bi-map-fill" style="padding-right:
</div>
<div class="col-auto">
<div class="input-group">
<span class="input-group-text" id="basic-addon1">Map type:</span>
<span class="input-group-text" id="basic-maptype">Map type:</span>
<select id="filter-map-type" class="form-select">
<option value="*" selected>*</option>
<option value="normal">Normal</option>
<option value="script">Script-Generated</option>
</select>
</div>
</div>
<div class="col-auto">
<div class="input-group">
<span class="input-group-text" id="basic-tileset">Tileset:</span>
<select id="filter-tileset" class="form-select">
<option value="*" selected>*</option>
<option value="arizona">arizona</option>
<option value="urban">urban</option>
<option value="rockies">rockies</option>
</select>
</div>
</div>
</form>
</div>
<div class="toolbar">
Expand Down Expand Up @@ -1153,6 +1164,10 @@ <h3 class="mb-0">%OILTOTAL% <span class="text-muted">/ <span class="fs-5">%OILBY
break;
}

if (filters.tileset && filters.tileset != '*') {
return row.tileset == filters.tileset;
}

return true;
}

Expand Down Expand Up @@ -1189,6 +1204,7 @@ <h3 class="mb-0">%OILTOTAL% <span class="text-muted">/ <span class="fs-5">%OILBY
filters.scavengers = document.getElementById('filter-scavengers').value;
filters.balance = document.getElementById('filter-balance').value;
filters.mapType = document.getElementById('filter-map-type').value;
filters.tileset = document.getElementById('filter-tileset').value;
}
$table.bootstrapTable('filterBy', filters, {
'filterAlgorithm': mapsTableFilterAlgorithm
Expand All @@ -1206,6 +1222,7 @@ <h3 class="mb-0">%OILTOTAL% <span class="text-muted">/ <span class="fs-5">%OILBY
document.getElementById('filter-scavengers').value = '*';
document.getElementById('filter-balance').value = '*';
document.getElementById('filter-map-type').value = '*';
document.getElementById('filter-tileset').value = '*';
}
}

Expand Down

0 comments on commit 92d6b27

Please sign in to comment.