Disable button for current shelf.

This commit is contained in:
Adam Kelly 2020-04-09 11:23:08 +01:00
parent 1783330708
commit 97e752cc12
2 changed files with 9 additions and 1 deletions

View file

@ -754,6 +754,14 @@ button.dropdown-button {
border: none; border: none;
} }
.dropdown-content button[disabled] {
color: #aaa;
}
.dropdown-content button[disabled]:hover {
background-color: #eee;
}
.dropdown-content button:hover { .dropdown-content button:hover {
background-color: #ddd; background-color: #ddd;
} }

View file

@ -13,7 +13,7 @@
{% csrf_token %} {% csrf_token %}
<input type="hidden" name="book" value="{{ book.id }}"></input> <input type="hidden" name="book" value="{{ book.id }}"></input>
{% for shelf in request.user.shelf_set.all %} {% for shelf in request.user.shelf_set.all %}
<button class="secondary" name="shelf" type="submit" value="{{ shelf.identifier }}">{{ shelf.name }}</button> <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>
{% endfor %} {% endfor %}
</form> </form>
</div> </div>