s4

changeset 409:388639a80a23

Also notify rule in cached file should be generated dynamically.
author HIROSE Yuuji <yuuji@gentei.org>
date Thu, 09 Feb 2017 20:13:58 +0859
parents 138a0c6b09a7
children c1b4a9dba1c9
files s4-blog.sh
diffstat 1 files changed, 6 insertions(+), 5 deletions(-) [+]
line diff
     1.1 --- a/s4-blog.sh	Thu Feb 09 19:45:06 2017 +0859
     1.2 +++ b/s4-blog.sh	Thu Feb 09 20:13:58 2017 +0859
     1.3 @@ -223,6 +223,8 @@
     1.4      cachefile="$td/$id.row.html"
     1.5      stampfile="$td/$id.row.stamp"
     1.6      editlink="${edit:+<a href="$elink+$edit">編集</a> }"
     1.7 +    nt="<label style=\"font-size: 70%;\"><input type=\"checkbox\"\
     1.8 +	 name=\"notifyto\" value=\"$uid\">返信通知送信</label>"
     1.9  
    1.10      # First, check the availability of user-icon.
    1.11      # If not existent, clear and reset row cache by rm $stampfile
    1.12 @@ -236,8 +238,6 @@
    1.13        : Nothing to do
    1.14      else
    1.15        {		######## New ROW creation begins here ######## >$cachefile
    1.16 -	nt="<label style=\"font-size: 70%;\"><input type=\"checkbox\"
    1.17 -	 name=\"notifyto\" value=\"$uid\">返信通知送信</label>"
    1.18  	tdcls="__NEWCLS__repatt"
    1.19  	if [ -s "$icon" ]; then
    1.20  	  icfn=`echo "$icon"|htmlescape`
    1.21 @@ -253,7 +253,7 @@
    1.22  <td class="$tdcls">${picon}__EDIT__#$aid
    1.23  <a href="$hlink+$uid">$uname</a>
    1.24  $tm
    1.25 -${notify:+$nt}</td>
    1.26 +<__NOTIFY__></td>
    1.27  EOF
    1.28  	echo -n "<td id=\"$aid\" class=\"repl\">"
    1.29  	echo "$hte"|unhexize|htmlescape|hreflink|minitbl
    1.30 @@ -309,8 +309,9 @@
    1.31        test -n "$stampfile" && date "+%F %T" > $stampfile
    1.32      fi
    1.33      # Printing a cached row
    1.34 -    sed -e "/<td class=/s/__NEWCLS__/$new${new:+ }/" \
    1.35 -	-e "/<td class=/s,__EDIT__,$editlink," \
    1.36 +    sed -e "/^<td class=/s/__NEWCLS__/$new${new:+ }/" \
    1.37 +	-e "/^<td class=/s,__EDIT__,$editlink," \
    1.38 +	-e "/^<__NOTIFY__>/s,,${notify:+$nt}," \
    1.39  	$cachefile
    1.40    done
    1.41