* move templates to static/t/ ; made make install target respect this
authorWilfried Göesgens <willi@citadel.org>
Tue, 12 Aug 2008 21:56:39 +0000 (21:56 +0000)
committerWilfried Göesgens <willi@citadel.org>
Tue, 12 Aug 2008 21:56:39 +0000 (21:56 +0000)
* load templates on webcit start into memory

33 files changed:
webcit/Makefile.in
webcit/static/beginbox.html [deleted file]
webcit/static/beginbox.m.html [deleted file]
webcit/static/beginbox_nt.html [deleted file]
webcit/static/chatframeset.html [deleted file]
webcit/static/endbox.html [deleted file]
webcit/static/endbox.m.html [deleted file]
webcit/static/head.html [deleted file]
webcit/static/head.m.html [deleted file]
webcit/static/msgcontrols.m.html [deleted file]
webcit/static/newstartpage.html [deleted file]
webcit/static/openid_login.html [deleted file]
webcit/static/openid_manual_create.html [deleted file]
webcit/static/pushemail.html [deleted file]
webcit/static/roombanner.html [deleted file]
webcit/static/roombanner.m.html [deleted file]
webcit/static/t/beginbox.html [new file with mode: 0644]
webcit/static/t/beginbox.m.html [new file with mode: 0644]
webcit/static/t/beginbox_nt.html [new file with mode: 0644]
webcit/static/t/chatframeset.html [new file with mode: 0644]
webcit/static/t/endbox.html [new file with mode: 0644]
webcit/static/t/endbox.m.html [new file with mode: 0644]
webcit/static/t/head.html [new file with mode: 0644]
webcit/static/t/head.m.html [new file with mode: 0644]
webcit/static/t/msgcontrols.m.html [new file with mode: 0644]
webcit/static/t/newstartpage.html [new file with mode: 0644]
webcit/static/t/openid_login.html [new file with mode: 0644]
webcit/static/t/openid_manual_create.html [new file with mode: 0644]
webcit/static/t/pushemail.html [new file with mode: 0644]
webcit/static/t/roombanner.html [new file with mode: 0644]
webcit/static/t/roombanner.m.html [new file with mode: 0644]
webcit/subst.c
webcit/webserver.c

index 5042d4f563f2658c7fc3d33ca8b767477557ff8b..0b607b909ed9181d0da575aeefa837e3f37c11d4 100644 (file)
@@ -102,8 +102,8 @@ install-setupbin: install-bin
 
 
 install-wwwdata:
-       test -d $(DESTDIR)$(WWWDIR)/static.local || mkdir -p $(DESTDIR)$(WWWDIR)/static.local
-       test -d $(DESTDIR)$(WWWDIR)/static || mkdir -p $(DESTDIR)$(WWWDIR)/static
+       test -d $(DESTDIR)$(WWWDIR)/static.local/t || mkdir -p $(DESTDIR)$(WWWDIR)/static.local/t
+       test -d $(DESTDIR)$(WWWDIR)/static/t || mkdir -p $(DESTDIR)$(WWWDIR)/static/t
        for i in `find static -type f | grep -v .svn`; do \
                $(INSTALL) $$i $(DESTDIR)$(WWWDIR)/$$i; \
        done
diff --git a/webcit/static/beginbox.html b/webcit/static/beginbox.html
deleted file mode 100644 (file)
index 593fefe..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-<!-- start beginbox.html-->
-<div class="box">
-<div class="boxlabel"><?BOXTITLE></div>
-<div class="boxcontent">
-<!-- end beginbox.html-->
diff --git a/webcit/static/beginbox.m.html b/webcit/static/beginbox.m.html
deleted file mode 100644 (file)
index 593fefe..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-<!-- start beginbox.html-->
-<div class="box">
-<div class="boxlabel"><?BOXTITLE></div>
-<div class="boxcontent">
-<!-- end beginbox.html-->
diff --git a/webcit/static/beginbox_nt.html b/webcit/static/beginbox_nt.html
deleted file mode 100644 (file)
index adb84e3..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-<! start beginbox_nt.html>
-<table border=1 cellspacing=0 cellpadding=0 width=100%><tr><td>
-<table border=0 cellspacing=0 cellpadding=3 width=100%>
-<tr><td bgcolor="#FFFFFF">
-<! end beginbox_nt.html>
diff --git a/webcit/static/chatframeset.html b/webcit/static/chatframeset.html
deleted file mode 100644 (file)
index 935d79e..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-<html>
-<head>
-<title>Real-time chat: <?ROOMNAME></title>
-</head>
-
-<frameset rows="*, 1, 70" framespacing="0" border="false" frameborder="0">
-
-       <frame name="chat_transcript" src="about:blank" scrolling="yes">
-       </frame>
-
-       <frame name="chat_recv" src="chat_recv" scrolling="no">
-       </frame>
-
-       <frame name="chat_send" src="chat_send" scrolling="no">
-       </frame>
-
-</frameset>
-
-<body bgcolor="#ffffff" link="#ff0000">
-<noframes>
-<div align="center">
-This function requires a browser that can support frames.
-</div>
-</noframes>
-</body>
-
-</html>
diff --git a/webcit/static/endbox.html b/webcit/static/endbox.html
deleted file mode 100644 (file)
index e04ad1b..0000000
+++ /dev/null
@@ -1 +0,0 @@
-</div></div>
diff --git a/webcit/static/endbox.m.html b/webcit/static/endbox.m.html
deleted file mode 100644 (file)
index e04ad1b..0000000
+++ /dev/null
@@ -1 +0,0 @@
-</div></div>
diff --git a/webcit/static/head.html b/webcit/static/head.html
deleted file mode 100644 (file)
index 23e43a2..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
-        "http://www.w3.org/TR/html4/strict.dtd">
-<html>
-<head>
-<title><?CURRENT_USER> - <?SERV_HUMANNODE></title>
-<meta name="MSSmartTagsPreventParsing" content="TRUE" >
-<meta name="keywords" content="groupware messaging collaboration" >
-<link href="static/niftyCorners.css" rel="stylesheet" type="text/css">
-<link href="static/webcit.css" rel="stylesheet" type="text/css">
-<link href="static/datepicker.css" rel="stylesheet" type="text/css">
-<link href="static/bt.css" rel="stylesheet" type="text/css">
-
-<?CSSLOCAL>
-<script type="text/javascript" src="static/prototype.js"></script>
-<script type="text/javascript" src="static/scriptaculous.js"></script>
-<script type="text/javascript" src="static/niftycube.js"></script>
-<script type="text/javascript" src="static/BubbleTooltips.js"></script>
-<script type="text/javascript" src="static/datepicker-dev.js"></script>
-<script type="text/javascript" src="static/table.js"></script>
-<script type="text/javascript" src="static/wclib.js"></script>
-</head>
-<body>
-<div id="global">
-<!-- end head.html -->
diff --git a/webcit/static/head.m.html b/webcit/static/head.m.html
deleted file mode 100644 (file)
index 9e85a78..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
-        "http://www.w3.org/TR/html4/strict.dtd">
-<html>
-<head>
-<title><?CURRENT_USER> - <?SERV_HUMANNODE></title>
-<meta name="MSSmartTagsPreventParsing" content="TRUE" >
-<meta name="keywords" content="groupware messaging collaboration" >
-<link href="static/mobile.css" rel="stylesheet" type="text/css">
-<script type="text/javascript" src="static/mobile.js"></script>
-<meta name="viewport" content="width=device-width"/>
-</head>
-<body>
-<div id="global">
-<!-- end head.html -->
diff --git a/webcit/static/msgcontrols.m.html b/webcit/static/msgcontrols.m.html
deleted file mode 100644 (file)
index 9d46757..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
-        "http://www.w3.org/TR/html4/strict.dtd">
-<html>
-<head>
-<title><?CURRENT_USER> - <?SERV_HUMANNODE></title>
-<meta name="MSSmartTagsPreventParsing" content="TRUE" >
-<meta name="keywords" content="groupware messaging collaboration" >
-<link href="/static/mobile.css" rel="stylesheet" type="text/css">
-<script type="text/javascript" src="/static/mobile.js"></script>
-<meta name="viewport" content="width=980, initial-scale = 0.5"/>
-<base href="/"/>
-</head>
-<body>
-<div class="sticky">
-  <div class="mcontrols">
-    <button onmousedown="history.go(-1)">Back to message list</button> <button>Reply to this
-  message</button> <button>Move to trash</button>
-  </div>
-</div>
-<div id="vcontent">
diff --git a/webcit/static/newstartpage.html b/webcit/static/newstartpage.html
deleted file mode 100644 (file)
index 72247e3..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-<! newstartpage.html start>
-<div class="room_banner" >
-<div align=center >
-<h1>New start page</h1>
-&nbsp;
-</div></div>
-<div id="content">
-<div align=center>
-<font size=+2>Your start page has been changed.</font> </div>
-<br /><br />
-<div align=center>
-<i>(Note: this does not change your browser's home page.
-It changes the page you begin on when you log on to <?SERV_HUMANNODE>).</i>
-<br /><br />
-
-<a href="javascript:history.back()">Back...</a>
-</div>
-</div>
-<! newstartpage.html end>
\ No newline at end of file
diff --git a/webcit/static/openid_login.html b/webcit/static/openid_login.html
deleted file mode 100644 (file)
index 9c0f811..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-<?=beginbox>
-<?HELLO>
-<div class="login_message"><?MESG></div>
-<form action="openid_login" method="POST"  class="box" id="login_form">
-        <label for="uname"><?OPENID_BOX></label>
-        <input type="text" name="openid_url" id="uname" class="openid_urlarea"> <br>
-        <label for="lname"><?LANGUAGE_BOX></label>
-        <?DO_LANGUAGE_BOX> <br>
-        <div class="logbuttons">
-        <input type="submit" name="login_action" value="<?LOGIN_BUTTON>" class="logbutton">
-        <input type="submit" name="exit_action" value="<?EXIT_BUTTON>"  class="logbutton">
-        <br>
-        </div>
-</form>
-<?OFFER_CONVENTIONAL_LOGIN>
-<div class="login_image"><img src="image&name=hello"></div>
-<div class="login_infos"><?LOGIN_INSTRUCTIONS></div>
-<?=endbox>
diff --git a/webcit/static/openid_manual_create.html b/webcit/static/openid_manual_create.html
deleted file mode 100644 (file)
index 7b4807d..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-<?=beginbox>
-<?HELLO>
-<div class="login_infos">
-       <img src="static/openid-small.gif"><?VERIFIED><br />
-       <?REASON><br />
-       <?ACTION_REQUESTED><br />
-</div>
-<form action="openid_manual_create" method="POST"  class="box" id="login_form">
-       <input type="hidden" NAME="openid_url" VALUE="<?CLAIMED_ID>">
-        <label for="uname"><?USERNAME_BOX></label>
-        <input type="text" name="name" id="uname" > <br>
-        <div class="logbuttons">
-        <input type="submit" name="newuser_action" value="<?NEWUSER_BUTTON>" class="logbutton" >
-        <input type="submit" name="exit_action" value="<?EXIT_BUTTON>"  class="logbutton">
-        <br>
-        </div>
-</form>
-<?=endbox>
diff --git a/webcit/static/pushemail.html b/webcit/static/pushemail.html
deleted file mode 100644 (file)
index bf9213b..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-    <div id="banner">
-      <h1>Configure Push Email</h1>
-    </div>
-
-    <div id="content" class="config_service">
-    <!-- NOT beginbox -->
-    <div class="box">
-    <div class="boxlabel"><?BOXTITLE></div>
-    <div class="boxcontent">
-       <!-- still not begin box -->
-    <!-- Begin Push email configure -->
-
-      <div id="pushemail">
-        <div class="instructions">
-          <p>If your administrator has enabled the functionality, Citadel can notify a
-          Funambol server that you haved recieved new email and automatically syncronize
-          any devices you have with the Funambol client installed.</p>
-
-          <p>Alternatively, if the administrator has configured it, Citadel can send a
-          text message to you when new mail arrives.</p>
-        </div>
-
-        <form id="pushconfig" method="post" action="save_pushemail">
-          <p class="option"><input type="radio" name="pushsetting" value=
-          "funambol" <?PUSH_FNBL>><strong>Notify Funambol server</strong></p>
-
-          <p class="option"><input type="radio" name="pushsetting" value=
-          "textmessage" <?PUSH_TEXT>><strong>Send a text message</strong> to... <input type="text"
-          name="user_sms_number" size="20" <?SMSNUM> > (Use international format, without any
-          leading zeros, spaces or hypens, like +61415011501)</p>
-
-          <p class="option"><input type="radio" name="pushsetting" value=
-          "none" <?PUSH_NONE>><strong>Don't send any notifications</strong></p>
-
-          <p><input type="submit" name="submit" value="Save settings"></p>
-        </form>
-        <br>
-        <br>
-      </div>
-      </div>
-      </div>
diff --git a/webcit/static/roombanner.html b/webcit/static/roombanner.html
deleted file mode 100644 (file)
index 2fcfb2e..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-<!-- start roombanner.html -->
-<div class="room_banner" >
-<?ROOMPIC>
-<h1><?ROOMNAME></h1>
-<?ROOMINFO>
-<p class="nummsgs"><?NUMMSGS></p>
-</div>
-<ul class="room_actions">
-<li class="start_page"><?START></li>
-<li class="search"><?SEARCHOMATIC></li>
-<li class="view"><?VIEWOMATIC></li>
-</ul>
-<!-- end roombanner.html -->
diff --git a/webcit/static/roombanner.m.html b/webcit/static/roombanner.m.html
deleted file mode 100644 (file)
index a026fa0..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<!-- start roombanner.html -->
-<div class="room_banner" >
-<h1 class="roomname"><?ROOMPIC> <?ROOMNAME></h1>
-<p><?ROOMINFO> <?NUMMSGS></p>
-<p><?START> <?SEARCHOMATIC></p>
-</div>
-<!-- end roombanner.html -->
diff --git a/webcit/static/t/beginbox.html b/webcit/static/t/beginbox.html
new file mode 100644 (file)
index 0000000..593fefe
--- /dev/null
@@ -0,0 +1,5 @@
+<!-- start beginbox.html-->
+<div class="box">
+<div class="boxlabel"><?BOXTITLE></div>
+<div class="boxcontent">
+<!-- end beginbox.html-->
diff --git a/webcit/static/t/beginbox.m.html b/webcit/static/t/beginbox.m.html
new file mode 100644 (file)
index 0000000..593fefe
--- /dev/null
@@ -0,0 +1,5 @@
+<!-- start beginbox.html-->
+<div class="box">
+<div class="boxlabel"><?BOXTITLE></div>
+<div class="boxcontent">
+<!-- end beginbox.html-->
diff --git a/webcit/static/t/beginbox_nt.html b/webcit/static/t/beginbox_nt.html
new file mode 100644 (file)
index 0000000..adb84e3
--- /dev/null
@@ -0,0 +1,5 @@
+<! start beginbox_nt.html>
+<table border=1 cellspacing=0 cellpadding=0 width=100%><tr><td>
+<table border=0 cellspacing=0 cellpadding=3 width=100%>
+<tr><td bgcolor="#FFFFFF">
+<! end beginbox_nt.html>
diff --git a/webcit/static/t/chatframeset.html b/webcit/static/t/chatframeset.html
new file mode 100644 (file)
index 0000000..935d79e
--- /dev/null
@@ -0,0 +1,27 @@
+<html>
+<head>
+<title>Real-time chat: <?ROOMNAME></title>
+</head>
+
+<frameset rows="*, 1, 70" framespacing="0" border="false" frameborder="0">
+
+       <frame name="chat_transcript" src="about:blank" scrolling="yes">
+       </frame>
+
+       <frame name="chat_recv" src="chat_recv" scrolling="no">
+       </frame>
+
+       <frame name="chat_send" src="chat_send" scrolling="no">
+       </frame>
+
+</frameset>
+
+<body bgcolor="#ffffff" link="#ff0000">
+<noframes>
+<div align="center">
+This function requires a browser that can support frames.
+</div>
+</noframes>
+</body>
+
+</html>
diff --git a/webcit/static/t/endbox.html b/webcit/static/t/endbox.html
new file mode 100644 (file)
index 0000000..e04ad1b
--- /dev/null
@@ -0,0 +1 @@
+</div></div>
diff --git a/webcit/static/t/endbox.m.html b/webcit/static/t/endbox.m.html
new file mode 100644 (file)
index 0000000..e04ad1b
--- /dev/null
@@ -0,0 +1 @@
+</div></div>
diff --git a/webcit/static/t/head.html b/webcit/static/t/head.html
new file mode 100644 (file)
index 0000000..23e43a2
--- /dev/null
@@ -0,0 +1,24 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+        "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<title><?CURRENT_USER> - <?SERV_HUMANNODE></title>
+<meta name="MSSmartTagsPreventParsing" content="TRUE" >
+<meta name="keywords" content="groupware messaging collaboration" >
+<link href="static/niftyCorners.css" rel="stylesheet" type="text/css">
+<link href="static/webcit.css" rel="stylesheet" type="text/css">
+<link href="static/datepicker.css" rel="stylesheet" type="text/css">
+<link href="static/bt.css" rel="stylesheet" type="text/css">
+
+<?CSSLOCAL>
+<script type="text/javascript" src="static/prototype.js"></script>
+<script type="text/javascript" src="static/scriptaculous.js"></script>
+<script type="text/javascript" src="static/niftycube.js"></script>
+<script type="text/javascript" src="static/BubbleTooltips.js"></script>
+<script type="text/javascript" src="static/datepicker-dev.js"></script>
+<script type="text/javascript" src="static/table.js"></script>
+<script type="text/javascript" src="static/wclib.js"></script>
+</head>
+<body>
+<div id="global">
+<!-- end head.html -->
diff --git a/webcit/static/t/head.m.html b/webcit/static/t/head.m.html
new file mode 100644 (file)
index 0000000..9e85a78
--- /dev/null
@@ -0,0 +1,14 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+        "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<title><?CURRENT_USER> - <?SERV_HUMANNODE></title>
+<meta name="MSSmartTagsPreventParsing" content="TRUE" >
+<meta name="keywords" content="groupware messaging collaboration" >
+<link href="static/mobile.css" rel="stylesheet" type="text/css">
+<script type="text/javascript" src="static/mobile.js"></script>
+<meta name="viewport" content="width=device-width"/>
+</head>
+<body>
+<div id="global">
+<!-- end head.html -->
diff --git a/webcit/static/t/msgcontrols.m.html b/webcit/static/t/msgcontrols.m.html
new file mode 100644 (file)
index 0000000..9d46757
--- /dev/null
@@ -0,0 +1,20 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+        "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<title><?CURRENT_USER> - <?SERV_HUMANNODE></title>
+<meta name="MSSmartTagsPreventParsing" content="TRUE" >
+<meta name="keywords" content="groupware messaging collaboration" >
+<link href="/static/mobile.css" rel="stylesheet" type="text/css">
+<script type="text/javascript" src="/static/mobile.js"></script>
+<meta name="viewport" content="width=980, initial-scale = 0.5"/>
+<base href="/"/>
+</head>
+<body>
+<div class="sticky">
+  <div class="mcontrols">
+    <button onmousedown="history.go(-1)">Back to message list</button> <button>Reply to this
+  message</button> <button>Move to trash</button>
+  </div>
+</div>
+<div id="vcontent">
diff --git a/webcit/static/t/newstartpage.html b/webcit/static/t/newstartpage.html
new file mode 100644 (file)
index 0000000..72247e3
--- /dev/null
@@ -0,0 +1,19 @@
+<! newstartpage.html start>
+<div class="room_banner" >
+<div align=center >
+<h1>New start page</h1>
+&nbsp;
+</div></div>
+<div id="content">
+<div align=center>
+<font size=+2>Your start page has been changed.</font> </div>
+<br /><br />
+<div align=center>
+<i>(Note: this does not change your browser's home page.
+It changes the page you begin on when you log on to <?SERV_HUMANNODE>).</i>
+<br /><br />
+
+<a href="javascript:history.back()">Back...</a>
+</div>
+</div>
+<! newstartpage.html end>
\ No newline at end of file
diff --git a/webcit/static/t/openid_login.html b/webcit/static/t/openid_login.html
new file mode 100644 (file)
index 0000000..9c0f811
--- /dev/null
@@ -0,0 +1,18 @@
+<?=beginbox>
+<?HELLO>
+<div class="login_message"><?MESG></div>
+<form action="openid_login" method="POST"  class="box" id="login_form">
+        <label for="uname"><?OPENID_BOX></label>
+        <input type="text" name="openid_url" id="uname" class="openid_urlarea"> <br>
+        <label for="lname"><?LANGUAGE_BOX></label>
+        <?DO_LANGUAGE_BOX> <br>
+        <div class="logbuttons">
+        <input type="submit" name="login_action" value="<?LOGIN_BUTTON>" class="logbutton">
+        <input type="submit" name="exit_action" value="<?EXIT_BUTTON>"  class="logbutton">
+        <br>
+        </div>
+</form>
+<?OFFER_CONVENTIONAL_LOGIN>
+<div class="login_image"><img src="image&name=hello"></div>
+<div class="login_infos"><?LOGIN_INSTRUCTIONS></div>
+<?=endbox>
diff --git a/webcit/static/t/openid_manual_create.html b/webcit/static/t/openid_manual_create.html
new file mode 100644 (file)
index 0000000..7b4807d
--- /dev/null
@@ -0,0 +1,18 @@
+<?=beginbox>
+<?HELLO>
+<div class="login_infos">
+       <img src="static/openid-small.gif"><?VERIFIED><br />
+       <?REASON><br />
+       <?ACTION_REQUESTED><br />
+</div>
+<form action="openid_manual_create" method="POST"  class="box" id="login_form">
+       <input type="hidden" NAME="openid_url" VALUE="<?CLAIMED_ID>">
+        <label for="uname"><?USERNAME_BOX></label>
+        <input type="text" name="name" id="uname" > <br>
+        <div class="logbuttons">
+        <input type="submit" name="newuser_action" value="<?NEWUSER_BUTTON>" class="logbutton" >
+        <input type="submit" name="exit_action" value="<?EXIT_BUTTON>"  class="logbutton">
+        <br>
+        </div>
+</form>
+<?=endbox>
diff --git a/webcit/static/t/pushemail.html b/webcit/static/t/pushemail.html
new file mode 100644 (file)
index 0000000..bf9213b
--- /dev/null
@@ -0,0 +1,41 @@
+    <div id="banner">
+      <h1>Configure Push Email</h1>
+    </div>
+
+    <div id="content" class="config_service">
+    <!-- NOT beginbox -->
+    <div class="box">
+    <div class="boxlabel"><?BOXTITLE></div>
+    <div class="boxcontent">
+       <!-- still not begin box -->
+    <!-- Begin Push email configure -->
+
+      <div id="pushemail">
+        <div class="instructions">
+          <p>If your administrator has enabled the functionality, Citadel can notify a
+          Funambol server that you haved recieved new email and automatically syncronize
+          any devices you have with the Funambol client installed.</p>
+
+          <p>Alternatively, if the administrator has configured it, Citadel can send a
+          text message to you when new mail arrives.</p>
+        </div>
+
+        <form id="pushconfig" method="post" action="save_pushemail">
+          <p class="option"><input type="radio" name="pushsetting" value=
+          "funambol" <?PUSH_FNBL>><strong>Notify Funambol server</strong></p>
+
+          <p class="option"><input type="radio" name="pushsetting" value=
+          "textmessage" <?PUSH_TEXT>><strong>Send a text message</strong> to... <input type="text"
+          name="user_sms_number" size="20" <?SMSNUM> > (Use international format, without any
+          leading zeros, spaces or hypens, like +61415011501)</p>
+
+          <p class="option"><input type="radio" name="pushsetting" value=
+          "none" <?PUSH_NONE>><strong>Don't send any notifications</strong></p>
+
+          <p><input type="submit" name="submit" value="Save settings"></p>
+        </form>
+        <br>
+        <br>
+      </div>
+      </div>
+      </div>
diff --git a/webcit/static/t/roombanner.html b/webcit/static/t/roombanner.html
new file mode 100644 (file)
index 0000000..2fcfb2e
--- /dev/null
@@ -0,0 +1,13 @@
+<!-- start roombanner.html -->
+<div class="room_banner" >
+<?ROOMPIC>
+<h1><?ROOMNAME></h1>
+<?ROOMINFO>
+<p class="nummsgs"><?NUMMSGS></p>
+</div>
+<ul class="room_actions">
+<li class="start_page"><?START></li>
+<li class="search"><?SEARCHOMATIC></li>
+<li class="view"><?VIEWOMATIC></li>
+</ul>
+<!-- end roombanner.html -->
diff --git a/webcit/static/t/roombanner.m.html b/webcit/static/t/roombanner.m.html
new file mode 100644 (file)
index 0000000..a026fa0
--- /dev/null
@@ -0,0 +1,7 @@
+<!-- start roombanner.html -->
+<div class="room_banner" >
+<h1 class="roomname"><?ROOMPIC> <?ROOMNAME></h1>
+<p><?ROOMINFO> <?NUMMSGS></p>
+<p><?START> <?SEARCHOMATIC></p>
+</div>
+<!-- end roombanner.html -->
index 35c117d4702120bbf72ec690eccf25c6fee78857..35dbfb0120e85dc95d9f0e6b83c8057523bd7c2e 100644 (file)
@@ -12,6 +12,8 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <unistd.h>
+#include <dirent.h>
+#include <errno.h>
 
 #include "webcit.h"
 #include "webserver.h"
@@ -488,53 +490,26 @@ void ProcessTemplate(WCTemplate *Tmpl, StrBuf *Target)
  * \brief Display a variable-substituted template
  * \param templatename template file to load
  */
-void *load_template(const char *templatename, long len) {
-       HashList *pCache;
-       HashList *Static;
-       HashList *StaticLocal;
-       StrBuf *flat_filename;
-       char filename[PATH_MAX];
+void *load_template(StrBuf *filename, StrBuf *Key, HashList *PutThere)
+{
        int fd;
        struct stat statbuf;
        const char *pS, *pE, *pch, *Err;
        int pos;
-       struct stat mystat;
        WCTemplate *NewTemplate;
 
-       flat_filename = NewStrBufPlain(templatename, len);
-       if (WC->is_mobile) {
-               Static = WirelessTemplateCache;
-               StaticLocal = WirelessLocalTemplateCache;
-               StrBufAppendBufPlain(flat_filename, HKEY(".m.html"), 0);
-       }
-       else {
-               Static = TemplateCache;
-               StaticLocal = LocalTemplateCache;
-               StrBufAppendBufPlain(flat_filename, HKEY(".html"), 0);
-       }
-       
-       strcpy(filename, static_dirs[1]);
-       strcat(filename, ChrPtr(flat_filename));
-       pCache = StaticLocal;
-       if (stat(filename, &mystat) == -1)
-       {
-               pCache = Static;
-               strcpy(filename, static_dirs[0]);
-               strcat(filename, ChrPtr(flat_filename));
-       }
-
-       fd = open(filename, O_RDONLY);
+       fd = open(ChrPtr(filename), O_RDONLY);
        if (fd <= 0) {
                wprintf(_("ERROR: could not open template "));
                wprintf("'%s' - %s<br />\n",
-                       (const char*)templatename, strerror(errno));
+                       ChrPtr(filename), strerror(errno));
                return NULL;
        }
 
        if (fstat(fd, &statbuf) == -1) {
                wprintf(_("ERROR: could not stat template "));
                wprintf("'%s' - %s<br />\n",
-                       (const char*)templatename, strerror(errno));
+                       ChrPtr(filename), strerror(errno));
                return NULL;
        }
 
@@ -548,7 +523,7 @@ void *load_template(const char *templatename, long len) {
                FreeWCTemplate(NewTemplate);
                wprintf(_("ERROR: reading template "));
                wprintf("'%s' - %s<br />\n",
-                       (const char*)templatename, strerror(errno));
+                       ChrPtr(filename), strerror(errno));
                return NULL;
        }
        close(fd);
@@ -584,7 +559,7 @@ void *load_template(const char *templatename, long len) {
                PutNewToken(NewTemplate, NewTemlpateSubstitute(pS, pts, pte));
                pch ++;
        }
-       Put(pCache, filename, strlen(filename), NewTemplate, FreeWCTemplate);
+       Put(PutThere, ChrPtr(Key), StrLength(Key), NewTemplate, FreeWCTemplate);
        return NewTemplate;
 }
 
@@ -609,8 +584,8 @@ void DoTemplate(const char *templatename, long len)
 
        if (!GetHash(StaticLocal, templatename, len, &vTmpl) &&
            !GetHash(Static, templatename, len, &vTmpl)) {
-               vTmpl = load_template(templatename, len); 
-               //////TODO: lock this!
+               printf ("didn't find %s\n", templatename);
+               return;
        }
        if (vTmpl == NULL) 
                return;
@@ -618,6 +593,73 @@ void DoTemplate(const char *templatename, long len)
        
 }
 
+int LoadTemplateDir(const char *DirName, HashList *wireless, HashList *big)
+{
+       StrBuf *FileName;
+       StrBuf *Tag;
+       StrBuf *Dir;
+       DIR *filedir = NULL;
+       struct dirent *filedir_entry;
+       int d_namelen;
+       int d_without_ext;
+       int IsMobile;
+       
+       Dir = NewStrBuf();
+       StrBufPrintf(Dir, "%s/t", DirName);
+       filedir = opendir (ChrPtr(Dir));
+       if (filedir == NULL) {
+               return 0;
+       }
+
+       FileName = NewStrBuf();
+       Tag = NewStrBuf();
+       while ((filedir_entry = readdir(filedir)))
+       {
+               char *MinorPtr;
+               char *PStart;
+#ifdef _DIRENT_HAVE_D_NAMELEN
+               d_namelen = filedir_entry->d_namelen;
+#else
+               d_namelen = strlen(filedir_entry->d_name);
+#endif
+               d_without_ext = d_namelen;
+               while ((d_without_ext > 0) && (filedir_entry->d_name[d_without_ext] != '.'))
+                       d_without_ext --;
+               if ((d_without_ext == 0) || (d_namelen < 3))
+                       continue;
+
+               IsMobile = (strstr(filedir_entry->d_name, ".m.html")!= NULL);
+               PStart = filedir_entry->d_name;
+               StrBufPrintf(FileName, "%s/t/%s", ChrPtr(Dir),  filedir_entry->d_name);
+               MinorPtr = strchr(filedir_entry->d_name, '.');
+               if (MinorPtr != NULL)
+                       *MinorPtr = '\0';
+               StrBufPlain(Tag, filedir_entry->d_name, MinorPtr - filedir_entry->d_name);
+
+
+               printf("%s %d %s\n",ChrPtr(FileName), IsMobile, ChrPtr(Tag));
+               load_template(FileName, Tag, (IsMobile)?wireless:big);          
+       }
+       closedir(filedir);
+       FreeStrBuf(&FileName);
+       FreeStrBuf(&Tag);
+       FreeStrBuf(&Dir);
+       return 1;
+}
+
+void InitTemplateCache(void)
+{
+       
+       LoadTemplateDir(static_dirs[0],
+                       WirelessTemplateCache,
+                       TemplateCache);
+       LoadTemplateDir(static_dirs[1],
+                       WirelessLocalTemplateCache,
+                       LocalTemplateCache);
+
+
+}
+
 void 
 InitModule_SUBST
 (void)
index b6cdd996068d3349e8ee02c9577d292c47d7c2e3..6a0c80abf7a0fadcccb3d2c61840aed4265bbf42 100644 (file)
@@ -587,6 +587,7 @@ void spawn_another_worker_thread()
 const char foobuf[32];
 const char *nix(void *vptr) {snprintf(foobuf, 32, "%0x", (long) vptr); return foobuf;}
 #endif 
+void InitTemplateCache(void);
 
 /*
  * \brief Here's where it all begins.
@@ -621,6 +622,7 @@ int main(int argc, char **argv)
        WirelessLocalTemplateCache = NewHash(1, NULL);
        TemplateCache = NewHash(1, NULL);
        LocalTemplateCache = NewHash(1, NULL);
+       InitTemplateCache();
 
        initialise_modules();