renamed id_name_form to edit_id_name, then made show_id_name and used it for all appropriate classes. Shaved about 150 LOC / removed 5 x duplication of code :)
This commit is contained in:
@@ -52,7 +52,7 @@
|
||||
<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('owneds')}}">Show Owned Types</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>
|
||||
</div>
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block main_content %}
|
||||
<h3>Conditions</h3>
|
||||
<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>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for condition in conditions %}
|
||||
<tr><td data-sort="{{condition.id}}"><a href="{{url_for('condition', id=condition.id )}}">{{condition.name}}</a></td></tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endblock main_content %}
|
||||
@@ -1,15 +0,0 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block main_content %}
|
||||
<h3>Covertypes</h3>
|
||||
<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>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for covertype in covertypes %}
|
||||
<tr><td data-sort="{{covertype.id}}"><a href="{{url_for('covertype', id=covertype.id )}}">{{covertype.name}}</a></td></tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endblock main_content %}
|
||||
@@ -1,15 +0,0 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block main_content %}
|
||||
<h3>Owned List</h3>
|
||||
<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>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for owned in owneds %}
|
||||
<tr><td data-sort="{{owned.id}}"><a href="{{url_for('owned', id=owned.id )}}">{{owned.name}}</a></td></tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endblock main_content %}
|
||||
@@ -1,15 +0,0 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block main_content %}
|
||||
<h3>Publishers</h3>
|
||||
<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>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for publisher in publishers %}
|
||||
<tr><td data-sort="{{publisher.name}}"><a href="{{url_for('publisher', id=publisher.id )}}">{{publisher.name}}</a></td></tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endblock main_content %}
|
||||
@@ -1,15 +0,0 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block main_content %}
|
||||
<h3>Ratings</h3>
|
||||
<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>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for rating in ratings %}
|
||||
<tr><td data-sort="{{rating.id}}"><a href="{{url_for('rating', id=rating.id )}}">{{rating.name}}</a></td></tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endblock main_content %}
|
||||
@@ -1,14 +1,14 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block main_content %}
|
||||
<h3>Genres</h3>
|
||||
<h3>{{page_title}}</h3>
|
||||
<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>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for genre in genres %}
|
||||
<tr><td><a href="{{url_for('genre', id=genre.id )}}">{{genre.name}}</a></td></tr>
|
||||
{% for obj in objects %}
|
||||
<tr><td data-sort="{{obj.id}}"><a href="{{url_for(url_base, id=obj.id )}}">{{obj.name}}</a></td></tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
Reference in New Issue
Block a user