]> dev.renevier.net Git - syj.git/blob - application/views/scripts/idx/index.phtml
ac7e9dd16c830b143536d32ee313993f95a09ba1
[syj.git] / application / views / scripts / idx / index.phtml
1 <noscript>
2     <style type="text/css">
3         #map, #message, #data_controls, #login_controls, #user_area, #login_area, #newpwd_area {
4             display: none;
5         }
6     </style>
7
8     <p><?php echo $this->translate('SYJ needs javascript. Please activate scripts in your browser.');?></p>
9 </noscript>
10
11 <div id="map"></div>
12 <div id="map-overlay"></div>
13
14 <?php
15 $message = "";
16 $msgclass = "info";
17 if ($this->errorMsg) {
18     $message .= $this->errorMsg;
19     $msgclass = "error";
20 } else if (!$this->path and !$this->loggedUser) {
21     $message .= $this->translate('Welcome on Syj.');
22     $message .= "<br>";
23     $message .= $this->translate('To create a journey, just press <strong>"start a route"</strong> button, then click on the map to add points to your route. You can zoom and move the map with the controls in the top left corner');
24     $message .= "<br>";
25     $message .= $this->translate('When you have finished a path, press "create", button.');
26 }
27 ?>
28
29 <div id="message" class="message <?php echo $msgclass?>">
30     <?php echo $message ?>
31 </div>
32
33
34 <div id="path-length" class="menu-group">
35     <div id="path-length-title" class="info-title"><?php echo $this->translate('route length')?></div>
36     <div id="path-length-content">
37     </div>
38 </div>
39
40 <div id="menu">
41
42     <?php echo $this->localeSwitcher(); ?>
43
44     <div id="login_controls" class="menu-group">
45         <div>
46             <div class="menu-item">
47             <?php
48                 echo $this->anchor('login', $this->translate('login'), array('id' => 'login_control_anchor'));
49                 $anchortext = sprintf("<span id=\"account-create-anchor\">%s</span><span id=\"account-info\"><br>%s</span>",
50                                       $this->translate('create an account'),
51                                       $this->translate('Whith an account, you can manage and modify your routes'));
52                 ?>
53                </div>
54                <div class="menu-item">
55                <?php
56                 echo $this->anchor('', $anchortext, array('id' => 'user_control_anchor'), false);
57             ?>
58             </div>
59         </div>
60         <div>
61             <?php echo $this->logoutLink(); ?>
62         </div>
63     </div>
64
65     <?php if (isset($this->path)) { ?>
66         <div id="path-infos" class="menu-group">
67             <div class="menu-item">
68                 <div id="path-infos-toggler"><a href="" id="path-infos-anchor"><?php echo $this->translate("route infos")?></a></div>
69              </div>
70                 <div id="path-infos-content" class="menu-item">
71
72                     <div id="path-directlink-title" class="info-title"><?php echo $this->translate("direct link")?></div>
73                     <div id="path-directlink-content"><?php
74                             $serverUrl = rtrim($this->serverUrl(), '/');
75                             $baseUrl = trim($this->baseUrl(), '/');
76                             $fullBaseUrl = $serverUrl . '/' . ($baseUrl ? ($baseUrl . '/'): '');
77                             $urlcomp = urlencode($this->path->urlcomp ?: $this->path->id);
78                             $href = $fullBaseUrl . 'idx/' . $urlcomp . '?format=raw';
79                             printf('<a href="%s" title="%s">%s</a>',
80                                         $href,
81                                         $this->translate('direct link'),
82                                         $this->escape($href));
83                         ?></div>
84
85                     <div id="path-export-title" class="info-title"><?php echo $this->translate("export")?></div>
86                     <div id="path-export-content"><?php
87                        $href = $fullBaseUrl . 'geom/' . urlencode($this->path->id) . '.kml';
88                        printf('<a href="%s" title="%s">%s</a>',
89                                         $href,
90                                         $this->translate('kml export'),
91                                         $this->translate('kml export'));
92
93                         print '<br>';
94                        $href = $fullBaseUrl . 'geom/' . urlencode($this->path->id) . '.gpx';
95                        printf('<a href="%s" title="%s">%s</a>',
96                                         $href,
97                                         $this->translate('gpx export'),
98                                         $this->translate('gpx export'));
99                        ?>
100
101
102                 </div>
103             </div>
104         </div>
105     <?php }?>
106
107     <div id="data_controls">
108         <div id="data_controls_btns">
109
110     <?php if (isset($this->path)) { ?>
111         <input id="clone-btn" name="clone-btn" type="button" value="<?php echo $this->translate('duplicate');?>">
112         <br>
113         <input id="edit-btn" name="edit-btn" type="button" value="<?php echo $this->translate('edit');?>">
114     <?php } else {?>
115
116         <form id="nominatim-form" action="nominatim" method="get">
117             <div><a id="nominatim-label" href=""><?php echo $this->translate('Search a place')?></a></div>
118             <div id="nominatim-message" class="message"></div>
119             <div id="nominatim-controls">
120             <input name="nominatim-search" id="nominatim-search">
121             <input type="submit" id="nominatim-submit" name="nominatim-submit" value="<?php echo $this->translate('Ok')?>">
122             <img id="nominatim-throbber" src="icons/throbber.gif">
123             </div>
124
125         </form>
126
127         <input id="create-btn" name="create-btn" type="button" value="<?php echo $this->translate('start a route');?>">
128     <?php } ?>
129         </div>
130
131     <?php
132         print $this->geomform;
133     ?>
134
135 </div>
136
137 <?php if (!isset($this->path)) {?>
138             <div id="nominatim-suggestions">
139             <div id="nominatim-suggestions-title"><?php echo $this->translate('more results')?></div>
140             <ul id="nominatim-suggestions-list"></ul>
141             </div>
142 <?php }?>
143
144
145 </div>
146
147 <div id="newpwd_area" class="modal">
148     <div id="newpwd_message" class="message"></div>
149     <?php
150         print $this->newpwdform;
151     ?>
152 </div>
153
154 <div id="user_area" class="modal">
155     <div id="user_message" class="message"></div>
156     <?php
157         print $this->userform;
158     ?>
159 </div>
160
161 <div id="login_area" class="modal">
162    <div id="login_message" class="message"></div>
163
164 <?php
165   print $this->loginform;
166 ?>
167
168 <p id="login_area_create"><a id="login_area_create_anchor" href=""><?php echo $this->translate('create an account')?></a></p>
169
170 </div>
171
172 <div id="termsofusearea" class="modal">
173   <iframe id="termsofuseiframe" width="100%" height="100%" frameborder="0"></iframe>
174 </div>