[ARVADOS] updated: 700fcdd3594713fc2f692d5c3c31474f0c8e14ff
git at public.curoverse.com
git at public.curoverse.com
Tue Sep 16 16:23:11 EDT 2014
Summary of changes:
apps/workbench/app/models/arvados_base.rb | 6 +++++
apps/workbench/app/models/group.rb | 4 +++
apps/workbench/app/views/application/show.html.erb | 30 ++++++++++++----------
services/api/app/models/arvados_model.rb | 6 -----
4 files changed, 26 insertions(+), 20 deletions(-)
via 700fcdd3594713fc2f692d5c3c31474f0c8e14ff (commit)
via 454e8fd7bbe6afdfd5fe9905cd0376741bf5f9a0 (commit)
from aff3c1ad491cf4ce7fe7912eaf17c1109d35faf6 (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 700fcdd3594713fc2f692d5c3c31474f0c8e14ff
Author: Phil Hodgson <bitbucket at philhodgson.net>
Date: Tue Sep 16 16:23:08 2014 -0400
3661: add centralized method for defining whether an object can be copied to a project
diff --git a/apps/workbench/app/models/arvados_base.rb b/apps/workbench/app/models/arvados_base.rb
index 083db91..7bc043c 100644
--- a/apps/workbench/app/models/arvados_base.rb
+++ b/apps/workbench/app/models/arvados_base.rb
@@ -318,6 +318,12 @@ class ArvadosBase < ActiveRecord::Base
false
end
+ # can this class of object be copied into a project?
+ # override to false on indivudal model classes for which this should not be true
+ def self.copies_to_projects?
+ self.goes_in_projects?
+ end
+
def editable?
(current_user and current_user.is_active and
(current_user.is_admin or
diff --git a/apps/workbench/app/models/group.rb b/apps/workbench/app/models/group.rb
index d478198..3f5da15 100644
--- a/apps/workbench/app/models/group.rb
+++ b/apps/workbench/app/models/group.rb
@@ -3,6 +3,10 @@ class Group < ArvadosBase
true
end
+ def self.copies_to_projects?
+ false
+ end
+
def self.contents params={}
res = arvados_api_client.api self, "/contents", {
_method: 'GET'
diff --git a/apps/workbench/app/views/application/show.html.erb b/apps/workbench/app/views/application/show.html.erb
index 264e019..ac74335 100644
--- a/apps/workbench/app/views/application/show.html.erb
+++ b/apps/workbench/app/views/application/show.html.erb
@@ -8,20 +8,22 @@
<% if @object.class.goes_in_projects? && @object.uuid != current_user.uuid # Not the "Home" project %>
<% content_for :tab_line_buttons do %>
- <%= link_to(
- choose_projects_path(
- title: 'Copy to project...',
- action_name: 'Copy',
- action_href: actions_path,
- action_method: 'post',
- action_data: {
- copy_selections_into_project: true,
- selection: @name_link.andand.uuid || @object.uuid,
- selection_param: 'uuid',
- success: 'redirect-to-created-object'
- }.to_json),
- { class: "btn btn-sm btn-primary", remote: true, method: 'get' }) do %>
- <i class="fa fa-fw fa-copy"></i> Copy to project...
+ <% if @object.class.copies_to_projects? %>
+ <%= link_to(
+ choose_projects_path(
+ title: 'Copy to project...',
+ action_name: 'Copy',
+ action_href: actions_path,
+ action_method: 'post',
+ action_data: {
+ copy_selections_into_project: true,
+ selection: @name_link.andand.uuid || @object.uuid,
+ selection_param: 'uuid',
+ success: 'redirect-to-created-object'
+ }.to_json),
+ { class: "btn btn-sm btn-primary", remote: true, method: 'get' }) do %>
+ <i class="fa fa-fw fa-copy"></i> Copy to project...
+ <% end %>
<% end %>
<% if @object.owner_uuid == current_user.uuid or (Group.find(@object.owner_uuid).writable_by.include?(current_user.uuid) rescue nil) %>
<%= link_to(
commit 454e8fd7bbe6afdfd5fe9905cd0376741bf5f9a0
Author: Phil Hodgson <bitbucket at philhodgson.net>
Date: Tue Sep 16 16:22:14 2014 -0400
3661: removed useless method to wrong project
(fix from last commit)
diff --git a/services/api/app/models/arvados_model.rb b/services/api/app/models/arvados_model.rb
index 4ef62c9..1138bd2 100644
--- a/services/api/app/models/arvados_model.rb
+++ b/services/api/app/models/arvados_model.rb
@@ -205,12 +205,6 @@ class ArvadosModel < ActiveRecord::Base
head_uuid: target_uuid).any?
end
- # can this class of object go into a project?
- # default to false, override to true on individual model classes
- def self.goes_in_projects?
- false
- end
-
protected
def ensure_ownership_path_leads_to_user
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list