X-Git-Url: https://git.plutz.net/?p=confetti;a=blobdiff_plain;f=cards%2Flist.sh;fp=cards%2Flist.sh;h=834803f336756b7419de663eec5a8b3585f44e0e;hp=4a57bd2314f300585b6ef50eb6f9162536898945;hb=39d5084924d723c5bbea52c2b62fdfc39d39fe23;hpb=751d678a319fdf0730023e06e375565f8039aee3 diff --git a/cards/list.sh b/cards/list.sh index 4a57bd2..834803f 100755 --- a/cards/list.sh +++ b/cards/list.sh @@ -56,6 +56,19 @@ card_item(){ done fi ;; + TEL) if [ $cnt -gt 0 ]; then + printf '[h3 %s]' "$(l10n TEL)" + seq 1 $cnt |while read c; do + teltype="$(pdi_attrib "$card" TEL $c TYPE)" + [ "$teltype" ] \ + && printf '[span .item .TEL [span .type ­%s:] %s]' \ + "$(l10n "$teltype" |HTML)" \ + "$(pdi_value "$card" TEL $c |unescape |HTML)" \ + || printf '[span .item .TEL ­%s]' \ + "$(pdi_value "$card" TEL $c |unescape |HTML)" + done + fi + ;; *) if [ $cnt -gt 0 ]; then printf '[h3 %s]' "$(l10n "$item")" seq 1 $cnt |while read c; do @@ -101,6 +114,7 @@ edit_item(){ "$(l10n n_post)" "$(HTML "$n5")" ;; GENDER) + gender="$(pdi_value "$card" GENDER)" printf ' [select .item .GENDER name="GENDER" [option value="" disabled="disabled" %s %s] @@ -108,18 +122,12 @@ edit_item(){ [option value="male" %s %s] [option value="other" %s %s] [option value="none" %s %s] - ] - ' \ - "$([ "$(pdi_value "$card" GENDER)" = '' ] && printf 'selected="selected"')" \ - "$(l10n GENDER)" \ - "$([ "$(pdi_value "$card" GENDER)" = 'female' ] && printf 'selected="selected"')" \ - "$(l10n gender_female)" \ - "$([ "$(pdi_value "$card" GENDER)" = 'male' ] && printf 'selected="selected"')" \ - "$(l10n gender_male)" \ - "$([ "$(pdi_value "$card" GENDER)" = 'other' ] && printf 'selected="selected"')" \ - "$(l10n gender_other)" \ - "$([ "$(pdi_value "$card" GENDER)" = 'none' ] && printf 'selected="selected"')" \ - "$(l10n gender_none)" + ]\n' \ + "$([ "$gender" = '' ] && printf 'selected="selected"')" "$(l10n GENDER)" \ + "$([ "$gender" = 'female' ] && printf 'selected="selected"')" "$(l10n gender_female)" \ + "$([ "$gender" = 'male' ] && printf 'selected="selected"')" "$(l10n gender_male)" \ + "$([ "$gender" = 'other' ] && printf 'selected="selected"')" "$(l10n gender_other)" \ + "$([ "$gender" = 'none' ] && printf 'selected="selected"')" "$(l10n gender_none)" ;; BDAY|X-ZACK-JOINDATE|X-ZACK-LEAVEDATE) printf '[h3 %s] @@ -134,6 +142,26 @@ edit_item(){ "$item" "$item" "$(pdi_value "$card" "$item" $c |unescape |HTML)" done ;; + TEL) printf '[h3 %s]' "$(l10n "$item")" + seq 1 $cnt |while read c; do + teltype="$(pdi_attrib "$card" TEL $c TYPE)" + printf '[select .item .teltype name="teltype" + [option value="" disabled="disabled" %s %s] + [option value="HOME" %s %s] + [option value="WORK" %s %s] + [option value="CELL" %s %s] + [option value="FAX" %s %s] + ]\n' \ + "$([ "$teltype" = '' ] && printf 'selected="selected"')" "$(l10n teltype)" \ + "$([ "$teltype" = 'HOME' ] && printf 'selected="selected"')" "$(l10n HOME)" \ + "$([ "$teltype" = 'WORK' ] && printf 'selected="selected"')" "$(l10n WORK)" \ + "$([ "$teltype" = 'CELL' ] && printf 'selected="selected"')" "$(l10n CELL)" \ + "$([ "$teltype" = 'FAX' ] && printf 'selected="selected"')" "$(l10n FAX)" + + printf '[input .item .%s name="%s" value="%s" placeholder="%s"]' \ + "$item" "$item" "$(pdi_value "$card" "$item" $c |unescape |HTML)" "$(l10n "$item")" + done + ;; *) printf '[h3 %s]' "$(l10n "$item")" seq 1 $cnt |while read c; do printf '[input .item .%s name="%s" value="%s" placeholder="%s"]' \