-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbar.navigation.panel.latte
54 lines (51 loc) · 1.58 KB
/
bar.navigation.panel.latte
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
<h1>Navigation</h1>
<div class="nette-inner">
<table style="width: 100%;">
<thead>
<tr>
<th>Module</th>
<th>Presenter</th>
<th>Action</th>
</tr>
</thead>
<tbody>
{var $rowspan_module = 1}
{var $rowspan_presenter = 1}
{foreach $tree as $module => $presenters}
{foreach $presenters as $presenter => $actions}
{foreach $actions as $action}
<tr>
{if $rowspan_module == 1}
{var $rowspan_module = \Panel\Navigation::getRowspan($presenters)}
<td rowspan="{$rowspan_module}">{$module}</td>
{else}
{var $rowspan_module = $rowspan_module - 1}
{/if}
{if $rowspan_presenter == 1}
{var $rowspan_presenter = \Panel\Navigation::getRowspan($actions)}
<td rowspan="{$rowspan_presenter}">
{if in_array('default', $actions)}
<a href="{=\Nette\Environment::getApplication()->getPresenter()->link($module ? ":$module:$presenter:" : ":$presenter:")}">
{$presenter}
</a>
{else}
<a href="{=\Nette\Environment::getApplication()->getPresenter()->link($module ? ":$module:$presenter:$action" : ":$presenter:$action")}">
{$presenter}
</a>
{/if}
</td>
{else}
{var $rowspan_presenter = $rowspan_presenter - 1}
{/if}
<td>
<a href="{=\Nette\Environment::getApplication()->getPresenter()->link($module ? ":$module:$presenter:$action" : ":$presenter:$action")}">
{$action}
</a>
</td>
</tr>
{/foreach}
{/foreach}
{/foreach}
</tbody>
</table>
</div>