var data = [];
var param_name = $(this).attr('data-selection-param-name');
var href = $(this).attr('data-href');
+ if ($(this).closest('.disabled').length > 0) {
+ return false;
+ }
$('.persistent-selection:checkbox:checked').each(function() {
data.push({name: param_name, value: $(this).val()});
});
padding-bottom: 1em;
}
.arv-description-in-table {
- max-height: 3.5em;
+ height: 4em;
overflow-x: hidden;
overflow-y: hidden;
}
tail_uuid: @object.uuid,
head_uuid: src.uuid,
link_class: 'name',
- name: @object.uuid)
+ name: src.uuid)
else
case action
when :copy
@project_links = Link.limit(RELATION_LIMIT).order("modified_at DESC")
.where(head_uuid: @object.uuid, link_class: 'name').results
project_hash = Group.where(uuid: @project_links.map(&:tail_uuid)).to_hash
- @projects = @project_links.map { |link| project_hash[link.tail_uuid] }
+ @projects = project_hash.values
@permissions = Link.limit(RELATION_LIMIT).order("modified_at DESC")
.where(head_uuid: @object.uuid, link_class: 'permission',
name: 'can_read').results
end
end
+ def destroy
+ while (objects = Link.filter([['owner_uuid','=',@object.uuid],
+ ['tail_uuid','=',@object.uuid]])).any?
+ objects.each do |object|
+ object.destroy
+ end
+ end
+ while (objects = @object.contents(include_linked: false)).any?
+ objects.each do |object|
+ object.update_attributes! owner_uuid: current_user.uuid
+ end
+ end
+ super
+ end
+
def find_objects_for_index
@objects = Group.
filter([['group_class','in',['project','folder']]]).
<% content_for :content_top do %>
- <% if @object and not @object.is_a?(Group) and @object.class.goes_in_projects? and @object.owner_uuid == current_user.uuid %>
+ <% if @object and not @object.is_a?(Group) and @object.class.goes_in_projects? and @object.owner_uuid == current_user.uuid and not @name_link %>
<div class="pull-right" style="width: 40%">
<div class="alert alert-warning alert-dismissable">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
-<%if object and object.class.goes_in_projects? %>
+<%if object and (object.class.goes_in_projects? or (object.is_a?(Link) and ArvadosBase::resource_class_for_uuid(object.head_uuid).to_s == 'Collection')) %>
<% fn = if defined? friendly_name
friendly_name
else
<div class="panel panel-info">
<div class="panel-heading">
<h3 class="panel-title">
- <% i = 0 %>
- <% @project_links.each do |l| %>
- <%= if i > 0 then ', ' end %>
- <% i += 1 %>
- <%= l.name %>
- <% end %>
+ <%= @name_link.andand.name || @object.uuid %>
</h3>
</div>
<div class="panel-body">
<img src="/favicon.ico" class="pull-right" alt="" style="opacity: 0.3"/>
+ <p><i>Content hash:</i><br />
+ <span class="arvados-uuid"><%= @object.uuid %></span></p>
+
<% if not (@output_of.andand.any? or @log_of.andand.any?) %>
<p><i>No source information available.</i></p>
<% end %>
<% if @output_of.andand.any? %>
- <p>This collection was the output of:<br />
+ <p><i>This collection was the output of:</i><br />
<%= render_arvados_object_list_start(@output_of, 'Show all jobs',
jobs_path(filter: [['output', '=', @object.uuid]].to_json)) do |job| %>
<%= link_to_if_arvados_object(job, friendly_name: true) %><br />
<% end %>
<% if @log_of.andand.any? %>
- <p>This collection contains log messages from:<br />
+ <p><i>This collection contains log messages from:</i><br />
<%= render_arvados_object_list_start(@log_of, 'Show all jobs',
jobs_path(filter: [['log', '=', @object.uuid]].to_json)) do |job| %>
<%= link_to_if_arvados_object(job, friendly_name: true) %><br />
<%= render_arvados_object_list_start(@projects, 'Show all projects',
links_path(filter: [['head_uuid', '=', @object.uuid],
['link_class', '=', 'name']].to_json)) do |project| %>
- <%= link_to_if_arvados_object(project, friendly_name: true) %><br />
+ <%= link_to_if_arvados_object(project, friendly_name: true) %><br />
<% end %>
</p>
<% end %>
<% end %>
My projects
</li>
- <% my_projects.each do |p| %>
- <li>
- <%= link_to(p.name, project_path(p.uuid)) %>
+ <% @my_project_tree.each do |pnode| %>
+ <% next if pnode[:object].class != Group %>
+ <li style="padding-left: <%= pnode[:depth]-1 %>em">
+ <%= link_to(pnode[:object].name, project_path(pnode[:object].uuid)) %>
</li>
<% end %>
<li class="divider">
<li role="presentation" class="dropdown-header">
Projects shared with me
</li>
- <% projects_shared_with_me.each do |p| %>
- <li>
- <%= link_to project_path(p.uuid) do %>
- <i class="fa fa-fw fa-share-alt"></i> <%= p.name %>
+ <% @shared_project_tree.each do |pnode| %>
+ <% next if pnode[:object].class != Group %>
+ <li style="padding-left: <%= pnode[:depth]-1 %>em">
+ <%= link_to project_path(pnode[:object].uuid) do %>
+ <i class="fa fa-fw fa-share-alt" style="color:#aaa"></i> <%= pnode[:object].name %>
<% end %>
</li>
<% end %>
<%= link_to(p.name, project_path(p.uuid), data: {object_uuid: p.uuid, name: 'name'}) %>
</li>
<% end %>
- <% if current_project_uuid.andand != @object.andand.uuid %>
- <li class="nav-separator">
- <i class="fa fa-lg fa-angle-double-right"></i>
- </li>
- <% end %>
</ul>
</nav>
<% end %>
-<% template = PipelineTemplate.find(@object.pipeline_template_uuid) rescue nil %>
-<%= content_for :content_top do %>
- <h2>
- <%= render_editable_attribute @object, 'name', nil %>
- </h2>
- <% if template %>
- <blockquote><span class="deemphasize">From template:</span><br />
- <%= link_to_if_arvados_object template, friendly_name: true %><br />
- <%= template.description %>
- </blockquote>
- <% end %>
-<% end %>
-
-<% content_for :tab_line_buttons do %>
- <%= link_to(copy_pipeline_instance_path('id' => @object.uuid, 'pipeline_instance[state]' => 'New'),
- class: 'btn btn-primary',
- #data: {toggle: :tooltip, placement: :top}, title: 'copy and modify',
- method: :post,
- ) do %>
- Clone and edit <i class="fa fa-fw fa-copy"></i>
- <% end %>
-<% end %>
-
<% if !@object.state.in? ['New', 'Ready'] %>
- <% content_for :tab_line_buttons do %>
- <% if @object.state.in? ['RunningOnClient', 'RunningOnServer'] %>
- <%= link_to(url_for('pipeline_instance[state]' => 'Paused'),
- class: 'btn btn-primary run-pipeline-button',
- method: :patch
- ) do %>
- Stop <i class="fa fa-fw fa-stop"></i>
- <% end %>
- <% elsif @object.state == 'Paused' %>
- <%= link_to(url_for('pipeline_instance[state]' => 'RunningOnServer'),
- class: 'btn btn-primary run-pipeline-button',
- method: :patch
- ) do %>
- Resume <i class="fa fa-fw fa-play"></i>
- <% end %>
- <% end %>
- <% end %>
-
<% pipeline_job_uuids = [] %>
<div class="pull-right">
<% if @object.state.in? %w(RunningOnServer RunningOnClient) %>
- <% content_for :js do %>
- setInterval(function(){$('a.refresh').click()}, 15000);
- <% end %>
-
<% if !pipeline_job_uuids.empty? %>
<h4>Log messages from running jobs</h4>
<% log_history = pipeline_log_history(pipeline_job_uuids) %>
<p><i>Here are all of the pipeline's components (jobs that will need to run in order to complete the pipeline). If you know what you're doing (or you're experimenting) you can modify these parameters before starting the pipeline. Usually, you only need to edit the settings presented on the "Inputs" tab above.</i></p>
<% end %>
- <% content_for :tab_line_buttons do %>
- <%= link_to(url_for('pipeline_instance[state]' => 'RunningOnServer'),
- class: 'btn btn-primary run-pipeline-button',
- method: :patch
- ) do %>
- Run <i class="fa fa-fw fa-play"></i>
- <% end %>
- <% end %>
-
<% if @object.state.in? ['New', 'Ready'] %>
<%= render partial: 'show_components_editable', locals: {editable: true} %>
<% else %>
+++ /dev/null
-../application/show.html.erb
\ No newline at end of file
--- /dev/null
+<% template = PipelineTemplate.find?(@object.pipeline_template_uuid) %>
+<%= content_for :content_top do %>
+ <h2>
+ <%= render_editable_attribute @object, 'name', nil %>
+ </h2>
+ <% if template %>
+ <blockquote><span class="deemphasize">From template:</span><br />
+ <%= link_to_if_arvados_object template, friendly_name: true %><br />
+ <%= template.description %>
+ </blockquote>
+ <% end %>
+<% end %>
+
+<% content_for :tab_line_buttons do %>
+ <%= link_to(copy_pipeline_instance_path('id' => @object.uuid, 'pipeline_instance[state]' => 'New'),
+ class: 'btn btn-primary',
+ #data: {toggle: :tooltip, placement: :top}, title: 'copy and modify',
+ method: :post,
+ ) do %>
+ Clone and edit <i class="fa fa-fw fa-copy"></i>
+ <% end %>
+
+ <% if @object.state.in? ['New', 'Ready'] %>
+ <%= link_to(url_for('pipeline_instance[state]' => 'RunningOnServer'),
+ class: 'btn btn-primary run-pipeline-button',
+ method: :patch
+ ) do %>
+ Run <i class="fa fa-fw fa-play"></i>
+ <% end %>
+ <% else %>
+ <% if @object.state.in? ['RunningOnClient', 'RunningOnServer'] %>
+ <%= link_to(url_for('pipeline_instance[state]' => 'Paused'),
+ class: 'btn btn-primary run-pipeline-button',
+ method: :patch
+ ) do %>
+ Stop <i class="fa fa-fw fa-stop"></i>
+ <% end %>
+ <% elsif @object.state == 'Paused' %>
+ <%= link_to(url_for('pipeline_instance[state]' => 'RunningOnServer'),
+ class: 'btn btn-primary run-pipeline-button',
+ method: :patch
+ ) do %>
+ Resume <i class="fa fa-fw fa-play"></i>
+ <% end %>
+ <% end %>
+ <% end %>
+<% end %>
+
+<% if @object.state.in? %w(RunningOnServer RunningOnClient) %>
+ <% content_for :js do %>
+ setInterval(function(){$('a.refresh').click()}, 15000);
+ <% end %>
+<% end %>
+
+<%= render partial: 'content', layout: 'content_layout', locals: {pane_list: controller.show_pane_list }%>
<% any = false %>
<% recent_jobs_and_pipelines[0..9].each do |object| %>
<% any = true %>
- <div class="row">
+ <div class="row" style="height: 4.5em">
<div class="col-sm-4">
<%= render :partial => "show_object_button", :locals => {object: object, size: 'xs'} %>
<% if object.respond_to?(:name) %>
- <%= render_editable_attribute object, 'name', nil, {tiptitle: 'rename', btnplacement: :left} %>
+ <%= render_editable_attribute object, 'name', nil, {tiptitle: 'rename'} %>
<% else %>
<%= object.class_for_display %> <%= object.uuid %>
<% end %>
action_method: 'post',
action_data: {selection_param: 'selection[]', copy_selections_into_project: @object.uuid, success: 'page-refresh'}.to_json),
{ class: "btn btn-primary btn-sm", remote: true, method: 'get', data: {'event-after-select' => 'page-refresh'} }) do %>
- <i class="fa fa-fw fa-plus"></i> Add data
+ <i class="fa fa-fw fa-plus"></i> Add data...
<% end %>
<%= link_to(
choose_pipeline_templates_path(
action_method: 'post',
action_data: {'selection_param' => 'pipeline_instance[pipeline_template_uuid]', 'pipeline_instance[owner_uuid]' => @object.uuid, 'success' => 'redirect-to-created-object'}.to_json),
{ class: "btn btn-primary btn-sm", remote: true, method: 'get' }) do %>
- <i class="fa fa-fw fa-gear"></i> Run a pipeline
+ <i class="fa fa-fw fa-gear"></i> Run a pipeline...
<% end %>
- <%= link_to projects_path(method: 'post', owner_uuid: @object.uuid), class: 'btn btn-sm btn-primary' do %>
+ <%= link_to projects_path('project[owner_uuid]' => @object.uuid), method: 'post', class: 'btn btn-sm btn-primary' do %>
<i class="fa fa-fw fa-plus"></i>
Add a subproject
<% end %>
action_method: 'put',
action_data: {selection_param: 'project[owner_uuid]', success: 'page-refresh'}.to_json),
{ class: "btn btn-sm btn-primary arv-move-to-project", remote: true, method: 'get' }) do %>
- <i class="fa fa-fw fa-truck"></i> Move to...
+ <i class="fa fa-fw fa-truck"></i> Move project...
<% end %>
- <% if @objects_and_names.empty? %>
- <%= button_to(project_path(id: @object.uuid, return_to: projects_path), method: 'delete', class: 'btn btn-sm btn-primary', data: {confirm: "Really delete project '#{@object.name}'?"}) do %>
- <i class="fa fa-fw fa-trash-o"></i> Delete project
- <% end %>
+ <%= link_to(project_path(id: @object.uuid, return_to: projects_path), method: 'delete', class: 'btn btn-sm btn-primary', data: {confirm: "Really delete project '#{@object.name}'?"}) do %>
+ <i class="fa fa-fw fa-trash-o"></i> Delete project
<% end %>
<% end %>
<% end %>
<div class="row">
<div class="col-sm-5">
<div class="btn-group btn-group-sm">
- <button type="button" class="btn btn-default">Selection...</button>
+ <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">Selection...</button>
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
<span class="sr-only">Toggle Dropdown</span>
data-kind="<%= object.kind %>"
>
<td>
- <%= render partial: 'selection_checkbox', locals: {object: object, friendly_name: ((name_object.name rescue '') || '')} %>
+ <%= render partial: 'selection_checkbox', locals: {object: name_object, friendly_name: ((name_object.name rescue '') || '')} %>
<% if project.editable? %>
<%= link_to({action: 'remove_item', id: project.uuid, item_uuid: ((name_link && name_link.uuid) || object.uuid)}, method: :delete, remote: true, data: {confirm: "Remove #{object.class_for_display.downcase} #{name_object.name rescue object.uuid} from this project?", toggle: 'tooltip', placement: 'top'}, class: 'btn btn-sm btn-default btn-nodecorate', title: 'remove') do %>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">
- Shared projects
+ Projects shared with me
</h3>
</div>
<div class="panel-body scroll-20em">