]> git.plutz.net Git - confetti/commitdiff
ordering for courses, default ordering for attendees
authorpaul <paul@plutz.net>
Mon, 2 Dec 2013 15:20:02 +0000 (15:20 +0000)
committerpaul <paul@plutz.net>
Mon, 2 Dec 2013 15:20:02 +0000 (15:20 +0000)
svn path=/trunk/; revision=32

pages/attendees.sh
pages/courses.sh
templates/courses.css.sh
templates/courses.html.sh
templates/text_courses.sh

index 32f651bd9af35ce1387fddd9b25522b69bc987d9..a8a22c720475d1f8f758d63a9299c2d56e11d2e1 100755 (executable)
@@ -1,5 +1,7 @@
 #!/bin/sh
 
+[ -z "$_GET[\"order\"]" ] && _GET["order"]=firstname
+
 listcards() {
   case "$_GET[\"filtertype\"]" in
     any)
index 9610ec20df0883f724e5c34196b7b597b07ae450..c0aab02520dcff39991c2e54b4ac6f30f86ff266 100755 (executable)
@@ -1,10 +1,24 @@
 #!/bin/sh
 
+[ -z "$_GET[\"order\"]" ] && _GET["order"]=DOW
+
 listcourses() {
   case "$_GET[\"filtertype\"]" in
     *) ls -1 ${_DATA}/ical/*ics 2>/dev/null
       ;;
   esac |case "$_GET[\"order\"]" in
+    DOW)
+      while read file; do
+        icstime="$(sed -rn 's:^DTSTART\:(TZID=.*\:)?([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2})([0-9]{2})([0-9]{2})Z?\r$:\2-\3-\4 \5\:\6\:\7:p' "$file")"
+        echo "$(date -d "$icstime" "+%u %H%M%S")\t$file"
+      done
+      ;;
+    TOD)
+      while read file; do
+        icstime="$(sed -rn 's:^DTSTART\:(TZID=.*\:)?([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2})([0-9]{2})([0-9]{2})Z?\r$:\2-\3-\4 \5\:\6\:\7:p' "$file")"
+        echo "$(date -d "$icstime" +%H%M%S)\t$file"
+      done
+      ;;
     *)
       sed -r 's:^.*$:x\t&:'
       ;;
index a0fdb03d2b70398f9d868972814dfb5b1a1dc715..fb98be59a75c7b2abf8b4c2b58570855aed224fb 100644 (file)
@@ -1,15 +1,29 @@
 cat <<EOF
 
-.newcourse {
+.sort {
   display: block;
   width: 126ex;
   border-width: 1px;
   border-style: solid;
-  border-radius: 4px 4px 0 0;
+  border-radius: 4px 4px 0 0 ;
   margin: 1em auto .25em auto;
   padding: .25em 2ex .25em 2ex;
   background: #EFF;
 }
+.sort .label {
+  font-weight: bold;
+}
+
+.newcourse {
+  display: block;
+  width: 126ex;
+  border-width: 1px;
+  border-style: solid;
+  border-radius: 0 0 4px 4px;
+  margin: .25em auto 1em auto;
+  padding: .25em 2ex .25em 2ex;
+  background: #EFF;
+}
 
 .courselist .course {
   display: block;
index 365c576210ef21c34606a5fe97c91c2139ba6ba7..10fa011cabf2846a3b98ea51e4b7e8b8902ed4e6 100644 (file)
@@ -1,7 +1,23 @@
 
 edit="$_GET[\"edit\"]"
 
+check_order(){
+  [ "$_GET[\"order\"]" = "$1" ] && echo 'checked="checked"'
+}
+
 cat <<EOF
+<div class="sort">
+  <form class="search" action="/" method="GET">
+    <input type="hidden" name="page" value="courses"/>
+    <input type="hidden" name="edit" value="$edit"/>
+    <span class="label">$(l10n sort_order):</span>
+    <input type="radio" name="order" value="DOW" $(check_order DOW)>$(l10n order_DOW)</input>
+    <input type="radio" name="order" value="TOD" $(check_order TOD)>$(l10n order_TOD)</input>
+    <br>
+    <button type="submit" name="" value="">$(l10n order_apply)</button>
+  </form>
+</div>
+
 <div class="newcourse">
   <form action="?action=new_course" method="POST">
     <button type="submit">$(l10n newcourse)</button>
index 540cd760a473268727e1cfea7f673ad14ef54d77..74b8805a2c38caeda4dbc682fd42d18904eb3480 100755 (executable)
@@ -27,6 +27,11 @@ item_name[edit_dtscal]="&#x2713;"
 item_name[edit]="Bearbeiten"
 item_name[ics_export]="ICal exportieren"
 
+item_name[sort_order]="Sortierung"
+item_name[order_DOW]="Wochentag"
+item_name[order_TOD]="Uhrzeit"
+item_name[order_apply]="Sortieren"
+
 item_name[t_every]="Alle"
 item_name[t_eternal]="ewig"
 item_name[t_times]="mal"