You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by cu...@apache.org on 2017/04/11 02:00:28 UTC

[whimsy] branch master updated: Provide default header/footer for tools

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  d70fbe2   Provide default header/footer for tools
d70fbe2 is described below

commit d70fbe266101917bc041e7b64aa149f60955a2c1
Author: Shane Curcuru <as...@shanecurcuru.org>
AuthorDate: Mon Apr 10 22:00:23 2017 -0400

    Provide default header/footer for tools
---
 lib/whimsy/asf/themes.rb | 60 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 60 insertions(+)

diff --git a/lib/whimsy/asf/themes.rb b/lib/whimsy/asf/themes.rb
new file mode 100644
index 0000000..d744886
--- /dev/null
+++ b/lib/whimsy/asf/themes.rb
@@ -0,0 +1,60 @@
+require 'wunderbar'
+
+# Define common page features for whimsy tools using bootstrap styles
+class Wunderbar::HtmlMarkup
+  # Emit ASF style header with _h1 title and common links
+  def _whimsy_header title, style = :full
+    case style
+    when :mini
+      _div.header do
+        _h1 title
+      end
+    else
+      _div.header.container_fluid do
+        _ul class: 'nav nav-tabs' do
+          _li role: 'presentation' do
+            _a href: 'https://www.apache.org/' do
+              _img title: 'ASF Logo', alt: 'ASF Logo', width: 250, height: 101,
+                src: 'https://www.apache.org/foundation/press/kit/asf_logo_small.png'
+            end
+          end
+          _li role: 'presentation' do
+            _a href: '/' do
+              _img title: 'Whimsy logo', alt: 'Whimsy hat', src: 'https://whimsy.apache.org/whimsy.svg', height: 101 
+            end
+          end
+          _li role: 'presentation' do
+            _a 'Mailing list', href: 'https://lists.apache.org/list.html?dev@whimsical.apache.org'
+          end
+          _li role: 'presentation' do
+            _a 'About this site', href: '/technology'
+          end
+          _li role: 'presentation' do
+            _span.badge id: 'script-ok'
+          end
+        end
+        _h1 title
+      end
+    end
+  end
+  
+  # Emit ASF style footer with (optional) list of related links
+  def _whimsy_footer related
+    _div.footer.container_fluid do
+      _div.panel.panel_default do 
+        _div.panel_heading do
+          _h3.panel_title 'Related Apache Resources'
+        end
+        _div.panel_body do
+          _ul do
+            related.each do |url, desc|
+              _li do
+                _a desc, href: url
+              end
+            end
+          end
+        end
+      end
+    end
+  end
+end
\ No newline at end of file

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