[ARVADOS] updated: 5380c722ce344d712cab307d41e0f7a654a4070c
git at public.curoverse.com
git at public.curoverse.com
Thu Mar 26 14:56:22 EDT 2015
Summary of changes:
.../app/controllers/actions_controller.rb | 8 ++++++-
.../app/controllers/application_controller.rb | 9 ++++++++
.../application/_getting_started_popup.html.erb | 26 ++++++++++++++++++++++
.../views/application/getting_started_popup.js.erb | 2 ++
apps/workbench/app/views/layouts/body.html.erb | 20 ++++++++++++++++-
apps/workbench/config/application.default.yml | 1 +
apps/workbench/config/routes.rb | 1 +
7 files changed, 65 insertions(+), 2 deletions(-)
create mode 100644 apps/workbench/app/views/application/_getting_started_popup.html.erb
create mode 100644 apps/workbench/app/views/application/getting_started_popup.js.erb
via 5380c722ce344d712cab307d41e0f7a654a4070c (commit)
from 46b124cc766e4e35e40c1c3e2c1b388816aa682a (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 5380c722ce344d712cab307d41e0f7a654a4070c
Author: Radhika Chippada <radhika at curoverse.com>
Date: Thu Mar 26 14:55:37 2015 -0400
5493: wiring for 'getting started' popup
diff --git a/apps/workbench/app/controllers/actions_controller.rb b/apps/workbench/app/controllers/actions_controller.rb
index 7737a3c..9db8827 100644
--- a/apps/workbench/app/controllers/actions_controller.rb
+++ b/apps/workbench/app/controllers/actions_controller.rb
@@ -1,6 +1,6 @@
class ActionsController < ApplicationController
- skip_filter :require_thread_api_token, only: [:report_issue_popup, :report_issue]
+ skip_filter :require_thread_api_token, only: [:report_issue_popup, :report_issue, :getting_started_popup]
skip_filter :check_user_agreements, only: [:report_issue_popup, :report_issue]
@@exposed_actions = {}
@@ -253,6 +253,12 @@ class ActionsController < ApplicationController
end
end
+ def getting_started_popup
+ respond_to do |format|
+ format.js
+ end
+ end
+
protected
def derive_unique_filename filename, manifest_files
diff --git a/apps/workbench/app/controllers/application_controller.rb b/apps/workbench/app/controllers/application_controller.rb
index 1b59c57..f81e095 100644
--- a/apps/workbench/app/controllers/application_controller.rb
+++ b/apps/workbench/app/controllers/application_controller.rb
@@ -700,6 +700,15 @@ class ApplicationController < ActionController::Base
missing_required
end
+ helper_method :update_getting_started_shown_user_pref
+ def update_getting_started_shown_user_pref
+ prefs = current_user.prefs
+ if !prefs[:getting_started_shown]
+ prefs[:getting_started_shown] = Time.now
+ current_user.update_attributes prefs: prefs
+ end
+ end
+
def select_theme
return Rails.configuration.arvados_theme
end
diff --git a/apps/workbench/app/views/application/_getting_started_popup.html.erb b/apps/workbench/app/views/application/_getting_started_popup.html.erb
new file mode 100644
index 0000000..eb161bc
--- /dev/null
+++ b/apps/workbench/app/views/application/_getting_started_popup.html.erb
@@ -0,0 +1,26 @@
+<%
+ update_getting_started_shown_user_pref() if current_user
+%>
+
+<div class="modal">
+ <div class="modal-dialog modal-with-loading-spinner">
+ <div class="modal-content">
+ <div class="modal-header">
+ <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
+ <div>
+ <div class="col-sm-8"> <h4 class="modal-title"> Getting Started with Arvados </h4> </div>
+ <div class="spinner spinner-32px spinner-h-center col-sm-1" hidden="true"></div>
+ </div>
+ <br/>
+ </div>
+
+ <div class="modal-body" style="height: 25em; overflow-y: scroll">
+ Wait for it
+ </div>
+
+ <div class="modal-footer">
+ <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>
+ </div>
+ </div>
+ </div>
+</div>
diff --git a/apps/workbench/app/views/application/getting_started_popup.js.erb b/apps/workbench/app/views/application/getting_started_popup.js.erb
new file mode 100644
index 0000000..d9c4fa8
--- /dev/null
+++ b/apps/workbench/app/views/application/getting_started_popup.js.erb
@@ -0,0 +1,2 @@
+$("#getting-started-modal-window").html("<%= escape_javascript(render partial: 'getting_started_popup') %>");
+$("#getting-started-modal-window .modal").modal('show');
diff --git a/apps/workbench/app/views/layouts/body.html.erb b/apps/workbench/app/views/layouts/body.html.erb
index fbbd0fa..67e50bd 100644
--- a/apps/workbench/app/views/layouts/body.html.erb
+++ b/apps/workbench/app/views/layouts/body.html.erb
@@ -118,6 +118,12 @@
<span class="fa fa-lg fa-question-circle"></span>
</a>
<ul class="dropdown-menu">
+ <li> <%= link_to getting_started_popup_path(),
+ {class: 'getting-started-modal-window', remote: true, return_to: request.url} do %>
+ <i class="fa fa-fw fa-info"></i> Getting Started ...
+ <% end %>
+ </li>
+ <li><%= link_to raw('<i class="fa fa-book fa-fw"></i> Public Pipelines and Datasets'), "#{Rails.configuration.arvados_wikisite}/projects/arvados/wiki/Public_Pipelines_and_Datasets", target: "_blank" %></li>
<li><%= link_to raw('<i class="fa fa-book fa-fw"></i> Tutorials and User guide'), "#{Rails.configuration.arvados_docsite}/user", target: "_blank" %></li>
<li><%= link_to raw('<i class="fa fa-book fa-fw"></i> API Reference'), "#{Rails.configuration.arvados_docsite}/api", target: "_blank" %></li>
<li><%= link_to raw('<i class="fa fa-book fa-fw"></i> SDK Reference'), "#{Rails.configuration.arvados_docsite}/sdk", target: "_blank" %></li>
@@ -190,7 +196,11 @@
</nav>
<% end %>
- <%= render partial: 'browser_unsupported' %><%# requires JS support below %>
+ <%= render partial: 'browser_unsupported' %> <%# requires JS support below %>
+
+ <% if current_user and !current_user.prefs[:getting_started_shown] %> <%# requires JS support below %>
+ <div id="getting-started-modal-window"></div>
+ <% end %>
<div id="page-wrapper">
<%= yield %>
@@ -202,3 +212,11 @@
<div class="modal-container"></div>
<div id="report-issue-modal-window"></div>
<script src="/browser_unsupported.js"></script>
+
+<div id="getting-started-modal-window"></div>
+<% if current_user and !current_user.prefs[:getting_started_shown] %>
+ <script>
+ $("#getting-started-modal-window").html("<%= escape_javascript(render partial: 'getting_started_popup') %>");
+ $("#getting-started-modal-window .modal").modal('show');
+ </script>
+<% end %>
diff --git a/apps/workbench/config/application.default.yml b/apps/workbench/config/application.default.yml
index f3d1792..0b8f36d 100644
--- a/apps/workbench/config/application.default.yml
+++ b/apps/workbench/config/application.default.yml
@@ -131,6 +131,7 @@ common:
arvados_insecure_https: true
activation_contact_link: mailto:info at arvados.org
arvados_docsite: http://doc.arvados.org
+ arvados_wikisite: http://arvados.org
arvados_theme: default
show_user_agreement_inline: false
secret_token: ~
diff --git a/apps/workbench/config/routes.rb b/apps/workbench/config/routes.rb
index 7ed02e7..2e152c7 100644
--- a/apps/workbench/config/routes.rb
+++ b/apps/workbench/config/routes.rb
@@ -12,6 +12,7 @@ ArvadosWorkbench::Application.routes.draw do
get "users/setup" => 'users#setup', :as => :setup_user
get "report_issue_popup" => 'actions#report_issue_popup', :as => :report_issue_popup
post "report_issue" => 'actions#report_issue', :as => :report_issue
+ get "getting_started_popup" => 'actions#getting_started_popup', :as => :getting_started_popup
resources :nodes
resources :humans
resources :traits
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list