order="$(GET o)"
edit="$(GET e |PATH)"
-[ "$order" ] || order=firstname
+[ "$order" ] || order=lastname
edit="${edit##*/}"
{ w_filter_diag
&& edit_item "$card" X-ZACK-LEAVEDATE
card_item "$card" SOUND PHOTO LOGO
)]
- [div .section .phone $(edit_item "$card" TEL)]
- [div .section .message $(
- edit_item "$card" EMAIL
- [ $(pdi_count "$card" IMPP) -gt 0 ] && edit_item "$card" IMPP
- [ $(pdi_count "$card" URL ) -gt 0 ] && edit_item "$card" URL
- )]
+ [div .section .phone $(
+ edit_item "$card" TEL EMAIL
+ [ $(pdi_count "$card" IMPP) -gt 0 ] \
+ && edit_item "$card" IMPP
+ [ $(pdi_count "$card" URL ) -gt 0 ] \
+ && edit_item "$card" URL
+ )]
[div .section .address $(edit_item "$card" ADR)]
- [div .section .note $(edit_item "$card" NOTE)]
- [div .section .attendance
- [h3 $(l10n course_attendance) ] $(
- for course in "$_DATA"/ical/*.ics; do
- printf '[label [input type="checkbox" name="attendance" value="%s" %s] %s]' \
- "${course##*/}" \
- "$(grep -qF "${course##*/} ${cardfile##*/}" "$_DATA/mappings/attendance" \
- && printf 'checked="checked"'
- )" \
- "$(pdi_value "$(pdi_load "$course")" SUMMARY |unescape |HTML)"
- done)
- [h3 $(l10n CATEGORIES) ] $(
- grep -xE '[^ ]+' "$_DATA"/mappings/categories |while read -r cat; do
- printf '[label [input type="checkbox" name="attendance" value="%s" %s] %s]' \
- "$(HTML "$cat")" \
- "$(seq 1 $(pdi_count "$card" CATEGORIES) |while read c; do
- pdi_value "$card" CATEGORIES $c |grep -qxF "$cat" \
- && printf 'checked="checked"' && break
- done)" \
- "$(HTML "$cat")"
- done)
- ]
+ [div .section .insurance $(edit_item "$card" X-HEALTH-INSURANCE)]
+ [div .section .note $(edit_item "$card" NOTE X-CLIENT-REFERRAL)]
[div .control
[select .item name="newfield"
[option value="" disabled="disabled" selected="selected" $(l10n edit_addfieldtext)]
local card="$(pdi_load "$cardfile")"
cat <<-EOF
[div .card #${cardfile##*/}
- [div .section .basic ­$(
+ [div .section .basic $(
card_item "$card" FN GENDER NICKNAME BDAY X-ZACK-JOINDATE X-ZACK-LEAVEDATE SOUND PHOTO LOGO
)]
- [div .section .phone ­$(card_item "$card" TEL)]
- [div .section .message ­$(card_item "$card" EMAIL IMPP URL)]
- [div .section .address ­$(card_item "$card" ADR)]
- [div .section .note ­$(card_item "$card" NOTE)]
- [div .section .attendance [h3 $(l10n course_attendance) ] [ul ­
- $(grep -F " ${cardfile##*/}" "$_DATA/mappings/attendance" |while read each discard; do
- printf '[li [a .item .attendance href="/courses#%s" ­%s]]' \
- "$each" \
- "$(pdi_value "$(pdi_load "$_DATA/ical/$each")" SUMMARY |unescape |HTML)"
- done)]
- $(card_item "$card" CATEGORIES)
- ]
+ [div .section .address $(card_item "$card" ADR)]
+ [div .section .phone $(card_item "$card" TEL EMAL IMPP URL)]
+ [div .section .insurance $(card_item "$card" X-HEALTH-INSURANCE)]
+ [div .section .note $(card_item "$card" NOTE X-CLIENT-REFERRAL)]
[div .control
[a .item href="/cards/edit_card.sh?card=${cardfile##*/}" $(l10n edit)]
[a .item href="/cards/export_card.sh?card=${cardfile##*/}" $(l10n vcf_export)]
# You should have received a copy of the GNU Affero General Public License
# along with Confetti. If not, see <http://www.gnu.org/licenses/>.
-list_categories() {
- grep -vxE '^[ ]*$' "${_DATA}/mappings/categories"
-}
-
w_filter_item() {
n=$3
cat <<EOF
"$field" "$n" "$(l10n filter_$field)"
done)
[input type="text" name="filter_text$n" value="$([ "$1" = CATEGORIES ] || HTML "$2")" placeholder="$(l10n filter_placeholder)"]
- [fieldset .categories
- $(list_categories | while read cat; do
- printf '[label [checkbox "filter_cat%i" "|%s" %s] %s ]' \
- "$n" "$(HTML "$cat")" \
- "$(printf %s "$cat" |grep -qxEe "$2" && printf checked )" \
- "$(HTML "$cat")"
- done)
- [a href="/cards/categories.sh" $(l10n edit_categories)]
- ]
]
EOF
}
EOF
}
-# listcards |grep ${edit:+-v} "$edit" \
-# | while read card; do
-# "${_EXEC}"/cgilite/html-sh.sed <<-ENDCARD
-# [div #${card} .card
-# $(view_card "$card")[!--
-# --][div .control
-# [a "?action=edit_card&card=${card}" .item $(l10n edit)]
-# [a "?action=export_vcard&card=${card}".item $(l10n vcf_export)]
-# ${profile_medical:+[a "?action=new_prescription&client=${card}" .item $(l10n new_prescription)]}
-# ]]
-# ENDCARD
-# done
-
-#!/bin/sh
-
card_item(){
local card="$1"
local item cnt c
cnt="$(pdi_count "$card" "$item")"
case $item in
- FN) printf '[h2 .item .FN ­%s]' "$(pdi_value "$card" FN |unescape |HTML)"
+ FN) printf '[h2 .item .FN . %s]' "$(pdi_value "$card" FN |unescape |HTML)"
;;
- GENDER) printf '[span .item .GENDER ­%s]' "$(pdi_value "$card" GENDER |l10n)"
+ GENDER) printf '[span .item .GENDER . %s]' "$(pdi_value "$card" GENDER |l10n)"
;;
NICKNAME) seq 1 $cnt |while read c; do
- printf '[span .item .NICKNAME ­aka. "%s"]' \
+ printf '[span .item .NICKNAME aka. "%s"]' \
"$(pdi_value "$card" NICKNAME $c |unescape |HTML)"
done
;;
EMAIL)
[ $cnt -gt 0 ] && printf '[h3 %s]' "$(l10n EMAIL)"
seq 1 $cnt |while read c; do
- printf '[a .item .EMAIL href="mailto:%s" ­%s]' \
+ printf '[a .item .EMAIL href="mailto:%s" . %s]' \
"$(pdi_value "$card" EMAIL $c |unescape |HTML)" \
"$(pdi_value "$card" EMAIL $c |unescape |HTML)"
done
seq 1 $cnt |while read c; do
teltype="$(pdi_attrib "$card" TEL $c TYPE)"
[ "$teltype" ] \
- && printf '[span .item .TEL [span .type ­%s:] %s]' \
+ && printf '[span .item .TEL [span .type . %s:] %s]' \
"$(l10n "TYPE=$teltype" |HTML)" \
"$(pdi_value "$card" TEL $c |unescape |HTML)" \
- || printf '[span .item .TEL ­%s]' \
+ || printf '[span .item .TEL . %s]' \
"$(pdi_value "$card" TEL $c |unescape |HTML)"
done
;;
+ X-HEALTH-INSURANCE)
+ [ $cnt -gt 0 ] && printf '[h3 %s]' "$(l10n X-HEALTH-INSURANCE)"
+ seq 1 $cnt |while read c; do
+ IFS=\; read -r hi_name hi_number hi_status <<-EOF
+ $(pdi_value "$card" X-HEALTH-INSURANCE $c)
+ EOF
+ printf '[span .item .hi_company . %s]
+ [span .item .hi_number [label %s:] %s]
+ [span .item .hi_status [label %s:] %s]
+ ' "$(unescape "$hi_name" |HTML)" \
+ "$(l10n hi_number)" "$(unescape "$hi_number" |HTML)" \
+ "$(l10n hi_status)" "$(unescape "$hi_status" |HTML)"
+ done
+ ;;
*)[ $cnt -gt 0 ] && printf '[h3 %s]' "$(l10n "$item")"
seq 1 $cnt |while read c; do
- printf '[span .item .%s ­%s]' "$item" \
+ printf '[span .item .%s . %s]' "$item" \
"$(pdi_value "$card" "$item" $c |unescape |HTML)"
done
;;
printf 'Content-Type: text/html; charset=utf-8\r\n\r\n'
{ printf '
[html [head
- [title Confetti]
+ [title Lobster]
[meta name="viewport" content="width=device-width"]
[link rel="stylesheet" type="text/css" href="/style.css"]
'