Mercurial > hgrepos > hgweb.cgi > s4
changeset 286:1c4f13f0813e
Add newer article flag representing by time string decoration.
author | HIROSE Yuuji <yuuji@gentei.org> |
---|---|
date | Mon, 15 Aug 2016 11:15:20 +0859 |
parents | e87d6bc1e62a |
children | 422270e94adc |
files | examples/common/default/default.css s4-blog.sh |
diffstat | 2 files changed, 9 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/examples/common/default/default.css Mon Aug 15 10:08:27 2016 +0859 +++ b/examples/common/default/default.css Mon Aug 15 11:15:20 2016 +0859 @@ -87,6 +87,9 @@ width: 400px; height: 300px; max-width: 50em; max-height: 20em; padding: 0; border: 0; } +.blog_replies span.new { /* New Article from last visit */ + background: white; color: red; +} p.profimg {float: left; max-width: 400px; max-height: 400px; overflow: hidden; margin-right: 1em; padding: 0; border: white 1px solid; box-shadow: 2px 3px 4px
--- a/s4-blog.sh Mon Aug 15 10:08:27 2016 +0859 +++ b/s4-blog.sh Mon Aug 15 11:15:20 2016 +0859 @@ -143,6 +143,9 @@ hlink="$myname?home" elink="$myname?editart" catlink="$myname?showattc+article_m" deficon="img/file-icon.png" + # 2016-08-15 Newer flag introduced + atime=`query "SELECT time FROM acclog + WHERE tbl='blog' AND tblrowid=$rowid AND user='$user';"` sq $db<<EOF | WITH a_s AS ( SELECT id, @@ -167,6 +170,7 @@ author) uname, a.rowid, s.TIME, + CASE WHEN s.TIME > '$atime' THEN 'new' ELSE '' END newer, hex(s.TEXT), (SELECT group_concat(rowid||':'||length(bin)||':'||hex(val), ' ') FROM article_m @@ -177,14 +181,14 @@ a_s s ON a.id=s.id; EOF - while IFS='|' read id edit notify uid uname aid tm hte imgids; do + while IFS='|' read id edit notify uid uname aid tm new hte imgids; do nt="<label style=\"font-size: 70%;\"><input type=\"checkbox\" name=\"notifyto\" value=\"$uid\">返信通知送信</label>" cat<<EOF | <tr id="$id"> <td>${edit:+<a href="$elink+$edit">編集</a> }#$aid <a href="$hlink+$uid">$uname</a> -$tm +<span${new:+ class="new"}>$tm</span> ${notify:+$nt}</td><td id="$aid">`echo "$hte"|unhexize|htmlescape` EOF hreflink