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/28 12:22:12 UTC

[whimsy] branch master updated: Move to brand/list for public use

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  8f29933   Move to brand/list for public use
8f29933 is described below

commit 8f299334af42e63b8beebef591860a77f9c38d28
Author: Shane Curcuru <as...@shanecurcuru.org>
AuthorDate: Fri Apr 28 08:22:08 2017 -0400

    Move to brand/list for public use
---
 www/brand/assets/bootstrap-min.css         |  6 ++++
 www/brand/assets/bootstrap-min.js          |  7 +++++
 www/brand/assets/jquery-min.js             |  4 +++
 www/{test/trademark.cgi => brand/list.cgi} | 50 +++++++++++++++++++++++++++---
 www/test/trademark.cgi                     |  8 +++--
 5 files changed, 68 insertions(+), 7 deletions(-)

diff --git a/www/brand/assets/bootstrap-min.css b/www/brand/assets/bootstrap-min.css
new file mode 100644
index 0000000..4cf729e
--- /dev/null
+++ b/www/brand/assets/bootstrap-min.css
@@ -0,0 +1,6 @@
+/*!
+ * Bootstrap v3.3.6 (http://getbootstrap.com)
+ * Copyright 2011-2015 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ *//*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr [...]
+/*# sourceMappingURL=bootstrap.min.css.map */
\ No newline at end of file
diff --git a/www/brand/assets/bootstrap-min.js b/www/brand/assets/bootstrap-min.js
new file mode 100644
index 0000000..e79c065
--- /dev/null
+++ b/www/brand/assets/bootstrap-min.js
@@ -0,0 +1,7 @@
+/*!
+ * Bootstrap v3.3.6 (http://getbootstrap.com)
+ * Copyright 2011-2015 Twitter, Inc.
+ * Licensed under the MIT license
+ */
+if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1||b[0]>2)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 3")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:" [...]
+d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate.bs.scrollspy")},b.prototype.clear=function(){a(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var d=a.fn.scrollspy;a.fn.scrollspy=c,a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=d,this},a(window).on("load.bs.scrollspy.data-api",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);c.call(b,b.data()) [...]
\ No newline at end of file
diff --git a/www/brand/assets/jquery-min.js b/www/brand/assets/jquery-min.js
new file mode 100644
index 0000000..e6a051d
--- /dev/null
+++ b/www/brand/assets/jquery-min.js
@@ -0,0 +1,4 @@
+/*! jQuery v1.11.2 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */
+!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l="1.11.2",m=function(a,b){return new m.fn.init(a,b)},n=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,o=/^-ms-/,p=/-([\da-z])/gi,q=function(a,b [...]
+return!0}function Q(a,b,d,e){if(m.acceptData(a)){var f,g,h=m.expando,i=a.nodeType,j=i?m.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||m.guid++:h),j[k]||(j[k]=i?{}:{toJSON:m.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=m.extend(j[k],b):j[k].data=m.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[m.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[m.camelCase(b)])):f=g,f}}fu [...]
+}m.Tween=Zb,Zb.prototype={constructor:Zb,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(m.cssNumber[c]?"":"px")},cur:function(){var a=Zb.propHooks[this.prop];return a&&a.get?a.get(this):Zb.propHooks._default.get(this)},run:function(a){var b,c=Zb.propHooks[this.prop];return this.pos=b=this.options.duration?m.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):a,this.now=( [...]
diff --git a/www/test/trademark.cgi b/www/brand/list.cgi
old mode 100755
new mode 100644
similarity index 74%
copy from www/test/trademark.cgi
copy to www/brand/list.cgi
index e54cf06..e20d109
--- a/www/test/trademark.cgi
+++ b/www/brand/list.cgi
@@ -1,4 +1,7 @@
 #!/usr/bin/env ruby
+# Wvisible:brand,trademarks
+PAGETITLE = 'Listing of Apache Trademarks'
+
 $LOAD_PATH.unshift File.realpath(File.expand_path('../../../lib', __FILE__))
 require 'csv'
 require 'json'
@@ -7,11 +10,47 @@ require 'wunderbar'
 require 'wunderbar/bootstrap'
 require 'net/http'
 
-PAGETITLE = 'Listing of Apache Trademarks'
-COUNTRY = 'CountryName' # Fieldnames from counsel provided docket
+# Fieldnames/values from counsel provided docket.csv
+MNAM = 'TrademarkName'
+COUNTRY = 'CountryName' 
 STAT = 'TrademarkStatus'
 CLASS = 'Class'
 REG = 'RegNumber'
+APPNUMBER = 'AppNumber'
+CLASSGOODS = 'ClassGoods'
+REGISTERED = 'Registered'
+USA = 'United States of America'
+
+# Transform docket spreadsheet into structured JSON
+def csv2json
+  brand_dir = ASF::SVN['private/foundation/Brand']
+  csv = CSV.read("#{brand_dir}/docket.csv", headers:true)
+  docket = {}
+  csv.each do |r|
+    r << ['pmc', r[MNAM].downcase.sub('.org','').sub(' & design','')]
+    key = r['pmc'].to_sym
+    mrk = {}
+    %W[ #{STAT} #{COUNTRY} #{CLASS} #{APPNUMBER} #{REG} #{CLASSGOODS} ].each do |col|
+      mrk[col] = r[col]
+    end  
+    if not docket.key?(key)
+      docket[key] = { r[MNAM] => [mrk] }
+    else
+      if not (docket[key]).key?(r[MNAM])
+        docket[key][r[MNAM]] = [mrk]
+      else
+        docket[key][r[MNAM]] << mrk      
+      end
+    end
+  end
+  
+  docket
+end
+
+# Since the CSV changes rarely, it is manually checked in separately
+_json do
+  csv2json
+end
 
 def _unreg(name, url, desc, parent, n)
   _div.panel.panel_default do
@@ -42,8 +81,8 @@ def _marks(marks)
         _{"#{mark} &reg;"}
       end
       items.each do |itm|
-        if itm[STAT] == 'Registered' then
-          if itm[COUNTRY] == 'United States of America' then
+        if itm[STAT] == REGISTERED then
+          if itm[COUNTRY] == USA then
             _li.list_group_item do
               _a "In the #{itm[COUNTRY]}, class #{itm[CLASS]}, reg # #{itm[REG]}", href: 'usptolink'
             end
@@ -118,7 +157,8 @@ _html do
 
     _whimsy_footer({
       "https://www.apache.org/foundation/marks/resources" => "Trademark Site Map",
-      "https://www.apache.org/foundation/marks/list/" => "Official Apache Trademark List"
+      "https://www.apache.org/foundation/marks/list/" => "Official Apache Trademark List",
+      "https://www.apache.org/foundation/marks/contact" => "Contact Us About Trademarks"
       })
   end
 end
diff --git a/www/test/trademark.cgi b/www/test/trademark.cgi
index e54cf06..a2cd1ce 100755
--- a/www/test/trademark.cgi
+++ b/www/test/trademark.cgi
@@ -7,7 +7,7 @@ require 'wunderbar'
 require 'wunderbar/bootstrap'
 require 'net/http'
 
-PAGETITLE = 'Listing of Apache Trademarks'
+PAGETITLE = 'Listing of Apache Trademarks - DEPRECATED'
 COUNTRY = 'CountryName' # Fieldnames from counsel provided docket
 STAT = 'TrademarkStatus'
 CLASS = 'Class'
@@ -92,8 +92,12 @@ _html do
     docket = JSON.parse(File.read("#{brand_dir}/docket.json"))
     projects = JSON.parse(Net::HTTP.get(URI('https://projects.apache.org/json/foundation/projects.json')))
 
-    _whimsy_content do
+    _whimsy_content do 
       _h3 'The ASF holds the following registered trademarks:'
+      _h3 do
+        _ 'THIS PAGE IS DEPRECATED, please '
+        _a 'see the new /brand/list page instead', href: 'https://whimsy.apache.org/brand/list'
+      end
       docket.each do |pmc, marks|
         if pmc == 'apache' then
           _apache(marks)

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