]> git.openstreetmap.org Git - rails.git/blobdiff - app/views/account/deletions/show.html.erb
Merge branch 'pull/5196'
[rails.git] / app / views / account / deletions / show.html.erb
index 99c1686d85c0943c2aaec65293c1b0ac24ae3f48..9b9b0f182ccd88caae6844096ce887594294c257 100644 (file)
@@ -6,10 +6,7 @@
 
 <div class="alert alert-danger row mx-0 p-3 align-items-center">
   <div class="col-auto">
-    <picture>
-      <source srcset="<%= image_path "notice.svg" %>" type="image/svg+xml"></source>
-      <%= image_tag("notice.png", :srcset => image_path("notice.svg")) %>
-    </picture>
+    <%= notice_svg_tag %>
   </div>
   <div class="col">
     <p class="mb-0"><%= t ".warning" %></p>
   <li><%= t ".retain_email" %></li>
 </ul>
 
-<%= link_to t(".delete_account"), account_path, { :method => :delete, :class => "btn btn-danger", :data => { :confirm => t(".confirm_delete") } } %>
+<% if current_user.deletion_allowed? %>
+  <%= link_to t(".delete_account"), account_path, { :method => :delete, :class => "btn btn-danger", :data => { :confirm => t(".confirm_delete") } } %>
+<% else %>
+  <div class="alert alert-warning">
+    <%= t ".recent_editing_html", :time => friendly_date(current_user.deletion_allowed_at) %>
+  </div>
+  <button class="btn btn-secondary" disabled><%= t(".delete_account") %></button>
+<% end %>
+
 <%= link_to t(".cancel"), edit_account_path, :class => "btn btn-link" %>