From 1262bad59e3a846f6d3dd5071a135dc1b0506eaf Mon Sep 17 00:00:00 2001
From: Eric Lippmann <eric.lippmann@netways.de>
Date: Wed, 30 Sep 2015 23:28:10 +0200
Subject: [PATCH] Fix navigation/index view script

refs #5543
---
 .../views/scripts/navigation/index.phtml      | 125 ++++++++++--------
 1 file changed, 72 insertions(+), 53 deletions(-)

diff --git a/application/views/scripts/navigation/index.phtml b/application/views/scripts/navigation/index.phtml
index 2f77d0995..7ef7320ee 100644
--- a/application/views/scripts/navigation/index.phtml
+++ b/application/views/scripts/navigation/index.phtml
@@ -1,59 +1,78 @@
 <?php if (! $this->compact): ?>
 <div class="controls">
-    <?= $this->tabs; ?>
-    <?= $this->sortBox; ?>
-    <?= $this->limiter; ?>
-    <?= $this->paginator; ?>
-    <?= $this->filterEditor; ?>
+    <?= $this->tabs ?>
+    <?= $this->sortBox ?>
+    <?= $this->limiter ?>
+    <?= $this->paginator ?>
+    <?= $this->filterEditor ?>
 </div>
 <?php endif ?>
-<div class="content" data-base-target="_next">
-    <a href="<?= $this->href('navigation/add'); ?>">
-        <?= $this->icon('plus'); ?> <?= $this->translate('Create A New Navigation Item'); ?>
-    </a>
+<div class="content">
+    <?= $this->qlink(
+        $this->translate('Create A New Navigation Item') ,
+        'navigation/add',
+        null,
+        array(
+            'class'             => 'button-link',
+            'data-base-target'  => '_next',
+            'icon'              => 'plus',
+            'title'             => $this->translate('Create a new navigation item')
+        )
+    ) ?>
 <?php if (count($items) === 0): ?>
-    <p><?= $this->translate('You did not create any navigation item yet'); ?></p>
-<?php else: ?>
-    <table class="action alternating">
-        <thead>
-            <th><?= $this->translate('Navigation'); ?></th>
-            <th style="width: 10em"><?= $this->translate('Type'); ?></th>
-            <th style="width: 5em"><?= $this->translate('Shared'); ?></th>
-            <th style="width: 5em"><?= $this->translate('Remove'); ?></th>
-        </thead>
-        <tbody>
-        <?php foreach ($items as $item): ?>
-            <tr>
-                <td><?= $this->qlink(
-                    $item->name,
-                    'navigation/edit',
-                    array(
-                        'name'  => $item->name,
-                        'type'  => $item->type
-                    ),
-                    array(
-                        'title' => sprintf($this->translate('Edit navigation item %s'), $item->name)
-                    )
-                ); ?></td>
-                <td><?= $item->type && isset($types[$item->type])
-                    ? $this->escape($types[$item->type])
-                    : $this->escape($this->translate('Unknown')); ?></td>
-                <td><?= $item->owner ? $this->translate('Yes') : $this->translate('No'); ?></td>
-                <td><?= $this->qlink(
-                    '',
-                    'navigation/remove',
-                    array(
-                        'name'  => $item->name,
-                        'type'  => $item->type
-                    ),
-                    array(
-                        'icon'  => 'trash',
-                        'title' => sprintf($this->translate('Remove navigation item %s'), $item->name)
-                    )
-                ); ?></td>
-            </tr>
-        <?php endforeach ?>
-        </tbody>
+    <p><?= $this->translate('You did not create any navigation item yet.') ?></p>
+</div>
+<?php return; endif ?>
+    <table class="action-table listing-table" data-base-target="_next">
+    <thead>
+    <tr>
+        <th><?= $this->translate('Navigation') ?></th>
+        <th><?= $this->translate('Type') ?></th>
+        <th><?= $this->translate('Shared') ?></th>
+        <th></th>
+    </tr>
+    </thead>
+    <tbody>
+<?php foreach ($items as $item): ?>
+    <tr>
+        <td>
+            <?= $this->qlink(
+                $item->name,
+                'navigation/edit',
+                array(
+                    'name'  => $item->name,
+                    'type'  => $item->type
+                ),
+                array(
+                    'title' => sprintf($this->translate('Edit navigation item %s'), $item->name)
+                )
+            ) ?>
+        </td>
+        <td>
+            <?= $item->type && isset($types[$item->type])
+                ? $this->escape($types[$item->type])
+                : $this->escape($this->translate('Unknown')) ?>
+        </td>
+        <td class="icon-col">
+            <?= $item->owner ? $this->translate('Yes') : $this->translate('No') ?>
+        </td>
+        <td class="icon-col text-right">
+            <?= $this->qlink(
+                '',
+                'navigation/remove',
+                array(
+                    'name'  => $item->name,
+                    'type'  => $item->type
+                ),
+                array(
+                    'class' => 'action-link',
+                    'icon'  => 'cancel',
+                    'title' => sprintf($this->translate('Remove navigation item %s'), $item->name)
+                )
+            ) ?>
+        </td>
+    </tr>
+<?php endforeach ?>
+    </tbody>
     </table>
-<?php endif ?>
-</div>
\ No newline at end of file
+</div>