mirror of
https://github.com/wintercms/winter.git
synced 2024-06-28 05:33:29 +02:00
Add preview mode support to record finder
This commit is contained in:
parent
c813318729
commit
87e9996193
@ -112,8 +112,6 @@ class FileUpload extends FormWidgetBase
|
||||
*/
|
||||
protected function prepareVars()
|
||||
{
|
||||
$this->previewMode = true;
|
||||
|
||||
if ($this->previewMode) {
|
||||
$this->useCaption = false;
|
||||
}
|
||||
|
@ -1,3 +1,11 @@
|
||||
<div class="recordfinder-widget" id="<?= $this->getId('container') ?>">
|
||||
<?= $this->makePartial('recordfinder') ?>
|
||||
</div>
|
||||
<?php if ($this->previewMode && !$value): ?>
|
||||
|
||||
<span class="form-control"><?= e(trans('backend::lang.form.preview_no_record_message')) ?></span>
|
||||
|
||||
<?php else: ?>
|
||||
|
||||
<div class="recordfinder-widget" id="<?= $this->getId('container') ?>">
|
||||
<?= $this->makePartial('recordfinder') ?>
|
||||
</div>
|
||||
|
||||
<?php endif ?>
|
@ -14,15 +14,18 @@
|
||||
<span class="text-muted"><?= $prompt ?></span>
|
||||
<?php endif ?>
|
||||
</span>
|
||||
<button
|
||||
class="btn btn-default"
|
||||
data-control="popup"
|
||||
data-size="huge"
|
||||
data-handler="<?= $this->getEventHandler('onFindRecord') ?>"
|
||||
data-request-data="recordfinder_flag: 1"
|
||||
type="button">
|
||||
<i class="icon-th-list"></i>
|
||||
</button>
|
||||
|
||||
<?php if (!$this->previewMode): ?>
|
||||
<button
|
||||
class="btn btn-default"
|
||||
data-control="popup"
|
||||
data-size="huge"
|
||||
data-handler="<?= $this->getEventHandler('onFindRecord') ?>"
|
||||
data-request-data="recordfinder_flag: 1"
|
||||
type="button">
|
||||
<i class="icon-th-list"></i>
|
||||
</button>
|
||||
<?php endif ?>
|
||||
|
||||
<input
|
||||
type="hidden"
|
||||
|
@ -186,6 +186,7 @@ return [
|
||||
'confirm_tab_close' => 'Do you really want to close the tab? Unsaved changes will be lost.',
|
||||
'behavior_not_ready' => 'Form behavior has not been initialized, check that you have called initForm() in your controller.',
|
||||
'preview_no_files_message' => 'There are no files uploaded.',
|
||||
'preview_no_record_message' => 'There is no record selected.',
|
||||
'select' => 'Select',
|
||||
'select_all' => 'all',
|
||||
'select_none' => 'none',
|
||||
|
Loading…
x
Reference in New Issue
Block a user