File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 4
4
< form method ="POST ">
5
5
{% csrf_token %}
6
6
{{ form|crispy }}
7
- < button type ="submit " hx-post =". "
7
+ {% if book %}
8
+ < button type ="submit " hx-post ="{% url 'update-book' book.id %} "
8
9
class ="inline-flex items-center px-3 py-2 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 ">
9
10
Submit
10
11
</ button >
11
- {% if book %}
12
12
< button hx-get ="{% url 'detail-book' book.id %} " type ="button "
13
13
class ="ml-2 inline-flex items-center px-3 py-2 border border-gray-300 shadow-sm text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 ">
14
14
Cancel
15
15
</ button >
16
+ {% else %}
17
+ < button type ="submit " hx-post =". "
18
+ class ="inline-flex items-center px-3 py-2 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 ">
19
+ Submit
20
+ </ button >
16
21
{% endif %}
17
22
</ form >
18
23
</ div >
You can’t perform that action at this time.
0 commit comments