Skip to content

Commit b579c44

Browse files
deploy: c16aeae
1 parent 49a97a8 commit b579c44

3 files changed

Lines changed: 78 additions & 4 deletions

File tree

index.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,16 @@ <h1>
200200
<button class="btn btn-default btn-sm sort-btn" data-sort="event-date">Event Date</button>
201201
</div>
202202

203+
<div class="col-xs-12 search-row">
204+
<div class="input-group search-bar">
205+
<span class="input-group-addon"><i class="fas fa-search"></i></span>
206+
<input type="text" id="search-input" class="form-control" placeholder="Search by name, venue, location…" autocomplete="off">
207+
<span class="input-group-btn">
208+
<button id="clear-search" class="btn btn-default" type="button" title="Clear search"><i class="fas fa-times"></i></button>
209+
</span>
210+
</div>
211+
</div>
212+
203213
</div>
204214

205215
</div>

static/css/styles.css

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,45 @@ h2 .evtname {
1111
opacity: 0.5;
1212
}
1313

14+
.search-row {
15+
margin-top: 16px;
16+
margin-bottom: 4px;
17+
}
18+
19+
.search-bar .input-group-addon {
20+
background: #fff;
21+
border-right: none;
22+
color: #007bff;
23+
font-size: 14px;
24+
}
25+
26+
.search-bar .form-control {
27+
border-left: none;
28+
box-shadow: none;
29+
font-size: 14px;
30+
}
31+
32+
.search-bar .form-control:focus {
33+
border-color: #007bff;
34+
box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.12);
35+
}
36+
37+
.search-bar .input-group-btn .btn {
38+
border-left: none;
39+
color: #aaa;
40+
box-shadow: none;
41+
height: 34px;
42+
padding-top: 6px;
43+
padding-bottom: 6px;
44+
font-size: 14px;
45+
line-height: 1.42857;
46+
}
47+
48+
.search-bar .input-group-btn .btn:hover {
49+
color: #555;
50+
background: #f8f9fa;
51+
}
52+
1453
.sort-label {
1554
margin-left: 10px;
1655
margin-right: 5px;

static/js/main.js

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10948,11 +10948,26 @@ $(function() {
1094810948
filter3: new Set()
1094910949
};
1095010950

10951+
var searchQuery = '';
10952+
1095110953
function updateConfList() {
1095210954
$(".conf").each(function () {
1095310955
let conf = $(this);
1095410956
let show = true;
1095510957

10958+
// Check search query against name, description, date, and place
10959+
if (searchQuery) {
10960+
let text = (
10961+
conf.find('.conf-title').text() + ' ' +
10962+
conf.find('.meta').first().text() + ' ' +
10963+
conf.find('.conf-date').text() + ' ' +
10964+
conf.find('.conf-place').text()
10965+
).toLowerCase();
10966+
if (text.indexOf(searchQuery) === -1) {
10967+
show = false;
10968+
}
10969+
}
10970+
1095610971
// Check each filter group
1095710972
Object.keys(selectedFilters).forEach(filterGroup => {
1095810973
if (selectedFilters[filterGroup].size > 0) {
@@ -10968,7 +10983,6 @@ $(function() {
1096810983
}
1096910984
});
1097010985

10971-
// Show or hide based on filter matching
1097210986
if (show) {
1097310987
conf.show();
1097410988
} else {
@@ -10993,16 +11007,27 @@ $(function() {
1099311007

1099411008
// Handle "Clear Filters" button click
1099511009
$("#clear-filters").click(function () {
10996-
// Uncheck all checkboxes
1099711010
$(".filter-checkbox").prop("checked", false);
10998-
10999-
// Reset the selected filters
1100011011
selectedFilters = {
1100111012
filter1: new Set(),
1100211013
filter2: new Set(),
1100311014
filter3: new Set()
1100411015
};
11016+
searchQuery = '';
11017+
$('#search-input').val('');
11018+
updateConfList();
11019+
});
11020+
11021+
// Search input handler
11022+
$('#search-input').on('input', function () {
11023+
searchQuery = $(this).val().toLowerCase().trim();
11024+
updateConfList();
11025+
});
1100511026

11027+
// Clear search button
11028+
$('#clear-search').click(function () {
11029+
searchQuery = '';
11030+
$('#search-input').val('').focus();
1100611031
updateConfList();
1100711032
});
1100811033

0 commit comments

Comments
 (0)