s4

changeset 219:e2dea2f63a69

Duplicate posting by reload avoided
author HIROSE Yuuji <yuuji@gentei.org>
date Mon, 13 Jun 2016 12:28:00 +0859
parents 849e6dee3485
children 7d05425e4057
files examples/common/default/default.css examples/sns/form/article.def s4-blog.sh s4-funcs.sh s4.cgi
diffstat 5 files changed, 27 insertions(+), 19 deletions(-) [+]
line diff
     1.1 --- a/examples/common/default/default.css	Mon Jun 13 08:36:49 2016 +0859
     1.2 +++ b/examples/common/default/default.css	Mon Jun 13 12:28:00 2016 +0859
     1.3 @@ -77,6 +77,7 @@
     1.4      border: 1px solid black; border-collapse: collapse;
     1.5      white-space: pre-wrap;
     1.6  }
     1.7 +table.blog_replies+p.update_link {margin-top: 0; margin-bottom: 14em;}
     1.8  .blog_replies td:nth-child(2) {
     1.9      vertical-align: top; min-width: 30em; height: 3em;
    1.10      max-width: 50em;
     2.1 --- a/examples/sns/form/article.def	Mon Jun 13 08:36:49 2016 +0859
     2.2 +++ b/examples/sns/form/article.def	Mon Jun 13 12:28:00 2016 +0859
     2.3 @@ -4,6 +4,6 @@
     2.4  時刻:ctime:s:stamp:
     2.5  参照元:parent:s:parent: 
     2.6  パス:path:s:path:
     2.7 -本文:text:s:textarea:cols="60" rows="8"
     2.8 -画像:image:m:image:multiple
     2.9 +本文:text:s:textarea:cols="72" rows="4"
    2.10 +添付:image:m:image:multiple
    2.11  stage:stage:x:hidden:value="replyblog"
     3.1 --- a/s4-blog.sh	Mon Jun 13 08:36:49 2016 +0859
     3.2 +++ b/s4-blog.sh	Mon Jun 13 12:28:00 2016 +0859
     3.3 @@ -101,7 +101,6 @@
     3.4  
     3.5    #(1)Display root article
     3.6    cat<<EOF
     3.7 -<form class="replyblog" action="$myname?replyblog+${rowid}#bottom" method="POST" enctype="multipart/form-data">
     3.8  <table class="bloghead">
     3.9  EOF
    3.10  
    3.11 @@ -251,18 +250,23 @@
    3.12  <input type="submit" value="送信">
    3.13  <input type="reset" value="リセット"></div></div>
    3.14  '
    3.15 -  echo '</table>'
    3.16 -  
    3.17 -  $iswritable && cat<<EOF
    3.18 -<div class="blogcomment">
    3.19 -<!-- <p>コメント記入</p> -->
    3.20 -<input type="hidden" name="blogid" value="$id">
    3.21 -<input type="hidden" name="stage" value="replyblog">
    3.22 -<input type="hidden" name="serial" value="$serial">
    3.23 -$textform
    3.24 -</div>
    3.25 -EOF
    3.26 -  echo "</form><p id=\"bottom\"></p>"
    3.27 +  cat<<-EOF
    3.28 +	</table>
    3.29 +	<p class="update_link"><a
    3.30 +	 href="?reload/$rowid">再読込</a></p>
    3.31 +	EOF
    3.32 +  $iswritable && cat<<-EOF
    3.33 +	<div class="blogcomment">
    3.34 +	<div class="fold">
    3.35 +	<input type="checkbox" id="cmt" checked><label for="cmt"
    3.36 +	>コメントする</label>
    3.37 +	<div>
    3.38 +	`GF_ACTION="?replyblog+${rowid}#bottom" \
    3.39 +	 GF_ARGS="<input type=\"hidden\" name=\"blogid\" value=\"$id\">" \
    3.40 +	 genform $formdir/article.def`
    3.41 +	</div></div></div>
    3.42 +	<p id="bottom"></p>
    3.43 +	EOF
    3.44    # Record access log
    3.45    acclog blog $rowid
    3.46  }
     4.1 --- a/s4-funcs.sh	Mon Jun 13 08:36:49 2016 +0859
     4.2 +++ b/s4-funcs.sh	Mon Jun 13 12:28:00 2016 +0859
     4.3 @@ -2614,7 +2614,7 @@
     4.4    # $1 = form definition file
     4.5    # $2, $3 (optional)= table name and ROWID
     4.6    # If $GF_VIEWONLY set and nonNull, output values without form
     4.7 -  # If $GF_HIDDEN set, use it hidden values
     4.8 +  # If $GF_ARGS set, use it as content-strings in the form
     4.9    # If $GF_OWNER set, use it as value of name="owner"
    4.10    # If $GF_STAGE set, use it as value of name="stage"
    4.11    forms="" hiddens="" rowid=$3
    4.12 @@ -2757,8 +2757,6 @@
    4.13  	if [ -z "$rowid" ]; then
    4.14  	  val=$((($(date +%s)-1433084400)/10))c$$
    4.15  	fi
    4.16 -##	form="<input type=\"hidden\" name=\"serial\" value=\"$val\">"
    4.17 -##	2015-07-31
    4.18  	form="<input type=\"hidden\" name=\"$name\" value=\"$val\">"
    4.19  	prompt="" ;;
    4.20        [Ss][Ee][Ss][Ss][Ii][Oo][Nn])
    4.21 @@ -2799,7 +2797,7 @@
    4.22  EOF
    4.23    fi
    4.24    cat<<EOF
    4.25 -</form>
    4.26 +$GF_ARGS</form>
    4.27  $tail
    4.28  EOF
    4.29  }
     5.1 --- a/s4.cgi	Mon Jun 13 08:36:49 2016 +0859
     5.2 +++ b/s4.cgi	Mon Jun 13 12:28:00 2016 +0859
     5.3 @@ -65,6 +65,11 @@
     5.4  err blog_reply2 $rowid
     5.5      blog_reply $rowid
     5.6      ;;
     5.7 +  reload*)	# Dirty workaround for reloading page just after submit
     5.8 +    newurl="$urlbase?replyblog+${stage#*/}#bottom"
     5.9 +    echo "Refresh: 0; $newurl"; echo
    5.10 +    exit 0
    5.11 +    ;;
    5.12    lshandout|gethandout)
    5.13      if [ x"$stage" = x"lshandout" ]; then
    5.14        contenttype; echo