1 # Copyright 2014, 2015 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 n=$(printf %s "$values[N]" \
19 | sed -rn 's:^([^;]*)(\;[^;]*)(\;[^;]*)?(\;[^;]*)?(\;[^;]*)?$:\4 \2 \3 \1 \5:gp' \
20 | sed -r 's:,: :;s:\;: :g;s: +: :g;s:^ $::;'
22 fullname="${n:-${values[FN]:-${values[NICKNAME]}}}"
25 <div class="section basic">
26 <h2 class="item FN">$fullname</h2>
27 ${values[GENDER]:+<span class="item GENDER">$(l10n $values[GENDER])</span>}
29 $(for n in NICKNAME NICKNAME{0..10}; do
30 echo "${values[$n]:+<span class="item NICKNAME">aka. $values[$n]</span>}"
33 ${values[BDAY]:+<span class="item BDAY"><b>*:</b> $values[BDAY]</span>}
34 ${values[X-ZACK-JOINDATE]:+<span class="item X-ZACK-JOINDATE"><b>$(l10n label_join):</b> $values[X-ZACK-JOINDATE]</span>}
35 ${values[X-ZACK-LEAVEDATE]:+<span class="item X-ZACK-LEAVEDATE"><b>$(l10n label_leave):</b> $values[X-ZACK-LEAVEDATE]</span>}
36 ${values[SOUND]:+<audio controls="controls" class="item SOUND"><source type="audio/ogg" src="data:audio/ogg;base64,$values[SOUND]" /></audio>}
37 ${values[PHOTO]:+<img class="item PHOTO" src="data:image/$tags[PHOTO_TYPE];base64,$values[PHOTO]" />}
38 ${values[LOGO]:+<img class="item LOGO" src="data:image/$tags[LOGO_TYPE];base64,$values[LOGO]" />}
41 --><div class="section phone">
43 $(for n in TEL TEL{0..10}; do
44 echo "${values[$n]:+<span class="item TEL">$tags[${n}_TYPE] $values[$n]</span>}"
48 --><div class="section message">
49 ${values[EMAIL]:+<h3>$(l10n EMAIL)</h3>}
50 $(for n in EMAIL EMAIL{0..10}; do
51 echo "${values[$n]:+<span class="item EMAIL"><a href="mailto:$values[$n]">$values[$n]</a></span>}"
53 ${values[IMPP]:+<h3>$(l10n IMPP)</h3>}
54 $(for n in IMPP IMPP{0..10}; do
55 echo "${values[$n]:+<span class="item IMPP">$tags[${n}_TYPE] <a href="$values[$n]">$values[$n]</a></span>}"
59 --><div class="section address">
61 $(for n in ADR ADR{0..10}; do
62 echo "${values[$n]:+<span class="item ADR">$values[$n]</span>}"
64 ${values[URL]:+<h3>$(l10n URL)</h3>}
65 $(for n in URL URL{0..10}; do
66 echo "${values[$n]:+<span class="item URL"><a href="$values[$n]">$values[$n]</a></span>}"
70 --><div class="section note">
72 $(for n in NOTE NOTE{0..10}; do
73 echo "${values[$n]:+<span class="item NOTE">$values[$n]</span>}"
77 --><div class="section attendance">
78 <h3>$(l10n course_attendance)</h3>
80 $(sed -rn 's:(.*)\t'$id'$:\1:p' "$_DATA/mappings/attendance" |while read each; do
81 cname="$(sed -rn 's:^SUMMARY\:(.*)$:\1:p' "$_DATA/ical/$each")"
82 echo ' <li><a class="item attendance" href="?p=courses#'$each'">'$cname'</a></li>'