]> dev.renevier.net Git - syj.git/blob - application/views/scripts/list/index.phtml
improves list style
[syj.git] / application / views / scripts / list / index.phtml
1     <noscript>
2         <style type="text/css">
3             #container, #navigation, #message {
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 <?php
12     if ($this->paginator->count() == 0) {
13         $link = $this->Anchor($this->baseUrl(), $this->translate ("create a route"), array(), false);
14         $noroutecontent = $this->translate("you have created no route yet, you may want to %s", $link);
15
16         printf ('<div class="warn noroute">%s</div>', $noroutecontent);
17         return;
18     }
19
20     print '<div id="container">';
21     print '<div id="message"></div>';
22
23     $pages = $this->paginator->getPages();
24     if (isset($pages->previous) or isset($pages->next)) {
25         print '<div id="navigation">';
26
27         if (isset($pages->previous)) {
28             $title = $this->translate("first page");
29             $href = $this->addParamToUrl($this->url(), 'page', (string)$pages->first, true);
30             printf ('<a class="page-link" title="%s" href="%s">«</a>', $title, $href);
31
32             $title = $this->translate("previous page");
33             $href = $this->addParamToUrl($this->url(), 'page', (string)$pages->previous, true);
34             printf ('<a class="page-link" title="%s" href="%s">&lt;</a>', $title, $href);
35         } else {
36             print '<span class="page-link">«</span>';
37             print '<span class="page-link">&lt;</span>';
38         }
39
40         if (isset($pages->next)) {
41             $title = $this->translate("next page");
42             $href = $this->addParamToUrl($this->url(), 'page', (string)$pages->next, true);
43             printf ('<a class="page-link" title="%s" href="%s">&gt;</a>', $title, $href);
44
45             $title = $this->translate("last page");
46             $href = $this->addParamToUrl($this->url(), 'page', (string)$pages->last, true);
47             printf ('<a class="page-link" title="%s" href="%s">»</a>', $title, $href);
48         } else {
49             print '<span class="page-link">&gt;</span>';
50             print '<span class="page-link">»</span>';
51         }
52
53         print '</div>';
54     }
55
56
57     print $this->localeSwitcher();
58
59     foreach ($this->paginator as $item) {
60         $map = sprintf('<div class="map" data-geom="%s"></div>', $this->escape($item->geom));
61         $href = $this->url(array(
62             'controller' => 'idx',
63             'action' => 'index',
64             'url' => $item->id
65         ), 'idx');
66         $maplink = $this->Anchor($href, $map, array(), false);
67         $modifylink = $this->Anchor($href, $this->translate("modify or duplicate"));
68         $deletelink = sprintf('<a href="#" class="delete-link">%s</a>', $this->translate("delete"));
69
70         printf ('<div class="item" data-id="%d">
71                 <div class="geom">%s</div>
72                 <div class="controls"><div class="control-link">%s</div><div class="control-link">%s</div></div>
73                 <div class="title">%s</div>
74                 </div>
75                 ',
76                 (int)$item->id, $maplink, $modifylink,  $deletelink, $this->escape($item->displayTitle));
77     }
78
79     print '</div>';
80 ?>