bookshelf/templates/form.html (48 lines of code) (raw):
{#
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#}
{# [START form] #}
{% extends "base.html" %}
{% block content %}
<h3>{{action}} book</h3>
<form method="POST" enctype="multipart/form-data">
<div class="form-group">
<label for="title">Title</label>
<input type="text" name="title" id="title" value="{{book.title}}" class="form-control"/>
</div>
<div class="form-group">
<label for="author">Author</label>
<input type="text" name="author" id="author" value="{{book.author}}" class="form-control"/>
</div>
<div class="form-group">
<label for="publishedDate">Date Published</label>
<input type="text" name="publishedDate" id="publishedDate" value="{{book.publishedDate}}" class="form-control"/>
</div>
<div class="form-group">
<label for="description">Description</label>
<textarea name="description" id="description" class="form-control">{{book.description}}</textarea>
</div>
<div class="form-group">
<label for="image">Cover Image</label>
<input type="file" name="image" id="image" class="form-control"/>
</div>
<div class="form-group hidden">
<label for="imageUrl">Cover Image URL</label>
<input type="text" name="imageUrl" id="imageUrl" value="{{book.imageUrl}}" class="form-control"/>
</div>
<button type="submit" class="btn btn-success">Save</button>
</form>
{% endblock %}
{# [END form] #}