"$([ "$(pdi_value "$card" GENDER)" = 'none' ] && printf 'selected="selected"')" \
"$(l10n gender_none)"
;;
- BDAY|X-ZACK-JOIDATE|X-ZACK-LEAVEDATE)
+ BDAY|X-ZACK-JOINDATE|X-ZACK-LEAVEDATE)
printf '[h3 %s]
[input .item .%s name="%s" value="%s" placeholder="YYYY-MM-DD"]
' \
edit_item "$card" N GENDER
[ "$(pdi_count "$card" NICKNAME)" -gt 0 ] \
&& edit_item "$card" NICKNAME
+ edit_item "$card" BDAY
edit_item "$card" X-ZACK-JOINDATE
[ "$(pdi_count "$card" X-ZACK-LEAVEDATE)" -gt 0 ] \
&& edit_item "$card" X-ZACK-LEAVEDATE
print_card(){
local cardfile="$1"
- local cachefile="${_DATA}/cache/${cardfile##*/}.cache"
-
- if [ "$cachefile" -nt "$cardfile" -a "$cachefile" -nt "${_EXEC}/cards" ]; then
- cat "$cachefile"
- else
- local card="$(pdi_load "$cardfile")"
- tee "$cachefile" <<-EOF
+ local card="$(pdi_load "$cardfile")"
+ cat <<-EOF
[div .card #${cardfile##*/}
[div .section .basic ­$(
card_item "$card" FN GENDER NICKNAME BDAY X-ZACK-JOINDATE X-ZACK-LEAVEDATE SOUND PHOTO LOGO
]
]
EOF
- fi
+}
+
+print_cards(){
+ local cardfile cachefile date size name ldate=0 lsize lname
+
+ while read cardfile; do
+ cachefile="${_DATA}/cache/${cardfile##*/}.cache"
+ if [ -s "$cachefile" -a "$cachefile" -nt "$cardfile" \
+ -a "$cachefile" -nt "${_EXEC}/cards" ]; then
+ cat "$cachefile"
+ else
+ print_card "$cardfile" |tee "$cachefile"
+ fi
+ done
}
filter_cards(){
filter_cards \
| order_cards \
| grep -xvF "$edit" \
- | while read cardfile; do
- print_card "$cardfile"
- done
+ | print_cards
}