whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ru...@apache.org
Subject [whimsy] branch master updated: prettify Action without Meeting agenda items
Date Sat, 01 Jun 2019 12:38:14 GMT
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 9c4a882  prettify Action without Meeting agenda items
9c4a882 is described below

commit 9c4a882318a92547e0a4d63298819ff9d4adb39f
Author: Sam Ruby <rubys@intertwingly.net>
AuthorDate: Sat Jun 1 08:37:33 2019 -0400

    prettify Action without Meeting agenda items
---
 www/board/agenda/views/models/agenda.js.rb |  2 +-
 www/board/agenda/views/pages/report.js.rb  | 12 +++++++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/www/board/agenda/views/models/agenda.js.rb b/www/board/agenda/views/models/agenda.js.rb
index a28898a..00bbc11 100644
--- a/www/board/agenda/views/models/agenda.js.rb
+++ b/www/board/agenda/views/models/agenda.js.rb
@@ -168,7 +168,7 @@ class Agenda
     elsif @attach =~ /^3\w$/
       if Server.drafts.include? @text[/board_minutes_\w+.txt/]
         return false
-      elsif Minutes.get(@title) == 'approved'
+      elsif Minutes.get(@title) == 'approved' or @title =~ /^Action/
         return false
       else
         return true
diff --git a/www/board/agenda/views/pages/report.js.rb b/www/board/agenda/views/pages/report.js.rb
index fa58e9d..751dcb5 100644
--- a/www/board/agenda/views/pages/report.js.rb
+++ b/www/board/agenda/views/pages/report.js.rb
@@ -231,7 +231,7 @@ class Report < Vue
     return text
   end
 
-  # link to board minutes
+  # link to board minutes and other attachments
   def linkMinutes(text)
     text.gsub! /board_minutes_(\d+)_\d+_\d+\.txt/ do |match, year|
       if Server.drafts.include? match
@@ -242,6 +242,16 @@ class Report < Vue
       "<a href='#{link}'>#{match}</a>"
     end
 
+    text.gsub! /Attachment (\w+)/ do |match, attach|
+      item = Agenda.index.find {|item| item.attach == attach}
+      if item
+        "<a href='#{item.title.gsub(' ', '-')}'>#{match}</a>" +
+        "<pre>#{item.text}</pre>"
+      else
+        match
+      end
+    end
+
     return text
   end
 


Mime
View raw message