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 5784edf  Clean up posting of new discussion items
5784edf is described below

commit 5784edf25b3f850c7c8b15751e64c42eb8be5889
Author: Sam Ruby <ru...@intertwingly.net>
AuthorDate: Sat Apr 7 17:43:26 2018 -0400

    Clean up posting of new discussion items
---
 www/board/agenda/views/actions/post.json.rb | 14 ++++++++++++--
 www/board/agenda/views/buttons/post.js.rb   |  6 ++++--
 www/board/agenda/views/router.js.rb         | 17 +++++++++++++----
 3 files changed, 29 insertions(+), 8 deletions(-)

diff --git a/www/board/agenda/views/actions/post.json.rb 
b/www/board/agenda/views/actions/post.json.rb
index 4d53bca..6f58c47 100644
--- a/www/board/agenda/views/actions/post.json.rb
+++ b/www/board/agenda/views/actions/post.json.rb
@@ -5,6 +5,8 @@
 # special case for new special orders
 if @attach == '7?'
   @message = "Post Special Order 7X: #{@title}"
+elsif @attach == '8?'
+  @message = "Post Discussion Item 8X: #{@title}"
 end
 
 Agenda.update(@agenda, @message) do |agenda|
@@ -41,14 +43,22 @@ Agenda.update(@agenda, @message) do |agenda|
   elsif @attach == '8?'
     # new discussion item
 
+    # adjust indentation
+    indent = @report.scan(/^ +/).min
+    @report.gsub!(/^#{indent}/, '') if indent
+    @report.gsub!(/^(\S)/, '       \1')
+
     # add item letter to title
     discussion = agenda[/ 8\. Discussion Items.*\n 9\./m]
     items = discussion.scan(/^    ([A-Z]+)\./).flatten
     item = items.empty? ? 'A' : items.sort.last.succ
-    title = "    #{order}. #{@title}\n\n"
+    title = "    #{item}. #{@title}\n\n"
+
+    # update the commit message that will be used
+    @message.sub! "8X", "8#{item}"
 
     # insert into agenda
-    agenda[/\n() 9\. Action Items/, 1] = "#{title}#{@report}\n\n"
+    agenda[/\n() 9\. .*Action Items/, 1] = "#{title}#{@report}\n\n"
 
   elsif @attach.start_with? '+'
     pmc_reports = parsed.select {|section| section[:attach] =~ /^[A-Z]/}
diff --git a/www/board/agenda/views/buttons/post.js.rb 
b/www/board/agenda/views/buttons/post.js.rb
index cca30d4..399584f 100644
--- a/www/board/agenda/views/buttons/post.js.rb
+++ b/www/board/agenda/views/buttons/post.js.rb
@@ -167,7 +167,7 @@ class Post < Vue
         end
 
         #input field: commit_message
-        if @header != 'Add Resolution'
+        if @header != 'Add Resolution' and @header != 'Add Discussion Item'
           _input.post_report_message! label: 'commit message', 
             disabled: @disabled, value: @message
         end
@@ -258,7 +258,7 @@ class Post < Vue
     when 'edit resolution'
       @header = 'Edit Resolution'
       @label = 'resolution'
-      @message = "Edit #{@@item.title} Resolution"
+      @title = ''
 
     when 'post item'
       @header = 'Add Discussion Item'
@@ -296,6 +296,8 @@ class Post < Vue
 
     if @header == 'Add Resolution' or @@item.attach =~ /^[47]/
       @indent = '        '
+    elsif @header == 'Add Disussion Item' 
+      @indent = '        '
     elsif @@item.attach == '8.'
       @indent = '    '
     else
diff --git a/www/board/agenda/views/router.js.rb 
b/www/board/agenda/views/router.js.rb
index e3a475d..dcbedb8 100644
--- a/www/board/agenda/views/router.js.rb
+++ b/www/board/agenda/views/router.js.rb
@@ -94,6 +94,19 @@ class Router
     elsif path =~ %r{^cache/}
       item = {view: CachePage}
 
+    elsif path == 'Discussion-Items'
+
+      Agenda.index.each do |i|
+        if i.attach =~ /^8[.A-Z]/
+          item = i
+          break
+        end
+      end
+
+      if Agenda.date =~ /^2018-02/
+        item.next = {title: 'FY23 Budget Worksheet', href: 'fy23'}
+      end
+
     elsif path == 'fy23'
       item = {view: FY23, title: 'FY23 Budget Worksheet', color: 'available',
         prev: {title: 'Discussion Items', href: 'Discussion-Items'},
@@ -101,10 +114,6 @@ class Router
 
     else
       item = Agenda.find(path)
-
-      if path == 'Discussion-Items' and Agenda.date =~ /^2018-02/
-        item.next = {title: 'FY23 Budget Worksheet', href: 'fy23'}
-      end
     end
 
     # bail unless an item was found

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

Reply via email to