removed debug marks
[confetti] / templates / edit_attendee.sh
index d79553f..cb0b5b1 100755 (executable)
@@ -1,6 +1,6 @@
 edit_card_item() {
   case "$key" in
-    BEGIN|VERSION|END);;
+    BEGIN|VERSION|END|FN);;
     PHOTO)
       echo "<img class=\"PHOTO\" src=\"data:image/$tag[TYPE];base64,$value\"/>"
       ;;
@@ -9,8 +9,21 @@ edit_card_item() {
       [ -n "$tag[TYPE]" ] && echo -n "($tag[TYPE])"
       echo ":</span>"
       ;|
+    N)
+      n_last="$(echo "$value" |sed -r 's:^([^;]*;){0} *([^;]*);.*$:\2:')"
+      n_first="$(echo "$value" |sed -r 's:^([^;]*;){1} *([^;]*);.*$:\2:')"
+      n_middle="$(echo "$value" |sed -r 's:^([^;]*;){2} *([^;]*);.*$:\2:')"
+      n_pre="$(echo "$value" |sed -r 's:^([^;]*;){3} *([^;]*);.*$:\2:')"
+      n_post="$(echo "$value" |sed -r 's:^([^;]*;){4} *([^;]*);*$:\2:')"
+      echo "<input class=\"VALUE\" name=\"3$key\" value=\"$n_pre\" placeholder=\"$(l10n n_pre)\" />"
+      echo "<input class=\"VALUE\" name=\"1$key\" value=\"$n_first\" placeholder=\"$(l10n n_first)\" />"
+      echo "<input class=\"VALUE\" name=\"2$key\" value=\"$n_middle\" placeholder=\"$(l10n n_middle)\" />"
+      echo "<input class=\"VALUE\" name=\"0$key\" value=\"$n_last\" placeholder=\"$(l10n n_last)\" />"
+      echo "<input class=\"VALUE\" name=\"4$key\" value=\"$n_post\" placeholder=\"$(l10n n_post)\" /></span>"
+      echo "<button name=\"deletefield\" value=\"$key $value\">$(l10n edit_deletefield)</button>"
+      ;;
     *)
-      echo "<input class=\"VALUE\" name=\"$key\" value=\"$value\" /></item>"
+      echo "<input class=\"VALUE\" name=\"$key\" value=\"$value\" /></span>"
       echo "<button name=\"deletefield\" value=\"$key $value\">$(l10n edit_deletefield)</button>"
       ;;
   esac
@@ -20,9 +33,8 @@ edit_attendee() {
   cardfile="vcard/$1"
   tempfile="temp/$1"
   [ -f "$tempfile" ] && cardfile="$tempfile"
-  debug Using card: $cardfile
   unset key
-  vcf_parse "$cardfile" |debug |while read -r line; do
+  vcf_parse "$cardfile" |while read -r line; do
     declare -A tag
     case "$line" in
       value*) eval "$line";;