whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From curc...@apache.org
Subject [whimsy] branch master updated: Fixup _whimsy_body2 API suggested by @rubys
Date Sat, 27 May 2017 01:04:06 GMT
This is an automated email from the ASF dual-hosted git repository.

curcuru 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  63ccecd   Fixup _whimsy_body2 API suggested by @rubys
63ccecd is described below

commit 63ccecdb7b527d4f2f527655f2c23e0f1a2e7439
Author: Shane Curcuru <asf@shanecurcuru.org>
AuthorDate: Fri May 26 21:04:01 2017 -0400

    Fixup _whimsy_body2 API suggested by @rubys
---
 lib/whimsy/asf/themes.rb | 11 +++++++++--
 www/committers/tools.cgi |  5 +++--
 www/test/test.cgi        |  8 ++++----
 3 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/lib/whimsy/asf/themes.rb b/lib/whimsy/asf/themes.rb
index 6a56745..0701c82 100644
--- a/lib/whimsy/asf/themes.rb
+++ b/lib/whimsy/asf/themes.rb
@@ -187,7 +187,8 @@ class Wunderbar::HtmlMarkup
     end
   end
 
-  def _whimsy_body2 title, related, helpblock
+  # Emit complete bootstrap theme, with related links, and helpblock of intro text
+  def _whimsy_body2(title: 'MOAR WHIMSY!', related: {}, helpblock: nil)
     _whimsy_nav
     _div.content.container_fluid do
       _div.row do
@@ -198,7 +199,13 @@ class Wunderbar::HtmlMarkup
       _div.row do
         _div.col_md_8 do
           _whimsy_panel "About This Script" do
-            helpblock.call
+            if helpblock
+              helpblock.call
+            else
+              # TODO: make this point to the specific cgi being run
+              _a 'See the code', href: 'https://github.com/apache/whimsy/'
+            end
+
           end
         end
         _div.col_md_4 do
diff --git a/www/committers/tools.cgi b/www/committers/tools.cgi
index ff109e4..01961ff 100755
--- a/www/committers/tools.cgi
+++ b/www/committers/tools.cgi
@@ -11,12 +11,13 @@ require '../../tools/wwwdocs.rb'
 _html do
   _body? do
     _whimsy_body2(
-      PAGETITLE, {
+      title: PAGETITLE, 
+      related: {
         "https://projects.apache.org/" => "Apache Project Listing",
         "https://reference.apache.org/" => "Infra Reference Pages",
         "https://github.com/apache/whimsy/blob/master/www/committers/tools.cgi" => "See
This Code"
       },
-      -> {
+      helpblock: -> {
         _ 'This page shows a '
         _em 'partial'
         _ ' listing of tools that Whimsy provides. If you find this useful, please email
dev@whimsical!'
diff --git a/www/test/test.cgi b/www/test/test.cgi
index 9fec2fd..9c43227 100755
--- a/www/test/test.cgi
+++ b/www/test/test.cgi
@@ -10,12 +10,13 @@ require 'wunderbar/bootstrap'
 _html do
   _body? do
     _whimsy_body2(
-      "Sample Whimsy Theme", {
-        "https://projects.apache.org/" => "Whimsy Tool Listing",
+      title: PAGETITLE, 
+      related: {
+        "https://whimsy.apache.org/committers/tools" => "Whimsy Tool Listing",
         "https://community.apache.org/" => "Get Community Help",
         "https://github.com/apache/whimsy/" => "Read The Whimsy Code"
       },
-      -> {
+      helpblock: -> {
         _p "This www/test/test.cgi script shows a proposed new way to write whimsy tools."
         _p "Using lib/whimsy/theme and _whimsy_body2 means users have a consistent UI for
different tools, 
         and means that simple descriptions or help documentation are included at the start
of each tool."
@@ -26,7 +27,6 @@ _html do
         _p "This is where your code would output data or a form or whatever!"
         _p "All headers/footers and nicely wrapping a row is handled by themes.rb"
       end
-      
     end
   end
 end

-- 
To stop receiving notification emails like this one, please contact
['"commits@whimsical.apache.org" <commits@whimsical.apache.org>'].

Mime
View raw message