Merge branch 'main' into production

This commit is contained in:
Mouse Reeve 2021-12-05 10:29:23 -08:00
commit c52689c4b8
4 changed files with 25 additions and 15 deletions

View file

@ -115,6 +115,19 @@ input[type=file]::file-selector-button:hover {
color: #363636; color: #363636;
} }
details .dropdown-menu {
display: block !important;
}
details.dropdown[open] summary.dropdown-trigger::before {
content: "";
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
}
summary::marker { summary::marker {
content: none; content: none;
} }

View file

@ -210,10 +210,10 @@ let StatusCache = new class {
.forEach(item => BookWyrm.addRemoveClass(item, "is-hidden", true)); .forEach(item => BookWyrm.addRemoveClass(item, "is-hidden", true));
// Close menu // Close menu
let menu = button.querySelector(".dropdown-trigger[aria-expanded=true]"); let menu = button.querySelector("details[open]");
if (menu) { if (menu) {
menu.click(); menu.removeAttribute("open");
} }
} }

View file

@ -2,25 +2,20 @@
{% load utilities %} {% load utilities %}
{% with 0|uuid as uuid %} {% with 0|uuid as uuid %}
<div <details
id="menu_{{ uuid }}" id="menu_{{ uuid }}"
class=" class="
dropdown control dropdown control
{% if right %}is-right{% endif %} {% if right %}is-right{% endif %}
" "
> >
<button <summary
class="button dropdown-trigger pulldown-menu {{ class }}" class="button control dropdown-trigger pulldown-menu {{ class }}"
type="button"
aria-expanded="false"
aria-haspopup="true"
aria-controls="menu_options_{{ uuid }}"
data-controls="menu_{{ uuid }}"
> >
{% block dropdown-trigger %}{% endblock %} {% block dropdown-trigger %}{% endblock %}
</button> </summary>
<div class="dropdown-menu"> <div class="dropdown-menu control">
<ul <ul
id="menu_options_{{ uuid }}" id="menu_options_{{ uuid }}"
class="dropdown-content p-0 is-clipped" class="dropdown-content p-0 is-clipped"
@ -29,6 +24,6 @@
{% block dropdown-list %}{% endblock %} {% block dropdown-list %}{% endblock %}
</ul> </ul>
</div> </div>
</div> </details>
{% endwith %} {% endwith %}
{% endspaceless %} {% endspaceless %}

View file

@ -104,12 +104,14 @@ def find_authors_by_name(name_string, description=False):
# otherwise just grab the first title listing # otherwise just grab the first title listing
titles.append(element.find(".//title")) titles.append(element.find(".//title"))
if titles is not None: if titles:
# some of the "titles" in ISNI are a little ...iffy # some of the "titles" in ISNI are a little ...iffy
# '@' is used by ISNI/OCLC to index the starting point ignoring stop words # '@' is used by ISNI/OCLC to index the starting point ignoring stop words
# (e.g. "The @Government of no one") # (e.g. "The @Government of no one")
title_elements = [ title_elements = [
e for e in titles if not e.text.replace("@", "").isnumeric() e
for e in titles
if hasattr(e, "text") and not e.text.replace("@", "").isnumeric()
] ]
if len(title_elements): if len(title_elements):
author.bio = title_elements[0].text.replace("@", "") author.bio = title_elements[0].text.replace("@", "")