Skip to content

Commit d3c7aad

Browse files
committed
Fixed attachments on draft pages
1 parent e639600 commit d3c7aad

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

app/Http/Controllers/AttachmentController.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function upload(Request $request)
4040
]);
4141

4242
$pageId = $request->get('uploaded_to');
43-
$page = $this->pageRepo->getById($pageId);
43+
$page = $this->pageRepo->getById($pageId, true);
4444

4545
$this->checkPermission('attachment-create-all');
4646
$this->checkOwnablePermission('page-update', $page);
@@ -70,7 +70,7 @@ public function uploadUpdate($attachmentId, Request $request)
7070
]);
7171

7272
$pageId = $request->get('uploaded_to');
73-
$page = $this->pageRepo->getById($pageId);
73+
$page = $this->pageRepo->getById($pageId, true);
7474
$attachment = $this->attachment->findOrFail($attachmentId);
7575

7676
$this->checkOwnablePermission('page-update', $page);
@@ -106,7 +106,7 @@ public function update($attachmentId, Request $request)
106106
]);
107107

108108
$pageId = $request->get('uploaded_to');
109-
$page = $this->pageRepo->getById($pageId);
109+
$page = $this->pageRepo->getById($pageId, true);
110110
$attachment = $this->attachment->findOrFail($attachmentId);
111111

112112
$this->checkOwnablePermission('page-update', $page);
@@ -134,7 +134,7 @@ public function attachLink(Request $request)
134134
]);
135135

136136
$pageId = $request->get('uploaded_to');
137-
$page = $this->pageRepo->getById($pageId);
137+
$page = $this->pageRepo->getById($pageId, true);
138138

139139
$this->checkPermission('attachment-create-all');
140140
$this->checkOwnablePermission('page-update', $page);
@@ -153,9 +153,9 @@ public function attachLink(Request $request)
153153
*/
154154
public function listForPage($pageId)
155155
{
156-
$page = $this->pageRepo->getById($pageId);
156+
$page = $this->pageRepo->getById($pageId, true);
157157
$this->checkOwnablePermission('page-view', $page);
158-
return response()->json($page->files);
158+
return response()->json($page->attachments);
159159
}
160160

161161
/**

resources/assets/sass/_text.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ p.neg, p .neg, span.neg, .text-neg {
193193
p.muted, p .muted, span.muted, .text-muted {
194194
color: lighten($text-dark, 26%);
195195
&.small, .small {
196-
color: lighten($text-dark, 42%);
196+
color: lighten($text-dark, 32%);
197197
}
198198
}
199199

resources/views/pages/form-toolbox.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@
4343
<div class="padded files">
4444

4545
<div id="file-list" ng-show="!editFile">
46-
<p class="muted small">Upload some files or attach some link to display on your page. This are visible in the page sidebar.</p>
46+
<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>
4747

4848
<div tab-container>
4949
<div class="nav-tabs">
50-
<div tab-button="list" class="tab-item">File List</div>
50+
<div tab-button="list" class="tab-item">Attached Items</div>
5151
<div tab-button="file" class="tab-item">Upload File</div>
5252
<div tab-button="link" class="tab-item">Attach Link</div>
5353
</div>

0 commit comments

Comments
 (0)