File: menu.ecpp

package info (click to toggle)
vdr-plugin-live 3.5.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,128 kB
  • sloc: cpp: 12,995; javascript: 3,234; makefile: 241; sh: 40
file content (154 lines) | stat: -rw-r--r-- 5,545 bytes parent folder | download
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<%pre>

#include <livefeatures.h>
#include <setup.h>
#include <timerconflict.h>

using namespace vdrlive;

</%pre>
<%args>
active;
component;
filter;
</%args>
<%session scope="global">
bool logged_in(false);
TimerConflictNotifier timerNotifier();
</%session>

<# scope="page" should be enough but does not work with tntnet 3.0 #>
<%request scope="global">
std::string set_active;
std::string set_component;
</%request>

<%cpp>
if (!logged_in && LiveSetup().UseAuth()) {
  cToSvConcat targetUrl = "/login.html?redirect=";
  targetUrl.appendUrlEscaped(request.getQuery());
  return reply.redirect(targetUrl.data());
}

set_active = active;
if (!component.empty()) {
  set_component = component;
}

</%cpp>
<div id="menu">
<# 'choices' could be merged with 'menu', but using the same hierarchy as 'messagebar' and 'pagemenu' #>
  <div class="menubar"><!-- flexbox container for vertical alignment of menu choices -->
    <div class="choices"><!-- collect all menu choices into a single flexbox item -->
      <a href="whats_on.html?type=now"<& menu.setactive current=("whats_on") &>><$ tr("What's on?") $></a>
      <span class="sep">|</span>
      <a href="schedule.html"<& menu.setactive current=("schedule") &>><$ trVDR("Schedule") $></a>
      <span class="sep">|</span>
      <a href="multischedule.html"<& menu.setactive current=("multischedule") &>><$ tr("MultiSchedule") $></a>
      <span class="sep">|</span>
      <a href="timers.html"<& menu.setactive current=("timers") &>><$ trVDR("Timers") $></a>
<%cpp>
if ( LiveFeatures<features::epgsearch>().Recent() ) {
</%cpp>
      <span class="sep">|</span>
      <a href="searchepg.html"<& menu.setactive current=("searchepg") &>><$ tr("Search") $></a>
      <span class="sep">|</span>
      <a href="searchtimers.html"<& menu.setactive current=("searchtimers") &>><$ tr("Search timers") $></a>
<%cpp>
}
</%cpp>
      <span class="sep">|</span>
      <a href="recordings.html?flat=false&filter=<$filter$>"<& menu.setactive current=("recordings") &>><$ tr("Recordings") $></a>
      <span class="sep">|</span>
      <a href="recordings.html?flat=true&filter=<$filter$>"<& menu.setactive current=("recordings_flat") &>><$ tr("Recordings (flat)") $></a>
      <span class="sep">|</span>
      <a href="remote.html"<& menu.setactive current=("remote") &>><$ tr("Remote Control") $></a>
<%cpp>
if (LiveSetup().GetUseStreamdev() && LiveFeatures<features::streamdev_server>().Loaded()) {
</%cpp>
      <span class="sep">|</span>
      <a href="stream.html"<& menu.setactive current=("stream") &>><$ tr("Web-Streaming") $></a>
<%cpp>
}
</%cpp>
      <span class="sep">|</span>
      <a href="setup.html"<& menu.setactive current=("setup") &>><$ trVDR("Setup") $></a>
<# --- Used by D.H. to test infobox (not part of the released version)
      <span class="sep">|</span>
      <a href="ibox_status.html"<& menu.setactive current=("status") &>><$ tr("Status Test") $></a>
--- #>
<%cpp>
if (LiveSetup().UseAuth()) {
</%cpp>
      <span class="sep">|</span>
      <a id="login" href="login.html?action=logout"><$ tr("Logout") $></a>
<%cpp>
}
</%cpp>
      <span class="sep">|</span>
      <a <& tooltip.display domId=("aboutBox") &>>?</a>
    </div>
  </div>
</div>
<div id="messagebar" class="<? !timerNotifier.ShouldNotify() ? "notpresent" ?>">
<# use distinct flexbox container to avoid display-style conflict between 'messagebar' and 'notpresent' #>
  <div class="menubar"><!-- flexbox container for vertical alignment of message-bar choices -->
    <div class="choices"><!-- collect all message-bar choices into a single flexbox item -->
      <$ tr("Your attention is required") $>:
      <span id="mbmessage"><$ timerNotifier.Message() $></span>
      <span id="mbreact"><a href="<$ timerNotifier.Url() $>"><$ tr("React") $></a></span>
      <span id="mbdelimiter" class="<? timerNotifier.Url().empty() ? "notpresent " ?>sep">|</span>
      <span id="mbdismiss"><a href="" onclick="$('messagebar').addClass('notpresent'); return false"><$ tr("Dismiss") $></a></span>
    </div>
  </div>
</div>
<%cpp>
if (!component.empty()) {
</%cpp>
<div id="pagemenu">
  <div class="top"><!-- container for fading-in background gradient --></div>
  <div class="menubar"><!-- container for vertical alignment of page-menu choices -->
    <div class="choices"><!-- collect all page-menu choices into a single flexbox item -->
      <& menu.component current=("whats_on") &>
      <& menu.component current=("schedule") &>
      <& menu.component current=("multischedule") &>
      <& menu.component current=("timers") &>
<%cpp>
  if (LiveFeatures<features::epgsearch>().Recent()) {
</%cpp>
      <& menu.component current=("search") &>
      <& menu.component current=("searchepg") &>
      <& menu.component current=("searchtimers") &>
<%cpp>
  }
</%cpp>
      <& menu.component current=("recordings") &>
      <& menu.component current=("recordings_flat") &>
      <& menu.component current=("remote") &>
      <& menu.component current=("stream") &>
      <& menu.component current=("users") &>
    </div>
  </div>
  <div class="bottom"><!-- container for fading-out background gradient --></div>
</div>
<%cpp>
}
</%cpp>
<# logo, infobox and menus end here #>
</div> <# content #>
</div> <# page header #>
<# end of fixed page header #>

<%def setactive>
<%args>
current;
</%args>
<{ if (current == set_active) { }> class="active"<{ }
}></%def>

<%def component>
<%args>
current;
</%args>
<%cpp> if ((current == set_active) && (!set_component.empty())) { </%cpp><& (set_component) &><%cpp> } </%cpp>
</%def>