]> git.plutz.net Git - confetti/commitdiff
reenable clickable email address
authorpaul <paul@plutz.net>
Wed, 18 Apr 2018 14:33:28 +0000 (14:33 +0000)
committerpaul <paul@plutz.net>
Wed, 18 Apr 2018 14:33:28 +0000 (14:33 +0000)
svn path=/trunk/; revision=163

templates/view_card.sh

index 6d23a76bd0037798df0ade2c6cb265ecb64fec71..13dbab782e817e53853e81343b31e2d88e043018 100755 (executable)
@@ -20,9 +20,18 @@ list_items(){
   [ -n "${values[$item]+x}" ] && \
     printf '<h3>%s</h3>\n' "$(l10n $item)"
   for n in "$item" "$item"{0..100}; do
-    [ -z "${values[$n]+x}" ] && break \
-    || printf '<span class="item %s">%s</span>\n' \
-         "$item" "$(htmlsafe ${values[$n]})"
+    if [ -z "${values[$n]+x}" ]; then
+      break
+    else case "$item" in
+      EMAIL)
+        printf '<a class="item EMAIL" href="mailto:%s">%s</a>\n' \
+          "$(attribsafe "${values[$n]}")" "$(htmlsafe "${values[$n]}")"
+        ;;
+      *)
+        printf '<span class="item %s">%s</span>\n' \
+          "$item" "$(htmlsafe ${values[$n]})"
+        ;;
+    esac; fi
   done
 }