]> BookStack Code Mirror - bookstack/blob - resources/views/attachments/manager-edit-form.blade.php
Fixed failing test after drawio default url change
[bookstack] / resources / views / attachments / manager-edit-form.blade.php
1 <div component="ajax-form"
2      option:ajax-form:url="/attachments/{{ $attachment->id }}"
3      option:ajax-form:method="put"
4      option:ajax-form:response-container=".attachment-edit-container"
5      option:ajax-form:success-message="{{ trans('entities.attachments_updated_success') }}">
6     <h5>{{ trans('entities.attachments_edit_file') }}</h5>
7
8     <div class="form-group">
9         <label for="attachment_edit_name">{{ trans('entities.attachments_edit_file_name') }}</label>
10         <input type="text" id="attachment_edit_name"
11                name="attachment_edit_name"
12                value="{{ $attachment_edit_name ?? $attachment->name ?? '' }}"
13                placeholder="{{ trans('entities.attachments_edit_file_name') }}">
14         @if($errors->has('attachment_edit_name'))
15             <div class="text-neg text-small">{{ $errors->first('attachment_edit_name') }}</div>
16         @endif
17     </div>
18
19     <div component="tabs" class="tab-container">
20         <div class="nav-tabs">
21             <button refs="tabs@toggleFile" type="button" class="tab-item {{ $attachment->external ? '' : 'selected' }}">{{ trans('entities.attachments_upload') }}</button>
22             <button refs="tabs@toggleLink" type="button" class="tab-item {{ $attachment->external ? 'selected' : '' }}">{{ trans('entities.attachments_set_link') }}</button>
23         </div>
24         <div refs="tabs@contentFile" class="mb-m {{ $attachment->external ? 'hidden' : '' }}">
25             @include('form.dropzone', [
26                 'placeholder' => trans('entities.attachments_edit_drop_upload'),
27                 'url' =>  url('/attachments/upload/' . $attachment->id),
28                 'successMessage' => trans('entities.attachments_file_updated'),
29             ])
30         </div>
31         <div refs="tabs@contentLink" class="{{ $attachment->external ? '' : 'hidden' }}">
32             <div class="form-group">
33                 <label for="attachment_edit_url">{{ trans('entities.attachments_link_url') }}</label>
34                 <input type="text" id="attachment_edit_url"
35                        name="attachment_edit_url"
36                        value="{{ $attachment_edit_url ?? ($attachment->external ? $attachment->path : '')  }}"
37                        placeholder="{{ trans('entities.attachment_link') }}">
38                 @if($errors->has('attachment_edit_url'))
39                     <div class="text-neg text-small">{{ $errors->first('attachment_edit_url') }}</div>
40                 @endif
41             </div>
42         </div>
43     </div>
44
45     <button component="event-emit-select"
46             option:event-emit-select:name="edit-back" type="button" class="button outline">{{ trans('common.back') }}</button>
47     <button refs="ajax-form@submit" type="button" class="button">{{ trans('common.save') }}</button>
48 </div>