]> BookStack Code Mirror - bookstack/commitdiff
Fixed attachments on draft pages
authorDan Brown <redacted>
Sat, 12 Nov 2016 14:21:54 +0000 (14:21 +0000)
committerDan Brown <redacted>
Sat, 12 Nov 2016 14:21:54 +0000 (14:21 +0000)
app/Http/Controllers/AttachmentController.php
resources/assets/sass/_text.scss
resources/views/pages/form-toolbox.blade.php

index b32162e7f5042d5bb1e53777a85ebc68ecc16eb0..62be0b852236f9109249e17834f32ae85ae7eaee 100644 (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);
     }
 
     /**
index e81061685a1ab3afc1d37a8fdb4fab78a4fe0987..9bad2e83d15aa2621b04ce27993124fe8dd7306b 100644 (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%);
     }
 }
 
index 0ca8a311b672738058820cab77292eab675cae96..a6e66a24a13f3e778924634faea57ce4af24fd69 100644 (file)
             <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>