}
.newcard {
+ position: sticky;
+ top: 0;
display: block;
border: solid 1px;
margin: 1em 2em .5em 2em;
padding: .5em;
text-align: right;
background: #EEF;
+ z-index: 1;
+}
+.newcard a[href="#top"] {
+ position: absolute;
+ left: .5em;
+ font-weight: bold;
+ text-decoration: none;
+ color: inherit;
+}
+.newcard a[href="#top"]:before {
+ content: '\2b06';
}
.newcard button {
box-shadow: 0 0 .5ex #888;
}
+.card-anchor {
+ position: relative;
+ height: 0;
+ top: -4em;
+}
.card {
display: block;
position: relative;
{ w_filter_diag
printf '
[form class="newcard" action="/cards/new_card.sh" method="POST"
+ [a href="#top" . %s]
[button type="submit" %s]
- ]' "$(l10n newcard)"
+ ]' "$(l10n top)" "$(l10n newcard)"
[ "$edit" ] && edit_card "$edit"
list_cards
X-ZACK-JOINDATE_short) printf %s "Anm.";;
X-ZACK-LEAVEDATE_short) printf %s "Abm.";;
+ top) printf 'Seitenanfang';;
edit) printf %s "Bearbeiten";;
edit_categories) printf %s "Kategorien Bearbeiten";;
vcf_export) printf %s "Vcard Exportieren";;
else
card="$(pdi_load "$tempfile")"
cat <<-EOF
- [form .card #${cardfile##*/} action="/cards/update_card.sh" method="POST"
+ [span .card-anchor #${cardfile##*/}]
+ [form .card action="/cards/update_card.sh" method="POST"
[input type="hidden" name="tid" value="$(transid ${tempfile})"]
[div .section .basic $(
edit_item "$card" N GENDER
print_card(){
local cardfile="$1"
local card="$(pdi_load "$cardfile")"
+ local N1 N2 N3 N4 N5
+ IFS=\; read N1 N2 N3 N4 N5 <<-EOF
+ $(pdi_value "$card" N |pdi_unescape |HTML)
+ EOF
+
cat <<-EOF
- [div .card #${cardfile##*/}
- [div .section .basic $(
- card_item "$card" FN GENDER NICKNAME BDAY X-ZACK-JOINDATE X-ZACK-LEAVEDATE SOUND PHOTO LOGO
+ [span .card-anchor #${cardfile##*/}]
+ [div .card
+ [div .section .basic
+ [h2 .item .FN . $N4 $N1 $N5]
+ [span .item .firstname . $N2 $N3]
+ $(
+ card_item "$card" GENDER NICKNAME BDAY X-ZACK-JOINDATE X-ZACK-LEAVEDATE SOUND PHOTO LOGO
)]
[div .section .address $(card_item "$card" ADR)]
[div .section .phone $(card_item "$card" TEL EMAL IMPP URL)]
[link rel="stylesheet" type="text/css" href="%s"]
' "$style"
printf '
- ] [body class="%s"
+ ] [body #top class="%s"
' "$class"
cat
[ "$message" ] && printf '[p #message\n%s\n]' $(l10n "$message")