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: Display grouped by topics
Date Wed, 24 May 2017 21:06:15 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  fecfd97   Display grouped by topics
fecfd97 is described below

commit fecfd9768368c7a43bdb041b982635f079b5617e
Author: Shane Curcuru <asf@shanecurcuru.org>
AuthorDate: Wed May 24 17:06:08 2017 -0400

    Display grouped by topics
---
 tools/comdevtalks.rb |  9 ++++----
 www/events/talks.cgi | 63 +++++++++++++++++++++++++++++++++++++---------------
 2 files changed, 49 insertions(+), 23 deletions(-)

diff --git a/tools/comdevtalks.rb b/tools/comdevtalks.rb
index 36b7594..cd10fbf 100644
--- a/tools/comdevtalks.rb
+++ b/tools/comdevtalks.rb
@@ -1,14 +1,13 @@
 #!/usr/bin/env ruby
 <<~HEREDOC
 ComDev Talks: Parse ComDev listings of Apache-related talks
-
-Currently requires local checkout; future use for displaying talks by category
 HEREDOC
 require 'yaml'
 require 'json'
 
 COMDEVTALKS = 'https://svn.apache.org/repos/asf/comdev/site/trunk/content/speakers/talks/'
# *.yaml
 COMDEVDIR = '/Users/curcuru/src/comdev/site/trunk/content/speakers/talks/' # *.yaml
+SKIPFILE = 'README.yaml'
 
 # Parse all talks and submitters
 def parse_talks(dir = "#{COMDEVDIR}")
@@ -18,7 +17,7 @@ def parse_talks(dir = "#{COMDEVDIR}")
     begin
       if fname =~ /_/
         talks["#{File.basename(fname, ".*")}"] = YAML.load(File.read(fname.untaint))
-      else
+      elsif fname !~ /SKIPFILE/
         submitters["#{File.basename(fname, ".*")}"] = YAML.load(File.read(fname.untaint))
       end
     rescue Exception => e
@@ -34,8 +33,8 @@ end
 def get_talks_submitters()
   # return parse_talks
   # HACK static data until we have generated public/ or other format
-  talks = {"Apache_Way_2017"=>{"title"=>"Apache Way: Effective Open Source Project
Management", "teaser"=>"Learn how to manage long-lived diverse open source project communities
by following the behaviors of the Apache Way.", "submitter"=>"curcuru", "speakers"=>["curcuru"],
"abstract"=>"The \"Apache Way\" is the process by which Apache Software Foundation projects
are managed. It has evolved 18 years and has produced over 170 highly successful open source
Apache projects. But what is it  [...]
-
+  talks = {"Apache_Way_2017"=>{"title"=>"Apache Way: Effective Open Source Project
Management", "teaser"=>"Learn how to manage long-lived diverse open source project communities
by following the behaviors of the Apache Way.", "submitter"=>"curcuru", "speakers"=>["curcuru"],
"abstract"=>"The \"Apache Way\" is the process by which Apache Software Foundation projects
are managed. It has evolved 18 years and has produced over 170 highly successful open source
Apache projects. But what is it  [...]
+  
   submitters = {"curcuru"=>{"name"=>"Shane Curcuru", "website"=>"http://communityovercode.com/",
"twitter"=>"shanecurcuru", "facebook"=>nil, "bio"=>"Shane has been involved at the
Apache Software Foundation (ASF) since 1999, and serves as Director and VP of Brand Management,
setting trademark policies and helping all 200+ Apache projects implement and defend their
brands.\n\nOtherwise, Shane is: a father and husband, a friend, a geek, a Member of the ASF,
a baker, and a punny guy.  Oh, a [...]
   
   return talks, submitters
diff --git a/www/events/talks.cgi b/www/events/talks.cgi
index 81087f2..6d2eace 100755
--- a/www/events/talks.cgi
+++ b/www/events/talks.cgi
@@ -11,20 +11,29 @@ require "../../tools/comdevtalks.rb"
 
 talks = {}
 submitters = {}
+TOPICMAP = {
+  'apacheway' => "The Apache Way of Project Governance And Behaviors",
+  'community' => "Talks On Community Health And Maintenance",
+  'developers' => "Focus On How Developers Work In Apache Projects",
+  'incubator' => "About The Apache Incubator And Joining The ASF",
+  'contributors' => "Focus On Non-Technical Project Contributors"
+}
 
 def _talk(talk, submitters, parent, n)
   _div.panel.panel_default  id: talk[0] do
-    talk = talk[1] # originally an array of [Apache_Way_2017, {} ]
-    _div.panel_heading role: "tab", id: "urh#{n}" do
-      _h4.panel_title do
-        _a.collapsed role: "button", data_toggle: "collapse",  aria_expanded: "false", data_parent:
"##{parent}", href: "#urc#{n}", aria_controls: "urc#{n}" do
+    talk = talk[1] # originally an array of ['Apache_Way_2017', {...} ]
+    _div.panel_heading role: "tab", id: "#{parent}#{n}" do
+      _h3.panel_title do
+        _a.collapsed role: "button", data_toggle: "collapse",  aria_expanded: "false", data_parent:
"##{parent}", href: "##{parent}-c#{n}", aria_controls: "#{parent}-c#{n}" do
           _ talk['title']
+          _ ' '
+          _span.caret
         end
         _br
         _span.small talk['teaser']
       end
     end
-    _div.panel_collapse.collapse id: "urc#{n}", role: "tabpanel", aria_labelledby: "urh#{n}"
do
+    _div.panel_collapse.collapse id: "#{parent}-c#{n}", role: "tabpanel", aria_labelledby:
"#{parent}#{n}" do
       # TODO fix to display both submitter and/or speaker(s)
       submitter = submitters[talk['submitter']]
       submitter = talk['submitter'] unless submitter
@@ -32,7 +41,7 @@ def _talk(talk, submitters, parent, n)
         _thead do
           _tr do
             _th do
-              _ "#{submitter['name']}" #TODO lookup name, bio
+              _ "#{submitter['name']}"
             end
           end
         end
@@ -46,7 +55,7 @@ def _talk(talk, submitters, parent, n)
             _tr do
               _td do
                 _a! href: "#{talk['slides']}" do
-                  _span!.glyphicon class: 'glyphicon_file'
+                  _span!.glyphicon class: 'glyphicon-file'
                   _! ' Session Slides'
                 end
               end
@@ -56,16 +65,21 @@ def _talk(talk, submitters, parent, n)
             _tr do
               _td do
                 _a! href: "#{talk['video']}" do
-                  _span!.glyphicon class: 'glyphicon_facetime_video'
+                  _span!.glyphicon class: 'glyphicon-facetime-video'
                   _! ' Watch The Video'
                 end
               end
             end
           end
-          _tr do
-            _td do
-              _h4 "Speaker Bio"
-              _ "#{submitter['bio']}"
+          if submitter['bio']
+            _tr do
+              _td do
+                _h4 do
+                  _span.glyphicon class: 'glyphicon-user'
+                  _ ' Speaker Bio'
+                end
+                _ "#{submitter['bio']}"
+              end
             end
           end
         end
@@ -82,12 +96,25 @@ _html do
       _p do
         _ 'DRAFT listing of curated Apache non-technical talks - about the Apache Way, licenses,
brands, governance, and ASF history.'
         _a 'See the source data.', href: COMDEVTALKS
-      end 
-      
-      parent = "talkz" # TODO: split up by category
-      _div.panel_group id: parent, role: "tablist", aria_multiselectable: "true" do
-        talks.each_with_index do |talk, num|
-          _talk(talk, submitters, parent, num)
+      end
+
+      alltalks = talks.group_by { |t| t[1]['topics'][0]}
+      _p do
+        _ 'All talks by topics: '
+        alltalks.keys.each do | topic |
+          _a "#{topic}", href: "##{topic}"
+          _ ' | ' unless topic == alltalks.keys.last
+        end
+      end
+      alltalks.each do | topic, all_by_cat |
+        _h2 do
+          _ "#{TOPICMAP[topic]} "
+          _span.small "(#{topic})"
+        end
+        _div.panel_group id: topic, role: "tablist", aria_multiselectable: "true" do
+          all_by_cat.each_with_index do |talk, num|
+            _talk(talk, submitters, topic, num)
+          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