def move_or_copy action
uuids_to_add = params["selection"]
+ uuids_to_add = [ uuids_to_add ] unless uuids_to_add.is_a? Array
uuids_to_add.
collect { |x| ArvadosBase::resource_class_for_uuid(x) }.
uniq.
return render_not_found("object not found")
end
respond_to do |f|
- f.json { render json: @object.attributes.merge(href: url_for(@object)) }
+ f.json { render json: @object.attributes.merge(href: url_for(action: :show, id: @object)) }
f.html {
if params['tab_pane']
render_pane params['tab_pane']
@object ||= model_class.new @new_resource_attrs, params["options"]
if @object.save
respond_to do |f|
- f.json { render json: @object.attributes.merge(href: url_for(@object)) }
+ f.json { render json: @object.attributes.merge(href: url_for(action: :show, id: @object)) }
f.html {
redirect_to @object
}
skip_before_filter :find_object_by_uuid, only: [:welcome, :activity, :storage]
before_filter :ensure_current_user_is_admin, only: [:sudo, :unsetup, :setup]
+ def show
+ if params[:uuid] == current_user.uuid
+ redirect_to project_path(params[:uuid])
+ else
+ super
+ end
+ end
+
def welcome
if current_user
redirect_to (params[:return_to] || '/')
+<% content_for :tab_line_buttons do %>
+ <%= link_to(
+ choose_projects_path(
+ title: 'Copy to project...',
+ my_root_selectable: true,
+ 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 arv-move-to-project", remote: true, method: 'get' }) do %>
+ <i class="fa fa-fw fa-copy"></i> Copy to project...
+ <% end %>
+<% end %>
+
<div class="row row-fill-height">
<div class="col-md-6">
<div class="panel panel-info">
<div class="modal-footer">
<button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Cancel</button>
- <button class="btn btn-primary" aria-hidden="true"><%= params[:action_name] || 'Select' %></button>
+ <button class="btn btn-primary" aria-hidden="true" data-enable-if-selection disabled><%= params[:action_name] || 'Select' %></button>
<div class="modal-error hide" style="text-align: left; margin-top: 1em;">
</div>
</div>