X-Git-Url: https://git.plutz.net/?p=confetti;a=blobdiff_plain;f=templates%2Fview_attendee.sh;h=01fb3f0383565c3f9baa56a26aac6b1eb2367705;hp=1e02e3db017c1845f1a753927c91d73e8029ccbd;hb=e308373633b80056507ee9cedc5c9b7fc3a00dca;hpb=c778a3abd05946586813bb0b676e04b616d294a4
diff --git a/templates/view_attendee.sh b/templates/view_attendee.sh
index 1e02e3d..01fb3f0 100755
--- a/templates/view_attendee.sh
+++ b/templates/view_attendee.sh
@@ -73,6 +73,23 @@ view_card_item() {
esac
}
+edit_card_item() {
+ case "$key" in
+ BEGIN|VERSION|END);;
+ PHOTO)
+ echo ""
+ ;;
+ *)
+ echo -n "$(l10n "$key")"
+ [ -n "$tag[TYPE]" ] && echo -n "($tag[TYPE])"
+ echo ":"
+ ;|
+ *)
+ echo ""
+ ;;
+ esac
+}
+
view_attendee() { #Parameter: Cardfile
cardfile="$1"
cachefile="cache/vcf_$(basename "$cardfile").cache"
@@ -96,3 +113,25 @@ view_attendee() { #Parameter: Cardfile
esac
done |tee "$cachefile"
}
+
+edit_attendee() {
+ cardfile="$1"
+ unset key
+ vcf_parse "$cardfile" |while read -r line; do
+ declare -A tag
+ case "$line" in
+ value*) eval "$line";;
+ tag*) eval "$line";;
+ key*)
+ if [ -z "$key" ]; then
+ eval "$line"
+ else
+ edit_card_item
+ eval "$line"
+ unset value
+ unset tag
+ fi
+ ;;
+ esac
+ done
+}