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
12 changes: 11 additions & 1 deletion lmfdb/templates/refine_search_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@ <h2 id='search_h2'>{{KNOWL('intro.search', search_header)}}
<input type="hidden" name="sort_dir" value="{{info.sort_dir}}" />
</form>

<script>
{% if info.search_array.has_advanced_inputs(info) %}
<script> show_advancedQ(); </script>
show_advancedQ();
{% endif %}

function set_fresh() {
$(".search_stale").removeClass("search_stale").addClass("search_fresh");
}

$("input").on("input", set_fresh);
$("select").on("change", set_fresh);
</script>

7 changes: 7 additions & 0 deletions lmfdb/templates/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -2262,3 +2262,10 @@ div.upload_section {
.grecaptcha-badge {
visibility: hidden;
}

button.search_stale, button.search_stale:hover {
background: {{color.select_background}};
}
button.search_fresh {
background: {{color.button_background}};
}
7 changes: 6 additions & 1 deletion lmfdb/utils/search_boxes.py
Original file line number Diff line number Diff line change
Expand Up @@ -610,11 +610,16 @@ def _input(self, info):
onclick = ""
else:
onclick = " onclick='resetStart()'"
btext = "<button type='submit' name='search_type' value='{val}' style='width: {width}px;'{onclick}>{desc}</button>"
if self.description in ["Search again", "Generate statistics"]:
cls = " class='search_stale'"
else:
cls = " class='search_fresh'"
btext = "<button type='submit' name='search_type' value='{val}'{cls} style='width: {width}px;'{onclick}>{desc}</button>"
return btext.format(
width=self.width,
val=self.value,
desc=self.description,
cls=cls,
onclick=onclick)

class SearchButtonWithSelect(SearchButton):
Expand Down