tools: Get the donation bar ready for 2015
authorWerner Koch <wk@gnupg.org>
Tue, 30 Dec 2014 16:19:08 +0000 (17:19 +0100)
committerWerner Koch <wk@gnupg.org>
Tue, 30 Dec 2014 16:19:08 +0000 (17:19 +0100)
The current campaign started in December and thus the bar needs to
show the donations from December plus those coming in in 2015.

tools/mkkudos.sh
web/donate/index.org

index 9ab6e26..ee786f1 100755 (executable)
@@ -75,13 +75,20 @@ monyear=$(echo "$tmp" | awk -F: 'BEGIN { m[1] = "January";
       m[6] = "June"; m[7] = "July"; m[8] = "August"; m[9] = "September";
       m[10] = "October"; m[11] = "November"; m[12] = "December"; }
       {printf "%s %d", m[$2] , $1}')
-euro=$(echo "$tmp" | awk -F: '{printf "%d &euro;", int($8 + 0.5)}')
+euromo=$(echo "$tmp" | awk -F: '{printf "%d &euro;", int($8 + 0.5)}')
 euroyr=$(echo "$tmp" | awk -F: '{printf "%d &euro;", int($10 + 0.5)}')
+euroyr_campaign=$(echo "$tmp" | awk -F: '{printf "%d", int($10 + 0.5)}')
 n=$(echo "$tmp" | awk -F: '{printf "%d", $7}')
 nyr=$(echo "$tmp" | awk -F: '{printf "%d", $9}')
+
+# Campaign data
 goal="120000"
+tmp=$(grep '^2014:12:' "$donations")
+euro=$(echo "$tmp" | awk -F: '{printf "%d", int($8 + 0.5)}')
+euro=$(($euro + $euroyr_campaign))
 percent=$(echo "$euro:$goal" | awk -F: '{printf "%d",(int($1)*100)/int($2)}')
 
+
 for file in "$htdocs/donate/"kudos-????.html "$htdocs/donate/"kudos.html \
             "$htdocs/donate/"index.html \
             "$htdocs/"index.html
@@ -99,6 +106,7 @@ for file in "$htdocs/donate/"kudos-????.html "$htdocs/donate/"kudos.html \
    [ -f "$file.tmp" ] && rm "$file.tmp"
    awk -F: -v year=$year -v donors="$donors" \
            -v monyear="$monyear" -v euro="$euro" -v euroyr="$euroyr" \
+           -v euromo="$euromo" \
            -v n="$n" -v nyr="$nyr" -v goal="$goal" -v percent="$percent" \
             <"$file"  >"$file.tmp" '
      /<!--BEGIN-DONATIONS-->/ {indon=1; print; insert("") }
@@ -112,7 +120,7 @@ for file in "$htdocs/donate/"kudos-????.html "$htdocs/donate/"kudos.html \
            next
      }
      /<!--INSERT-MONTH-EURO-->/ {
-           printf "<!--INSERT-MONTH-EURO--> %s\n", euro;
+           printf "<!--INSERT-MONTH-EURO--> %s\n", euromo;
            next
      }
      /<!--INSERT-MONTH-N-->/ {
@@ -128,7 +136,7 @@ for file in "$htdocs/donate/"kudos-????.html "$htdocs/donate/"kudos.html \
            next
      }
      /<!--INSERT-PROGRESS-LEFT-->/ {
-           printf "<!--INSERT-PROGRESS-LEFT-->%s\n",
+           printf "<!--INSERT-PROGRESS-LEFT-->%s &euro;\n",
                   euro;
            next
      }
index f4cc20b..5888d95 100644 (file)
   to help with development and maintenance please consider to make a
   donation.
 
-** Recent donors
-
-#+HTML: <div id="tagcloudlist"><ul>
-#+HTML: <!--BEGIN-SOME-DONATIONS-->
-#+HTML: <!--END-SOME-DONATIONS-->
-#+HTML: <li><a href="/donate/kudos.html">(all)</a></li>
-#+HTML: </ul><p class="doclear"> </p></div>
-
-
 ** Ways to donate
 
   Paying using a credit card is currently our preferred choice.  If
    </table>
   </form>
 #+END_HTML
+
+** Recent donors
+
+#+HTML: <div id="tagcloudlist"><ul>
+#+HTML: <!--BEGIN-SOME-DONATIONS-->
+#+HTML: <!--END-SOME-DONATIONS-->
+#+HTML: <li><a href="/donate/kudos.html">(all)</a></li>
+#+HTML: </ul><p class="doclear"> </p></div>
+
+# eof #