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:10:10 UTC
[whimsy] branch master updated: Use new themes functions and add
container dif
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 4c83f93 Use new themes functions and add container dif
4c83f93 is described below
commit 4c83f938e3c52adccc2d3c7183e5b95be2b08a36
Author: Shane Curcuru <as...@shanecurcuru.org>
AuthorDate: Mon Apr 10 22:10:06 2017 -0400
Use new themes functions and add container dif
---
www/test/trademark.cgi | 110 ++++++++++++++-----------------------------------
1 file changed, 32 insertions(+), 78 deletions(-)
diff --git a/www/test/trademark.cgi b/www/test/trademark.cgi
index 30d99f3..362fa30 100755
--- a/www/test/trademark.cgi
+++ b/www/test/trademark.cgi
@@ -6,58 +6,10 @@ require 'whimsy/asf'
require 'wunderbar'
require 'wunderbar/bootstrap'
require 'net/http'
-
-# Adding consistent Whimsy styles TODO: document and move to lib/asf
-class Wunderbar::HtmlMarkup
- def _whimsy_header style, title
- case style
- when :fullsize
- _div.header 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 href: 'https://lists.apache.org/list.html?dev@whimsical.apache.org' do
- _ 'Mailing list'
- end
- end
- _li role: 'presentation' do
- _a href: '/technology' do
- _ 'About this site'
- end
- end
- end
- _h1 title
- end
- else
- _a href: 'https://whimsy.apache.org/' do
- _img title: 'ASF Logo', alt: 'ASF Logo',
- src: 'https://www.apache.org/img/asf_logo.png'
- end
- _h2 title
- end
- end
-end
+require 'whimsy/asf/themes'
PAGETITLE = 'Listing of Apache Registered Trademarks'
-brand_dir = ASF::SVN['private/foundation/Brand']
-docket = CSV.read("#{brand_dir}/trademark-registrations.csv", headers:true)
-docketcols = %w[ Mark Jurisdiction Class ]
-# TODO: consolidate Jurisdiction info by 'Mark' column
-
-# TODO add error recovery
-projects = JSON.parse(Net::HTTP.get(URI('https://projects.apache.org/json/foundation/projects.json')))
-
_html do
_head_ do
_title PAGETITLE
@@ -68,44 +20,46 @@ _html do
.issue {color: red; font-weight: bold}
}
end
-
_body? do
- _whimsy_header :fullsize, PAGETITLE
- _table class: "table " do
- _thead_ do
- _tr do
- docketcols.each { |h| _th h }
+ _whimsy_header PAGETITLE
+ brand_dir = ASF::SVN['private/foundation/Brand']
+ docket = CSV.read("#{brand_dir}/trademark-registrations.csv", headers:true)
+ docketcols = %w[ Mark Jurisdiction Class ]
+ # TODO: consolidate Jurisdiction info by 'Mark' column
+ # TODO add error recovery
+ projects = JSON.parse(Net::HTTP.get(URI('https://projects.apache.org/json/foundation/projects.json')))
+ _div.container_fluid do
+ _table class: "table " do
+ _thead_ do
+ _tr do
+ docketcols.each { |h| _th h }
+ end
end
- end
- _tbody do
- docket.each do | row |
- _tr_ do
- docketcols.each do |h|
- if h == 'Mark' then
- _td do
- begin
- # TODO: Map unusual project names
- _a row[h], href: projects[row[h].downcase]['homepage']
- rescue
- _ row[h]
+ _tbody do
+ docket.each do | row |
+ _tr_ do
+ docketcols.each do |h|
+ if h == 'Mark' then
+ _td do
+ begin
+ # TODO: Map unusual project names
+ _a row[h], href: projects[row[h].downcase]['homepage']
+ rescue
+ _ row[h]
+ end
end
+ else
+ _td row[h]
end
- else
- _td row[h]
end
end
end
end
end
end
-
- _div.footer do
- _h2_ 'Apache Trademark Resources'
- _ul do
- _li do
- _a 'Trademark Site Map', href: 'https://www.apache.org/foundation/marks/resources'
- end
- end
- end
+ _whimsy_footer({
+ "https://www.apache.org/foundation/marks/resources" => "Trademark Site Map",
+ "https://www.apache.org/foundation/marks/list/" => "Official Apache Trademark List"
+ })
end
end
--
To stop receiving notification emails like this one, please contact
['"commits@whimsical.apache.org" <co...@whimsical.apache.org>'].