summaryrefslogtreecommitdiff
path: root/cgi-bin/template
diff options
context:
space:
mode:
Diffstat (limited to 'cgi-bin/template')
-rw-r--r--cgi-bin/template/edit.html1
-rw-r--r--cgi-bin/template/page.html24
-rw-r--r--cgi-bin/template/whisper.html6
3 files changed, 15 insertions, 16 deletions
diff --git a/cgi-bin/template/edit.html b/cgi-bin/template/edit.html
index 27a3dd0..bc8cea0 100644
--- a/cgi-bin/template/edit.html
+++ b/cgi-bin/template/edit.html
@@ -13,6 +13,7 @@
{whisper_content}
</textarea>
<input type="submit" value=" 推 " class="submit"/>
+ <a style="float:right; color:red" href="{url}/delete.py?w={whisper_id}">删除</a>
</form>
</div>
</body>
diff --git a/cgi-bin/template/page.html b/cgi-bin/template/page.html
index b87a6b0..672be2c 100644
--- a/cgi-bin/template/page.html
+++ b/cgi-bin/template/page.html
@@ -5,18 +5,18 @@
<link rel="stylesheet" href="{url}{static}/style.css" type="text/css" />
<script src="{url}{static}/ckeditor/ckeditor.js"></script>
<script>
-// window.onload = function()
-// {
- // var dates = document.getElementsByClassName("whisper_date");
- // for(var i = 0; i < dates.length; i++)
- // {
- // var d = dates[i];
- // var tstamp = d.date;
- // var day = new Date(tstamp);
- // var timestr = day.toLocaleString();
- // d.innerHTML = timestr;
- // }
-//}
+window.onload = function()
+{{
+ var dates = document.getElementsByClassName("whisper_date");
+ for(var i = 0; i < dates.length; i++)
+ {{
+ var d = dates[i];
+ var tstamp = parseInt(d.getAttribute("date"));
+ var day = new Date(tstamp * 1000);
+ var timestr = day.toLocaleString();
+ d.innerHTML = timestr;
+ }}
+}}
</script>
<div id="container">
<img src="{url}{static}/logo.png" id="logo"/>
diff --git a/cgi-bin/template/whisper.html b/cgi-bin/template/whisper.html
index ca09bb7..ae7ede4 100644
--- a/cgi-bin/template/whisper.html
+++ b/cgi-bin/template/whisper.html
@@ -2,11 +2,9 @@
<div class="whisper_content">
{content}
</div>
- <div class="whisper_date" date="{date}">
- {date}
- </div>
+ <div class="whisper_date" date="{date}"></div>
<div class="whisper_edit">
<a href="{url}/edit.py?w={id}">[编辑]</a>
</div>
<div style="clear:both"></div>
-</div> \ No newline at end of file
+</div>