Reuse the pull css styling from the user menu.

This commit is contained in:
Adam Kelly 2020-04-09 22:33:51 +01:00
parent 0d1395d602
commit 0a4524a524
2 changed files with 53 additions and 60 deletions

View file

@ -139,7 +139,9 @@ body {
.pulldown-container {
position: relative;
display: inline;
}
.pulldown {
display: none;
position: absolute;
@ -149,14 +151,61 @@ body {
right: 0;
box-shadow: 0 5px 10px rgba(0,0,0,0.15);
width: max-content;
border: 2px solid #247BA0;
align: left;
}
.pulldown-container:hover .pulldown {
display: block;
}
.pulldown li {
margin-bottom: 0.5em;
}
div.pulldown-button {
background-color: #eee;
border: 2px solid #247BA0;
border-radius: 0.3em;
color: #247BA0;
width: max-content;
white-space: nowrap;
}
.pulldown-button form {
display: inline;
}
div.pulldown-button button {
display: inline;
border: none;
border-radius: 0;
background-color: inherit;
color: #247BA0;
}
div.pulldown button {
display: block;
text-align: left;
width: 100%;
border: none;
border-radius: 0;
background-color: white;
color: #247BA0;
}
.pulldown button[disabled] {
color: #aaa;
}
.pulldown button[disabled]:hover {
background-color: white;
}
.pulldown button:hover {
background-color: #ddd;
}
/* content area */
.content-container {
margin: 1rem;
@ -717,59 +766,3 @@ th, td {
text-align: center;
}
div.dropdown {
display: block;
white-space: nowrap;
background-color: #EEE;
border: 2px solid #247BA0;
border-radius: 0.3em;
color: #247BA0;
width: max-content;
}
.dropdown form {
display: inline;
}
button.dropdown-button {
display: inline;
border: none;
border-radius: 0;
background-color: inherit;
color: inherit;
}
.dropdown-content {
display: none;
position: absolute;
align: left;
border-radius: 3px;
border: 2px solid #247BA0;
}
.dropdown-content button {
text-align: left;
width: 100%;
border-radius: 0;
border: none;
}
.dropdown-content button[disabled] {
color: #aaa;
}
.dropdown-content button[disabled]:hover {
background-color: #eee;
}
.dropdown-content button:hover {
background-color: #ddd;
}
.dropdown-content button {
border-radius: 0;
}
.dropdown-arrow:hover .dropdown-content {
display: block;
}

View file

@ -1,18 +1,18 @@
{% load fr_display %}
{% if request.user.is_authenticated %}
<div class="dropdown secondary">
<div class="pulldown-button">
<form name="shelve" action="/shelve/" method="post">
{% csrf_token %}
<input type="hidden" name="book" value="{{ book.id }}"></input>
<input type="hidden" name="shelf" value="{% shelve_button_identifier book %}"></input>
<button class="dropdown-button" type="submit" style="">{% shelve_button_text book %}</button></form><div class="dropdown-arrow" style="display: inline;"><button class="dropdown-button">&dArr;</button>
<div class="dropdown-content">
<button type="submit" style="">{% shelve_button_text book %}</button></form><div class="pulldown-container"><button>&dArr;</button>
<div class="pulldown">
<form name="shelve" action="/shelve/" method="post">
{% csrf_token %}
<input type="hidden" name="book" value="{{ book.id }}"></input>
{% for shelf in request.user.shelf_set.all %}
<button class="secondary" name="shelf" type="submit" value="{{ shelf.identifier }}" {% if shelf in book.shelf_set.all %} disabled {% endif %}>{{ shelf.name }} {% if shelf in book.shelf_set.all %} ✓ {% endif %}</button>
<button name="shelf" type="submit" value="{{ shelf.identifier }}" {% if shelf in book.shelf_set.all %} disabled {% endif %}>{{ shelf.name }} {% if shelf in book.shelf_set.all %} ✓ {% endif %}</button>
{% endfor %}
</form>
</div>