From: paul Date: Wed, 18 Oct 2017 10:56:54 +0000 (+0000) Subject: enabled dynamic navigation links X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=406ba29b6abd1c12a56d754bf3c1f6aadb27aab6;p=confetti enabled dynamic navigation links svn path=/trunk/; revision=159 --- diff --git a/actions/update_bookmarks.sh b/actions/update_bookmarks.sh new file mode 100755 index 0000000..6a17d04 --- /dev/null +++ b/actions/update_bookmarks.sh @@ -0,0 +1,34 @@ +#!/bin/zsh + +# Copyright 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 . + +bmfile="${_DATA}/mappings/bookmarks" + url="$(validate "${_POST[bm_url]}" '/.+' '/')" +name="$(validate "${_POST[bm_name]}" '.+' "$url")" + +case "${_POST[submit]}" in + add) printf '%s\t%s\n' "${url}" "${name}" >>"${bmfile}" + ;; + del) cp "${bmfile}" "${bmfile}.temp" + grep -vF "${url} ${name}" "${bmfile}.temp" >"${bmfile}" + rm "${bmfile}.temp" + ;; +esac + + +redirect "${url}" diff --git a/static/common.css b/static/common.css index fa8528c..bee38cd 100644 --- a/static/common.css +++ b/static/common.css @@ -8,7 +8,8 @@ body { background: #EEE; margin: 0; - padding: 2.5em 0 0 0; + padding: 0; + padding-top: 2.5em; } .NAVIGATION { position: fixed; @@ -17,11 +18,12 @@ body { border-style: none solid solid solid; border-width: 0 1px 1px 1px; border-radius: 0 0 4px 4px; - margin: 0 auto auto 3%; - padding: .5em 1ex .5em 1ex; + margin: 0 2em; + padding: .5em 1ex; background: #FFF; z-index: 1; } +.NAVIGATION label, .NAVIGATION a { color: #008; border: solid 1px #BBF; @@ -29,11 +31,46 @@ body { padding: .2em 3ex .2em 3ex; background: #EFF; } +.NAVIGATION label:hover, .NAVIGATION a:hover { - border-width: 2px 1px 2px 1px; + border-width: 2px 1px; background: #F3FFFF; } +.NAVIGATION input#navigationconfig { display: none; } +.NAVIGATION label[for=navigationconfig] { } +.NAVIGATION input + label + form.config { + position: static; + display: none; +} +.NAVIGATION .config a { display: block; } +.NAVIGATION .config a:hover { border-width: 1px 2px; } +.NAVIGATION input:checked + label + form.config { display: block; } +.NAVIGATION .config input[type=text], +.NAVIGATION .config button { + font-size: .875em; + line-height: 1.5em; + height: 1.75em; + padding: 0 .25em; + vertical-align: bottom; + border: 1px solid #000; + background-color: #FFF; +} +.NAVIGATION .config input[type=text] { + margin: .25em 0 0 .375em; + border-right: none; + width: 70%; +} +.NAVIGATION .config button { + min-width: 2.5em; + text-align: center; + max-width: 30%; +} +.NAVIGATION .config button[value=del] { + background: #FCC; +} + + .trailbtn { display: none; } .trailbtn + .trailbox { display: none; } .trailbtn:checked + .trailbox { display: inline-block; } diff --git a/static/therapy.css b/static/therapy.css index cdc6312..9aa971e 100644 --- a/static/therapy.css +++ b/static/therapy.css @@ -22,7 +22,7 @@ body { form > button[type=submit] { position: fixed; display: block; - top: 0; left: 15em; + top: 0; right: 2.5em; height: 2.25em; padding: 0 3ex; font-size: 1em; font-weight: bold; color: #000; background-color: #FDD; diff --git a/templates/frame.html.sh b/templates/frame.html.sh index c1d3b4c..db31ad8 100755 --- a/templates/frame.html.sh +++ b/templates/frame.html.sh @@ -1,6 +1,6 @@ #!/bin/zsh -# Copyright 2014, 2015 Paul Hänsch +# Copyright 2014, 2015, 2017 Paul Hänsch # # This file is part of Confetti. # @@ -20,6 +20,8 @@ . "${_EXEC}/templates/text_frame.sh" [ -x "${_EXEC}/templates/text_${PAGE}.sh" ] && . "${_EXEC}/templates/text_${PAGE}.sh" +bmfile="${_DATA}/mappings/bookmarks" + cat < @@ -32,7 +34,30 @@ cat < EOF diff --git a/templates/text_frame.sh b/templates/text_frame.sh index e5f2dcb..36465ee 100755 --- a/templates/text_frame.sh +++ b/templates/text_frame.sh @@ -21,6 +21,10 @@ item_name[p_error]="Fehler" item_name[p_categories]="Kategorien" item_name[p_prescriptions]="Verschreibungen" item_name[p_therapy]="Therapie" +item_name[nc_edit]="⚙" +#item_name[nc_edit]="☰" +item_name[bm_add]="+" +item_name[bm_del]="-" case $PROFILE in medical)