8784: Fix test for latest firefox.
[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.andand.uuid # Not the "Home" project %>
15   <% content_for :tab_line_buttons do %>
16     <% if current_user.andand.is_active %>
17       <%= render partial: 'extra_tab_line_buttons' %>
18     <% end %>
19     <% if current_user.andand.is_active && @object.class.copies_to_projects? %>
20       <%= link_to(
21           choose_projects_path(
22            title: "Copy this #{object_class} to:",
23            action_name: 'Copy',
24            action_href: actions_path,
25            action_method: 'post',
26            action_data: {
27              copy_selections_into_project: true,
28              selection: @name_link.andand.uuid || @object.uuid,
29              selection_param: 'uuid',
30              success: 'redirect-to-created-object'
31            }.to_json),
32           { class: "btn btn-sm btn-primary", remote: true, method: 'get',
33             title: "Make a copy of this #{object_class}" }) do %>
34         <i class="fa fa-fw fa-copy"></i> Copy to project...
35       <% end %>
36     <% end %>
37     <% if (ArvadosBase.find(@object.owner_uuid).writable_by.include?(current_user.andand.uuid) rescue nil) %>
38       <%= link_to(
39           choose_projects_path(
40            title: "Move this #{object_class} to:",
41            action_name: 'Move',
42            action_href: actions_path,
43            action_method: 'post',
44            action_data: {
45              move_selections_into_project: true,
46              selection: @name_link.andand.uuid || @object.uuid,
47              selection_param: 'uuid',
48              success: 'redirect-to-created-object'
49            }.to_json),
50           { class: "btn btn-sm btn-primary force-cache-reload", remote: true, method: 'get',
51             title: "Move this #{object_class} to a different project"}) do %>
52         <i class="fa fa-fw fa-truck"></i> Move <%=object_class%>...
53       <% end %>
54     <% end %>
55   <% end %>
56 <% end %>
57
58 <% unless flash["error"].blank? %>
59 <div class="flash-message alert alert-danger" role="alert">
60   <p class="contain-align-left"><%= flash["error"] %></p>
61 </div>
62 <% flash.delete("error") %>
63 <% end %>
64
65 <% unless flash.empty? %>
66 <div class="flash-message alert alert-warning">
67   <% flash.each do |_, msg| %>
68   <p class="contain-align-left"><%= msg %></p>
69   <% end %>
70 </div>
71 <% end %>