]> git.plutz.net Git - confetti/blobdiff - templates/view_course.sh
design updates
[confetti] / templates / view_course.sh
index dc490c633a7a6a55ddc2b167b726dfbeb341bd06..f8e2f2cffb5aceb28bd1d928ae480eeb30edce10 100755 (executable)
@@ -1,3 +1,19 @@
+# Copyright 2014 Paul Hänsch
+#
+# This file is part of Confetti.
+# 
+# Confetti is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+# 
+# Confetti is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Affero General Public License for more details.
+# 
+# You should have received a copy of the GNU Affero General Public License
+# along with Confetti.  If not, see <http://www.gnu.org/licenses/>. 
 
 dtstart="$values[DTSTART]"
 [ -z "$dtstart" ] && dtstart=$(date +%Y%m%dT%H%M%S)
@@ -39,11 +55,13 @@ else
   rr_limit=ETERN
 fi
 
+coursemail=""
+
 echo '<div id="'${id}'" class="course">'
-echo '<form action="/?action=update_course" method="POST">'
+echo '<form action="?action=update_course" method="POST">'
 echo '<input type="hidden" name="course" value="'${id}'"/>'
 echo '  <div class="section basic">'
-echo '    <span class="sectitle">'$values[SUMMARY]'</span>'
+echo '    <h2>'$values[SUMMARY]'</h2>'
 echo '    <span class="text">'$(date -d "$dts_date" "+%A %B %d, %Y - %H:%M") $(l10n t_oclock)'</span>'
 [ "$rr_int" -eq 1 ] \
 && echo '<span class="text">'$(l10n s$rr_freq)'</span>' \
@@ -61,28 +79,22 @@ esac
 echo '  </div>'
 
 echo '  <div class="section COMMENT">'
-echo '    <span class="sectitle">'$(l10n COMMENT)'</span>'
+echo '    <h3>'$(l10n COMMENT)'</h3>'
 for n in COMMENT COMMENT{0..10}; do [ -n "$values[$n]" ] &&\
   echo '    <p class="item COMMENT">'$(echo "$values[$n]" |sed -r "s:$:<br/>:g" )'</p>'
 done
 echo '  </div>'
 
 echo '  <div class="section attendance">'
-echo '    <span class="sectitle">'$(l10n course_attendance)'</span>'
-sed -rn 's:'$id'\t(.+)$:\1:p' "$_DATA/mappings/attendance" |while read each; do
-  n_last="$(  sed -rn 's:^N(;.+)*\:([^;]*;){0} *([^;]*).*$:\3:p' "$_DATA/vcard/$each")"
-  n_first="$( sed -rn 's:^N(;.+)*\:([^;]*;){1} *([^;]*).*$:\3:p' "$_DATA/vcard/$each")"
-  n_middle="$(sed -rn 's:^N(;.+)*\:([^;]*;){2} *([^;]*).*$:\3:p' "$_DATA/vcard/$each")"
-  n_pre="$(   sed -rn 's:^N(;.+)*\:([^;]*;){3} *([^;]*).*$:\3:p' "$_DATA/vcard/$each")"
-  n_post="$(  sed -rn 's:^N(;.+)*\:([^;]*;){4} *([^;]*).*$:\3:p' "$_DATA/vcard/$each")"
-  aname="${n_pre} ${n_first} ${n_middle} ${n_last} ${n_post}"
-  echo '    <a class="attendance" href="/?page=attendees#'$each'">'$aname'</a>'
-done
+echo '    <h3>'$(l10n course_attendance)'</h3>'
+list_attendance "$id" |sort -k 2 |sed -r 's:^([^ ]+) (.*)$:<a class="attendance" href="?p=attendees#\1">\2</a>:'
 echo '  </div>'
 
-echo '  <div class="section control">'
-echo '    <a class="item control" href="?action=edit_course&course='${id}'">'$(l10n edit)'</a>'
-echo '    <a class="item control" href="?export=ical&course='${id}'">'$(l10n ics_export)'</a>'
+echo '  <div class="control">'
+echo '    <a class="item" href="?action=edit_course&course='${id}'">'$(l10n edit)'</a>'
+echo '    <a class="item" href="?action=generate_courselist&course='${id}'" target="_blank">'$(l10n courselist)'</a>'
+echo '    <a class="item" href="?action=export_ical&course='${id}'">'$(l10n ics_export)'</a>'
+echo '    <a class="item" href="mailto:zack@vuesch.org?bcc='$(course_mail "$id")'">'$(l10n course_mail)'</a>'
 echo '  </div>'
 echo '<input type="hidden" name="UID" value="'$values["UID"]'"/>'
 echo '</form>'