Merge branch 'master' into 8286-fav-projects
[arvados.git] / apps / workbench / app / views / projects / show.html.erb
1 <% content_for :content_top do %>
2   <h2>
3     <% if @object.uuid == current_user.andand.uuid %>
4       Home
5     <% else %>
6       <% starred = false %>
7       <% starred = true if is_starred %>
8       <% if starred %>
9         <%= link_to(url_for({action: 'star', status: 'delete', id: @object.uuid, controller: 'projects'}), method: :post, class: "btn btn-xs", title: "Undo favorite") do %>
10             <i class="fa fa-fw fa-star"></i>
11           <% end %>
12       <% else %>
13         <%= link_to(url_for({action: 'star', status: 'create', id: @object.uuid, controller: 'projects'}), method: :post, class: "btn btn-xs", title: "Mark favorite") do %>
14             <i class="fa fa-fw fa-star-o"></i>
15           <% end %>
16       <% end %>
17       <%= render_editable_attribute @object, 'name', nil, { 'data-emptytext' => "New project" } %>
18     <% end %>
19   </h2>
20 <% end %>
21
22 <% content_for :tab_line_buttons do %>
23   <% if @object.editable? %>
24     <div class="btn-group btn-group-sm">
25       <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown"><i class="fa fa-fw fa-plus"></i> Add data <span class="caret"></span></button>
26       <ul class="dropdown-menu pull-right" role="menu">
27         <li>
28           <%= link_to(
29                 choose_collections_path(
30                   title: 'Choose a collection to copy into this project:',
31                   multiple: true,
32                   action_name: 'Copy',
33                   action_href: actions_path(id: @object.uuid),
34                   action_method: 'post',
35                   action_data: {selection_param: 'selection[]', copy_selections_into_project: @object.uuid, success: 'page-refresh'}.to_json),
36                 { remote: true, data: {'event-after-select' => 'page-refresh', 'toggle' => 'dropdown'} }) do %>
37             <i class="fa fa-fw fa-clipboard"></i> Copy data from another project
38           <% end %>
39         </li>
40         <li>
41           <%= link_to(collections_path(options: {ensure_unique_name: true}, collection: {manifest_text: "", name: "New collection", owner_uuid: @object.uuid}, redirect_to_anchor: 'Upload'), {
42               method: 'post',
43               data: {toggle: 'dropdown'}}) do %>
44             <i class="fa fa-fw fa-upload"></i> Upload files from my computer
45           <% end %>
46         </li>
47       </ul>
48     </div>
49     <%= link_to(
50           choose_pipeline_templates_path(
51             title: 'Choose a pipeline to run:',
52             action_name: 'Next: choose inputs <i class="fa fa-fw fa-arrow-circle-right"></i>',
53             action_href: pipeline_instances_path,
54             action_method: 'post',
55             action_data: {'selection_param' => 'pipeline_instance[pipeline_template_uuid]', 'pipeline_instance[owner_uuid]' => @object.uuid, 'success' => 'redirect-to-created-object'}.to_json),
56           { class: "btn btn-primary btn-sm", remote: true, title: "Run a pipeline in this project" }) do %>
57       <i class="fa fa-fw fa-gear"></i> Run a pipeline...
58     <% end %>
59     <%= link_to projects_path({'project[owner_uuid]' => @object.uuid, 'options' => {'ensure_unique_name' => true}}), method: :post, title: "Add a subproject to this project", class: 'btn btn-sm btn-primary' do %>
60       <i class="fa fa-fw fa-plus"></i>
61       Add a subproject
62     <% end %>
63   <% end %>
64 <% end %>
65
66 <%= render file: 'application/show.html.erb', locals: local_assigns %>