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 <% if check_trash.andand.any? %>
22 <% object = check_trash.first %>
24 <% untrash_object = object %>
25 <% while !untrash_object.is_trashed %>
26 <% owner = Group.where(uuid: untrash_object.owner_uuid).include_trash(true).first %>
27 <% if owner.nil? then %>
30 <% untrash_object = owner %>
34 <% untrash_name = if !untrash_object.name.blank? then
35 "'#{untrash_object.name}'"
40 <p>The <%= req_item %> is
41 <% if untrash_object == object %>
44 owned by trashed project <%= untrash_name %> (<code><%= untrash_object.uuid %></code>).
49 It will be permanently deleted at <%= render_localized_date(untrash_object.delete_at) %>.
53 <% if untrash_object != object %>
54 You must untrash the owner project to access this <%= class_name_h %>.
56 <% if untrash_object.is_trashed and untrash_object.editable? %>
57 <% msg = "Untrash '#{untrash_name}'?" %>
58 <%= link_to({action: 'untrash_items', selection: [untrash_object.uuid], controller: :trash_items}, remote: true, method: :post,
59 title: "Untrash", style: 'cursor: pointer;') do %>
63 <%= form_tag url_for({action: 'untrash_items', controller: :trash_items}), {method: :post} %>
64 <%= hidden_field_tag :selection, [untrash_object.uuid] %>
65 <button type="submit">Click here to untrash <%= untrash_name %> <i class="fa fa-fw fa-recycle"></i></button>
73 <p>The <%= req_item %> was not found.</p>
75 <% if !current_user %>
78 <%= link_to(arvados_api_client.arvados_login_url(return_to: strip_token_from_path(request.url)),
79 {class: "btn btn-primary report-issue-modal-window"}) do %>
80 <i class="fa fa-fw fa-sign-in"></i> Log in
85 <% elsif class_name %>
88 Perhaps you'd like to <%= link_to("browse all
89 #{class_name_h.pluralize}", action: :index, controller:
90 class_name.tableize) %>?
97 <% error_message = "The #{req_item_plain_text} was not found." %>
98 <%= render :partial => "report_error", :locals => {error_message: error_message, error_type: '404'} %>