-
Notifications
You must be signed in to change notification settings - Fork 15
/
update_rack.html
130 lines (113 loc) · 5.28 KB
/
update_rack.html
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
{% extends "base.html" %}
{% block title %} fixcity.org {% endblock %}
{% block extra_header %}
<script type="text/javascript" src="/site_media/openlayers/OpenLayers.js"></script>
<script type="text/javascript">
// Settings needed by rackmap.js.
var pointRadius = "10";
var externalGraphic = "/site_media/img/rack.png";
var WKT = "{{ request.POST.location|default:rack.location.wkt }}";
function post_loadmap(map, geom) {
map.setCenter(geom.getBounds().getCenterLonLat(), 16);
};
</script>
<script type="text/javascript" src="/site_media/js/rackmap.js"></script>
<script type="text/javascript">
//<![CDATA[
if (jQuery.browser.msie) {
jQuery(window).load(function() {loadMap();});
} else {
jQuery(document).ready(function() {loadMap();});
}
//]]>
</script>
{% endblock %}
{% block menu %}
{% endblock %}
{% block content %}
<form id="addrack-form" action="." method="POST" enctype="multipart/form-data">
<label for="address">Street Address</label>
<div class="required"><input id="address" name="address" type="text"
title="Enter an address or click a point on the map"
value="{{request.POST.address|default:rack.address}}" />
<input type="hidden" id="location" name="location" value="{{wkt}}" />
{{ form.address.errors }} {{ form.location.errors }}
</div>
<label for="title">Establishment</label>
<div class="required"><input id="title" name="title" type="text"
title="What are you trying to get to? i.e. Key Foods, PS 121, restaurants"
value="{{request.POST.title|default:rack.title}}"
/>{{ form.title.errors }}</div>
<label for="description">Description</label>
<textarea id="description" name="description"
title="Why are bike racks needed here? Other details?">{{ request.POST.description|default:rack.description }}</textarea>
{{ form.description.errors }}
<label for="browse">Photo</label>
{% if rack.photo %}
<img src="{{rack.photo.extra_thumbnails.large}}" />
<br />
{% else %}
<div>No photo uploaded.</div>
{% endif %}
{{ form.photo.errors }}
<div id="photo-wrap">
<label for="fakebrowseinput">{% if rack.photo %}Replace{% else %}Add{% endif %} Photo</label>
<input id="browse" name="photo" type="file" value="{{request.FILES.photo.name}}" size="20" />
<div id="fakebrowse" class="selfclear"><input name="fakebrowseinput" id="fakebrowseinput" type="text" title="JPG, GIF or PNG files - 5MB maximum" /><span class="fakebutton">browse</span></div>
</div><!-- /#photo-wrap -->
<div id="statement-wrap">
<label for="statement">Statement of Support <small class="optional">(<a href="/site_media/resources/SupportStatement.pdf">optional</a>)</small></label>
<input id="statement" name="statement" type="file" value="" size="20" />
<div id="fakestatement" class="selfclear"><input name="fakestatementinput" id="fakestatementinput" type="text" title="" /><span class="fakebutton">browse</span></div>
</div><!-- /#statement-wrap -->
<!-- XXX Do we want to update date on edit? -->
<input type="hidden" name="date" value="{{rack.date}}"/>
<div id="email-wrap">
<label>Created By</label>
<div>{{creator}}</div>
</div>
<!-- These flags will trigger server-side processing of location
if set to zero. We use this to hack around
the impossibility of knowing if asynch functions have finished
when the form submits. Also provides a bit of graceful
degrading... not like we have a lot of that in a map-heavy
site. -->
<input type="hidden" id="geocoded" name="geocoded" value="0" />
<div id="verified-wrap">
<label for="verified">Verified</label>
{% if rack.verified %}
<input type="checkbox" name="verified" checked="checked" />
{% else %}
<input type="checkbox" name="verified" />
{% endif %}
</div>
<input type="submit" value="Save" />
<!-- errors for debugging
{{ form.errors }}
-->
</form>
<div class="suggest">
<div id="request-map">
</div>
<div id="quick-check">
<p>Suggestions must have a photo matching the <a class="photo-guidelines" href="#">guidelines</a> and meeting <a class="location-guidelines" href="#">placement requirements</a> to be verified. Support statements are optional for non-residential buildings.</p>
</div><!-- /#quick-check -->
</div><!-- /#suggest -->
{% endblock %}
{% block lede %}
<h1>Edit Rack</h1>
{% endblock %}
{% block extra_footer %}
<script type="text/javascript">
//<![CDATA[
jQuery(document).ready(function($) {
$('input#address, input#title, textarea#description, input#email, input#fakebrowseinput').inlineInfoTextify();
$('input#browse').change(function( objEvent ){$('#fakebrowseinput').val($(this).val()).removeClass("overlabel");});
$('input#statement').change(function( objEvent ){$('#fakestatementinput').val($(this).val()).removeClass("overlabel");});
expandOnce('#photo-wrap', '{% if rack.photo %}Replace{% else %}Add{% endif %} Photo');
expandOnce('#statement-wrap', 'Add Statement of Support');
$('textarea#description').maxLength(300);
$('input#address, input#title, textarea#description, input#fakebrowseinput').infoSuffixify();
//]]>
</script>
{% endblock %}