decided to use thing/-1 to create a new thing. Tried it on owned first, works so now also can delete owned/<id> as well. Also made sure not to show the delete button when we are only creating a thing

This commit is contained in:
2020-12-04 18:01:54 +11:00
parent cc9e7dff5b
commit ed07d1f9cb
4 changed files with 41 additions and 16 deletions

View File

@@ -58,7 +58,7 @@
<a class="dropdown-item" href="{{url_for('conditions')}}">Show Conditions</a>
<a class="dropdown-item" href="{{url_for('covertypes')}}">Create new Covertype</a>
<a class="dropdown-item" href="{{url_for('covertypes')}}">Show Covertypes</a>
<a class="dropdown-item" href="{{url_for('owneds')}}">Create new Owned Type</a>
<a class="dropdown-item" href="{{url_for('owned', id=-1)}}">Create new Owned Type</a>
<a class="dropdown-item" href="{{url_for('owneds')}}">Show Ownership Types</a>
<a class="dropdown-item" href="{{url_for('ratings')}}">Create new Rating</a>
<a class="dropdown-item" href="{{url_for('ratings')}}">Show Ratings</a>

View File

@@ -18,7 +18,11 @@
<br>
</div class="row">
<div class="form-row col-lg-12">
{{ form.delete( class="btn btn-outline-danger col-lg-2" )}}
{% if 'Create' in page_title %}
{{ form.delete( class="btn btn-outline-danger col-lg-2", style="visibility:hidden" )}}
{% else %}
{{ form.delete( class="btn btn-outline-danger col-lg-2" )}}
{% endif %}
{{ form.submit( class="btn btn-primary col-lg-2" )}}
</div class="form-row">
</form>

View File

@@ -2,6 +2,11 @@
{% block main_content %}
<h3>{{page_title}}</h3>
{% if message|length %}
<div class="row alert alert-{{alert}}">
{{message}}
</div>
{% endif %}
<table id="book_table" class="table table-striped table-sm" data-toolbar="#toolbar" data-search="true">
<thead>
<tr class="thead-light"><th>Name</th></tr>