]> git.plutz.net Git - busy/commitdiff
single tassk display
authorpaul <paul@plutz.net>
Tue, 11 Oct 2011 18:48:02 +0000 (18:48 +0000)
committerpaul <paul@plutz.net>
Tue, 11 Oct 2011 18:48:02 +0000 (18:48 +0000)
svn path=/trunk/; revision=16

Tasks.css
Tasks.page

index e7b8f24a66972454352bc90db714c8f7d818b324..f4a6c69f73f9b4d6510aef6ff67eeb53cc059ecc 100644 (file)
--- a/Tasks.css
+++ b/Tasks.css
@@ -1,17 +1,31 @@
 .Task{
   margin: .5em;
   width: 95%;
-  background-color: #DDF;
+  background-color: #EEF;
   color: #000;
   padding: .5em;
   border-width: 1px;
   border-color: #00A;
   border-style: solid solid solid solid;
 }
+
+.Task table{
+  width: 100%;
+  border-collapse: separate;
+  border-spacing: .5em;
+}
+.Task table tr td{
+  width: 30%;
+  text-align: center;
+  background-color: #FFE;
+  border-width: 1px;
+  border-style: solid;
+}
+
 .Task h1{
   margin: 0em;
   text-size: 2em;
 }
-.Task div{
+form.Task div{
   position: absolute;
 }
index 20f5e0f776bdb04b011b1451a6e8f4a6cf49c6e8..7ca263d5b08cf9901e8630af5bac2d3bb149493d 100644 (file)
@@ -1,6 +1,6 @@
 #!/bin/zsh
 
-info="$(sed -rn 's:(^|.*&)i=([0-9]{10}_[0-9]{3}).*|.*:\2:;s:&.*::' <<<"${QUERY_STRING}")"
+info="$(sed -r 's:(^|.*&)i=([0-9]{10}_[0-9]{3}).*|.*:\2:;s:&.*::' <<<"${QUERY_STRING}")"
 edit="$(sed -r 's:(^|.*&)e=([0-9]{10}_[0-9]{3}).*|.*:\2:;s:&.*::' <<<"${QUERY_STRING}")"
 search="$(sed -r 's:(^|.*&)s=(.*)|.*:\2:;s:&.*::;s:\+: :g;s:%:\\x:g' <<<"${QUERY_STRING}")"
 search="$(echo -e "${search}" |sed -rn '1{s:\t: :g;s:\r::g;s:\\:\\\\:g;p}')"
@@ -28,7 +28,34 @@ if [ -n "$search" ]; then
 fi
 echo '</div><div id="MAIN">'
 
-[ -n "$new" ] && cat <<TaskEnd
+if [ -n "$info" -a -r "Tasks/$info" -a -r "Tasks/$info.meta" ]; then
+  datafile="Tasks/$info"
+  metafile="Tasks/$info.meta"
+  headline="$(sed -rn '/^headline=/{s:^[a-z]+=(.+)$:\1:p;q}' "$metafile")"
+  taskstatus="$(sed -rn '/^status=/{s:^[a-z]+=(.+)$:\1:p;q}' "$metafile")"
+  section="$(sed -rn '/^section=/{s:^[a-z]+=(.+)$:\1:p;q}' "$metafile")"
+  attendant="$(sed -rn '/^attendant=/{s:^[a-z]+=(.+)$:\1:p;q}' "$metafile")"
+  [ -z "$section" ] && section='(none)'
+  [ -z "$attendant" ] && attendant='(none)'
+  cat <<TasksEND
+    <div class="Task">
+      <div class="wikitext">
+       <h1>$headline</h1>
+       $(_wiki "$datafile")
+      </div>
+      <table><tr>
+       <td><b>Status</b><br>
+       $taskstatus</td>
+       <td><b>Section</b><br>
+       $section</td>
+       <td><b>Attendant</b><br>
+       $attendant</td>
+      </tr></table>
+    </div>
+TasksEND
+fi
+
+[ -z "$info" -a -n "$new" ] && cat <<TaskEnd
 <form class="Task" style="height:20em;" method="post" action="write/taskmeta.cgi" accept-charset="UTF-8">
   <h1>$new</h1>
   <input type="hidden" name="headline" value="$new">
@@ -50,12 +77,14 @@ echo '</div><div id="MAIN">'
 </form>
 TaskEnd
 
-[ -z "$new" ] && stat -c '' Tasks/<0000000000-9999999999>_<000-999>.meta && for each in Tasks/<0000000000-9999999999>_<000-999>.meta(.om); do
+[ -z "$info" -a -z "$new" ] && stat -c '' Tasks/<0000000000-9999999999>_<000-999>.meta && for each in Tasks/<0000000000-9999999999>_<000-999>.meta(.om); do
   info="$(basename "$each" |sed 's:.meta$::')"
   headline="$(sed -rn '/^headline=/{s:^[a-z]+=(.+)$:\1:p;q}' "$each")"
   taskstatus="$(sed -rn '/^status=/{s:^[a-z]+=(.+)$:\1:p;q}' "$each")"
   section="$(sed -rn '/^section=/{s:^[a-z]+=(.+)$:\1:p;q}' "$each")"
   attendant="$(sed -rn '/^attendant=/{s:^[a-z]+=(.+)$:\1:p;q}' "$each")"
+  [ -z "$section" ] && section='(none)'
+  [ -z "$attendant" ] && attendant='(none)'
   cat <<TasksEND
    <div class="Task">
      <a href="${SCRIPTNAME}?p=Tasks&amp;i=${info}"><b>$headline</b></a><br>