mirror of
https://github.com/flextype/flextype.git
synced 2025-08-11 07:34:22 +02:00
Admin Panel:
- ClipboardJS added! - Snippets Manager: Embeded info modal added.
This commit is contained in:
@@ -183,6 +183,28 @@ fieldset[disabled] .form-control {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.form-control[disabled],
|
||||
.form-control[readonly],
|
||||
fieldset[disabled] .form-control {
|
||||
background-color: #1b1d23;
|
||||
border: 1px solid #000;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.clipboard {
|
||||
background-color: #1b1d23;
|
||||
border: 1px solid #000;
|
||||
color: #fff;
|
||||
|
||||
.btn {
|
||||
float: right;
|
||||
margin-top: -10px;
|
||||
margin-right: -15px;
|
||||
background: transparent;
|
||||
border: none;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Switches for Bootstrap 4.
|
||||
//
|
||||
|
@@ -64,7 +64,8 @@ gulp.task('js', function(){
|
||||
'node_modules/codemirror/mode/clike/clike.js',
|
||||
'node_modules/codemirror/mode/yaml/yaml.js',
|
||||
'node_modules/messenger-hubspot/build/js/messenger.min.js',
|
||||
'node_modules/messenger-hubspot/build/js/messenger-theme-flat.js'
|
||||
'node_modules/messenger-hubspot/build/js/messenger-theme-flat.js',
|
||||
'node_modules/clipboard/dist/clipboard.min.js'
|
||||
])
|
||||
.pipe(sourcemaps.init())
|
||||
.pipe(concat('build.min.js'))
|
||||
|
@@ -220,3 +220,6 @@ admin_system_settings_system_upload_images_quality: "Quality"
|
||||
admin_system_settings_system_upload_images_width: "Width"
|
||||
admin_system_settings_system_upload_images_height: "Height"
|
||||
admin_system_settings_system_upload_accept_file_types: "Accept file types"
|
||||
admin_embeded_code: "Embeded Code"
|
||||
admin_shortcode: "Shortcode"
|
||||
admin_php_code: "PHP Code"
|
||||
|
@@ -220,3 +220,4 @@ admin_system_settings_system_upload_images_quality: "Качество (0 - 100)"
|
||||
admin_system_settings_system_upload_images_width: "Ширина"
|
||||
admin_system_settings_system_upload_images_height: "Высота"
|
||||
admin_system_settings_system_upload_accept_file_types: "Допустимые типы файлов для загрузки"
|
||||
admin_embeded_code: "Embeded Code"
|
||||
|
@@ -17,6 +17,7 @@
|
||||
"messenger-hubspot": "1.5.0-b2",
|
||||
"popper.js": "^1.14.6",
|
||||
"run-sequence": "^2.2.1",
|
||||
"trumbowyg": "^2.13.0"
|
||||
"trumbowyg": "^2.13.0",
|
||||
"clipboard": "^2.0.4"
|
||||
}
|
||||
}
|
||||
|
@@ -12,6 +12,8 @@ use Flextype\Component\{Http\Http, Event\Event, Registry\Registry, Assets\Assets
|
||||
|
||||
<script>
|
||||
|
||||
new ClipboardJS('.js-clipboard-btn');
|
||||
|
||||
Messenger.options = {
|
||||
extraClasses: 'messenger-fixed messenger-on-bottom messenger-on-right',
|
||||
theme: 'flat'
|
||||
@@ -106,6 +108,12 @@ use Flextype\Component\{Http\Http, Event\Event, Registry\Registry, Assets\Assets
|
||||
$('.js-plugin-license-placeholder').html($(this).attr('data-license'));
|
||||
});
|
||||
|
||||
$('.js-snippets-info').click(function () {
|
||||
$('#snippetsInfoModal').modal();
|
||||
$('.js-snippets-snippet-placeholder').html($(this).attr('data-name'));
|
||||
$('.js-snippets-php-placeholder').html($(this).attr('data-name'));
|
||||
});
|
||||
|
||||
$('.js-entries-image-preview').click(function () {
|
||||
$('#entriesImagePreview').modal();
|
||||
$('.js-entry-image-preview-placeholder').css('background-image', 'url(' + $(this).attr('data-image-url') + ')');
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<?php namespace Flextype ?>
|
||||
<?php use Flextype\Component\{Http\Http, Registry\Registry, Filesystem\Filesystem, Token\Token, Text\Text} ?>
|
||||
<?php use Flextype\Component\{Http\Http, Registry\Registry, Filesystem\Filesystem, Token\Token, Text\Text, Form\Form} ?>
|
||||
<?php use function Flextype\Component\I18n\__; ?>
|
||||
<?php Themes::view('admin/views/partials/head')->display() ?>
|
||||
<?php Themes::view('admin/views/partials/navbar')
|
||||
@@ -44,6 +44,7 @@
|
||||
<div class="dropdown-menu">
|
||||
<a class="dropdown-item" href="<?= Http::getBaseUrl() ?>/admin/snippets/rename?snippet=<?= basename($snippet, '.php') ?>"><?= __('admin_entries_rename') ?></a>
|
||||
<a class="dropdown-item" href="<?= Http::getBaseUrl() ?>/admin/snippets/duplicate?snippet=<?= basename($snippet, '.php') ?>&token=<?= Token::generate() ?>"><?= __('admin_duplicate') ?></a>
|
||||
<a class="dropdown-item js-snippets-info" href="javascript:;" data-toggle="modal" data-target="#snippetsInfoModal" data-name="<?= basename($snippet, '.php') ?>"><?= __('admin_embeded_code') ?></a>
|
||||
</div>
|
||||
</div>
|
||||
<a class="btn btn-default" href="<?= Http::getBaseUrl() ?>/admin/snippets/delete?snippet=<?= basename($snippet, '.php') ?>&token=<?= Token::generate() ?>"><?= __('admin_entries_delete') ?></a>
|
||||
@@ -56,5 +57,37 @@
|
||||
|
||||
<?php endif ?>
|
||||
|
||||
|
||||
<!-- Modal -->
|
||||
<div class="modal fade" id="snippetsInfoModal" tabindex="-1" role="dialog" aria-labelledby="snippetsInfoModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="snippetsInfoModalLabel"><?= __('admin_embeded_code') ?></h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?= Form::label('shortcode', __('admin_shortcode'), ['for' => 'shortcode']) ?>
|
||||
<div class="alert alert-dark clipboard" role="alert">
|
||||
<span id="snippet">[snippet name="<span class="js-snippets-snippet-placeholder"></span>"]</span>
|
||||
<button class="js-clipboard-btn btn" data-clipboard-target="#snippet">
|
||||
copy
|
||||
</button>
|
||||
</div>
|
||||
<br>
|
||||
<?= Form::label('php_code', __('admin_php_code'), ['for' => 'php_code']) ?>
|
||||
<div id="php" class="alert alert-dark clipboard" role="alert">
|
||||
<span id="php"><?= Snippet::get("<span class="js-snippets-php-placeholder"></span>") ?></span>
|
||||
<button class="js-clipboard-btn btn" data-clipboard-target="#php">
|
||||
copy
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php Themes::view('admin/views/partials/content-end')->display() ?>
|
||||
<?php Themes::view('admin/views/partials/footer')->display() ?>
|
||||
|
Reference in New Issue
Block a user