From 5df79c53745fde5d6c3340a2979b1429cd5892c1 Mon Sep 17 00:00:00 2001 From: Henrik Rydberg Date: Sat, 8 Oct 2011 20:30:28 +0200 Subject: Initial import of htcd system 1.0 Signed-off-by: Henrik Rydberg --- htc/dmled.htc | 128 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 htc/dmled.htc (limited to 'htc/dmled.htc') diff --git a/htc/dmled.htc b/htc/dmled.htc new file mode 100644 index 0000000..61929fa --- /dev/null +++ b/htc/dmled.htc @@ -0,0 +1,128 @@ +\include{dml.htc} +\def{dmled.init}{xx}{ + %{listname}{address} + \dml.init{\1}{\group}{\npwd}{\server\npwd}; + \reconst{dml.address}{\2}; + \sort{DML}{INDEX}{>} +} +\def{dmled.page}{}{ + \cond{T.find}{} + \cond{T.msg}{0} + \title{Database Mailing List (\dml.listname)} + \db{DML}{ + \form{ + \table{width=100% bgcolor=#dddddd}{ + \tr{valign=top}{ + \td{ + + } + \td{ + \button{View}
+ \button{Reply}
+ \button{New} + } + } + \tr{valign=top}{ + \td{ + \input{find}{60}{\T.find} + } + \td{ + \button{Search} + } + } + } + } + \find.rec{\T.msg}{ + \if(!PROTECT||\user.allow(\dml.group)(TIME)){ + \table{width=100% bgcolor=#dddddd}{ + \tr{ + \th{align=left}{[INDEX] - [SUBJECT]} + \td{align=right}{ + \find.rec(PARENT){ + \if(!PROTECT||\user.allow(\dml.group)(TIME)){ + \bf{Prev:} + \href{\this?msg=[INDEX]}{[INDEX] - \sub(SUBJECT){0}{30}} + \su(AUTHOR){\[\user.name\]} + } + } + } + } + \tr{ + \td{align=left}{ + \su(AUTHOR){ + \user.name \lt;\href{mailto:\user.email}{\user.email};\gt + } + } + \td{align=right}{ + \time2htc(TIME) + } + } + \tr{ + \td{align=left colspan=2}{ + \htmlize(BODY) + } + } + \if(count ATTACH){ + \tr{ + \td{align=left colspan=2}{ + \forall{i}(ATTACH){ + \href{\npwd/attach/[i]}(i)\n + } + } + } + } + \tr{ + \td{align=left colspan=2}{ + [idx:=INDEX]; + \query(PARENT==idx&&(!PROTECT||\user.allow(\dml.group)(TIME))){ + \bf{Next:} + \href{\this?msg=[INDEX]}{[INDEX] - [SUBJECT]} + \su(AUTHOR){\[\user.name\]} +
+ } + } + } + } + } + } + } +} +\def{dmled.onpost}{}{ + \switch{\T.cmd} + {View}{ + \redirect{\server\this?msg=\T.dummy} + } + {Reply}{ + \redirect{\server\this} + \db{DML}{ + \find.rec{\T.dummy}{ + \if(!PROTECT||\user.allow(\dml.group)(TIME)){ + \redirect{ + mailto:\dml.address?subject=Reply \dml.listname\[[INDEX]\] [SUBJECT] + } + } + } + } + } + {New}{ + [node:=\on.glob{T.dummy}{\T.dummy}{1}]; + \redirect{mailto:\dml.address?subject=New \dml.listname\[[node]\] (no subject)} + } + { + \on.glob{T.find}{ + \redirect{\server\this?find=\encode{\T.find}} + } + } +} -- cgit v1.2.3