Fixed attachments on draft pages

This commit is contained in:
Dan Brown 2016-11-12 14:21:54 +00:00
parent e639600ba5
commit d3c7aada89
No known key found for this signature in database
GPG key ID: 46D9F943C24A2EF9
3 changed files with 9 additions and 9 deletions

View file

@ -40,7 +40,7 @@ class AttachmentController extends Controller
]);
$pageId = $request->get('uploaded_to');
$page = $this->pageRepo->getById($pageId);
$page = $this->pageRepo->getById($pageId, true);
$this->checkPermission('attachment-create-all');
$this->checkOwnablePermission('page-update', $page);
@ -70,7 +70,7 @@ class AttachmentController extends Controller
]);
$pageId = $request->get('uploaded_to');
$page = $this->pageRepo->getById($pageId);
$page = $this->pageRepo->getById($pageId, true);
$attachment = $this->attachment->findOrFail($attachmentId);
$this->checkOwnablePermission('page-update', $page);
@ -106,7 +106,7 @@ class AttachmentController extends Controller
]);
$pageId = $request->get('uploaded_to');
$page = $this->pageRepo->getById($pageId);
$page = $this->pageRepo->getById($pageId, true);
$attachment = $this->attachment->findOrFail($attachmentId);
$this->checkOwnablePermission('page-update', $page);
@ -134,7 +134,7 @@ class AttachmentController extends Controller
]);
$pageId = $request->get('uploaded_to');
$page = $this->pageRepo->getById($pageId);
$page = $this->pageRepo->getById($pageId, true);
$this->checkPermission('attachment-create-all');
$this->checkOwnablePermission('page-update', $page);
@ -153,9 +153,9 @@ class AttachmentController extends Controller
*/
public function listForPage($pageId)
{
$page = $this->pageRepo->getById($pageId);
$page = $this->pageRepo->getById($pageId, true);
$this->checkOwnablePermission('page-view', $page);
return response()->json($page->files);
return response()->json($page->attachments);
}
/**

View file

@ -193,7 +193,7 @@ p.neg, p .neg, span.neg, .text-neg {
p.muted, p .muted, span.muted, .text-muted {
color: lighten($text-dark, 26%);
&.small, .small {
color: lighten($text-dark, 42%);
color: lighten($text-dark, 32%);
}
}

View file

@ -43,11 +43,11 @@
<div class="padded files">
<div id="file-list" ng-show="!editFile">
<p class="muted small">Upload some files or attach some link to display on your page. This are visible in the page sidebar.</p>
<p class="muted small">Upload some files or attach some link to display on your page. These are visible in the page sidebar. <span class="secondary">Changes here are saved instantly.</span></p>
<div tab-container>
<div class="nav-tabs">
<div tab-button="list" class="tab-item">File List</div>
<div tab-button="list" class="tab-item">Attached Items</div>
<div tab-button="file" class="tab-item">Upload File</div>
<div tab-button="link" class="tab-item">Attach Link</div>
</div>