]> dev.renevier.net Git - syj.git/blobdiff - application/views/scripts/idx/index.phtml
routes profile
[syj.git] / application / views / scripts / idx / index.phtml
index f2983ee521afa5459c57d217423fcb9f6d904e79..f5b7b6771b37a5ee82079259065a6a9b49ceab44 100644 (file)
@@ -9,15 +9,26 @@
 </noscript>
 
 <div id="map"></div>
+<div id="map-overlay"></div>
 
-<div id="message" class="message info">
-<?php if (!$this->path and !$this->loggedUser) {?>
-<?php echo $this->translate('Welcome on Syj.')?>
-<br/>
-<?php echo $this->translate('To create a journey, just click on the map to add points to your route. You can zoom and move map with controls upper left.')?>
-<br/>
-<?php echo $this->translate('When you have finished a path, press "save", button.')?>
-<?php }?>
+<?php
+$message = "";
+$msgclass = "";
+if ($this->errorMsg) {
+    $message .= $this->errorMsg;
+    $msgclass = "error";
+} else if (!$this->path and !$this->loggedUser) {
+    $message .= $this->translate('To create a journey, press <strong>"start a route"</strong> button, then click on the map to add points. To delete a point, hold shift pressed while clicking on it.');
+    $message .= "<br>";
+    $message .= $this->translate('You can zoom and move the map with the controls in the top left corner.');
+    $message .= "<br>";
+    $message .= $this->translate('When you have finished a path, press "create", button.');
+    $msgclass = "info optional";
+}
+?>
+
+<div id="message" class="message <?php echo $msgclass?>">
+    <?php echo $message ?>
 </div>
 
 
                 <div id="path-infos-toggler"><a href="" id="path-infos-anchor"><?php echo $this->translate("route infos")?></a></div>
              </div>
                 <div id="path-infos-content" class="menu-item">
+
                     <div id="path-directlink-title" class="info-title"><?php echo $this->translate("direct link")?></div>
-                    <div id="path-directlink-content"><?php
-                            $serverUrl = rtrim($this->serverUrl(), '/');
-                            $baseUrl = trim($this->baseUrl(), '/');
+                    <div id="path-directlink-content" class="info-content"><?php
                             $urlcomp = urlencode($this->path->urlcomp ?: $this->path->id);
-                            $href = $serverUrl . '/' . ($baseUrl ? ($baseUrl . '/'): '') . 'idx/' . $urlcomp . '?format=raw';
+                            $href = $this->baseUrl() . '/idx/' . $urlcomp . '?format=raw';
                             printf('<a href="%s" title="%s">%s</a>',
                                         $href,
                                         $this->translate('direct link'),
                                         $this->escape($href));
                         ?></div>
+
+                    <div id="path-export-title" class="info-title"><?php echo $this->translate("export")?></div>
+                    <div id="path-export-content" class="info-content"><?php
+                       $fileName = $this->path->title ?: $this->path->id;
+                       $href = $this->baseUrl() . '/geom/' . rawurlencode($fileName) . '.kml';
+                       printf('<a href="%s" title="%s">%s</a>',
+                                        $href,
+                                        $this->translate('kml export'),
+                                        $this->translate('kml export'));
+
+                        print '<br>';
+                       $href = $this->baseUrl() . '/geom/' . rawurlencode($fileName) . '.gpx';
+                       printf('<a href="%s" title="%s">%s</a>',
+                                        $href,
+                                        $this->translate('gpx export'),
+                                        $this->translate('gpx export'));
+                       ?>
                 </div>
+
+                <?php if ($this->profileActive) { ?>
+                <div id="path-profile-title" class="info-title"><?php echo $this->translate("altitude profile")?></div>
+                <div id="path-profile-content" class="info-content"><?php
+                        $urlcomp = urlencode($this->path->urlcomp ?: $this->path->id);
+                        $href = $this->baseUrl() . '/profile/' . $urlcomp . '.png';
+                        $imgsrc =  $this->addParamToUrl($href, 'size', 'small', true);
+                        printf('<a href="%s"><img src="%s"></a>', $href, $imgsrc);
+                ?></div>
+                <?php }?>
+
+
             </div>
         </div>
     <?php }?>