-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathadmin_properties_index.twig
42 lines (40 loc) · 1.31 KB
/
admin_properties_index.twig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
{% extends "index.twig" %}
{% block pageHeader %}
<h1>Properties Management Console</h1>
{% endblock %}
{% block content %}
<a class="addPropertiesLink" href="{{ addUrl }}" >Add a new Property</a>
{% for p in properties %}
<div class="property">
<h2>{{ p.name|e }}</h2>
<p>
{{ p.city|e }}, {{ p.state|e }}<br>
{{ p.type|e }}
</p>
<p>
{{ p.description|e }}
</p>
<p>
<strong>Financed for: </strong>{{ p.amountFinanced|number_format }}
</p>
<img src="{{ imageSettings.path ~ "/" ~ p.image.thumbnailName }}" alt="{{ p.name }} thumbnail" /><br>
<a class="editPropertiesLink" href="{{ editUrl | replace({":id": p.id}) }}">Edit</a>
<form method="post" action="{{ deleteUrl | replace({":id": p.id}) }}">
<input type="hidden" name="_METHOD" value="DELETE"/>
<input class="deletePropertiesLink" type="submit" value="Delete"/>
</form>
</div>
{% endfor %}
{% endblock %}
{% block jsIncludes %}
<script type="text/javascript">
$(document).ready(function($) {
// Handle filtering on anchor tags
$('input.deletePropertiesLink').click(function(e) {
if (!confirm('Are you sure you want to delete this property?')) {
e.preventDefault();
}
});
});
</script>
{% endblock %}