@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Don't show the delete button on a deleted document

Summary:
This doesn't actually contain any logic to prevent a user from deleting a
document twice, but it makes it significantly harder to do so.

Test Plan:
Went to edit a document, saw the delete button. Clicked it, then went back to
the edit view, and no longer saw the delete button.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3952

authored by

Ricky Elrod and committed by
epriestley
7fac80cb 90dedc16

+10 -8
+10 -8
src/applications/phriction/controller/PhrictionEditController.php
··· 154 154 ->setErrors($errors); 155 155 } 156 156 157 + $delete_button = null; 157 158 if ($document->getID()) { 158 159 $panel_header = 'Edit Phriction Document'; 159 160 $submit_button = 'Save Changes'; 160 - $delete_button = phutil_render_tag( 161 - 'a', 162 - array( 163 - 'href' => '/phriction/delete/'.$document->getID().'/', 164 - 'class' => 'grey button', 165 - ), 166 - 'Delete Document'); 161 + if ($document->getStatus() != PhrictionDocumentStatus::STATUS_DELETED) { 162 + $delete_button = phutil_render_tag( 163 + 'a', 164 + array( 165 + 'href' => '/phriction/delete/'.$document->getID().'/', 166 + 'class' => 'grey button', 167 + ), 168 + 'Delete Document'); 169 + } 167 170 } else { 168 171 $panel_header = 'Create New Phriction Document'; 169 172 $submit_button = 'Create Document'; 170 - $delete_button = null; 171 173 } 172 174 173 175 $uri = $document->getSlug();