Implemented basic models
This commit is contained in:
parent
6bceef1664
commit
3ba6099976
16 changed files with 257 additions and 24 deletions
69
app/templates/edit.html
Normal file
69
app/templates/edit.html
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
{% set cpath = url_for("edit", id=wishlist.editId) %}
|
||||
|
||||
<h1>Change name</h1>
|
||||
<form action="{{ cpath }}" method="POST">
|
||||
{{ form_wl_editinfo.hidden_tag() }}
|
||||
|
||||
{{ form_wl_editinfo.title.label }}
|
||||
{{ form_wl_editinfo.title() }}
|
||||
|
||||
{{ form_wl_editinfo.description.label }}
|
||||
{{ form_wl_editinfo.description() }}
|
||||
|
||||
{{ form_wl_editinfo.wl_edit_submit() }}
|
||||
</form>
|
||||
|
||||
<h1>Reset urls</h1>
|
||||
<ul>
|
||||
<li>
|
||||
View: {{ wishlist.viewId }}
|
||||
</li>
|
||||
<li>
|
||||
Edit: {{ wishlist.editId }}
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<form action="{{ cpath }}" method="POST">
|
||||
{{ form_wl_reseturls.hidden_tag() }}
|
||||
{{ form_wl_reseturls.wl_reset_submit() }}
|
||||
</form>
|
||||
|
||||
<br>
|
||||
<h1>Delete wishlist</h1>
|
||||
<form action="{{ cpath }}" method="POST">
|
||||
{{ form_wl_delete.hidden_tag() }}
|
||||
{{ form_wl_delete.wl_del_submit() }}
|
||||
</form>
|
||||
|
||||
<br>
|
||||
<h1>New item</h1>
|
||||
<form action="{{ cpath }}" method="POST">
|
||||
{{ form_it_new.hidden_tag() }}
|
||||
|
||||
{{ form_it_new.title.label }}
|
||||
{{ form_it_new.title() }}
|
||||
|
||||
{{ form_it_new.description.label }}
|
||||
{{ form_it_new.description() }}
|
||||
|
||||
{{ form_it_new.price.label }}
|
||||
{{ form_it_new.price() }}
|
||||
|
||||
{{ form_it_new.it_new_submit() }}
|
||||
</form>
|
||||
|
||||
<br>
|
||||
<h1>Delete items</h1>
|
||||
<ul>
|
||||
{% for value in wishlist.items %}
|
||||
<li>
|
||||
<form action="{{ cpath }}" method="POST">
|
||||
{{ form_it_delete.hidden_tag() }}
|
||||
{{ form_it_delete.index(value=loop.index) }}
|
||||
{{ form_it_delete.it_del_submit() }}
|
||||
</form>
|
||||
{{ value.title }}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
11
app/templates/new.html
Normal file
11
app/templates/new.html
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<form action="/new" method="POST">
|
||||
{{ form.hidden_tag() }}
|
||||
|
||||
{{ form.title.label }}
|
||||
{{ form.title() }}
|
||||
|
||||
{{ form.description.label }}
|
||||
{{ form.description() }}
|
||||
|
||||
{{ form.submit() }}
|
||||
</form>
|
||||
10
app/templates/view.html
Normal file
10
app/templates/view.html
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<h1>{{wishlist.title}}</h1>
|
||||
<sub>{{wishlist.description}}</sub>
|
||||
|
||||
<a href="{{url_for('edit', id=wishlist.editId)}}">edit</a>
|
||||
|
||||
<ul>
|
||||
{% for item in wishlist.items %}
|
||||
<li><input type=checkbox {{ "checked" if item.bought }} {{ item.title }}: {{ item.description }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
Loading…
Add table
Add a link
Reference in a new issue