]> git.plutz.net Git - confetti/blobdiff - templates/edit_course.sh
design updates
[confetti] / templates / edit_course.sh
index c1deb5a622f0fa85673b8005071408871e4667f4..d1bb75c9c29e974443dd3d7619e0651c2adfa0f0 100755 (executable)
@@ -61,16 +61,16 @@ echo '<div id="'${id}'" class="course">'
 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">'$(l10n SUMMARY)'</span>'
+echo '    <h2>'$(l10n SUMMARY)'</h2>'
 echo '    <input type="text" class="item SUMMARY" name="SUMMARY" value="'$values[SUMMARY]'" />'
-echo '    <span class="sectitle">'$(l10n COMMENT)'</span>'
+echo '    <h3>'$(l10n COMMENT)'</h3>'
 for n in COMMENT COMMENT{0..10}; do [ -n "$values[$n]" ] &&\
   echo '    <textarea class="item COMMENT" name="COMMENT">'$values[$n]'</textarea>'
 done
 echo '  </div>'
 
 echo '  <div class="section dtstart">'
-echo '    <span class="sectitle">'$(l10n DTSTART)'</span>'
+echo '    <h3>'$(l10n DTSTART)'</h3>'
 echo '    <select class="DTSYEAR" name="DTSYEAR" onchange="this.form.submit();">'
 for y in {$(($dts_year - 50))..$(($dts_year + 50))}; do
   echo '    <option value="'$y'" '$([ "$y" -eq "$dts_year" ] && echo 'selected="selected"')'>'$y'</option>'
@@ -110,8 +110,9 @@ echo '    </select>'
 echo '  </div>'
 
 echo '  <div class="section recur">'
-echo '    <span class="sectitle">'$(l10n RRULE)'</span>'
-echo '    <span class="text">'$(l10n t_every)'</span>'
+echo '    <h3>'$(l10n RRULE)'</h3>'
+echo '    <span class="item">'
+echo '    '$(l10n t_every)''
 echo '    <select class="RRULE INTERVAL" name="RRULE_INTERVAL">'
 for i in {1..365}; do
   echo '    <option value="'$i'" '$([ "$i" = "$rr_int" ] && echo 'selected="selected"')'>'$i'</option>'
@@ -121,14 +122,17 @@ echo '    <select class="RRULE FREQ" name="RRULE_FREQ">'
 for f in DAILY WEEKLY MONTHLY YEARLY; do
   echo '    <option value="'$f'" '$([ "$f" = "$rr_freq" ] && echo 'selected="selected"')'>'$(l10n $f)'</option>'
 done
-echo '    </select><br/>'
+echo '    </select></span>'
+echo '    <span class="item">'
 echo '    <input type="radio" name="RRULE_LIMIT" value="ETERN" '$([ "$rr_limit" = ETERN ] && echo 'checked="checked"')'>'$(l10n t_eternal)'</input><br/>'
+echo '    </span><span class="item">'
 echo '    <input type="radio" name="RRULE_LIMIT" value="COUNT" '$([ "$rr_limit" = COUNT ] && echo 'checked="checked"')'></input>'
 echo '    <select class="RRULE COUNT" name="RRULE_COUNT">'
 for t in {1..365}; do
   echo '    <option value="'$t'" '$([ "$t" = "$rr_count" ] && echo 'selected="selected"')'>'$t'</option>'
 done
-echo '    </select><span class="text">'$(l10n t_times)'</span><br/>'
+echo '    </select>'$(l10n t_times)'</span>'
+echo '    <span class="item">'
 echo '    <input type="radio" name="RRULE_LIMIT" value="UNTIL" '$([ "$rr_limit" = UNTIL ] && echo 'checked="checked"')'>'$(l10n t_until)'</input>'
 echo '    <select class="RRULE UYEAR" name="RRULE_UYEAR">'
 for uy in {${dts_year}..$(($dts_year + 50))}; do
@@ -144,33 +148,31 @@ echo '    <select class="RRULE UDAY" name="RRULE_UDAY">'
 for ud in {01..31}; do
   echo '    <option value="'$ud'" '$([ "$ud" = "$rr_uday" ] && echo 'selected="selected"')'>'$ud'</option>'
 done
-echo '    </select>'
+echo '    </select></span>'
 echo '  </div>'
 
 echo '  <div class="section select_attendance">'
-echo '    <span class="sectitle">'$(l10n course_attendance)'</span>'
-echo '    <select class="item attendance" name="attendance" multiple="multiple">'
+echo '    <h3>'$(l10n course_attendance)'</h3>'
 listcards |while read card; do
   cfile="$_DATA/vcard/$card"
   aname=$(sed -rn 's:^N(;[^"\:]+|;"[^"]+")*\:([^;]*)(\;[^;]*)(\;[^;]*)?(\;[^;]*)?(\;[^;]*)?$:\5 \3 \4 \2 \6:p' "$cfile" \
           |sed -r 's:,: :;s:\;: :g;s: +: :g' \
           |tr -d '\r'
          )
-  selected=$(sed -rn "s:^$id\t$card\$:selected=\"selected\":p" $_DATA/mappings/attendance)
-  echo '    <option value="'$card'" '$selected'>'$aname'</option>'
+  selected=$(sed -rn "/^$id\t$card\$/{s;^.*\$;checked=\"checked\";p;q}" "${_DATA}/mappings/attendance")
+  echo '    <label><input type="checkbox" class="item" name="attendance" value="'$card'" '$selected'>'$aname'</label>'
 done
-echo '    </select>'
 echo '  </div>'
 
-echo '  <div class="section control">'
-echo '    <button class="item control" type="submit" name="action" value="addfield">'$(l10n edit_addfield)'</button>'
-echo '    <select class="item control" name="newfield">'
+echo '  <div class="control">'
+echo '    <select class="item" name="newfield">'
 echo '      <option value="" disabled="disabled" selected="selected">'$(l10n edit_addfieldtext)'</option>'
             for f in $SUP_FIELDS; do echo "<option value=\"$f\">$(l10n $f)</option>"; done
-echo '    </select>'
-echo '    <button class="item control" type="submit" name="action" value="update">'$(l10n edit_update)'</button>'
-echo '    <button class="item control" type="submit" name="action" value="delete">'$(l10n edit_delete)'</button>'
-echo '    <button class="item control" type="submit" name="action" value="cancel">'$(l10n edit_cancel)'</button>'
+echo '    </select'
+echo '    ><button class="item" type="submit" name="action" value="addfield">'$(l10n edit_addfield)'</button>'
+echo '    <button class="item" type="submit" name="action" value="update">'$(l10n edit_update)'</button>'
+echo '    <button class="item" type="submit" name="action" value="delete">'$(l10n edit_delete)'</button>'
+echo '    <button class="item" type="submit" name="action" value="cancel">'$(l10n edit_cancel)'</button>'
 echo '  </div>'
 echo '<input type="hidden" name="UID" value="'$values["UID"]'"/>'
 echo '</form>'