3 # Copyright 2014, 2015, 2017 Paul Hänsch
5 # This file is part of Confetti.
7 # Confetti is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU Affero General Public License as published by
9 # the Free Software Foundation, either version 3 of the License, or
10 # (at your option) any later version.
12 # Confetti is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU Affero General Public License for more details.
17 # You should have received a copy of the GNU Affero General Public License
18 # along with Confetti. If not, see <http://www.gnu.org/licenses/>.
20 . "${_EXEC}/templates/text_frame.sh"
21 [ -x "${_EXEC}/templates/text_${PAGE}.sh" ] && . "${_EXEC}/templates/text_${PAGE}.sh"
23 bmfile="${_DATA}/mappings/bookmarks"
30 <title>$(l10n p_${PAGE})</title>
31 <meta name="viewport" content="width=device-width">
32 <link rel="stylesheet" href="?static=common.css">
33 <link rel="stylesheet" href="?static=${PAGE}.css">
35 <body class="$PAGE" id="CONFIGURE">
36 <div class="NAVIGATION">
37 $(sed -rn '/^[^ ]+\t[^ ]+$/p' "$bmfile" \
38 | while read page name; do
39 printf '<a href="%s">%s</a>' "${page}" "${name}"
41 <label for="navigationconfig">$(l10n nc_edit)</label>
42 <input id="navigationconfig" class="config" type="checkbox" />
43 <form class="config" method="POST" action="?action=update_bookmarks">
44 $(for page in "${_EXEC}/pages/"*.sh; do
47 printf '<a href="?p=%s">%s</a>\n' "${page}" "$(l10n "p_${page}")"
48 done |grep -E '^<a href="\?p='"${page_filter}" )
49 $(if grep -qF "$REQUEST_URI" "$bmfile"; then
50 printf '<input type="hidden" name="bm_url" value="%s" />
51 <input type="text" name="bm_name" value="%s" readonly="readonly" /
52 ><button type="submit" name="submit" value="del">%s</button>' \
53 "$(attribsafe ${REQUEST_URI})" \
54 "$(attribsafe $(grep -m1 -F "$REQUEST_URI " "$bmfile" |sed -r 's;.*\t;;'))" \
57 printf '<input type="hidden" name="bm_url" value="%s" />
58 <input type="text" name="bm_name" placeholder="%s" /
59 ><button type="submit" name="submit" value="add">%s</button>' \
60 "$(attribsafe ${REQUEST_URI})" "$(l10n Bookmark)" "$(l10n bm_add)"
66 debug BODY; [ -x "${BODY}" ] && . "${BODY}" || printf %s 'Error'
70 <a href="#CONFIGURE">$(l10n configure)</a>
75 # vi:set filetype=html: