1 <%# Copyright (C) The Arvados Authors. All rights reserved.
3 SPDX-License-Identifier: AGPL-3.0 %>
6 if (controller.andand.action_name == 'show') and params[:uuid]
7 check_trash = controller.model_class.include_trash(true).where(uuid: params[:uuid])
8 class_name = controller.model_class.to_s.underscore
9 class_name_h = class_name.humanize(capitalize: false)
10 req_item = safe_join([class_name_h, " with UUID ",
11 raw("<code>"), params[:uuid], raw("</code>")], "")
12 req_item_plain_text = safe_join([class_name_h, " with UUID ", params[:uuid]])
14 req_item = "page you requested"
15 req_item_plain_text = "page you requested"
19 <% untrash_object = nil %>
21 <% if check_trash.andand.any? %>
22 <% object = check_trash.first %>
23 <% if object.respond_to?(:is_trashed) && object.is_trashed %>
24 <% untrash_object = object %>
28 <% owner = Group.where(uuid: owner.owner_uuid).include_trash(true).first %>
32 <% if owner.is_trashed %>
33 <% untrash_object = owner %>
40 <% if !untrash_object.nil? %>
43 <% untrash_name = if !untrash_object.name.blank? then
44 "'#{untrash_object.name}'"
49 <p>The <%= req_item %> is
50 <% if untrash_object == object %>
53 owned by trashed project <%= untrash_name %> (<code><%= untrash_object.uuid %></code>).
58 It will be permanently deleted at <%= render_localized_date(untrash_object.delete_at) %>.
62 <% if untrash_object != object %>
63 You must untrash the owner project to access this <%= class_name_h %>.
65 <% if untrash_object.is_trashed and untrash_object.editable? %>
66 <% msg = "Untrash '#{untrash_name}'?" %>
67 <%= link_to({action: 'untrash_items', selection: [untrash_object.uuid], controller: :trash_items}, remote: true, method: :post,
68 title: "Untrash", style: 'cursor: pointer;') do %>
72 <%= form_tag url_for({action: 'untrash_items', controller: :trash_items}), {method: :post} %>
73 <%= hidden_field_tag :selection, [untrash_object.uuid] %>
74 <button type="submit">Click here to untrash <%= untrash_name %> <i class="fa fa-fw fa-recycle"></i></button>
82 <p>The <%= req_item %> was not found.</p>
84 <% if !current_user %>
87 <%= link_to(arvados_api_client.arvados_login_url(return_to: strip_token_from_path(request.url)),
88 {class: "btn btn-primary report-issue-modal-window"}) do %>
89 <i class="fa fa-fw fa-sign-in"></i> Log in
94 <% elsif class_name %>
97 Perhaps you'd like to <%= link_to("browse all
98 #{class_name_h.pluralize}", action: :index, controller:
99 class_name.tableize) %>?
106 <% error_message = "The #{req_item_plain_text} was not found." %>
107 <%= render :partial => "report_error", :locals => {error_message: error_message, error_type: '404'} %>