-<% if current_user.andand.is_active %>
-<% content_for :tab_line_buttons do %>
- <%= link_to(choose_projects_path(id: "run-pipeline-button",
- title: 'Choose project',
- editable: true,
- action_name: 'Choose',
- action_href: pipeline_instances_path,
- action_method: 'post',
- action_data: {selection_param: 'pipeline_instance[owner_uuid]',
- 'pipeline_instance[pipeline_template_uuid]' => @object.uuid,
- 'pipeline_instance[description]' => "Created at #{Time.now.localtime}" + (@object.name.andand.size.andand>0 ? " using the pipeline template *#{@object.name}*" : ""),
- 'success' => 'redirect-to-created-object'
- }.to_json),
- { class: "btn btn-primary btn-sm", remote: true, title: 'Run this pipeline' }
- ) do %>
- <i class="fa fa-gear"></i> Run this pipeline
- <% end %>
-<% end %>
+<% if @object.editable? %>
+ <% content_for :tab_line_buttons do %>
+ <%= link_to(choose_projects_path(
+ id: "run-pipeline-button",
+ title: 'Choose project',
+ editable: true,
+ action_name: 'Choose',
+ action_href: pipeline_instances_path,
+ action_method: 'post',
+ action_data: {
+ 'selection_param' => 'pipeline_instance[owner_uuid]',
+ 'pipeline_instance[pipeline_template_uuid]' => @object.uuid,
+ 'pipeline_instance[description]' => "Created at #{Time.now.localtime}" + (@object.name.andand.size.andand>0 ? " using the pipeline template *#{@object.name}*" : ""),
+ 'success' => 'redirect-to-created-object',
+ }.to_json), {
+ class: "btn btn-primary btn-sm",
+ remote: true,
+ title: 'Run this pipeline'
+ }) do %>
+ <i class="fa fa-gear"></i> Run this pipeline
+ <% end %>
+ <% end %>
<% end %>
<%= render file: 'application/show.html.erb', locals: local_assigns %>
<div class="btn-group btn-group-sm">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">Selection <span class="caret"></span></button>
<ul class="dropdown-menu" role="menu">
- <% if current_user.andand.is_active %>
- <li><%= link_to "Create new collection with selected collections", '#',
- 'data-href' => combine_selected_path(
- action_data: {current_project_uuid: @object.uuid}.to_json
- ),
- 'id' => 'combine_selections_button',
- method: :post,
- 'data-selection-param-name' => 'selection[]',
- 'data-selection-action' => 'combine-project-contents',
- 'data-toggle' => 'dropdown'
- %></li>
+ <% if Collection.creatable? %>
+ <li><%= link_to "Create new collection with selected collections", '#',
+ 'data-href' => combine_selected_path(
+ action_data: {current_project_uuid: @object.uuid}.to_json
+ ),
+ 'id' => 'combine_selections_button',
+ method: :post,
+ 'data-selection-param-name' => 'selection[]',
+ 'data-selection-action' => 'combine-project-contents',
+ 'data-toggle' => 'dropdown'
+ %></li>
<% end %>
<li><%= link_to "Compare selected", '#',
'data-href' => compare_pipeline_instances_path,
'data-selection-action' => 'compare',
'data-toggle' => 'dropdown'
%></li>
- <% if current_user.andand.is_active %>
- <li><%= link_to "Copy selected...", '#',
- 'data-href' => choose_projects_path(
- title: 'Copy selected items to...',
- editable: true,
- action_name: 'Copy',
- action_href: actions_path,
- action_method: 'post',
- action_data_from_params: ['selection'],
- action_data: {
- copy_selections_into_project: true,
- selection_param: 'uuid',
- success: 'page-refresh'}.to_json),
- 'data-remote' => true,
- 'data-selection-param-name' => 'selection[]',
- 'data-selection-action' => 'copy',
- 'data-toggle' => 'dropdown'
- %></li>
+ <% if Collection.creatable? %>
+ <li><%= link_to "Copy selected...", '#',
+ 'data-href' => choose_projects_path(
+ title: 'Copy selected items to...',
+ editable: true,
+ action_name: 'Copy',
+ action_href: actions_path,
+ action_method: 'post',
+ action_data_from_params: ['selection'],
+ action_data: {
+ copy_selections_into_project: true,
+ selection_param: 'uuid',
+ success: 'page-refresh'}.to_json),
+ 'data-remote' => true,
+ 'data-selection-param-name' => 'selection[]',
+ 'data-selection-action' => 'copy',
+ 'data-toggle' => 'dropdown'
+ %></li>
<% end %>
<% if @object.editable? %>
- <li><%= link_to "Move selected...", '#',
- 'data-href' => choose_projects_path(
- title: 'Move selected items to...',
- editable: true,
- action_name: 'Move',
- action_href: actions_path,
- action_method: 'post',
- action_data_from_params: ['selection'],
- action_data: {
- move_selections_into_project: true,
- selection_param: 'uuid',
- success: 'page-refresh'}.to_json),
- 'data-remote' => true,
- 'data-selection-param-name' => 'selection[]',
- 'data-selection-action' => 'move',
- 'data-toggle' => 'dropdown'
- %></li>
- <li><%= link_to "Remove selected", '#',
- method: :delete,
- 'data-href' => url_for(action: :remove_items),
- 'data-selection-param-name' => 'item_uuids[]',
- 'data-selection-action' => 'remove',
- 'data-remote' => true,
- 'data-toggle' => 'dropdown'
- %></li>
+ <li><%= link_to "Move selected...", '#',
+ 'data-href' => choose_projects_path(
+ title: 'Move selected items to...',
+ editable: true,
+ action_name: 'Move',
+ action_href: actions_path,
+ action_method: 'post',
+ action_data_from_params: ['selection'],
+ action_data: {
+ move_selections_into_project: true,
+ selection_param: 'uuid',
+ success: 'page-refresh'}.to_json),
+ 'data-remote' => true,
+ 'data-selection-param-name' => 'selection[]',
+ 'data-selection-action' => 'move',
+ 'data-toggle' => 'dropdown'
+ %></li>
+ <li><%= link_to "Remove selected", '#',
+ method: :delete,
+ 'data-href' => url_for(action: :remove_items),
+ 'data-selection-param-name' => 'item_uuids[]',
+ 'data-selection-action' => 'remove',
+ 'data-remote' => true,
+ 'data-toggle' => 'dropdown'
+ %></li>
<% end %>
</ul>
</div>