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 2019/05/04 21:05:53 UTC

[whimsy] branch master updated (c9e7556 -> 47591ab)

This is an automated email from the ASF dual-hosted git repository.

curcuru pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git.


    from c9e7556  Move button to 1st column
     new 571ebda  Add _whimsy_accordion_item
     new 1bcae59  Use _whimsy_accordion_item with better style
     new 47591ab  Merge branch 'master' of https://github.com/apache/whimsy

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 lib/whimsy/asf/themes.rb | 30 +++++++++++++++++++++++++++-
 www/members/mentors.cgi  | 52 +++++++++++++++++++-----------------------------
 2 files changed, 49 insertions(+), 33 deletions(-)


[whimsy] 02/03: Use _whimsy_accordion_item with better style

Posted by cu...@apache.org.
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

commit 1bcae598d6f6c4f0d1b308a991111200b68be09a
Author: Shane Curcuru <as...@shanecurcuru.org>
AuthorDate: Sat May 4 17:01:56 2019 -0400

    Use _whimsy_accordion_item with better style
---
 www/members/mentors.cgi | 52 +++++++++++++++++++------------------------------
 1 file changed, 20 insertions(+), 32 deletions(-)

diff --git a/www/members/mentors.cgi b/www/members/mentors.cgi
index eca438f..27f2786 100755
--- a/www/members/mentors.cgi
+++ b/www/members/mentors.cgi
@@ -77,42 +77,30 @@ _html do
     ) do
       _div.panel_group id: MENTORS_LIST, role: "tablist", aria_multiselectable: "true" do
         mentors.each_with_index do |(apacheid, mentor), n| # TODO Should we randomize the default listing?
-          _div!.panel.panel_default  id: apacheid do
-            _div!.panel_heading role: "tab", id: "#{MENTORS_LIST}h#{n}" do
-              _h4!.panel_title do
-                _a!.collapsed role: "button", data_toggle: "collapse",  aria_expanded: "false", data_parent: "##{MENTORS_LIST}", href: "##{MENTORS_LIST}c#{n}", aria_controls: "#{MENTORS_LIST}c#{n}" do
-                  _ "#{mentor[MentorFormat::PUBLICNAME]}  (#{apacheid})  Timezone: #{mentor[MentorFormat::TIMEZONE]}  "
-                  _span.glyphicon.glyphicon_chevron_down id: "#{apacheid}-nav"
-                  mentor.delete(MentorFormat::PUBLICNAME) # So not re-displayed below
-                end
-              end
-            end
-            _div!.panel_collapse.collapse id: "#{MENTORS_LIST}c#{n}", role: "tabpanel", aria_labelledby: "#{MENTORS_LIST}h#{n}" do
-              _div!.panel_body do
-                _table.table.table_hover do
-                  _tbody do
-                    mentor.each do |k, v|
-                      _tr do
-                        _td!.text_right do
-                          _span.text_primary uimap.has_key?(k) ? "#{uimap[k][0]}" : "#{k}"
-                        end
-                        _td!.text_left do
-                          v = v.join(', ') if v.kind_of?(Array)
-                          _markdown v
-                        end
-                      end
+          _whimsy_accordion_item(listid: MENTORS_LIST, itemid: apacheid, itemtitle: "#{mentor[MentorFormat::PUBLICNAME]}  (#{apacheid})  Timezone: #{mentor[MentorFormat::TIMEZONE]}  ", n: n, itemclass: 'panel-primary') do
+            _table.table.table_hover do
+              _tbody do
+                mentor.delete(MentorFormat::PUBLICNAME) # So not re-displayed again
+                mentor.each do |k, v|
+                  _tr do
+                    _td!.text_right do
+                      _span.text_primary uimap.has_key?(k) ? "#{uimap[k][0]}" : "#{k}"
                     end
-                    _tr do
-                      _td!.text_right do
-                        _ 'ASF Projects/Podlings Involved In'
-                      end
-                      _td!.text_left do
-                        # TODO: instead of link to roster, this could read and display here
-                        _a "#{MentorFormat::ROSTER}#{apacheid}", href: "#{MentorFormat::ROSTER}#{apacheid}"
-                      end
+                    _td!.text_left do
+                      v = v.join(', ') if v.kind_of?(Array)
+                      _markdown v
                     end
                   end
                 end
+                _tr do
+                  _td!.text_right do
+                    _ 'ASF Projects/Podlings Involved In'
+                  end
+                  _td!.text_left do
+                    # TODO: instead of link to roster, this could read and display here
+                    _a "#{MentorFormat::ROSTER}#{apacheid}", href: "#{MentorFormat::ROSTER}#{apacheid}"
+                  end
+                end
               end
             end
           end


[whimsy] 03/03: Merge branch 'master' of https://github.com/apache/whimsy

Posted by cu...@apache.org.
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

commit 47591ab74ac244b04950f9211054ffe4361a53b6
Merge: 1bcae59 c9e7556
Author: Shane Curcuru <as...@shanecurcuru.org>
AuthorDate: Sat May 4 17:05:42 2019 -0400

    Merge branch 'master' of https://github.com/apache/whimsy

 www/members/mentors.cgi | 27 ++++++++++++++++++++-------
 1 file changed, 20 insertions(+), 7 deletions(-)

diff --cc www/members/mentors.cgi
index 27f2786,f24d3aa..9e1fd86
--- a/www/members/mentors.cgi
+++ b/www/members/mentors.cgi
@@@ -77,18 -88,41 +88,20 @@@ _html d
      ) do
        _div.panel_group id: MENTORS_LIST, role: "tablist", aria_multiselectable: "true" do
          mentors.each_with_index do |(apacheid, mentor), n| # TODO Should we randomize the default listing?
-           _whimsy_accordion_item(listid: MENTORS_LIST, itemid: apacheid, itemtitle: "#{mentor[MentorFormat::PUBLICNAME]}  (#{apacheid})  Timezone: #{mentor[MentorFormat::TIMEZONE]}  ", n: n, itemclass: 'panel-primary') do
+           timezone = mentor[MentorFormat::TIMEZONE]
+           offset = TZInfo::Timezone.get(timezone).strftime("%:z")
 -          _div!.panel.panel_default  id: apacheid do
 -            _div!.panel_heading role: "tab", id: "#{MENTORS_LIST}h#{n}" do
 -              _h4!.panel_title do
 -                _a!.collapsed role: "button", data_toggle: "collapse",  aria_expanded: "false", data_parent: "##{MENTORS_LIST}", href: "##{MENTORS_LIST}c#{n}", aria_controls: "#{MENTORS_LIST}c#{n}" do
 -                  _ "#{mentor[MentorFormat::PUBLICNAME]}  (#{apacheid})  Timezone: #{timezone} (#{offset}) "
 -                  _span.glyphicon.glyphicon_chevron_down id: "#{apacheid}-nav"
 -                  mentor.delete(MentorFormat::PUBLICNAME) # So not re-displayed below
 -                end
 -              end
 -            end
 -            _div!.panel_collapse.collapse id: "#{MENTORS_LIST}c#{n}", role: "tabpanel", aria_labelledby: "#{MENTORS_LIST}h#{n}" do
 -              _div!.panel_body do
 -                _table.table.table_hover do
 -                  _tbody do
 -                    mentor.each do |k, v|
 -                      _tr do
 -                        _td!.text_right do
 -                          _span.text_primary uimap.has_key?(k) ? "#{uimap[k][0]}" : "#{k}"
 -                        end
 -                        _td!.text_left do
 -                          v = v.join(', ') if v.kind_of?(Array)
 -                          _markdown v
 -                        end
 -                      end
++          _whimsy_accordion_item(listid: MENTORS_LIST, itemid: apacheid, itemtitle: "#{mentor[MentorFormat::PUBLICNAME]}  (#{apacheid})  Timezone: #{timezone} (#{offset})  ", n: n, itemclass: 'panel-primary') do
 +            _table.table.table_hover do
 +              _tbody do
 +                mentor.delete(MentorFormat::PUBLICNAME) # So not re-displayed again
 +                mentor.each do |k, v|
 +                  _tr do
 +                    _td!.text_right do
 +                      _span.text_primary uimap.has_key?(k) ? "#{uimap[k][0]}" : "#{k}"
                      end
 -                    _tr do
 -                      _td!.text_right do
 -                        _ 'ASF Projects/Podlings Involved In'
 -                      end
 -                      _td!.text_left do
 -                        # TODO: instead of link to roster, this could read and display here
 -                        _a "#{MentorFormat::ROSTER}#{apacheid}", href: "#{MentorFormat::ROSTER}#{apacheid}"
 -                      end
 +                    _td!.text_left do
 +                      v = v.join(', ') if v.kind_of?(Array)
 +                      _markdown v
                      end
                    end
                  end


[whimsy] 01/03: Add _whimsy_accordion_item

Posted by cu...@apache.org.
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

commit 571ebda401e7fc6b13875cd4ce77686fe9a968b1
Author: Shane Curcuru <as...@shanecurcuru.org>
AuthorDate: Sat May 4 17:01:21 2019 -0400

    Add _whimsy_accordion_item
---
 lib/whimsy/asf/themes.rb | 30 +++++++++++++++++++++++++++++-
 1 file changed, 29 insertions(+), 1 deletion(-)

diff --git a/lib/whimsy/asf/themes.rb b/lib/whimsy/asf/themes.rb
index 2433bab..c3aef09 100644
--- a/lib/whimsy/asf/themes.rb
+++ b/lib/whimsy/asf/themes.rb
@@ -195,6 +195,34 @@ class Wunderbar::HtmlMarkup
         end
       end
       _whimsy_foot
-    end    
+    end
   end
+  
+  # Emit wrapper panels for a single tablist accordion item
+  # @param listid of the parent _div.panel_group role: "tablist"
+  # @param itemid of this specific item
+  # @param itemtitle to display in the header panel
+  # @param n unique number of this item (for nav links)
+  # @param itemclass optional panel-success or similar styling
+  def _whimsy_accordion_item(listid: 'accordion', itemid: nil, itemtitle: '', n: 0, itemclass: nil)
+    raise ArgumentError.new("itemid must not be nil") if not itemid
+    args = {id: itemid}
+    args[:class] = itemclass if itemclass
+    _div!.panel.panel_default args do
+      _div!.panel_heading role: "tab", id: "#{listid}h#{n}" do
+        _h4!.panel_title do
+          _a!.collapsed role: "button", data_toggle: "collapse",  aria_expanded: "false", data_parent: "##{listid}", href: "##{listid}c#{n}", aria_controls: "#{listid}c#{n}" do
+            _ "#{itemtitle} "
+            _span.glyphicon.glyphicon_chevron_down id: "#{itemid}-nav"
+          end
+        end
+      end
+      _div!.panel_collapse.collapse id: "#{listid}c#{n}", role: "tabpanel", aria_labelledby: "#{listid}h#{n}" do
+        _div!.panel_body do
+          yield
+        end
+      end
+    end
+  end
+  
 end