{% extends "base.html" %} {% block main_content %}
		<div class="container">
			<h3 class="offset-lg-2">{{page_title}}</h3>
			<div class="row">
				<form class="form form-inline col-lg-12" action="" method="POST">
					{% for field in form %}
						{% if field.type == 'HiddenField' or field.type == 'CSRFTokenField' %}
							{{field}}<br>
						{% elif field.type != 'SubmitField' %}
							<div class="form-row col-lg-12">
							{{ field.label( class="col-lg-2" ) }}
							{{ field( class="form-control col" ) }}
							</div class="form-row col-lg-12">
						{% endif %}
					{% endfor %}
					<div class="form-row col-lg-12">
						<span class="col-lg-2"><center>Reference Images:</center></span>
                        <div class="form-row col">
						{% for ref_img in reference_imgs %}
                            <div class="form-control col-lg">
                                <input id="ref-img-id-{{ref_img.id}}" name="ref-img-id-{{ref_img.id}}" type="checkbox"
                                {% if object is defined and ref_img in object.refimg %}
                                checked
                                {% endif %}
                                > {{ref_img.fname}}</input>
                            </div>
						{% endfor %}
                        </div class="form-row col-lg-10">
					</div class="form-row col-lg-12">
					<div class="form-row col-lg-12">
					<br>
					</div class="form-row">
					<div class="form-row col-lg-12">
						{{ form.submit( class="btn btn-primary offset-lg-2 col-lg-2" )}}
						{% if 'Edit' in page_title %}
							{{ form.delete( class="btn btn-outline-danger col-lg-2" )}}
						{% endif %}
					</div class="form-row">
				</form>
			</div class="row">
		</div class="container">
{% endblock main_content %}
