Skip to content

Commit

Permalink
backNavigation
Browse files Browse the repository at this point in the history
  • Loading branch information
Markus Ehrnsperger committed Oct 29, 2023
1 parent 1ab78db commit 9074a54
Show file tree
Hide file tree
Showing 12 changed files with 66 additions and 80 deletions.
73 changes: 0 additions & 73 deletions live/css/DatePicker.css

This file was deleted.

9 changes: 9 additions & 0 deletions live/html/back.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<title>Back</title>
<script>
history.go(-2);
</script>
</head>
</html>
17 changes: 15 additions & 2 deletions pages/edit_recording.ecpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ const cRecording* recording;
throw HtmlError(tr("Couldn't find recording. Maybe you mistyped your request?"));
}

bool returnToReferer = false;
if (request.getMethod() == "POST") {
if (name.empty())
message = tr("Please set a name for the recording!");
Expand All @@ -62,11 +63,22 @@ const cRecording* recording;
if (newdir != ".") directory = newdir;
std::string filename = directory.empty() ? name : StringReplace(directory, "/", "~") + "~" + name;
if (LiveRecordingsManager()->MoveRecording(recording, FileSystemExchangeChars(filename, true), copy_only))
return reply.redirect(!edit_rec_referer.empty() ? edit_rec_referer : "recordings.html");
returnToReferer = true;
// return reply.redirect(!edit_rec_referer.empty() ? edit_rec_referer : "recordings.html");
else
message = tr("Cannot copy, rename or move the recording.");
}
}
}
if (returnToReferer) {
</%cpp>
<!DOCTYPE html>
<html>
<script>
history.go(-2);
</script>
</html>
<%cpp>
} else {

// if (message.empty()) edit_rec_referer = request.getHeader("Referer:", "recordings.html");

Expand Down Expand Up @@ -232,4 +244,5 @@ if (recording && recording->Info()->Aux()) {
</div>
</body>
</html>
% }
<%include>page_exit.eh</%include>
14 changes: 12 additions & 2 deletions pages/edit_timer.ecpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,18 @@ const cTimer* timer;
// dsyslog("live: remote '%s'", remote);
LiveTimerManager().UpdateTimer( timerId, remote, oldRemote, flags, channel, weekdays, date, start, stop, priority, lifetime, title, aux );
timerNotifier.SetTimerModification();
return reply.redirect(!edit_timerreferer.empty()?edit_timerreferer:"timers.html");
</%cpp>
<!DOCTYPE html>
<html>
<script>
history.go(-2);
</script>
</html>
<%cpp>
// return reply.redirect("html/back.html");
// return reply.redirect(!edit_timerreferer.empty()?edit_timerreferer:"timers.html");
}
}
} else {

if (message.empty())
edit_timerreferer = request.getHeader("Referer:", "timers.html");
Expand Down Expand Up @@ -374,4 +383,5 @@ const cTimer* timer;
</div>
</body>
</html>
% }
<%include>page_exit.eh</%include>
1 change: 1 addition & 0 deletions pages/multischedule.ecpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ std::vector<time_t> times_start;
</%request>
<%include>page_init.eh</%include>
<%cpp>
reply.setHeader (tnt::httpheader::cacheControl, "no-store, no-cache, max-age=0, must-revalidate, proxy-revalidate", true);
if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
pageTitle = tr("MultiSchedule");

Expand Down
1 change: 1 addition & 0 deletions pages/recordings.ecpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ using namespace vdrlive;

<%include>page_init.eh</%include>
<%cpp>
reply.setHeader (tnt::httpheader::cacheControl, "no-store, no-cache, max-age=0, must-revalidate, proxy-revalidate", true);
if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");

// create the "current" values of the global request parameters, based on their old values and the current arguments
Expand Down
1 change: 1 addition & 0 deletions pages/schedule.ecpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ bool logged_in(false);
</%request>
<%include>page_init.eh</%include>
<%cpp>
reply.setHeader (tnt::httpheader::cacheControl, "no-store, no-cache, max-age=0, must-revalidate, proxy-revalidate", true);
if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
</%cpp>
<%cpp>
Expand Down
1 change: 1 addition & 0 deletions pages/searchresults.ecpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ bool logged_in(false);
</%request>
<%include>page_init.eh</%include>
<%cpp>
reply.setHeader (tnt::httpheader::cacheControl, "no-store, no-cache, max-age=0, must-revalidate, proxy-revalidate", true);
if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");

pageTitle = tr("Search results");
Expand Down
16 changes: 13 additions & 3 deletions pages/timers.ecpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ using namespace vdrlive;
</%request>
<%include>page_init.eh</%include>
<%cpp>
reply.setHeader (tnt::httpheader::cacheControl, "no-store, no-cache, max-age=0, must-revalidate, proxy-revalidate", true);
if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");

pageTitle = trVDR("Timers");
Expand All @@ -47,14 +48,22 @@ using namespace vdrlive;
// dsyslog("live: timers.ecpp timer->Remote() %s", timer->Remote());
LiveTimerManager().DelTimer(timer->Id(), timer->Remote());
timerNotifier.SetTimerModification();
return reply.redirect("timers.html");
// return reply.redirect("timers.html");
}
if (action == "toggle") {
LiveTimerManager().ToggleTimerActive(timer->Id(), timer->Remote());
timerNotifier.SetTimerModification();
return reply.redirect("timers.html");
// return reply.redirect("timers.html");
}
}
</%cpp>
<!DOCTYPE html>
<html>
<script>
history.go(-1);
</script>
</html>
<%cpp>
} else {

std::string previousDay = "";
</%cpp>
Expand Down Expand Up @@ -217,6 +226,7 @@ using namespace vdrlive;
</div>
</body>
</html>
% }
<%include>page_exit.eh</%include>

<%def timer_actions>
Expand Down
1 change: 1 addition & 0 deletions pages/whats_on.ecpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ std::string current_displaytime;

<%include>page_init.eh</%include>
<%cpp>
reply.setHeader (tnt::httpheader::cacheControl, "no-store, no-cache, max-age=0, must-revalidate, proxy-revalidate", true);
if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");


Expand Down
3 changes: 3 additions & 0 deletions preload.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,11 @@ namespace vdrlive {
"img/playlist.png",
"img/sd.png",
"img/hd.png",
"img/rd.png",
"img/RecordingErrors.png",
"img/NoRecordingErrors.png",
"img/NotCheckedForRecordingErrors.png",
"js/live/browserwin.js",
"js/live/vdr_status.js",
"js/live/infowin.js",
"js/live/header.js",
Expand All @@ -108,6 +110,7 @@ namespace vdrlive {
"js/live/epg_tt_box.js",
"js/live/treeview.js",
"js/mootools/mootools.v1.11.js",
"html/back.html",
0
};

Expand Down
9 changes: 9 additions & 0 deletions tntconfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,15 @@ namespace vdrlive {
"/img/$1.$2",
"image/$2");

// map to 'html/basename(uri)'
// inserted by 'MarkusE' -- verified with above, but not counterchecked yet!
MapUrl(app,
"^/html.*/(.+)",
"content",
GetResourcePath(),
"/html/$1",
"text/html");

// Map favicon.ico into img directory
MapUrl(app,
"^/favicon.ico$",
Expand Down

0 comments on commit 9074a54

Please sign in to comment.