#!/bin/sh
+[ -z "$_GET[\"order\"]" ] && _GET["order"]=firstname
+
listcards() {
case "$_GET[\"filtertype\"]" in
any)
#!/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&:'
;;
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;
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>
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"