]> git.plutz.net Git - confetti/commitdiff
stubs for email display
authorpaul <paul@plutz.net>
Wed, 12 Mar 2014 16:16:05 +0000 (16:16 +0000)
committerpaul <paul@plutz.net>
Wed, 12 Mar 2014 16:16:05 +0000 (16:16 +0000)
svn path=/trunk/; revision=42

pages/email.sh
templates/email.css.sh [new file with mode: 0644]
templates/email.html.sh [new file with mode: 0644]

index b37b62abda736d153aa8a9f7571dcbee20ff359f..f05b3e06feeced0ff359399154eab9bdbb063e6c 100755 (executable)
@@ -1,12 +1,31 @@
 #!/bin/sh
 
+[ -z "$_GET[\"order\"]" ] && _GET["order"]=DOW
+
+listcards() {
+  ls -1 ${_DATA}/vcard/*vcf 2>/dev/null |while read file; do
+    fn=$(sed -rn 's:^N(;.+)*\:([^;]*;){1} *([^;]*).*$:\3:p' "$file")
+    echo "$fn\t$file"
+  done |sort |sed -r 's:^.*\t(.*/)([^/]+)$:\2:'
+}
+
+listcourses() {
+  ls -1 ${_DATA}/ical/*ics |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 |sort |sed -r 's:^.*\t(.*/)([^/]+)$:\2:'
+}
+
 case "$1" in
   title)
-   echo "Email"
+    echo "Email"
   ;;
   css)
+    . ${_EXEC}/templates/email.css.sh
   ;;
   body)
+    . ${_EXEC}/templates/text_email.sh
+    . ${_EXEC}/templates/email.html.sh
   ;;
 esac
   
diff --git a/templates/email.css.sh b/templates/email.css.sh
new file mode 100644 (file)
index 0000000..006bd95
--- /dev/null
@@ -0,0 +1,143 @@
+cat <<EOF
+
+.filter {
+  display: block;
+  width: 128ex;
+  border-width: 1px;
+  border-style: solid;
+  border-radius: 4px 4px 0 0;
+  margin: .5em auto .25em auto;
+  padding: .25em 1ex .25em 1ex;
+  background: #EFF;
+}
+
+.filter > .label {
+  display: block;
+  font-weight: bold;
+  font-size: 1.2em;
+  border-style: none none solid none;
+  border-width: 1px;
+  margin: 0em 0ex .5em 0ex;
+  background: #EEF;
+}
+
+.filter .search {
+  margin: 0em 2ex .5em 2ex;
+}
+.filter .search .label {
+  display: inline-block;
+  width: 12ex;
+  font-weight: bold;
+  margin-top: .5em;
+}
+.filter .search input[type="radio"] {
+  margin-top: .5em;
+  margin-left: 1ex;
+}
+.filter .search button {
+  margin-top: .5em;
+}
+
+.filter .search input[type="text"] {
+  width: 124ex;
+}
+
+.newcard {
+  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;
+}
+
+.cardlist .card {
+  display: block;
+  width: 130ex;
+  border-style: solid;
+  border-width: 1px;
+  margin: .25em auto;
+  padding: 0;
+  overflow: auto;
+  background: #FFF;
+}
+
+.cardlist .card .section {
+  display: inline-block;
+  float:left;
+  width: 20ex;
+  margin: .125em .25ex .5ex .25ex;
+  padding: 0 .2em .2em .2em;
+  background: #EEE;
+}
+.cardlist .card .section a.attendance {
+  display: inline-block;
+  margin-right: 1ex;
+  word-wrap: break-word;
+}
+
+.cardlist .card .attendance {
+  width: 83.5ex;
+}
+.cardlist .card .attendance .check {
+  display: inline-block;
+  width: 27ex;
+}
+
+.cardlist .card .control {
+  float: right;
+  text-align: right;
+  margin-right: 0;
+  background: #EEF;
+}
+.cardlist .card .control .item {
+  color: #008;
+  margin-top: .2em;
+  margin-right: 1ex;
+}
+.cardlist .card .control a.item {
+  min-width: 10ex;
+  border-style: solid double solid solid;
+  border-width: 1px 3px 1px 1px;
+  border-color: #000;
+  padding: .1em 1ex;
+  background: #FFF;
+}
+.cardlist .card .control a.item:hover{
+  border-width: 1px 1px 1px 1px;
+}
+
+.cardlist .card .section .sectitle {
+  display: block;
+  font-weight: bold;
+  margin: .2em .2em .2em .2em;
+}
+
+.cardlist .card .section .item {
+  display: block;
+  max-width: 20ex;
+  word-wrap: break-word;
+}
+
+.cardlist .card .section textarea.NOTE {
+  min-height: 6em;
+}
+.cardlist .card .section textarea.ADR {
+  min-height: 4em;
+}
+
+.cardlist .card .section .PHOTO {
+  width: 20ex;
+  max-heigth: 30ex;
+}
+
+.cardlist .card .section .FN {
+  font-weight: bold;
+  font-size: 1.2em;
+}
+
+EOF
+
+# vi:set filetype=css:
diff --git a/templates/email.html.sh b/templates/email.html.sh
new file mode 100644 (file)
index 0000000..195742a
--- /dev/null
@@ -0,0 +1,43 @@
+
+cat <<EOF
+<div class="select">
+  <span class="label">$(l10n filter_label)</span>
+  <form class="search" action="/?action=select_mailing" method="POST">
+
+    <div class="selectlist">
+      <span class="label">$(l10n select_courses):</span>
+      <select name="courses" multiple="multiple">
+       $(listcourses |while read course; do
+         name="$(sed -rn 's:^SUMMARY(;.+)*\:(.*)\r$:\2:p' "$_DATA/ical/$course")"
+         echo '<option value="'$course'">'$name'</option>'
+       done)
+      </select>'
+    </div>
+
+    <div class="selectlist">
+      <span class="label">$(l10n select_attendees):</span>
+      <select name="courses" multiple="multiple">
+       $(listcards |while read card; do
+         n_last="$(  sed -rn 's:^N(;.+)*\:([^;]*;){0} *([^;]*).*$:\3:p' "$_DATA/vcard/$card")"
+         n_first="$( sed -rn 's:^N(;.+)*\:([^;]*;){1} *([^;]*).*$:\3:p' "$_DATA/vcard/$card")"
+         n_middle="$(sed -rn 's:^N(;.+)*\:([^;]*;){2} *([^;]*).*$:\3:p' "$_DATA/vcard/$card")"
+         n_pre="$(   sed -rn 's:^N(;.+)*\:([^;]*;){3} *([^;]*).*$:\3:p' "$_DATA/vcard/$card")"
+         n_post="$(  sed -rn 's:^N(;.+)*\:([^;]*;){4} *([^;]*).*$:\3:p' "$_DATA/vcard/$card")"
+         name="${n_pre} ${n_first} ${n_middle} ${n_last} ${n_post}"
+         echo '<option value="'$card'">'$name'</option>'
+       done)
+      </select>'
+    </div>
+
+    <button type="submit" name="choice" value="new_selection">$(l10n selection_apply)</button>
+    <button type="submit" name="choice" value="del_selection">$(l10n selection_clear)</button>
+  </form>
+</div>
+
+<div class="maillist">
+$(
+)
+</div>
+EOF
+
+# vi:set filetype=html: