From 15ac1fbed01d77a482fe0500469eb83701a65f80 Mon Sep 17 00:00:00 2001 From: Damien De Paoli Date: Sat, 5 Dec 2020 21:23:54 +1100 Subject: [PATCH] made subbook show it is one more visually, also disabled fields that are part of the parent book so they cannot be changed --- templates/book.html | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/templates/book.html b/templates/book.html index 7333dd0..c7338f6 100644 --- a/templates/book.html +++ b/templates/book.html @@ -12,6 +12,16 @@
{{ book_form.id }} {{ book_form.csrf_token }} + {% if b.parent|length %} +
+ + +
+ {% endif %} {% for key in keys %}
@@ -67,7 +77,13 @@ {% if key == "notes" %} {% set rows=2 %} {% endif %} - {{book_form[key](class="form-control", value=books[key], rows=rows )}} + {% if b.parent|length and + (key == 'publisher' or key == 'owned' or key == 'covertype' + or key == 'condition' or key == 'blurb' ) %} + {{book_form[key](class="form-control", value=books[key], rows=rows, disabled="disabled" )}} + {% else %} + {{book_form[key](class="form-control", value=books[key], rows=rows )}} + {% endif %}
{% endif %} @@ -95,14 +111,6 @@ {% endif %} - {% if b.parent|length %} -
- - -
- {% endif %}
{{ book_form.delete( class="btn btn-outline-danger offset-lg-2 col-lg-2" )}} {{ book_form.submit( class="btn btn-primary col-lg-2" )}}