You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by ru...@apache.org on 2018/03/17 15:17:36 UTC

[whimsy] branch master updated: dewonkify

This is an automated email from the ASF dual-hosted git repository.

rubys pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new dc64b4c  dewonkify
dc64b4c is described below

commit dc64b4c29d26b48ec6bbd18dea9dfc6b69b6ced6
Author: Sam Ruby <ru...@intertwingly.net>
AuthorDate: Sat Mar 17 11:17:11 2018 -0400

    dewonkify
---
 www/board/agenda/views/actions/financials.json.rb | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/www/board/agenda/views/actions/financials.json.rb b/www/board/agenda/views/actions/financials.json.rb
index ea4f6c6..61cd97a 100644
--- a/www/board/agenda/views/actions/financials.json.rb
+++ b/www/board/agenda/views/actions/financials.json.rb
@@ -49,17 +49,25 @@ worksheet['Board Summary'].each do |row|
   rows << data
 end
 
-# delete first two rows
-rows.shift(2)
+# delete front and back matter
+rows.shift until rows[0][0].start_with? 'Current Balances'
+rows.pop until rows.last[0].start_with? 'Net Income'
 
-# move headings from second to seventh row
 headings = rows.delete_at(1)
+
+# adjust spacing of current balances
+blank = rows.index {|row| row.join.strip == ''}
+rows[1..blank].each do |row|
+  row[0] = row[0].ljust(35)
+end
+
+# move headings from second to seventh row
 headings[2] = headings[6] = 'Budget'
 1.upto(7) do |i|
   headings[i] = headings[i].strftime("%b-%y") if DateTime === headings[i]
   headings[i] = headings[i].rjust(12) if headings[i]
 end
-rows.insert(6, headings)
+rows.insert(blank+1, headings)
 
 # delete empty rows
 rows.pop while rows[-1].length == 1 and rows[-1][0].strip == ''
@@ -71,7 +79,7 @@ rows.each do |row|
 end
 
 # drop current balances
-rows.shift(5)
+rows.shift(6)
 
 # print out YTD totals
 rows.each do |row|

-- 
To stop receiving notification emails like this one, please contact
rubys@apache.org.