4025: add tooltips to some of the tab line buttons and also adjust the title of the...
[arvados.git] / apps / workbench / app / views / application / _title_and_buttons.html.erb
1 <% object_class = @object.class_for_display.downcase %>
2 <% content_for :page_title do %>
3   <%= (@object.respond_to?(:properties) and !@object.properties.nil? ? @object.properties[:page_title] : nil) ||
4       @name_link.andand.name ||
5       @object.friendly_link_name %>
6 <% end %>
7
8 <% content_for :content_top do %>
9   <% if !['Group','User', 'Collection'].include? @object.class.to_s # projects and collections handle it themselves %>
10     <%= render partial: 'name_and_description' %>
11   <% end %>
12 <% end %>
13
14 <% if @object.class.goes_in_projects? && @object.uuid != current_user.uuid # Not the "Home" project %>
15   <% content_for :tab_line_buttons do %>
16     <% if @object.class.copies_to_projects? %>
17       <%= link_to(
18           choose_projects_path(
19            title: "Copy this #{object_class} to:",
20            action_name: 'Copy',
21            action_href: actions_path,
22            action_method: 'post',
23            action_data: {
24              copy_selections_into_project: true,
25              selection: @name_link.andand.uuid || @object.uuid,
26              selection_param: 'uuid',
27              success: 'redirect-to-created-object'
28            }.to_json),
29           { class: "btn btn-sm btn-primary", remote: true, method: 'get', title: "Copy this #{object_class} to a different project" }) do %>
30         <i class="fa fa-fw fa-copy"></i> Copy to project...
31       <% end %>
32     <% end %>
33     <% if @object.owner_uuid == current_user.uuid or (Group.find(@object.owner_uuid).writable_by.include?(current_user.uuid) rescue nil) %>
34       <%= link_to(
35           choose_projects_path(
36            title: "Move this #{object_class} to:",
37            action_name: 'Move',
38            action_href: actions_path,
39            action_method: 'post',
40            action_data: {
41              move_selections_into_project: true,
42              selection: @name_link.andand.uuid || @object.uuid,
43              selection_param: 'uuid',
44              success: 'redirect-to-created-object'
45            }.to_json),
46           { class: "btn btn-sm btn-primary", remote: true, method: 'get', title: "Move this #{object_class} to a different project"}) do %>
47         <i class="fa fa-fw fa-truck"></i> Move...
48       <% end %>
49     <% end %>
50   <% end %>
51 <% end %>