[ARVADOS] updated: d0930bfe4226ba361a5b1087b01946130f8282fd
git at public.curoverse.com
git at public.curoverse.com
Mon Aug 4 21:42:29 EDT 2014
Summary of changes:
.../app/controllers/application_controller.rb | 26 +
.../app/controllers/user_agreements_controller.rb | 1 +
apps/workbench/app/controllers/users_controller.rb | 38 +
apps/workbench/app/models/user.rb | 6 +
apps/workbench/app/views/layouts/body.html.erb | 6 +
.../app/views/users/_manage_ssh_keys.html.erb | 8 +-
apps/workbench/app/views/users/_profile.html.erb | 49 +
apps/workbench/app/views/users/profile.html.erb | 1 +
apps/workbench/config/application.default.yml | 2 +
apps/workbench/config/routes.rb | 2 +
doc/_config.yml | 33 +-
.../_tutorial_bwa_sortsam_pipeline.liquid | 65 +
doc/_includes/_tutorial_expectations.liquid | 2 +-
doc/_layouts/default.html.liquid | 6 +-
doc/css/font-awesome.css | 1566 ++++++++++++++++++++
doc/css/nav-list.css | 7 +-
doc/fonts/FontAwesome.otf | Bin 0 -> 75188 bytes
doc/fonts/fontawesome-webfont.eot | Bin 0 -> 72449 bytes
doc/fonts/fontawesome-webfont.svg | 504 +++++++
doc/fonts/fontawesome-webfont.ttf | Bin 0 -> 141564 bytes
doc/fonts/fontawesome-webfont.woff | Bin 0 -> 83760 bytes
doc/install/install-docker.html.textile.liquid | 49 +-
doc/user/copying/copying.html.textile.liquid | 2 +-
.../examples/crunch-examples.html.textile.liquid | 2 +-
.../check-environment.html.textile.liquid | 4 +-
.../getting_started/workbench.html.textile.liquid | 10 +-
doc/user/index.html.textile.liquid | 29 +-
doc/user/reference/sdk-cli.html.textile.liquid | 2 +-
doc/user/topics/keep.html.textile.liquid | 8 +-
...nning-pipeline-command-line.html.textile.liquid | 117 +-
.../topics/tutorial-job-debug.html.textile.liquid | 27 +-
.../topics/tutorial-parallel.html.textile.liquid | 24 +-
.../tutorials/intro-crunch.html.textile.liquid | 17 +-
.../running-external-program.html.textile.liquid | 79 +-
.../tutorial-firstscript.html.textile.liquid | 61 +-
.../tutorial-keep-get.html.textile.liquid | 47 +
.../tutorial-keep-mount.html.textile.liquid | 32 +
.../tutorials/tutorial-keep.html.textile.liquid | 161 +-
.../tutorial-new-pipeline.html.textile.liquid | 63 +-
...tutorial-pipeline-workbench.html.textile.liquid | 40 +-
docker/api/omniauth.rb.in | 6 +-
docker/arvdock | 10 +-
docker/build.sh | 11 +-
docker/build_tools/Makefile | 136 +-
docker/build_tools/build.rb | 8 +-
docker/build_tools/config.rb | 20 +-
docker/config.yml.example | 15 +-
docker/keep/Dockerfile | 9 +-
docker/keep/keep_signing_secret.in | 1 +
docker/keep/run-keep.in | 11 +
docker/workbench/Dockerfile | 12 +-
docker/workbench/workbench_rails_env.in | 1 +
sdk/python/arvados/stream.py | 2 +-
sdk/python/tests/test_collections.py | 20 +
.../app/controllers/arvados/v1/jobs_controller.rb | 20 +-
.../app/controllers/arvados/v1/users_controller.rb | 7 +
services/api/app/models/arvados_model.rb | 6 +
services/api/app/models/user.rb | 13 +
services/api/config/routes.rb | 1 +
.../test/fixtures/api_client_authorizations.yml | 6 +
services/api/test/fixtures/links.yml | 46 +
services/api/test/fixtures/users.yml | 11 +
.../arvados/v1/groups_controller_test.rb | 31 +
.../arvados/v1/job_reuse_controller_test.rb | 21 +
services/fuse/tests/test_mount.py | 1 +
services/keep/src/keep/handler_test.go | 144 +-
services/keep/src/keep/handlers.go | 97 ++
services/keep/src/keep/volume.go | 11 +-
services/keep/src/keep/volume_unix.go | 37 +-
69 files changed, 3161 insertions(+), 649 deletions(-)
create mode 100644 apps/workbench/app/views/users/_profile.html.erb
create mode 100644 apps/workbench/app/views/users/profile.html.erb
create mode 100644 doc/_includes/_tutorial_bwa_sortsam_pipeline.liquid
create mode 100644 doc/css/font-awesome.css
create mode 100644 doc/fonts/FontAwesome.otf
create mode 100755 doc/fonts/fontawesome-webfont.eot
create mode 100755 doc/fonts/fontawesome-webfont.svg
create mode 100755 doc/fonts/fontawesome-webfont.ttf
create mode 100755 doc/fonts/fontawesome-webfont.woff
create mode 100644 doc/user/tutorials/tutorial-keep-get.html.textile.liquid
create mode 100644 doc/user/tutorials/tutorial-keep-mount.html.textile.liquid
create mode 100644 docker/keep/keep_signing_secret.in
create mode 100755 docker/keep/run-keep.in
create mode 100644 docker/workbench/workbench_rails_env.in
via d0930bfe4226ba361a5b1087b01946130f8282fd (commit)
via d82509cf925a2afa5b09f8a67952d5553101778d (commit)
via dbc08507876d9e2f4f3c28b4f76a345c829ab6cd (commit)
via dc8150c837a7285bf210be54240c03c20dee0af0 (commit)
via b789ede3e8646a7b8a186905e7c0ff37f6fd1072 (commit)
via 583e9e1e9672d3eb0a317d371acbb83b9ab840ec (commit)
via 66525e1578a6247f902cd4c215494600302bf857 (commit)
via 80b502ea52e896d7bb42cc566f7472e6cd4fe397 (commit)
via 1e66f628a28e212a7a2d49025c5558ccb589ace2 (commit)
via 729949090fcc5d4158be57657c036df1056bb0c8 (commit)
via f43267ad023fd4121c7ad12dc2b44579dfade1a4 (commit)
via 3862ce78fd0541199053efb9c25ea2d6e09223f7 (commit)
via 4aea5131a87f375285210d9ccde2470cfeac5876 (commit)
via 88442524bb47b70317fc5c994f38c2b144a68f04 (commit)
via fad433ed99dffb9fd003c5dfd5f7bad770b19206 (commit)
via f0a746bb545d7db0760cd397c849315787c5231a (commit)
via 80ada0673ac37cf1d3b70918a214f2ade484ec45 (commit)
via 52192560846cf801b8e9e29cb06060a16a1d154d (commit)
via c81c0efd74addbdb2cf3ef2114ed96123d5a881e (commit)
via fe5556e0f3105f2d8b752d796fea21363a1b0eb6 (commit)
via ee56bdc1c7868ddae32e919205e77a3125a2a5e3 (commit)
via fada92364f7ab0aa7074f1b260b4d79ca7ab55eb (commit)
via d579e7069ab2df27493180a36f2830ba7c10e6a6 (commit)
via b01bc9f64291554fea0e548d18081bb0fd1a7342 (commit)
via d6d7788c4e6b1d3da88833329b326fd7a3891503 (commit)
via 62fd09a5e985462de60f7fd4a788a902ea80b8fb (commit)
via 93fd025b021dfe3e4848a0768d5b5ff2a2971842 (commit)
via ee91e2ebc7759e1823edd376db938a785ad62f45 (commit)
via ad02c4a8569b1cbf7336b5d65beb065e17420d56 (commit)
via 5ce0e0fe745c8d3e0f23629f26eeb8b0d01923db (commit)
via 0b07e15a0e3b3c9dd69f137d8617b20bba3b1f75 (commit)
via fe11ead2089ef954dd76c1f23a7db3527f057413 (commit)
via 8e998c69259240de0af63428fe94de645e665615 (commit)
via aaffa04907e58c0048340da0fa868628a15d1f3e (commit)
via f22a032d478ab34e801990ad4bf7f62cfb6cb07a (commit)
via 57d004018f00b864dc883d9ff1ed508e57396095 (commit)
via 96e1e7d819e587e20752ba46d89ae6f9a217903b (commit)
via f516aad961fde5430e7da2e3f812279ab730ad31 (commit)
via 5f6af45e3f79b2dbff55e821465f3d599a9e44e6 (commit)
via fb460bdf4b45dd9d8b46951a1457a301bd565430 (commit)
via 74d53a1ab38162c4c0977f12568617f7beb57c45 (commit)
via 33d7f4bcbf5c77da3a58f22d866e886ff8aa04dd (commit)
via f435a88f167ff6827bb520d4deeadb76f1cec53f (commit)
via 7305149050a24e7429ff679579cd4182188a7116 (commit)
via 0264c5591acb6e2e2758de37c83423b5e4bba5b5 (commit)
via 2343d25e00fe0c9416dd36f3e5f0ef21f25d245f (commit)
via b9d9b77e04adb656aa9ab37d2688aef7ce0b8b2a (commit)
via e45841e8d8b3ea1030f3c35d06fa01589fab732d (commit)
via 351cb9776d09732980f269878c13f4bc98ee6381 (commit)
via 77f1129ec53edffb5ed5a859106675cf262977e8 (commit)
from 42d84bd014b3ab3a1906c9ba68b39835765fe705 (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 d0930bfe4226ba361a5b1087b01946130f8282fd
Merge: d82509c dbc0850
Author: radhika <radhika at curoverse.com>
Date: Mon Aug 4 21:37:04 2014 -0400
Merge branch 'master' into 3296-user-profile
commit d82509cf925a2afa5b09f8a67952d5553101778d
Author: radhika <radhika at curoverse.com>
Date: Mon Aug 4 21:36:22 2014 -0400
3296: manage profile page added
diff --git a/apps/workbench/app/controllers/application_controller.rb b/apps/workbench/app/controllers/application_controller.rb
index df57e9e..b3d4768 100644
--- a/apps/workbench/app/controllers/application_controller.rb
+++ b/apps/workbench/app/controllers/application_controller.rb
@@ -13,6 +13,7 @@ class ApplicationController < ActionController::Base
# skip_around_filter :require_thread_api_token
around_filter :require_thread_api_token, except: ERROR_ACTIONS
before_filter :check_user_agreements, except: ERROR_ACTIONS
+ before_filter :check_user_profile, except: [:update_profile] + ERROR_ACTIONS
before_filter :check_user_notifications, except: ERROR_ACTIONS
before_filter :load_filters_and_paging_params, except: ERROR_ACTIONS
before_filter :find_object_by_uuid, except: [:index, :choose] + ERROR_ACTIONS
@@ -510,6 +511,31 @@ class ApplicationController < ActionController::Base
true
end
+ def check_user_profile
+ @profile_config = Rails.configuration.user_profile_form_fields
+ user_prefs = User.limit(1).where(uuid: current_user.uuid).first.prefs
+ @current_user_profile = user_prefs[:profile] if user_prefs
+
+ if current_user && @profile_config
+ missing_required_profile = false
+
+ @profile_config.andand.each do |entry|
+ if entry['required']
+ if !@current_user_profile || !@current_user_profile[entry['key'].to_sym]
+ missing_required_profile = true
+ break
+ end
+ end
+ end
+
+ if missing_required_profile
+ #redirect_to_profile
+ render 'users/profile'
+ end
+ end
+ true
+ end
+
def select_theme
return Rails.configuration.arvados_theme
end
diff --git a/apps/workbench/app/controllers/user_agreements_controller.rb b/apps/workbench/app/controllers/user_agreements_controller.rb
index 6ab8ae2..924bf44 100644
--- a/apps/workbench/app/controllers/user_agreements_controller.rb
+++ b/apps/workbench/app/controllers/user_agreements_controller.rb
@@ -1,6 +1,7 @@
class UserAgreementsController < ApplicationController
skip_before_filter :check_user_agreements
skip_before_filter :find_object_by_uuid
+ skip_before_filter :check_user_profile
def model_class
Collection
diff --git a/apps/workbench/app/controllers/users_controller.rb b/apps/workbench/app/controllers/users_controller.rb
index 67b51a9..96c183d 100644
--- a/apps/workbench/app/controllers/users_controller.rb
+++ b/apps/workbench/app/controllers/users_controller.rb
@@ -277,6 +277,44 @@ class UsersController < ApplicationController
end
end
+ def manage_profile
+ @profile_config = Rails.configuration.user_profile_form_fields
+ user_prefs = User.limit(1).where(uuid: current_user.uuid).first.prefs
+ @current_user_profile = user_prefs[:profile] if user_prefs
+
+ respond_to do |f|
+ f.html { render template: 'users/profile' }
+ end
+ end
+
+ def update_profile
+ user_prefs = User.limit(1).where(uuid: current_user.uuid).first.prefs
+ @current_user_profile = user_prefs[:profile] if user_prefs
+ @current_user_profile ||= {}
+
+ profile_keys = []
+ @profile_config = Rails.configuration.user_profile_form_fields
+ @profile_config.andand.each do |entry|
+ profile_keys << entry['key']
+ end
+
+ updated_profile = {}
+ params.andand.each do |param|
+ if profile_keys.include? param[0]
+ if param[1].andand.size>0
+ updated_profile['profile_'+param[0]] = param[1]
+ end
+ end
+ end
+
+ # current_user.update_attributes! prefs: @current_user_profile
+ current_user.update_profile updated_profile
+
+ respond_to do |f|
+ f.html { render template: 'users/profile' }
+ end
+ end
+
protected
def find_current_links user
diff --git a/apps/workbench/app/models/user.rb b/apps/workbench/app/models/user.rb
index 9c91477..74f4a6b 100644
--- a/apps/workbench/app/models/user.rb
+++ b/apps/workbench/app/models/user.rb
@@ -49,4 +49,10 @@ class User < ArvadosBase
arvados_api_client.api(self, "/setup", params)
end
+ def update_profile params
+ self.private_reload(arvados_api_client.api(self.class,
+ "/#{self.uuid}/profile",
+ params))
+ end
+
end
diff --git a/apps/workbench/app/views/layouts/body.html.erb b/apps/workbench/app/views/layouts/body.html.erb
index 55c9d81..1d08164 100644
--- a/apps/workbench/app/views/layouts/body.html.erb
+++ b/apps/workbench/app/views/layouts/body.html.erb
@@ -43,8 +43,14 @@
<%= current_user.email %>
</a>
<ul class="dropdown-menu" role="menu">
+ <li role="presentation" class="dropdown-header">
+ My account
+ </li>
<% if current_user.is_active %>
<li role="presentation"><a href="/manage_account" role="menuitem"><i class="fa fa-key fa-fw"></i> Manage account</a></li>
+ <% if Rails.configuration.user_profile_form_fields %>
+ <li role="presentation"><a href="/profile" role="menuitem"><i class="fa fa-key fa-fw"></i> Manage my profile</a></li>
+ <% end %>
<li role="presentation" class="divider"></li>
<% end %>
<li role="presentation"><a href="<%= logout_path %>" role="menuitem"><i class="fa fa-sign-out fa-fw"></i> Log out</a></li>
diff --git a/apps/workbench/app/views/users/_profile.html.erb b/apps/workbench/app/views/users/_profile.html.erb
new file mode 100644
index 0000000..47bb9b1
--- /dev/null
+++ b/apps/workbench/app/views/users/_profile.html.erb
@@ -0,0 +1,49 @@
+<div>
+ <div class="panel panel-default">
+ <div class="panel-heading">
+ <h4 class="panel-title">
+ Profile
+ </h4>
+ </div>
+ <div class="panel-body">
+ <div>
+ <%= form_tag update_profile_path, {method: 'get', id: 'save_profile_form', name: 'save_profile_form', class: 'form-horizontal', remote: true} do %>
+ <% @profile_config.andand.each do |entry| %>
+ <%
+ label = entry['required'] ? '* ' : ''
+ label += entry['form_field_title']
+ value = @current_user_profile[entry['key'].to_sym] if @current_user_profile
+ %>
+ <div class="form-group">
+ <label for="<%=entry['key']%>"
+ class="col-sm-2 control-label"
+ style=<%="color:red" if entry['required']&&!value%>> <%=label%>
+ </label>
+ <% if entry['type'] == 'select' %>
+ <div class="col-sm-10">
+ <select class="form-control" id="<%=entry['key']%>" name="<%=entry['key']%>">
+ <% entry['options'].each do |option| %>
+ <option value="<%=option%>" <%='selected' if option==value%>><%=option%></option>
+ <% end %>
+ </select>
+ </div>
+ <% else %>
+ <div class="col-sm-10">
+ <input type="text" class="form-control" id="<%=entry['key']%>" name="<%=entry['key']%>" placeholder="<%=entry['form_field_description']%>" value="<%=value%>" ></input>
+ </div>
+ <% end %>
+ </div>
+ <% end %>
+
+ <div class="form-group">
+ <div class="col-sm-offset-2 col-sm-10">
+ <button type="submit" class="btn btn-default">Save profile</button>
+ </div>
+ </div>
+
+ <% end %>
+ </div>
+ </div>
+ </div>
+</div>
+
diff --git a/apps/workbench/app/views/users/profile.html.erb b/apps/workbench/app/views/users/profile.html.erb
new file mode 100644
index 0000000..a95f14d
--- /dev/null
+++ b/apps/workbench/app/views/users/profile.html.erb
@@ -0,0 +1 @@
+<%= render :partial => 'users/profile' %>
diff --git a/apps/workbench/config/application.default.yml b/apps/workbench/config/application.default.yml
index 2fe701a..eea16c0 100644
--- a/apps/workbench/config/application.default.yml
+++ b/apps/workbench/config/application.default.yml
@@ -74,3 +74,5 @@ common:
secret_key_base: false
default_openid_prefix: https://www.google.com/accounts/o8/id
send_user_setup_notification_email: true
+
+ user_profile_form_fields: false
diff --git a/apps/workbench/config/routes.rb b/apps/workbench/config/routes.rb
index 091a069..cae7d2b 100644
--- a/apps/workbench/config/routes.rb
+++ b/apps/workbench/config/routes.rb
@@ -10,6 +10,7 @@ ArvadosWorkbench::Application.routes.draw do
get '/user_agreements/signatures' => 'user_agreements#signatures'
get "users/setup_popup" => 'users#setup_popup', :as => :setup_user_popup
get "users/setup" => 'users#setup', :as => :setup_user
+ get "users/update_profile" => 'users#update_profile', :as => :update_profile
resources :nodes
resources :humans
resources :traits
@@ -36,6 +37,7 @@ ArvadosWorkbench::Application.routes.draw do
get '/manage_account' => 'users#manage_account'
get "/add_ssh_key_popup" => 'users#add_ssh_key_popup', :as => :add_ssh_key_popup
get "/add_ssh_key" => 'users#add_ssh_key', :as => :add_ssh_key
+ get '/profile' => 'users#manage_profile'
resources :logs
resources :factory_jobs
resources :uploaded_datasets
diff --git a/services/api/app/controllers/arvados/v1/users_controller.rb b/services/api/app/controllers/arvados/v1/users_controller.rb
index a044fb7..c32ad0b 100644
--- a/services/api/app/controllers/arvados/v1/users_controller.rb
+++ b/services/api/app/controllers/arvados/v1/users_controller.rb
@@ -114,6 +114,13 @@ class Arvados::V1::UsersController < ApplicationController
show
end
+ # update profile for the user
+ def profile
+ reload_object_before_update
+ @object.profile params
+ show
+ end
+
protected
def self._setup_requires_parameters
diff --git a/services/api/app/models/user.rb b/services/api/app/models/user.rb
index d27b4fe..a9dd7e8 100644
--- a/services/api/app/models/user.rb
+++ b/services/api/app/models/user.rb
@@ -198,6 +198,19 @@ class User < ArvadosModel
self.save!
end
+ # update current user profile
+ def profile updated_profile
+ user_profile = self.prefs['profile']
+ user_profile ||= {}
+ updated_profile.each do |entry|
+ if entry[0].starts_with? 'profile_'
+ user_profile[entry[0].partition('_').last] = entry[1]
+ end
+ end
+ self.prefs['profile'] = user_profile
+ self.save!
+ end
+
protected
def ensure_ownership_path_leads_to_user
diff --git a/services/api/config/routes.rb b/services/api/config/routes.rb
index 74d2aea..85991f3 100644
--- a/services/api/config/routes.rb
+++ b/services/api/config/routes.rb
@@ -52,6 +52,7 @@ Server::Application.routes.draw do
post 'activate', on: :member
post 'setup', on: :collection
post 'unsetup', on: :member
+ post 'profile', on: :member
end
resources :virtual_machines do
get 'logins', on: :member
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list