s4

changeset 260:1b9d45b823b8

UI changed to tab selection
author HIROSE Yuuji <yuuji@gentei.org>
date Wed, 20 Jul 2016 13:19:15 +0859
parents 85a001a9c7c5
children 1a4df907ac87
files examples/common/default/default.css examples/common/default/home.m4.html s4-funcs.sh
diffstat 3 files changed, 69 insertions(+), 25 deletions(-) [+]
line diff
     1.1 --- a/examples/common/default/default.css	Tue Jul 19 13:55:49 2016 +0859
     1.2 +++ b/examples/common/default/default.css	Wed Jul 20 13:19:15 2016 +0859
     1.3 @@ -105,6 +105,36 @@
     1.4      display: block; background: #fadede;
     1.5      height: auto; opacity: 1.0; transition: 1s;
     1.6  }
     1.7 +
     1.8 +/* fold2!! */
     1.9 +div.foldtabs {
    1.10 +    position: relative; max-height: 5em; margin-top: 1em;
    1.11 +    border-top: 1px solid black; padding-top: 1em;
    1.12 +}
    1.13 +div.foldtabs > div {
    1.14 +    position: absolute; top: 2.5em; opacity: 0.0; background: pink;
    1.15 +    margin: 2px;
    1.16 +}
    1.17 +div.foldtabs input[type="radio"] {display: none;}
    1.18 +div.foldtabs input[type="radio"]:checked + label + div {
    1.19 +    display: block; opacity: 1.0; transition: 0.2s; width: 100%;
    1.20 +    margin: 0; z-index: 2;
    1.21 +}
    1.22 +div.foldtabs > label {
    1.23 +    border: 1px outset #ddd; background: #ddd; xbackground: pink;
    1.24 +    border-top-left-radius: 0.8em; border-top-right-radius: 0.8em;
    1.25 +    margin: 0;
    1.26 +    padding: 0.2ex 0.5em; height: 3em;
    1.27 +}
    1.28 +div.foldtabs > input:active + label {background: white;}
    1.29 +div.foldtabs input:checked + label {
    1.30 +    background: pink; border: pink 1px solid; border-bottom-width: 6px;
    1.31 +}
    1.32 +div.foldtabs input:checked + label:last-of-type {border-width: 1px;}
    1.33 +input[type="checkbox"] + label + input[type="submit"] {display: none;}
    1.34 +input[type="checkbox"]:checked + label + input[type="submit"] {
    1.35 +    display: inline;}
    1.36 +
    1.37  div.dumptable {max-height: 15em; overflow: auto;}
    1.38  table.dumpblogs td,
    1.39  div.lcto td {	/* LINK + CTIME + TITLE + OWNER + something... */
     2.1 --- a/examples/common/default/home.m4.html	Tue Jul 19 13:55:49 2016 +0859
     2.2 +++ b/examples/common/default/home.m4.html	Wed Jul 20 13:19:15 2016 +0859
     2.3 @@ -5,17 +5,21 @@
     2.4  _PROFILE_
     2.5  </div>
     2.6  
     2.7 -<div class="fold">
     2.8 -<input type="checkbox" id="sd"><label for="sd">日記一覧を見る(_NBLOG_)</label>
     2.9 +<div class="foldtabs">
    2.10 +<input type="radio" id="sd" name="foldtabs"><label for="sd">自分の日記(_NBLOG_)</label>
    2.11  <div><!-- in home.m4 -->_BLOGS_</div><!-- in home.m4 -->
    2.12 -</div>
    2.13  
    2.14 -<div class="fold"> <!-- in home.m4.html -->
    2.15 -<input type="checkbox" id="grp"><label
    2.16 - for="grp">個人の参加グループ一覧を見る</label>
    2.17 +
    2.18 +<input type="radio" id="grp" name="foldtabs"><label
    2.19 + for="grp">参加中グループ</label>
    2.20  <div> <!-- div.fold hides this div (in home.m4.html) -->
    2.21  <div class="dumptable">
    2.22  _GROUPS_
    2.23  </div><!-- end of .dumptable -->
    2.24  </div><!-- div.fold hides upto here (in home.m4.html) -->
    2.25 -</div> <!-- end of fold (in home.m4.html) -->
    2.26 +
    2.27 +_HOMETAIL_
    2.28 +
    2.29 +<input type="radio" id="close" name="foldtabs"><label
    2.30 +for="close">×</label>
    2.31 +</div> <!--  end of fold (in home.m4.html) -->
     3.1 --- a/s4-funcs.sh	Tue Jul 19 13:55:49 2016 +0859
     3.2 +++ b/s4-funcs.sh	Wed Jul 20 13:19:15 2016 +0859
     3.3 @@ -1481,16 +1481,13 @@
     3.4    nblog=`query "SELECT count(id) FROM blog_s WHERE key='owner' AND \
     3.5  		val='$uname';"`
     3.6    listblog $uname			> $bf
     3.7 -  listgroupbytable $formdir/grp.def $cond \
     3.8 -      | _m4 -D_BODYCLASS_=home -D_TITLE_="spaste(\`$tf')" \
     3.9 -	    -D_PROFILE_="spaste(\`$pf')$conflink" \
    3.10 -	    -D_PROFIMG_="spaste(\`$imf')" \
    3.11 -	    -D_BLOGS_="spaste(\`$bf')" \
    3.12 -	    -D_SEARCH_="spaste(\`$sf')" \
    3.13 -	    -D_NBLOG_="$nblog" \
    3.14 -	    -D_GROUPS_="syscmd(\`cat')" \
    3.15 -	    $layout/html.m4.html $layout/home.m4.html
    3.16 +
    3.17 +  hometail=$tmpd/tail.$$
    3.18 +  mkfifo $hometail
    3.19 +
    3.20 +  #Calling listgroupbytable, originally here
    3.21    
    3.22 +  (
    3.23    if [ x"$user" = x"$uname" ]; then
    3.24      # Display Most Recent Entry
    3.25      shortval=${dumpcollen:+"substr(val, 0, $dumpcollen)"}
    3.26 @@ -1530,9 +1527,9 @@
    3.27  EOF
    3.28  
    3.29      cat<<-EOF
    3.30 -	<div class="fold lcto">
    3.31 -	`cgi_checkbox mrd yes id="mre"`<label
    3.32 -	 for="mre">最近書き込んだ場所一覧</label>
    3.33 +	`cgi_radio foldtabs yes id="mre"`<label
    3.34 +	 for="mre">最近の書き込み先</label>
    3.35 +	<div class="lcto">
    3.36  	`DT_VIEW=replyblog dumptable html blog`
    3.37  	</div>
    3.38  	EOF
    3.39 @@ -1556,19 +1553,32 @@
    3.40      cont=$((cont-1))
    3.41      err newcount=$cont
    3.42      if [ $cont -gt 0 ]; then
    3.43 -      echo "全体の新着記事${cont}傑" | html h2
    3.44 -      echo "$new10"
    3.45 +      #echo "全体の新着記事${cont}傑" | html h2
    3.46 +      cgi_radio foldtabs yes 'id="new10"'
    3.47 +      echo "<label for=\"new10\">新着${cont}傑</label><div>"
    3.48        cat<<-EOF | html form 'action="?home"'
    3.49 -	<div class="fold noborder lcto">
    3.50 -	`cgi_checkbox readchk yes 'id="read"'`<label
    3.51 +	`cgi_checkbox fold yes 'id="read"'`<label
    3.52  	 for="read">新着ふくめて全部読んだことにする</label>
    3.53 -	 <div>`cgi_submit '確定'`</div>
    3.54 +	 `cgi_submit '確定'`
    3.55  	 `cgi_hidden read yes`
    3.56 -	</div>
    3.57  	EOF
    3.58 +      echo "$new10 <!-- new10 -->"
    3.59 +      echo "</div>"
    3.60      fi
    3.61    fi
    3.62 +  ) > $hometail &		# Is background call safe to m4??
    3.63    #
    3.64 +  listgroupbytable $formdir/grp.def $cond |
    3.65 +      _m4 -D_BODYCLASS_=home -D_TITLE_="spaste(\`$tf')" \
    3.66 +	  -D_PROFILE_="spaste(\`$pf')$conflink" \
    3.67 +	  -D_PROFIMG_="spaste(\`$imf')" \
    3.68 +	  -D_BLOGS_="spaste(\`$bf')" \
    3.69 +	  -D_SEARCH_="spaste(\`$sf')" \
    3.70 +	  -D_NBLOG_="$nblog" \
    3.71 +	  -D_GROUPS_="syscmd(\`cat')" \
    3.72 +	  -D_HOMETAIL_="syscmd(\`cat $hometail')" \
    3.73 +	  $layout/html.m4.html $layout/home.m4.html
    3.74 +
    3.75    # Record access log
    3.76    [ -n "$1" ] && [ x"$1" != x"$user" ] && acclog user $1
    3.77  }