1 # Copyright 2014 Paul Hänsch
3 # This file is part of Confetti.
5 # Confetti is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU Affero General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
10 # Confetti is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU Affero General Public License for more details.
15 # You should have received a copy of the GNU Affero General Public License
16 # along with Confetti. If not, see <http://www.gnu.org/licenses/>.
18 echo '<div id="'${id}'" class="card">'
19 echo ' <div class="section basic">'
20 echo ' <span class="item FN">'$values[FN]'</span>'
21 [ -n "$values[GENDER]" ] && \
22 echo ' <span class="item GENDER">'$(l10n $values[GENDER])'</span>'
23 for n in NICKNAME NICKNAME{0..10}; do [ -n "$values[$n]" ] &&\
24 echo ' <span class="item NICKNAME">aka. '$values[$n]'</span>'
26 [ -n "$values[BDAY]" ] &&\
27 echo ' <span class="item BDAY"><b>*:</b> '$values[BDAY]'</span>'
29 [ -n "$values[X-ZACK-JOINDATE]" ] &&\
30 echo ' <span class="item X-ZACK-JOINDATE"><b>'$(l10n label_join)':</b> '$values[X-ZACK-JOINDATE]'</span>'
31 [ -n "$values[X-ZACK-LEAVEDATE]" ] &&\
32 echo ' <span class="item X-ZACK-LEAVEDATE"><b>'$(l10n label_leave)':</b> '$values[X-ZACK-LEAVEDATE]'</span>'
34 if [ -n "$values[SOUND]" ]; then
35 echo ' <audio controls="controls" class="item SOUND">'
36 echo ' <source type="audio/ogg" src="data:audio/ogg;base64,'$values[SOUND]'" />'
39 [ -n "$values[PHOTO]" ] &&\
40 echo ' <img class="item PHOTO" src="data:image/'$tags[PHOTO_TYPE]';base64,'$values[PHOTO]'" />'
41 [ -n "$values[LOGO]" ] &&\
42 echo ' <img class="item LOGO" src="data:image/'$tags[LOGO_TYPE]';base64,'$values[LOGO]'" />'
45 echo ' <div class="section phone">'
46 echo ' <span class="sectitle">'$(l10n TEL)'</span>'
47 for n in TEL TEL{0..10}; do [ -n "$values[$n]" ] &&\
48 echo ' <span class="item TEL">'$tags[${n}_TYPE]' '$values[$n]'</span>'
52 echo ' <div class="section message">'
53 [ -n "$values[EMAIL]" ] && \
54 echo ' <span class="sectitle">'$(l10n EMAIL)'</span>'
55 for n in EMAIL EMAIL{0..10}; do [ -n "$values[$n]" ] &&\
56 echo ' <span class="item EMAIL"><a href="mailto:'$values[$n]'">'$values[$n]'</a></span>'
58 [ -n "$values[IMPP]" ] && \
59 echo ' <span class="sectitle">'$(l10n IMPP)'</span>'
60 for n in IMPP IMPP{0..10}; do [ -n "$values[$n]" ] &&\
61 echo ' <span class="item IMPP">'$tags[${n}_TYPE]' <a href="'$values[$n]'">'$values[$n]'</a></span>'
65 echo ' <div class="section address">'
66 echo ' <span class="sectitle">'$(l10n ADR)'</span>'
67 for n in ADR ADR{0..10}; do [ -n "$values[$n]" ] &&\
68 echo ' <span class="item ADR">'$values[$n]'</span>'
70 [ -n "$values[URL]" ] && \
71 echo ' <span class="sectitle">'$(l10n URL)'</span>'
72 for n in URL URL{0..10}; do [ -n "$values[$n]" ] &&\
73 echo ' <span class="item URL"><a href="'$values[$n]'">'$values[$n]'</a></span>'
77 echo ' <div class="section note">'
78 echo ' <span class="sectitle">'$(l10n NOTE)'</span>'
79 for n in NOTE NOTE{0..10}; do [ -n "$values[$n]" ] &&\
80 echo ' <span class="item NOTE">'$values[$n]'</span>'
84 echo ' <div class="section">'
85 echo ' <span class="sectitle">'$(l10n course_attendance)'</span>'
86 sed -rn 's:(.*)\t'$id'$:\1:p' "$_DATA/mappings/attendance" |while read each; do
87 cname="$(sed -rn 's:^SUMMARY\:(.*)$:\1:p' "$_DATA/ical/$each")"
88 echo ' <a class="item attendance" href="?p=courses#'$each'">'$cname'</a>'
92 echo ' <div class="section control">'
93 echo ' <a class="item control" href="?action=edit_attendee&card='${id}'">'$(l10n edit)'</a>'
94 echo ' <a class="item control" href="?action=export_vcard&card='${id}'">'$(l10n vcf_export)'</a>'