]> code.citadel.org Git - citadel.git/commitdiff
* DOBOX("subtemplate", "template_with_headerstring") added
authorWilfried Göesgens <willi@citadel.org>
Mon, 25 Aug 2008 20:29:22 +0000 (20:29 +0000)
committerWilfried Göesgens <willi@citadel.org>
Mon, 25 Aug 2008 20:29:22 +0000 (20:29 +0000)
* some more templates for replacing the whois online view added

webcit/static/t/wholiststatic.html [new file with mode: 0644]
webcit/static/t/wholiststatic_header.html [new file with mode: 0644]
webcit/static/t/whosection.html
webcit/subst.c

diff --git a/webcit/static/t/wholiststatic.html b/webcit/static/t/wholiststatic.html
new file mode 100644 (file)
index 0000000..0fa142a
--- /dev/null
@@ -0,0 +1,10 @@
+<table class="altern">
+ <tr>
+  <th class="edit_col"> </th>
+  <th colspan="2"> </th>
+  <th><?_("User name")></th>
+  <th><?_("Room")></th>
+  <th class="host_col"><?_("From host")></th>
+</tr>
+<?ITERATE("WHOLIST", "whosection")>
+</table>
diff --git a/webcit/static/t/wholiststatic_header.html b/webcit/static/t/wholiststatic_header.html
new file mode 100644 (file)
index 0000000..d5f6281
--- /dev/null
@@ -0,0 +1 @@
+<?_("Users currently on")> <?SERV_HUMANNODE>
index 9947713de485088be481f8adef7f72b751f149a1..b28f86910173bfb134029e7127d3e4d096aecea9 100644 (file)
@@ -1,85 +1,32 @@
 <tr class="<?ITERATE:ODDEVEN>">
 <td class="edit_col">
-
-<?!("COND:AIDE", 1)>
-
-<??("COND:SUBST", 2, "WHO:ISME")>
+<?!("COND:AIDE", 1)><??("COND:SUBST", 2, "WHO:ISME")>
  <a href="terminate_session?which_session=<?WHO:SESSION>" onClick="return ConfirmKill();"><?_("(kill)")</a>
-<??("X", 2)>
-<??("X", 1)>
-
-<?!("COND:SUBST", 3, "WHO:ISME")>
- <a href="edit_me">(<?_("edit")>)</a>
-<?!("X", 3)>
+<??("X", 2)><??("X", 1)>
+<?!("COND:SUBST", 3, "WHO:ISME")>   <a href="edit_me">(<?_("edit")>)</a>  <?!("X", 3)>
 </td>
-
-
 <!-- link to page this user -->
-
 <td width="5%%"><a href="display_page?recp=<?WHO:NAME("X")>">
- <img align="middle" src="static/citadelchat_24x.gif" alt="(p)" border="0" /></a> 
  <img align="middle" src="static/citadelchat_24x.gif" alt="(p)" border="0" /></a> 
 </td>
-
 <!-- idle flag --->
 <td width="5%%">
-
-<?!("COND:SUBST", 4, "WHO:IDLE")>
-<img align="middle" src="static/inactiveuser_24x.gif" alt="(<?_("idle since")>s <?WHO:IDLESINCE> <?_("Minutes")>)" border="0" />
-<?!("X", 4)>
-<??("COND:SUBST", 5, "WHO:IDLE")>
-<img align="middle" src="static/activeuser_24x.gif" alt="(<?_("active")>)" border="0" />
-<?!("X", 5)>
+<?!("COND:SUBST", 4, "WHO:IDLE")>  <img align="middle" src="static/inactiveuser_24x.gif" alt="(<?_("idle since")>s <?WHO:IDLESINCE> <?_("Minutes")>)" border="0" />  <?!("X", 4)>
+<??("COND:SUBST", 5, "WHO:IDLE")>  <img align="middle" src="static/activeuser_24x.gif" alt="(<?_("active")>)" border="0" />  <?!("X", 5)>
 </td>
 <td>
 <!--  username (link to user bio/photo page)  -->
 <a href="showuser?who=<?WHO:NAME("U")>"> <?WHO:NAME("U")></a> 
-
 <?!("COND:SUBST", 6, "WHO:NSESSIONS", 1)>[<?WHO:NSESSIONS>] </a><?!("X", 6)>
-
 <!-- room -->
 </td><td>
 <?WHO:ROOM>
-
-<?!("WHO:REALROOM", 7>
-<br /><i>
-<?WHO:REALROOM("X")>
-</i>
-<?!("X", 7)>
+<?!("WHO:REALROOM", 7> <br /><i>  <?WHO:REALROOM("X")>  </i>  <?!("X", 7)>
 </td>
    <td class="host_col">
 <!-- hostname -->
 <?WHO:HOST("X")>
-
-<?!("WHO:REALHOST", 8)>
-<br /><i><?WHO:REALHOST("X")></i>
+<?!("COND:SUBST", 8, "WHO:REALHOST", "")> <br /><i> <?WHO:REALHOST("X")></i>
 <?!("X", 8)>
 </td>
 </tr>
-
-<!--
-
-<?WHO:NAME>
-<?WHO:ROOM>
-<?WHO:HOST>
-<?WHO:REALROOM>
-<?WHO:REALHOST>
-<?WHO:LASTACTIVE>
-<?WHO:SESSION>
-<??("COND:SUBST", 123, "WHO:IDLE")>
-is idle.
-<??("X", 123)>
-<?!("COND:SUBST", 1234, "WHO:IDLE")>
-is not idle
-<?!("X", 1234)>
-
-<??("COND:SUBST", 1223, "WHO:ISME")>
-its me.
-<??("X", 1223)>
-<?!("COND:SUBST", 122234, "WHO:ISME")>
-no, not me.
-<?!("X", 122234)>
-
-<?WHO:IDLE>
-<?WHO:NSESSIONS>
-
--->
index 74a95068d8ee9122b9a8bd0831ac2b1ae83aa293..c6e99ac6397b3347ed0a56d4aa6943015503ce04 100644 (file)
@@ -966,6 +966,7 @@ void tmpl_iterate_subtmpl(StrBuf *Target, int nArgs, WCTemplateToken *Tokens, vo
                        
                StrBufAppendBuf(Target, SubBuf, 0);
                FlushStrBuf(SubBuf);
+               oddeven = ~ oddeven;
        }
        DeleteHashPos(&it);
        It->Destructor(List);
@@ -1031,6 +1032,25 @@ void RegisterConditional(const char *Name, long len,
        Put(Contitionals, Name, len, Cond, NULL);
 }
 
+void tmpl_do_boxed(StrBuf *Target, int nArgs, WCTemplateToken *Tokens, void *Context)
+{
+       if (nArgs == 2) {
+               StrBuf *Headline = NewStrBuf();
+               DoTemplate(Tokens->Params[1]->Start, 
+                          Tokens->Params[1]->len,
+                          Context, 
+                          Headline);
+               SVPutBuf("BOXTITLE", Headline, 0);
+       }
+
+       DoTemplate(HKEY("beginbox"), Context, Target);
+       DoTemplate(Tokens->Params[0]->Start, 
+                  Tokens->Params[0]->len,
+                  Context, 
+                  Target);
+       DoTemplate(HKEY("endbox"), Context, Target);
+}
+
 void 
 InitModule_SUBST
 (void)
@@ -1045,6 +1065,7 @@ InitModule_SUBST
        RegisterNamespace("CURRENT_USER", 0, 0, tmplput_current_user);
        RegisterNamespace("CURRENT_ROOM", 0, 0, tmplput_current_room);
        RegisterNamespace("ITERATE", 2, 4, tmpl_iterate_subtmpl);
+       RegisterNamespace("DOBOXED", 1, 2, tmpl_do_boxed);
        RegisterConditional(HKEY("COND:SUBST"), 3, ConditionalVar);
 }