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 3a91154 Add error page display to roster; docs
3a91154 is described below
commit 3a91154666697c4c2264727a08734cdb46aca233
Author: Shane Curcuru <[email protected]>
AuthorDate: Thu Apr 27 12:55:40 2017 -0400
Add error page display to roster; docs
---
www/roster/README | 33 ++++++++++++++++++++++++++++++++-
www/roster/main.rb | 10 ++++++++++
www/roster/views/errors.html.rb | 30 ++++++++++++++++++++++++++++++
3 files changed, 72 insertions(+), 1 deletion(-)
diff --git a/www/roster/README b/www/roster/README
index 1b9e68a..229d725 100644
--- a/www/roster/README
+++ b/www/roster/README
@@ -1,3 +1,12 @@
+This Whimsy Roster tool presents a variety of organizational data about
+people and groups at the ASF in a convenient and secure manner.
+It uses Rack and Sinatra to run the server, Wunderbar for output, and
+the whimsy/asf library to directly access a variety of ASF data
+sources and files.
+
+Run Roster Locally :car:
+===
+
To test locally, run:
rake server
@@ -7,6 +16,28 @@ sever using:
rake auth server
-Doing so will prompt you for your password. Should your username for apache
+Doing so will prompt you for your ASF password. Should your ASF username
not match your local user name, set the `USER` environment variable to your
apache user id before running the above command.
+
+Issues? [Local setup](../../DEVELOPMENT.md#running-whimsy-applications-car).
+
+Architecture Overview
+===
+
+The roster tool primarily displays data from a variety of sources
+(private and public), and in some cases allows self-service for
+Apache committers to update data directly.
+
+* config.ru and main.rb are the startup and central control.
+
+* models/ obviously provide the data models; many of them mirror but
+ add functionality to some of the whimsy/asf models.
+
+* views/ provide the individual view pages.html.rb and (when used)
+ associated pages.js.rb scripts that make interactive features work,
+ using React.js.
+
+* lib/whimsy/asf/auth is used by a few tools to do specific authorization
+ steps **within** the tool - instead of simply relying on httpd
+ to gate access to a URL as a whole.
\ No newline at end of file
diff --git a/www/roster/main.rb b/www/roster/main.rb
index c3b2658..ba0cf01 100755
--- a/www/roster/main.rb
+++ b/www/roster/main.rb
@@ -185,3 +185,13 @@ get '/orgchart/:name' do |name|
_html :duties
end
+
+error do
+ @errors = env
+ _html :errors
+end
+
+not_found do
+ @errors = env
+ _html :errors
+end
\ No newline at end of file
diff --git a/www/roster/views/errors.html.rb b/www/roster/views/errors.html.rb
new file mode 100644
index 0000000..648207d
--- /dev/null
+++ b/www/roster/views/errors.html.rb
@@ -0,0 +1,30 @@
+#
+# Error display
+#
+
+_html do
+ _header do
+ _link rel: 'stylesheet', href: 'stylesheets/app.css'
+ end
+ _body? do
+ _whimsy_header 'Error - Apache Whimsy'
+ _whimsy_content do
+ _div.row do
+ _div.col_sm_10 do
+ _div.panel.panel_danger do
+ _div.panel_heading {_h3.panel_title 'Error - Apache Whimsy'}
+ _div.panel_body do
+ _p '"Hey, Rocky! Watch me pull a rabbit out of my hat."'
+ _p 'Oh, snap! Something went wrong. Error details follow:'
+ _ul do
+ %w( sinatra.error sinatra.route REQUEST_URI ).each do |k|
+ _li "#{k} = #{@errors[k]}"
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+end
--
To stop receiving notification emails like this one, please contact
['"[email protected]" <[email protected]>'].