}
settings_menu(){
+ local nick="$(HTML "${nickname#\?}")"
printf '
[form #settings method="POST" action="?settings"
[hidden "session_key" "%s"]
printf '[p .error %s %s]' "${ERROR%% *}" "$(HTML "${ERROR#.* }")"
unset ERROR
fi
- printf '
+ if [ "$NICK_REGISTRATION" != on -o "$nickname" = '?Guest' ]; then
+ printf '
+ [a .section href="#nick" Nickname]
+ [div #nick .open [input name="nickname" placeholder="%s"][submit "action" "nick" Set Cookie]]
+ ' "$nick"
+ else
+ printf '
[a .section href="#nick" Nickname]
[div #nick [input name="nickname" placeholder="%s"][submit "action" "nick" Set Cookie]]
- ' "$(HTML "${nickname#\?}")"
- [ "$NICK_REGISTRATION" = on -a "$nickname" != '?Guest' ] && printf '
[a .section href="#register" Register Nickname]
[div #register
[p Registration will set a permanent Cookie in your Browser.
Registration requires neither a password, nor an email address.]
[input name="regnick" value="%s"][submit "action" "register" Register]
- ]' "$(HTML "${nickname#\?}")"
+ ]' "$nick" "$nick"
+ fi
printf ']'
}
}
#settings .error.nick ~ a.section + #nick,
#settings .error.register ~ a.section + #register,
-#settings a.section + #nick,
+#settings a.section + .open,
#settings a.section + *:target {
max-height: 20ex;
padding: 1ex 1ex .5ex 1ex;