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 1b0f394 styleallthethings Use consistent layout and styles
1b0f394 is described below
commit 1b0f394f89983cfd07882969cc57646ed90c1cc0
Author: Shane Curcuru <[email protected]>
AuthorDate: Wed Jun 7 18:48:26 2017 -0400
styleallthethings Use consistent layout and styles
---
www/site.cgi | 273 ++++++++++++++++++++++++++++++++++-------------------------
1 file changed, 156 insertions(+), 117 deletions(-)
diff --git a/www/site.cgi b/www/site.cgi
index d2a9dd1..13fdafd 100755
--- a/www/site.cgi
+++ b/www/site.cgi
@@ -122,62 +122,83 @@ _html do
.table td {font-size: smaller;}
}
end
-
_body? do
-
- _whimsy_header PAGETITLE
-
- _whimsy_content do
- _div.panel.panel_default do
- _div!.panel_heading 'Common Links Found On TLP Sites'
- _div.panel_body do
- _ 'Current (beta) status of Apache PMC top level websites vis-a-vis '
- _a 'required links', href:
'https://www.apache.org/foundation/marks/pmcs#navigation'
- _ '. '
- _a 'See crawler code', href:
'https://gitbox.apache.org/repos/asf?p=whimsy.git;a=blob_plain;f=tools/site-scan.rb;hb=HEAD'
- _ ' and '
- _a 'raw JSON data', href: DATAURI
- _ ". Last crawl time: #{crawl_time} over #{sites.size} sites."
- _br
- _ul do
- analysis[1].each do |cls, desc|
- _li.label desc, class: cls
- end
- end
- end
+ _whimsy_body(
+ title: PAGETITLE,
+ subtitle: 'Checking TLP Websites For Required Links',
+ related: {
+ "https://whimsy.apache.org/committers/tools" => "Whimsy Tool Listing",
+ "https://www.apache.org/foundation/marks/pmcs#navigation" => "Required
PMC Links Policy",
+ "https://github.com/apache/whimsy/" => "Read The Whimsy Code"
+ },
+ helpblock: -> {
+ _p do
+ _ 'This script periodically craws all Apache project websites to check
them for a few specific links or text blocks that all projects are expected to
have.'
+ _ 'The checks (currently in beta) include verifying that all '
+ _a 'required links', href:
'https://www.apache.org/foundation/marks/pmcs#navigation'
+ _ ' appear on a project homepage, along with checking if project logos
appear in apache.org/img'
end
-
+ _p do
+ _a 'View the crawler code', href:
'https://github.com/apache/whimsy/blob/master/tools/site-scan.rb'
+ _ ', '
+ _a 'website display code', href:
'https://github.com/apache/whimsy/blob/master/www/site.cgi'
+ _ ', and '
+ _a 'raw JSON data', href: DATAURI
+ _ '.'
+ _br
+ _ "Last crawl time: #{crawl_time} over #{sites.size} websites."
+ end
+ }
+ ) do
+
if path_info =~ %r{/project/(.+)}
# details for an individual project
project = $1
links = sites[project]
- _h2 do
- _a links['display_name'], href: links['uri']
- end
- _table.table.table_striped do
- _tbody do
- cols.each do |col|
- cls = label(analysis, links, col, project)
- _tr do
- _td do
- _a col.capitalize, href: "../check/#{col}"
+ _whimsy_panel_table(
+ title: "Site Check For Project - #{links['display_name']}",
+ helpblock: -> {
+ _a href: '../', aria_label: 'Home to site checker' do
+ _span.glyphicon.glyphicon_home :aria_hidden
+ end
+ _span.glyphicon.glyphicon_menu_right
+ _ ' Results for project: '
+ _a links['display_name'], href: links['uri']
+ _ ' Check Results column is the actual text found on the project
homepage for this check.'
+ }
+ ) do
+ _table.table.table_striped do
+ _tbody do
+ _thead do
+ _tr do
+ _th! 'Check Type'
+ _th! 'Check Results'
+ _th! 'Check Description'
end
-
- if links[col] =~ /^https?:/
- _td class: cls do
- _a links[col], href: links[col]
+ end
+ cols.each do |col|
+ cls = label(analysis, links, col, project)
+ _tr do
+ _td do
+ _a col.capitalize, href: "../check/#{col}"
end
- else
- _td links[col], class: cls
- end
-
- _td do
- if cls == 'label-warning'
- _ '(Expected to match the regular expression: '
- _code CHECKS[col].source
- _ ')'
+
+ if links[col] =~ /^https?:/
+ _td class: cls do
+ _a links[col], href: links[col]
+ end
else
- _ ''
+ _td links[col], class: cls
+ end
+
+ _td do
+ if cls == 'label-warning'
+ _ 'Expected to match the regular expression: '
+ _code CHECKS[col].source
+ _ ''
+ else
+ _ ''
+ end
end
end
end
@@ -187,33 +208,44 @@ _html do
elsif path_info =~ %r{/check/(.+)}
# details for a single check
col = $1
- _h2 col.capitalize
- if CHECKS.include? col
- _p! do
- _ '(Expected to match the regular expression: '
- _code CHECKS[col].source
- _ ')'
- end
- _p do
- if DOCS.include? col
- _a DOCS[col][1], href: DOCS[col][0]
+ _whimsy_panel_table(
+ title: "Site Check Of Type - #{col.capitalize}",
+ helpblock: -> {
+ _a href: '../', aria_label: 'Home to site checker' do
+ _span.glyphicon.glyphicon_home :aria_hidden
end
- end
- end
- _table.table do
- _tbody do
- sites.each do |n, links|
- _tr class: label(analysis, links, col, n) do
- _td do
- _a links['display_name'], href: "../project/#{n}"
- end
-
- if links[col] =~ /^https?:/
- _td do
- _a links[col], href: links[col]
+ _span.glyphicon.glyphicon_menu_right
+ if CHECKS.include? col
+ _ ' Check Results are expected to match the regular expression: '
+ _code CHECKS[col].source
+ if DOCS.include? col
+ _ ' '
+ _a DOCS[col][1], href: DOCS[col][0]
+ end
+ end
+ }
+ ) do
+ _table.table.table_condensed.table_striped do
+ _thead do
+ _tr do
+ _th! 'Project'
+ _th! 'Check Results'
+ end
+ end
+ _tbody do
+ sites.each do |n, links|
+ _tr do
+ _td do
+ _a links['display_name'], href: "../project/#{n}"
+ end
+
+ if links[col] =~ /^https?:/
+ _td class: label(analysis, links, col, n) do
+ _a links[col], href: links[col]
+ end
+ else
+ _td links[col], class: label(analysis, links, col, n)
end
- else
- _td links[col]
end
end
end
@@ -221,46 +253,59 @@ _html do
end
else
# overview
- _table.table.table_condensed.table_striped do
- _thead do
- _tr do
- _th! 'Project', data_sort: 'string-ins'
- cols.each do |col|
- _th! data_sort: 'string' do
- _a col.capitalize, href: "check/#{col}"
- _br
- analysis[0][col].each do |cls, val|
- _ ' '
- _span.label val, class: cls
- end
- end
- end
- end
- end
-
- sort_order = {
- 'label-success' => 1,
- 'label-warning' => 2,
- 'label-danger' => 3
+ _whimsy_panel_table(
+ title: "Site Check - All Projects Results",
+ helpblock: -> {
+ _ul.list_inline do
+ _li.small "Data key: "
+ analysis[1].each do |cls, desc|
+ _li.label desc, class: cls
+ end
+ _li.small " Click column badges to sort"
+ end
}
-
- _tbody do
- sites.each do |n, links|
- _tr do
- _td do
- _a "#{links['display_name']}", href: "project/#{n}"
- end
- cols.each do |c|
- cls = label(analysis, links, c, n)
- _td '', class: cls, data_sort_value: sort_order[cls]
- end
- end
- end
- end
- end
- end
+ ) do
+ _table.table.table_condensed.table_striped do
+ _thead do
+ _tr do
+ _th! 'Project', data_sort: 'string-ins'
+ cols.each do |col|
+ _th! data_sort: 'string' do
+ _a col.capitalize, href: "check/#{col}"
+ _br
+ analysis[0][col].each do |cls, val|
+ _ ' '
+ _span.label val, class: cls
+ end
+ end
+ end
+ end
+ end
+
+ sort_order = {
+ 'label-success' => 1,
+ 'label-warning' => 2,
+ 'label-danger' => 3
+ }
+
+ _tbody do
+ sites.each do |n, links|
+ _tr do
+ _td do
+ _a "#{links['display_name']}", href: "project/#{n}"
+ end
+ cols.each do |c|
+ cls = label(analysis, links, c, n)
+ _td '', class: cls, data_sort_value: sort_order[cls]
+ end
+ end
+ end
+ end
+ end
+ end # of _whimsy_panel_table
+ end
end
-
+
_script %{
var table = $(".table").stupidtable();
table.on("aftertablesort", function (event, data) {
@@ -269,13 +314,7 @@ _html do
var dir = $.fn.stupidtable.dir;
var arrow = data.direction === dir.ASC ? "↑" : "↓";
th.eq(data.column).append('<span class="arrow">' + arrow +'</span>');
- });
+ });
}
- _whimsy_footer(
- related: {
- "https://www.apache.org/foundation/marks/pmcs" => "Apache Project
Branding Policy",
- "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
['"[email protected]" <[email protected]>'].