[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [lego/master] Add redirect model and template
commit 37611e7cfae397d5e8a8aa41ac219a41ae2b6181
Author: hiro <hiro@xxxxxxxxxxxxxx>
Date: Fri Oct 25 21:21:40 2019 +0200
Add redirect model and template
---
models/redirect.ini | 7 +++++++
templates/redirect.html | 1 +
2 files changed, 8 insertions(+)
diff --git a/models/redirect.ini b/models/redirect.ini
new file mode 100644
index 0000000..91ea2ce
--- /dev/null
+++ b/models/redirect.ini
@@ -0,0 +1,7 @@
+[model]
+name = Redirect
+
+[fields.target]
+label = Redirect Target
+type = string
+description = Target is of type 'string' to allow relative paths. Converted to url in the template.
diff --git a/templates/redirect.html b/templates/redirect.html
new file mode 100644
index 0000000..60560fb
--- /dev/null
+++ b/templates/redirect.html
@@ -0,0 +1 @@
+<meta http-equiv="refresh" content="0; URL='{{ this.target|url }}'" />
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits