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: _whimsy_body allows images in related, for example for incubator logo
Date Sun, 04 Jun 2017 15:35:27 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  6f6ac70   _whimsy_body allows images in related, for example for incubator logo
6f6ac70 is described below

commit 6f6ac70f146e18fe851d030acf3702ee1f169008
Author: Shane Curcuru <asf@shanecurcuru.org>
AuthorDate: Sun Jun 4 11:35:22 2017 -0400

    _whimsy_body allows images in related, for example for incubator logo
---
 lib/whimsy/asf/themes.rb | 54 ++++++++++++++++++++++++++++++++++++++++++++++++
 www/test/test.cgi        |  3 ++-
 2 files changed, 56 insertions(+), 1 deletion(-)

diff --git a/lib/whimsy/asf/themes.rb b/lib/whimsy/asf/themes.rb
index cf7d09a..5986d11 100644
--- a/lib/whimsy/asf/themes.rb
+++ b/lib/whimsy/asf/themes.rb
@@ -216,4 +216,58 @@ class Wunderbar::HtmlMarkup
       _whimsy_foot
     end    
   end
+  # Emit complete bootstrap theme, with related links, and helpblock of intro text
+  def _whimsy_body(title: 'MOAR WHIMSY!', subtitle: 'About This Script', related: {}, helpblock:
nil)
+    _whimsy_nav
+    _div.content.container_fluid do
+      _div.row do
+        _div.col_sm_12 do
+          _h1 title
+        end
+      end
+      _div.row do
+        _div.col_md_8 do
+          _whimsy_panel subtitle do
+            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
+          _whimsy_panel "More Whimsy", style: "panel-info" do
+            _ul list_style_position: 'inside' do
+              if related
+                related.each do |url, desc|
+                  if url =~ /.*\.(png|jpg|svg|gif)\z/i
+                    # Extension: allow images, style to align with bullets
+                    _li.list_unstyled do
+                      _img alt: desc, src: url, height: '60px', style: 'margin-left: -20px;
padding: 2px 0px;'
+                    end
+                  else
+                    _li do
+                      _a desc, href: url
+                    end
+                  end
+                end
+              else
+                _li do
+                  _a 'Whimsy Source Code', href: 'https://github.com/apache/whimsy/'
+                end
+              end
+            end
+          end
+        end
+      end      
+      _div.row do
+        _div.col_sm_12 do
+          yield
+        end
+      end
+      _whimsy_foot
+    end    
+  end
 end
\ No newline at end of file
diff --git a/www/test/test.cgi b/www/test/test.cgi
index 9c43227..d0468fa 100755
--- a/www/test/test.cgi
+++ b/www/test/test.cgi
@@ -9,10 +9,11 @@ require 'wunderbar/bootstrap'
 
 _html do
   _body? do
-    _whimsy_body2(
+    _whimsy_body(
       title: PAGETITLE, 
       related: {
         "https://whimsy.apache.org/committers/tools" => "Whimsy Tool Listing",
+        "https://incubator.apache.org/images/incubator_feather_egg_logo_sm.png" => "Incubator
Logo",
         "https://community.apache.org/" => "Get Community Help",
         "https://github.com/apache/whimsy/" => "Read The Whimsy Code"
       },

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

Mime
View raw message