]> git.plutz.net Git - confetti/commitdiff
show attendees in course list
authorpaul <paul@plutz.net>
Mon, 2 Dec 2013 18:53:45 +0000 (18:53 +0000)
committerpaul <paul@plutz.net>
Mon, 2 Dec 2013 18:53:45 +0000 (18:53 +0000)
svn path=/trunk/; revision=35

actions/update_attendee.sh
templates/courses.css.sh
templates/text_courses.sh
templates/view_course.sh

index 078d0966b232427c45a97381086ae440983044de..76e0086497d918c9d1400d023ec43a39e82e67d2 100644 (file)
@@ -43,7 +43,10 @@ case "$_POST[\"action\"]" in
     done
     sed -i -r '/^(.+)\t'$card'$/d' "$attfile"
     for each in $attendance; do
-      echo "$each\t$card" >>"$attfile"
+      echo "$each\t$card"
+    done >>"$attfile"
+    sed -rn 's:^(.+)'$card'$:\1:p' "$attfile" |while read course; do
+      touch "$_DATA/ical/$course"
     done
 
     echo "END:VCARD\r" >>"$tempfile"
index fb98be59a75c7b2abf8b4c2b58570855aed224fb..c7e90386d640e66e2c5ac71d0ab0e552c2886f06 100644 (file)
@@ -45,6 +45,20 @@ cat <<EOF
   background: #EEE;
 }
 
+.courselist .course .attendance {
+  width:50ex;
+}
+.courselist .course .attendance a {
+  display: inline-block;
+  max-width: 13.75ex;
+  color: #008;
+  border-style: solid;
+  border-width: 1px;
+  margin: .25em .125ex .25em .125ex;
+  padding: .125em 1ex .125em 1ex;
+  background: #EFF;
+}
+
 .courselist .course .dtstart {
   width: 35ex;
 }
index 74b8805a2c38caeda4dbc682fd42d18904eb3480..cc773f27f22e38768064e4de9ef98b70b95496d6 100755 (executable)
@@ -27,6 +27,8 @@ item_name[edit_dtscal]="&#x2713;"
 item_name[edit]="Bearbeiten"
 item_name[ics_export]="ICal exportieren"
 
+item_name[course_attendance]="Teilnehmende"
+
 item_name[sort_order]="Sortierung"
 item_name[order_DOW]="Wochentag"
 item_name[order_TOD]="Uhrzeit"
index e5513c42ba560e1585dc3edfc41a33bdfce55d5b..dc490c633a7a6a55ddc2b167b726dfbeb341bd06 100755 (executable)
@@ -67,6 +67,19 @@ for n in COMMENT COMMENT{0..10}; do [ -n "$values[$n]" ] &&\
 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 '  </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>'