X-Git-Url: https://git.plutz.net/?p=confetti;a=blobdiff_plain;f=templates%2Fframe.html.sh;h=a2d8feefe579e5bd95222de7089247fcce26f78a;hp=bac287180270d0f05c00f5dc531c3794fd908676;hb=3b1ba429c9c2f361e62041037d9555d92bbeb6c1;hpb=a8c6f8b510bb4747798c4f576162733d982bae75 diff --git a/templates/frame.html.sh b/templates/frame.html.sh index bac2871..a2d8fee 100755 --- a/templates/frame.html.sh +++ b/templates/frame.html.sh @@ -1,26 +1,70 @@ +#!/bin/zsh + +# Copyright 2014, 2015, 2017 Paul Hänsch +# +# This file is part of Confetti. +# +# Confetti is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Confetti is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# 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: