From: Paul Hänsch Date: Mon, 9 Dec 2019 23:47:37 +0000 (+0100) Subject: different layout of listing X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=7c3de62f78eba0142bc054bdda1f3ab1cb1c20a4;p=lobster different layout of listing --- diff --git a/cards/index.cgi b/cards/index.cgi index f1306f6..639bb64 100755 --- a/cards/index.cgi +++ b/cards/index.cgi @@ -18,7 +18,7 @@ filter="$(GET f)" order="$(GET o)" edit="$(GET e |PATH)" -[ "$order" ] || order=firstname +[ "$order" ] || order=lastname edit="${edit##*/}" { w_filter_diag diff --git a/cards/list.sh b/cards/list.sh index f2f4a4b..2735c54 100755 --- a/cards/list.sh +++ b/cards/list.sh @@ -25,35 +25,16 @@ edit_card(){ && 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)] @@ -78,21 +59,13 @@ print_card(){ 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)] diff --git a/cards/widgets.sh b/cards/widgets.sh index 5fbf125..a3836bf 100755 --- a/cards/widgets.sh +++ b/cards/widgets.sh @@ -15,10 +15,6 @@ # You should have received a copy of the GNU Affero General Public License # along with Confetti. If not, see . -list_categories() { - grep -vxE '^[ ]*$' "${_DATA}/mappings/categories" -} - w_filter_item() { n=$3 cat <