]> BookStack Code Mirror - bookstack/blobdiff - resources/views/attachments/manager.blade.php
Updated attachments to work with new dropzone
[bookstack] / resources / views / attachments / manager.blade.php
index 7d14d00e7d29600fa9b16e020de1b756e26176d8..4eeee24bb850aed44e0064b1bc54b476a17d4d94 100644 (file)
@@ -6,66 +6,44 @@
      class="toolbox-tab-content">
 
     <h4>{{ trans('entities.attachments') }}</h4>
-    <div class="px-l files">
+    <div component="dropzone"
+         option:dropzone:url="{{ url('/attachments/upload?uploaded_to=' . $page->id) }}"
+         option:dropzone:success-message="{{ trans('entities.attachments_file_uploaded') }}"
+         option:dropzone:error-message="{{ trans('errors.attachment_upload_error') }}"
+         option:dropzone:upload-limit="{{ config('app.upload_limit') }}"
+         option:dropzone:upload-limit-message="{{ trans('errors.server_upload_limit') }}"
+         option:dropzone:zone-text="{{ trans('entities.attachments_dropzone') }}"
+         option:dropzone:file-accept="*"
+         class="px-l files">
 
-        <div refs="attachments@listContainer">
+        <div refs="attachments@list-container dropzone@drop-target" class="relative">
             <p class="text-muted small">{{ trans('entities.attachments_explain') }} <span
                         class="text-warn">{{ trans('entities.attachments_explain_instant_save') }}</span></p>
 
-            <div component="tabs" refs="attachments@mainTabs" class="tab-container">
-                <div role="tablist">
-                    <button id="attachment-tab-items"
-                            role="tab"
-                            aria-selected="true"
-                            aria-controls="attachment-panel-items"
-                            type="button"
-                            class="tab-item">{{ trans('entities.attachments_items') }}</button>
-                    <button id="attachment-tab-upload"
-                            role="tab"
-                            aria-selected="false"
-                            aria-controls="attachment-panel-upload"
-                            type="button"
-                            class="tab-item">{{ trans('entities.attachments_upload') }}</button>
-                    <button id="attachment-tab-links"
-                            role="tab"
-                            aria-selected="false"
-                            aria-controls="attachment-panel-links"
-                            type="button"
-                            class="tab-item">{{ trans('entities.attachments_link') }}</button>
-                </div>
-                <div id="attachment-panel-items"
-                     tabindex="0"
-                     role="tabpanel"
-                     aria-labelledby="attachment-tab-items"
-                     refs="attachments@list">
-                    @include('attachments.manager-list', ['attachments' => $page->attachments->all()])
-                </div>
-                <div id="attachment-panel-upload"
-                     tabindex="0"
-                     role="tabpanel"
-                     hidden
-                     aria-labelledby="attachment-tab-upload">
-                    @include('form.dropzone', [
-                        'placeholder' => trans('entities.attachments_dropzone'),
-                        'url' =>  url('/attachments/upload?uploaded_to=' . $page->id),
-                        'successMessage' => trans('entities.attachments_file_uploaded'),
-                    ])
-                </div>
-                <div id="attachment-panel-links"
-                     tabindex="0"
-                     role="tabpanel"
-                     hidden
-                     aria-labelledby="attachment-tab-links"
-                     class="link-form-container">
-                    @include('attachments.manager-link-form', ['pageId' => $page->id])
-                </div>
+            <hr class="mb-s">
+
+            <div class="flex-container-row">
+                <button refs="dropzone@select-button" type="button" class="button outline small">{{ trans('entities.attachments_upload') }}</button>
+                <button refs="attachments@attach-link-button" type="button" class="button outline small">{{ trans('entities.attachments_link') }}</button>
+            </div>
+            <div>
+                <p class="text-muted text-small">{{ trans('entities.attachments_upload_drop') }}</p>
             </div>
+            <div refs="dropzone@status-area" class="fixed top-right px-m py-m"></div>
 
-        </div>
+            <hr>
 
-        <div refs="attachments@editContainer" class="hidden attachment-edit-container">
+            <div refs="attachments@list-panel">
+                @include('attachments.manager-list', ['attachments' => $page->attachments->all()])
+            </div>
 
         </div>
 
+        <div refs="attachments@links-container" hidden class="link-form-container">
+            @include('attachments.manager-link-form', ['pageId' => $page->id])
+        </div>
+
+        <div refs="attachments@edit-container" hidden class="attachment-edit-container"></div>
+
     </div>
 </div>
\ No newline at end of file