mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-22 23:02:42 +01:00
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
This commit is contained in:
parent
90dedc16a0
commit
7fac80cb9a
1 changed files with 10 additions and 8 deletions
|
@ -154,20 +154,22 @@ final class PhrictionEditController
|
|||
->setErrors($errors);
|
||||
}
|
||||
|
||||
$delete_button = null;
|
||||
if ($document->getID()) {
|
||||
$panel_header = 'Edit Phriction Document';
|
||||
$submit_button = 'Save Changes';
|
||||
$delete_button = phutil_render_tag(
|
||||
'a',
|
||||
array(
|
||||
'href' => '/phriction/delete/'.$document->getID().'/',
|
||||
'class' => 'grey button',
|
||||
),
|
||||
'Delete Document');
|
||||
if ($document->getStatus() != PhrictionDocumentStatus::STATUS_DELETED) {
|
||||
$delete_button = phutil_render_tag(
|
||||
'a',
|
||||
array(
|
||||
'href' => '/phriction/delete/'.$document->getID().'/',
|
||||
'class' => 'grey button',
|
||||
),
|
||||
'Delete Document');
|
||||
}
|
||||
} else {
|
||||
$panel_header = 'Create New Phriction Document';
|
||||
$submit_button = 'Create Document';
|
||||
$delete_button = null;
|
||||
}
|
||||
|
||||
$uri = $document->getSlug();
|
||||
|
|
Loading…
Reference in a new issue