Add for loop tags for edit page

This commit is contained in:
duongban
2021-05-29 20:35:56 +07:00
parent 6994d61281
commit 9c0af2a15c

View File

@@ -1,17 +1,24 @@
{% extends "layout.html" %} {% extends "layout.html" %}
{% block body %} {% block body %}
<div class="well"> <div class="well editPanel">
<h2>Edit Card #{{ card.id }}</h2> <h2>Edit Card #{{ card.id }}</h2>
<form action="{{ url_for('edit_card') }}" method="post" class="cardForm"> <form action="{{ url_for('edit_card') }}" method="post" class="cardForm">
<div class="form-group"> <div class="form-group">
<label for="general" class="btn btn-default btn-lg">General &nbsp; {% for tag in tags %}
<label for={{tag.tagName}} class="toggleButton btn btn-default btn-lg">{{tag.tagName}} &nbsp;
<input type="radio" name="type" value={{tag.id}}
id={{tag.tagName}} {{ "checked" if (card.type == tag.id) else "" }} />
</label>
{% endfor %}
<!-- <label for="general" class="btn btn-default btn-lg">General &nbsp;
<input type="radio" name="type" value="1" <input type="radio" name="type" value="1"
id="general" {{ "checked" if (card.type == 1) else "" }} /> id="general" {{ "checked" if (card.type == 1) else "" }} />
</label> </label>
<label for="code" class="btn btn-default btn-lg">Code &nbsp; <label for="code" class="btn btn-default btn-lg">Code &nbsp;
<input type="radio" name="type" value="2" id="code" {{ "checked" if (card.type == 2) else "" }} /> <input type="radio" name="type" value="2" id="code" {{ "checked" if (card.type == 2) else "" }} />
</label> </label> -->
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="front">Front of Card</label> <label for="front">Front of Card</label>