File size: 4,638 Bytes
d70361b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>Menu Management — Vedangsoft Change Detection</title>
  <link rel="stylesheet" href="/static/css/style.css?v=34" />
  <link rel="stylesheet" href="/static/css/dda.css?v=43" />
</head>
<body>
  <div class="app dda-app dda-app-full">
    {% include "partials/navbar_dda.html" %}

    <div class="dda-main-col">
      {% include "partials/alerts_dda.html" %}

      <section id="tab-admin-menu" class="dda-panel active" role="tabpanel">
        <div class="dda-hero">
          <h1>Menu Management</h1>
          <p class="sub">Create, reorder, and nest navigation menu items.</p>
        </div>

        <div class="dda-admin-2col">
          <div class="card">
            <div class="card-header">
              <h3>Menu Items</h3>
              <button type="button" class="btn btn-primary btn-sm" id="btn-new-menu-item">+ Add Menu Item</button>
            </div>
            <div id="menu-item-list" class="dda-menu-list"><p class="dim">Loading menu items…</p></div>
          </div>

          <div class="card">
            <div class="card-header"><h3>Instructions</h3></div>
            <div class="dda-admin-side-panel">
              <p><strong>Label</strong> — the text shown in the sidebar.</p>
              <p><strong>Icon</strong> — optional emoji shown next to the label.</p>
              <p><strong>Module</strong> — links the item to a permission module. The item is hidden from a user's sidebar if their role has no "View" permission for that module. Leave unset for an item that's always visible.</p>
              <p><strong>Parent item</strong> — makes this a sub-item, indented under its parent. Only one level of nesting is supported. A parent with visible sub-items renders as a collapsible group in the sidebar (like "Configuration"); a parent with no visible sub-items is hidden.</p>
              <p><strong>URL</strong> — the route this item navigates to.</p>
              <p>Use <strong>▲ / ▼</strong> to reorder items within their group (top-level items reorder among themselves; sub-items reorder among their siblings).</p>
            </div>
            <div class="card-header" style="margin-top:1.25rem"><h3>Module Keys</h3></div>
            <div id="module-keys-list" class="dda-module-keys"><p class="dim">Loading…</p></div>
          </div>
        </div>
      </section>
    </div>
  </div>

  <div id="menu-item-modal" class="dda-modal hidden" role="dialog" aria-modal="true">
    <div class="dda-modal-panel card" style="max-width:480px">
      <div class="card-header">
        <h3 id="menu-item-modal-title">Add Menu Item</h3>
        <button type="button" class="btn btn-secondary btn-sm" id="menu-item-modal-close">Close</button>
      </div>
      <form id="menu-item-form">
        <input type="hidden" id="menu-item-id" />
        <div class="form-group">
          <label for="menu-item-label">Label</label>
          <input type="text" id="menu-item-label" required />
        </div>
        <div class="location-row">
          <div class="form-group">
            <label for="menu-item-icon">Icon <span class="dim">(emoji, optional)</span></label>
            <input type="text" id="menu-item-icon" maxlength="8" placeholder="📄" />
          </div>
          <div class="form-group">
            <label for="menu-item-url">URL</label>
            <input type="text" id="menu-item-url" placeholder="/example" required />
          </div>
        </div>
        <div class="form-group">
          <label for="menu-item-module">Module <span class="dim">(gates visibility)</span></label>
          <select id="menu-item-module">
            <option value="">— No module (always visible) —</option>
          </select>
        </div>
        <div class="form-group">
          <label for="menu-item-parent">Parent item <span class="dim">(sub-menus)</span></label>
          <select id="menu-item-parent">
            <option value="">— Top Level —</option>
          </select>
        </div>
        <label class="dda-check"><input type="checkbox" id="menu-item-active" checked /> Active (visible in the sidebar)</label>
        <button type="submit" class="btn btn-primary" style="margin-top:0.75rem">Save menu item</button>
      </form>
    </div>
  </div>

  <script src="/static/js/dda/shared.js?v=7"></script>
  <script src="/static/js/dda/app.js?v=29"></script>
  <script src="/static/js/dda/notifications.js?v=5"></script>
  <script src="/static/js/dda/admin_menu.js?v=2"></script>
</body>
</html>