X-Git-Url: https://git.plutz.net/?p=confetti;a=blobdiff_plain;f=templates%2Fframe.html.sh;h=b8128a34d6d112fb52474e5ce6041c6ec7e8635a;hp=b76717bb0416eb5eb68cc48e89d68095f8fa9708;hb=069a829a781c2799836843fe037dc44d1af5c9db;hpb=25a24a7d834757e006b46b863453d5f79780a63f diff --git a/templates/frame.html.sh b/templates/frame.html.sh index b76717b..b8128a3 100755 --- a/templates/frame.html.sh +++ b/templates/frame.html.sh @@ -1,55 +1,75 @@ +#!/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' + +cat < + $(l10n configure) + +' EOF # vi:set filetype=html: