1 | <html xmlns="http://www.w3.org/1999/xhtml" |
---|
2 | xml:lang="en-US" |
---|
3 | lang="en-US" |
---|
4 | metal:use-macro="here/main_template/macros/master" |
---|
5 | xmlns:tal="http://xml.zope.org/namespaces/tal" |
---|
6 | xmlns:i18n="http://xml.zope.org/namespaces/i18n" |
---|
7 | i18n:domain="quills"> |
---|
8 | |
---|
9 | <head> |
---|
10 | <metal:block fill-slot="javascript_head_slot" |
---|
11 | tal:define="key here/getMapKey|nothing" |
---|
12 | tal:condition="key"> |
---|
13 | <script type="text/javascript" src="" |
---|
14 | tal:attributes="src string:http://maps.google.com/maps?file=api&v=2&key=${key}"> |
---|
15 | </script> |
---|
16 | <script type="text/javascript" src="" |
---|
17 | tal:attributes="src string:$portal_url/editLocation.js"></script> |
---|
18 | </metal:block> |
---|
19 | </head> |
---|
20 | |
---|
21 | <body> |
---|
22 | <div metal:fill-slot="main" |
---|
23 | tal:define="errors options/state/getErrors" |
---|
24 | id="weblog-topics"> |
---|
25 | |
---|
26 | <div tal:define="location context/@@LocationView; |
---|
27 | mapoptions context/@@MapView"> |
---|
28 | <tal:x define="mapcenter python:mapoptions and mapoptions.getMapCenter(); |
---|
29 | maplatitude python:mapcenter and len(mapcenter)==2 and mapcenter[0] or None; |
---|
30 | maplongitude python:mapcenter and len(mapcenter)==2 and mapcenter[1] or None; |
---|
31 | mapzoom python:mapoptions and mapoptions.getMapZoom(); |
---|
32 | maptype python:mapoptions and mapoptions.getMapType(); |
---|
33 | latitude python:location and location.getLatitude(); |
---|
34 | longitude python:location.getLongitude()"> |
---|
35 | <h1 class="documentFirstHeading" |
---|
36 | i18n:translate="heading_location">Location</h1> |
---|
37 | <form name="geolocation_form" |
---|
38 | method="post" |
---|
39 | action="." |
---|
40 | tal:attributes="action string:${here_url}/${template/getId}"> |
---|
41 | |
---|
42 | <div class="field" |
---|
43 | tal:define="error errors/latitude|nothing;" |
---|
44 | tal:attributes="class python:test(error, 'field error', 'field')"> |
---|
45 | <!-- <label for="latitude" i18n:translate="label_latitude"> |
---|
46 | Latitude |
---|
47 | </label>--> |
---|
48 | <div tal:content="error">Validation error output</div> |
---|
49 | <input type="hidden" name="latitude" id="latitude" |
---|
50 | tal:attributes="value request/latitude|latitude" /> |
---|
51 | </div> |
---|
52 | <div class="field" |
---|
53 | tal:define="error errors/longitude|nothing;" |
---|
54 | tal:attributes="class python:test(error, 'field error', 'field')"> |
---|
55 | <!-- <label for="longitude" i18n:translate="label_longitude"> |
---|
56 | Longitude |
---|
57 | </label>--> |
---|
58 | <div tal:content="error">Validation error output</div> |
---|
59 | <input type="hidden" name="longitude" id="longitude" |
---|
60 | tal:attributes="value request/longitude|longitude" /> |
---|
61 | </div> |
---|
62 | <div class="field" |
---|
63 | tal:define="error errors/maplatitude|nothing;" |
---|
64 | tal:attributes="class python:test(error, 'field error', 'field')"> |
---|
65 | <label for="maplatitude" i18n:translate="label_maplatitude"> |
---|
66 | Map Latitude |
---|
67 | </label> |
---|
68 | <div tal:content="error">Validation error output</div> |
---|
69 | <input type="text" name="maplatitude" id="maplatitude" |
---|
70 | tal:attributes="value request/maplatitude|maplatitude" /> |
---|
71 | </div> |
---|
72 | <div class="field" |
---|
73 | tal:define="error errors/maplongitude|nothing;" |
---|
74 | tal:attributes="class python:test(error, 'field error', 'field')"> |
---|
75 | <label for="maplongitude" i18n:translate="label_maplongitude"> |
---|
76 | Map Longitude |
---|
77 | </label> |
---|
78 | <div tal:content="error">Validation error output</div> |
---|
79 | <input type="text" name="maplongitude" id="maplongitude" |
---|
80 | tal:attributes="value request/maplongitude|maplongitude" /> |
---|
81 | </div> |
---|
82 | <div class="field" |
---|
83 | tal:define="error errors/mapzoom|nothing;" |
---|
84 | tal:attributes="class python:test(error, 'field error', 'field')"> |
---|
85 | <label for="mapzoom" i18n:translate="label_mapzoom"> |
---|
86 | Map Zoom |
---|
87 | </label> |
---|
88 | <div tal:content="error">Validation error output</div> |
---|
89 | <select name="mapzoom" id="mapzoom"> |
---|
90 | <option tal:repeat="zoom python:['',] + range(20)" |
---|
91 | tal:content="zoom" |
---|
92 | tal:attributes="selected python:str(zoom) == mapzoom; |
---|
93 | value zoom">Zoom</option> |
---|
94 | </select> |
---|
95 | </div> |
---|
96 | <div class="field" |
---|
97 | tal:define="error errors/maptype|nothing;" |
---|
98 | tal:attributes="class python:test(error, 'field error', 'field')"> |
---|
99 | <label for="maptype" i18n:translate="label_maptype"> |
---|
100 | Map Type |
---|
101 | </label> |
---|
102 | <div tal:content="error">Validation error output</div> |
---|
103 | <input type="radio" name="maptype" id="Map" value="Map" |
---|
104 | tal:attributes="checked python:maptype=='Map'" /> |
---|
105 | <label for="maptype1">Map</label> |
---|
106 | <input type="radio" name="maptype" id="Satellite" value="Satellite" |
---|
107 | tal:attributes="checked python:maptype=='Satellite'" /> |
---|
108 | <label for="maptype2">Satellite</label> |
---|
109 | <input type="radio" name="maptype" id="Hybrid" value="Hybrid" |
---|
110 | tal:attributes="checked python:maptype=='Hybrid'" /> |
---|
111 | <label for="maptype3">Hybrid</label> |
---|
112 | </div> |
---|
113 | <div class="formControls"> |
---|
114 | <input class="context" |
---|
115 | tabindex="" |
---|
116 | type="submit" |
---|
117 | name="form.button.Save" |
---|
118 | value="Save" |
---|
119 | i18n:attributes="value label_save;" |
---|
120 | tal:attributes="tabindex tabindex/next;" /> |
---|
121 | <input class="standalone" |
---|
122 | tabindex="" |
---|
123 | type="submit" |
---|
124 | id='cancel_button' |
---|
125 | name="form.button.Cancel" |
---|
126 | value="Cancel" |
---|
127 | i18n:attributes="value label_cancel;" |
---|
128 | tal:attributes="tabindex tabindex/next;" /> |
---|
129 | </div> |
---|
130 | |
---|
131 | <input type="hidden" name="form.submitted" value="1" /> |
---|
132 | |
---|
133 | </form> |
---|
134 | |
---|
135 | <div id="geomap" style="position: relative; height: 480px;"></div> |
---|
136 | |
---|
137 | </tal:x> |
---|
138 | <!--<tal:x condition="python:not(location.getLatitude() or location.getLatitude())"> |
---|
139 | The object can't be adapted to IGEOLocated |
---|
140 | </tal:x>--> |
---|
141 | </div> |
---|
142 | </div> |
---|
143 | </body> |
---|
144 | |
---|
145 | </html> |
---|