s4

changeset 587:1e40019d1bb1

Indicate notification mode in submit button
author HIROSE Yuuji <yuuji@gentei.org>
date Fri, 16 Aug 2019 14:01:43 +0900
parents a03bfd5d242a
children 33fab353a39e
files examples/common/default/default.css s4-blog.sh
diffstat 2 files changed, 20 insertions(+), 10 deletions(-) [+]
line diff
     1.1 --- a/examples/common/default/default.css	Fri Aug 16 09:48:19 2019 +0900
     1.2 +++ b/examples/common/default/default.css	Fri Aug 16 14:01:43 2019 +0900
     1.3 @@ -310,7 +310,8 @@
     1.4      position: fixed;
     1.5      top: 0em; left: 0;
     1.6  }
     1.7 -form.summary input[type=submit] {background: #cfc;}
     1.8 +form.summary input[type=submit],
     1.9 +input[type="submit"].all {background: #cfc;}
    1.10  
    1.11  /*
    1.12   * PR Web
     2.1 --- a/s4-blog.sh	Fri Aug 16 09:48:19 2019 +0900
     2.2 +++ b/s4-blog.sh	Fri Aug 16 14:01:43 2019 +0900
     2.3 @@ -27,6 +27,15 @@
     2.4    # $1=articleid $2=user
     2.5    mode=`getgroupattr $grp regmode`
     2.6  }
     2.7 +blog_getteam() {
     2.8 +  # $1=rowid of blog
     2.9 +  blogid="${1%%[!A-Z0-9a-z_]*}"
    2.10 +  # team cannot get `getvalbyid blog team "$blogid"` because it's not
    2.11 +  # defined in blog.def.  Yes, it is Illegal USE!!
    2.12 +  query "SELECT val FROM blog_s
    2.13 +		    WHERE id=(SELECT id FROM blog WHERE rowid=$blogid)
    2.14 +			  AND key='team';"
    2.15 +}
    2.16  blog_notify_reply() (
    2.17    # $1=blogid $2=ReplyingUser $3=WrittenText $4(optional)=Action
    2.18    blogid="${1%%[!A-Z0-9a-z_]*}"
    2.19 @@ -50,11 +59,8 @@
    2.20        fi
    2.21  	;;
    2.22      no)		emails="" ;;
    2.23 -    *) team=`query "SELECT val FROM blog_s
    2.24 -		    WHERE id=(SELECT id FROM blog WHERE rowid=$blogid)
    2.25 -			   AND key='team';"`
    2.26 -       # team cannot get `getvalbyid blog team "$blogid"` because it's not
    2.27 -       # defined in blog.def.  Yes, it is Illegal USE!!
    2.28 +    *) team=`blog_getteam "$blogid"`
    2.29 +       # team cannot get by `getvalbyid blog team "$blogid"`
    2.30         emails=`TEAM=$team collectemail $blogowner` ;;
    2.31    esac
    2.32    ## 2017-0210 Respond to the direct reply mark such as: >#1234
    2.33 @@ -159,8 +165,10 @@
    2.34    else	# if writable
    2.35      isgrpowner "$user" "$blogowner" && isgrpadmin=true	# (*1)
    2.36    fi
    2.37 -  case `getvalbyid blog notify "$rowid"` in # "all", "admin" or "no" (or NULL)
    2.38 -    admin)	notifyto=1 ;;
    2.39 +  blog_notify=`getvalbyid blog notify "$rowid"`
    2.40 +  blog_team=`blog_getteam "$rowid"`
    2.41 +  case "$blog_notify" in # "all", "admin" or "no" (or NULL)
    2.42 +    admin)	notifyto=adm ;;
    2.43      *)		notifyto="" ;;
    2.44    esac
    2.45    case `getvalbyid blog mode "$rowid"` in
    2.46 @@ -221,7 +229,7 @@
    2.47  	echo "クイズモードは本人と管理者の書き込みのみが表示されます。"
    2.48  	;;
    2.49      esac | html p 'class="warn"'
    2.50 -    echo '<table class="blog_replies">'
    2.51 +    echo '<table class="blog_replies"> <!-- blog:blog_showentry() main table -->'
    2.52      if [ x"$blogtype" = x"クイズ" ]; then
    2.53        if $isgroup; then
    2.54  	if ! isgrpowner "$user" "$blogowner"; then
    2.55 @@ -436,6 +444,7 @@
    2.56    touchhelp="${touchpanel:+<p class=\"help\">$help</p>}"
    2.57    filehelp="《添付の注意》
    2.58  $file_accept_help"
    2.59 +  ntmode="通知モード=$blog_notify${blog_team:+ (team=$blog_team)}"
    2.60    textform='<div class="fold">
    2.61  <input type="checkbox" id="cmt" checked><label
    2.62   accesskey="c" title="C" for="cmt">コメントする</label><div>
    2.63 @@ -445,7 +454,7 @@
    2.64  <tr><td>添付ファイル(${filesize_max_MB}以下):"'
    2.65  <input type="file" name="image"'" $file_accept title=\"$filehelp\" multiple></td></tr>"'
    2.66  </table>
    2.67 -<input type="submit" value="送信">
    2.68 +<input type="submit" value="送信"'" class=\"$blog_notify\" title=\"$ntmode\""'>
    2.69  <input type="reset" value="リセット"></div></div>
    2.70  '
    2.71    cat<<-EOF