X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/70fa68ef9087dd85d6e18fba2ef11f94ddeb95a4..16413f6ebe1bba3a070cdff3d7436ad508db8514:/apps/workbench/app/views/folders/show.html.erb diff --git a/apps/workbench/app/views/folders/show.html.erb b/apps/workbench/app/views/folders/show.html.erb index 200b0f36e3..ebf504ef7e 100644 --- a/apps/workbench/app/views/folders/show.html.erb +++ b/apps/workbench/app/views/folders/show.html.erb @@ -2,17 +2,17 @@
-

- <%= render_editable_attribute @object, 'name', nil, { 'data-emptytext' => "New folder" } %> -

+

+ <%= render_editable_attribute @object, 'name', nil, {data: {emptytext: "New folder"}} %> +

-

- <%= render_editable_attribute @object, 'description', nil, { 'data-emptytext' => "Created: #{@object.created_at.to_s(:long)}", 'data-toggle' => 'manual', 'id' => "#{@object.uuid}-description" } %> -

+ <%= render_editable_attribute @object, 'description', nil, { 'data-emptytext' => "Created: #{@object.created_at.to_s(:long)}", 'data-toggle' => 'manual', 'id' => "#{@object.uuid}-description" } %> <% if @object.attribute_editable? 'description' %> - Edit description +
+ Edit description +
<% end %>
@@ -20,34 +20,32 @@
-

- Activity -

+

+ Activity +

-
- <% @logs[0..2].each do |log| %> -

- <%= time_ago_in_words(log.event_at) %> ago: <%= log.summary %> - <% if log.object_uuid %> - <%= link_to_if_arvados_object log.object_uuid, link_text: raw('') %> - <% end %> -

- <% end %> +
<% if @logs.any? %> - <%= link_to raw('Show all activity   '), - logs_path(filters: [['object_uuid','=',@object.uuid]].to_json), - class: 'btn btn-sm btn-default' %> + <%= render_arvados_object_list_start(@logs, 'Show all activity', + logs_path(filters: [['object_uuid','=',@object.uuid]].to_json)) do |log| %> +

+ <%= time_ago_in_words(log.event_at) %> ago: <%= log.summary %> + <% if log.object_uuid %> + <%= link_to_if_arvados_object log.object_uuid, link_text: raw('') %> + <% end %> +

+ <% end %> <% else %> -

- Created: <%= @object.created_at.to_s(:long) %> -

-

- Last modified: <%= @object.modified_at.to_s(:long) %> by <%= link_to_if_arvados_object @object.modified_by_user_uuid, friendly_name: true %> -

+

+ Created: <%= @object.created_at.to_s(:long) %> +

+

+ Last modified: <%= @object.modified_at.to_s(:long) %> by <%= link_to_if_arvados_object @object.modified_by_user_uuid, friendly_name: true %> +

<% end %>
@@ -55,23 +53,46 @@
-

- Sharing and permissions -

+

+ Sharing and permissions +

-
-

Owner: <%= link_to_if_arvados_object @object.owner_uuid, friendly_name: true %>

- <% if @share_links.any? %> -

Shared with: - <% @share_links.andand.each do |link| %> -
<%= link_to_if_arvados_object link.tail_uuid, friendly_name: true %> +

+ <% if @object.owner %> +

Permissions inherited from: +
+ <% if User == resource_class_for_uuid(@object.owner_uuid) %> + + <% else %> + + <% end %> + <%= link_to_if_arvados_object @object.owner_uuid, friendly_name: true %> + <%= button_to('Move to...', + choose_folders_path( + title: 'Move to...', + editable: true, + action_name: 'Move', + action_href: folder_path(@object.uuid), + action_method: 'put', + action_data: {selection_param: 'folder[owner_uuid]'}.to_json), + { class: "btn btn-default btn-xs arv-move-to-folder", remote: true, method: 'get' }) %> +

+
+ <% end %> +

+ <% if not @share_links.any? %> + (No additional permissions) + <% else %> + Also shared with: + <% @share_links.andand.each do |link| %> +
<%= link_to_if_arvados_object link.tail_uuid, friendly_name: true %> + <% end %> <% end %>

- <% end %>
@@ -112,7 +133,7 @@
- +
@@ -128,31 +149,39 @@ - + + <% @objects_and_names.each do |object, name_link| %> - - - <%= render :partial => "selection_checkbox", :locals => {object: object} %> - - - <%= render :partial => "show_object_button", :locals => {object: object, size: 'xs'} %> - - - <%= render_editable_attribute name_link, 'name', nil, { 'data-emptytext' => "Unnamed #{object.class}" } %> - - - <%= object.content_summary %> - - - - <%= raw distance_of_time_in_words(object.modified_at, Time.now).sub('about ','~').sub(' ',' ') + ' ago' rescue object.modified_at %> - - - - <%= object.uuid %> - - + + + <%= render :partial => "selection_checkbox", :locals => {object: object} %> + + + <%= render :partial => "show_object_button", :locals => {object: object, size: 'xs'} %> + + + <%= render_editable_attribute name_link, 'name', nil, {data: {emptytext: "Unnamed #{object.class_for_display}"}} %> + + + <%= object.content_summary %> + + + + <%= raw distance_of_time_in_words(object.modified_at, Time.now).sub('about ','~').sub(' ',' ') + ' ago' rescue object.modified_at %> + + + + <%= object.uuid %> + + + <% if @object.editable? %> + <%= link_to({action: 'remove_item', id: @object.uuid, item_uuid: ((name_link && name_link.uuid) || object.uuid)}, method: :delete, remote: true, data: {confirm: "You are about to remove #{object.class_for_display} #{object.uuid} from this folder.\n\nAre you sure?"}, class: 'btn btn-xs btn-default') do %> + Remove + <% end %> + <% end %> + + <% end %> @@ -173,6 +202,8 @@ uuid + +