X-Git-Url: https://git.plutz.net/?p=confetti;a=blobdiff_plain;f=templates%2Fframe.html.sh;h=a2d8feefe579e5bd95222de7089247fcce26f78a;hp=d6441d26dc215fa4ee5a9bfbcbc385dec0ad82f9;hb=3b1ba429c9c2f361e62041037d9555d92bbeb6c1;hpb=63e4f339c5eb99b4aed9a2f201c2547c06703b5c diff --git a/templates/frame.html.sh b/templates/frame.html.sh index d6441d2..a2d8fee 100755 --- a/templates/frame.html.sh +++ b/templates/frame.html.sh @@ -1,4 +1,6 @@ -# Copyright 2014 Paul Hänsch +#!/bin/zsh + +# Copyright 2014, 2015, 2017 Paul Hänsch # # This file is part of Confetti. # @@ -15,63 +17,54 @@ # You should have received a copy of the GNU Affero General Public License # along with Confetti. If not, see . +. "${_EXEC}/templates/text_frame.sh" +[ -x "${_EXEC}/templates/text_${PAGE}.sh" ] && . "${_EXEC}/templates/text_${PAGE}.sh" + +bmfile="${_DATA}/mappings/bookmarks" + cat < - $($PAGE title) - + $(l10n p_${PAGE}) + + + - + -
- $(. $PAGE body) + $(sed -rn '/^[^ ]+\t[^ ]+$/p' "$bmfile" \ + | while read page name; do + printf '%s' "${page}" "${name}" + done) + + +
+ $(for page in "${_EXEC}/pages/"*.sh; do + page="${page##*/}" + page="${page%.sh}" + printf '%s\n' "${page}" "$(l10n "p_${page}")" + done |grep -E '^ + ' \ + "$(attribsafe ${REQUEST_URI})" \ + "$(attribsafe $(grep -m1 -F "$REQUEST_URI " "$bmfile" |sed -r 's;.*\t;;'))" \ + "$(l10n bm_del)" + else + printf ' + ' \ + "$(attribsafe ${REQUEST_URI})" "$(l10n Bookmark)" "$(l10n bm_add)" + fi) +
- - EOF +debug BODY; [ -x "${BODY}" ] && . "${BODY}" || printf %s 'Error' + +printf '' + # vi:set filetype=html: