Compare commits
38 commits
Author | SHA1 | Date | |
---|---|---|---|
Simon Vieille | 26cbaa8469 | ||
Simon Vieille | 7897bafcc2 | ||
Simon Vieille | 63a8a60e2d | ||
Simon Vieille | d01e9d618b | ||
Simon Vieille | 96347a1730 | ||
Simon Vieille | aeb0e6c109 | ||
Simon Vieille | 64258a2d8c | ||
Simon Vieille | 70329ceeda | ||
Simon Vieille | 1adb1ebe2b | ||
Simon Vieille | f57cc8e4d6 | ||
Simon Vieille | b21967028e | ||
Simon Vieille | 5b22851674 | ||
Simon Vieille | 4082bb171a | ||
Simon Vieille | dc19617fb1 | ||
Simon Vieille | dbd2036fb0 | ||
Simon Vieille | 8e2566abc8 | ||
Simon Vieille | 66e1a9c87f | ||
Simon Vieille | 6709c0a303 | ||
Simon Vieille | 614ae40901 | ||
Simon Vieille | 430bff9433 | ||
Simon Vieille | 6441da8a27 | ||
Simon Vieille | 801e3317e7 | ||
Simon Vieille | f7604d2a45 | ||
Simon Vieille | 8a632a1b14 | ||
Simon Vieille | 4701090134 | ||
Simon Vieille | c40c7e3362 | ||
Simon Vieille | 8edbf0cc08 | ||
Simon Vieille | 175321bc2d | ||
Simon Vieille | 5d6531d197 | ||
Simon Vieille | 90603f62e0 | ||
Simon Vieille | 053f4aa5b8 | ||
Simon Vieille | 79754d45c1 | ||
Simon Vieille | c98ea50f30 | ||
Simon Vieille | 0f1bc761b2 | ||
Simon Vieille | 50dbb07314 | ||
Simon Vieille | 72e783f865 | ||
Simon Vieille | ee28c9abb7 | ||
2bd6836a7f |
21
CHANGELOG.md
21
CHANGELOG.md
|
@ -1,5 +1,26 @@
|
|||
## [Unreleased]
|
||||
|
||||
### Added
|
||||
* allow to use `window.tinymceModes` to add or override tinymce modes
|
||||
* add border color on tinymce editor
|
||||
### Fixed
|
||||
* fix default crud sort
|
||||
* fix hidden save button in file manager
|
||||
* fix template of CrudController (maker)
|
||||
* fix undefined `window.tinymce.murph`
|
||||
|
||||
## [v1.24.1] - 2024-02-01
|
||||
### Fixed
|
||||
* update Murph version constant
|
||||
|
||||
## [v1.24.0] - 2024-01-27
|
||||
### Added
|
||||
* add CSS class `no-wrap`
|
||||
* copy the pager of the CRUD at the bottom of the list
|
||||
### Fixed
|
||||
* fix an issue with the file manager when editing an item opened in a modal
|
||||
* fix type casting in slugifier
|
||||
|
||||
## [v1.23.0] - 2023-11-01
|
||||
### Added
|
||||
* allow to define templates show before and after a murph collection item
|
||||
|
|
|
@ -424,15 +424,14 @@ abstract class CrudController extends AdminController
|
|||
$sessionSortName = sprintf('%s_label', $sessionId);
|
||||
$sessionSortDirection = sprintf('%s_direction', $sessionId);
|
||||
|
||||
$name = $request->query->get(
|
||||
'_sort',
|
||||
$session->get($sessionSortName, $defaultSort['label'] ?? null)
|
||||
);
|
||||
$name = $request->query->get('_sort', $session->get($sessionSortName)) ?? $defaultSort['label'] ?? null;
|
||||
|
||||
$direction = strtolower($request->query->get(
|
||||
'_sort_direction',
|
||||
$session->get($sessionSortDirection, $defaultSort['direction'] ?? 'asc')
|
||||
));
|
||||
$direction = strtolower(
|
||||
$request->query->get(
|
||||
'_sort_direction',
|
||||
$session->get($sessionSortDirection)
|
||||
) ?? $defaultSort['direction'] ?? 'asc'
|
||||
);
|
||||
|
||||
$session->set($sessionSortName, $name);
|
||||
$session->set($sessionSortDirection, $direction);
|
||||
|
|
|
@ -49,7 +49,7 @@ class NodeEventSubscriber extends EntityManagerEventSubscriber
|
|||
|
||||
$node = $event->getEntity();
|
||||
|
||||
$node->setCode($this->codeSlugify->slugify($node->getCode()));
|
||||
$node->setCode($this->codeSlugify->slugify($node->getCode() ?? ''));
|
||||
|
||||
if ($node->getDisableUrl()) {
|
||||
$node->setUrl(null);
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
namespace App\Core;
|
||||
|
||||
if (!defined('MURPH_VERSION')) {
|
||||
define('MURPH_VERSION', 'v1.23.0');
|
||||
define('MURPH_VERSION', 'v1.24.1');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -619,7 +619,11 @@ fieldset.form-group {
|
|||
|
||||
&-filter {
|
||||
padding-right: 20px;
|
||||
padding-bottom: 20px;
|
||||
padding-bottom: 15px;
|
||||
|
||||
.pagination {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 769px) {
|
||||
padding-right: 10px;
|
||||
|
@ -650,8 +654,20 @@ fieldset.form-group {
|
|||
}
|
||||
}
|
||||
|
||||
.table .crud-batch-column {
|
||||
width: 1%;
|
||||
.table {
|
||||
.crud-batch-column {
|
||||
width: 1%;
|
||||
}
|
||||
|
||||
.crud-action-column {
|
||||
text-align: right;
|
||||
white-space: nowrap;
|
||||
width: 1px;
|
||||
}
|
||||
}
|
||||
|
||||
.no-wrap {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
form {
|
||||
|
@ -728,8 +744,15 @@ label.required::after {
|
|||
background: map-get($theme-colors, 'dark-blue');
|
||||
}
|
||||
|
||||
.tox.tox-silver-sink.tox-tinymce-aux {
|
||||
z-index: 3000 !important;
|
||||
.tox {
|
||||
&.tox-silver-sink.tox-tinymce-aux {
|
||||
z-index: 3000 !important;
|
||||
}
|
||||
|
||||
&.tox-tinymce {
|
||||
border-color: $input-border-color;
|
||||
border-radius: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.field-boolean {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import '../../../../../../../../assets/css/admin.scss';
|
||||
|
||||
require('../../../../../../../../node_modules/bootstrap/dist/js/bootstrap.min.js')
|
||||
require('./modules/sidebar.js')()
|
||||
require('./modules/table-fixed.js')()
|
||||
require('./modules/form-confirm.js')()
|
||||
require('./modules/form-file.js')()
|
||||
|
@ -27,5 +28,4 @@ require('./modules/file-manager.js')()
|
|||
require('./modules/file-picker.js')()
|
||||
require('./modules/analytics.js')()
|
||||
require('./modules/page.js')()
|
||||
require('./modules/sidebar.js')()
|
||||
require('./modules/node.js')()
|
||||
|
|
|
@ -36,8 +36,9 @@ const fileManagerBrowser = function (callback) {
|
|||
|
||||
const clickCallback = (e) => {
|
||||
callback($(e.target).attr('data-value'), {})
|
||||
$('div[id^="modal-container-"]').modal('hide')
|
||||
container.modal('hide')
|
||||
$('#fm-modal').next('.modal-backdrop').remove()
|
||||
$('#fm-modal').next('div[id^="modal-container-"]').modal('hide')
|
||||
$('#fm-modal').modal('hide')
|
||||
|
||||
$('body').off('click', '#file-manager-insert', clickCallback)
|
||||
}
|
||||
|
|
|
@ -1,9 +1,34 @@
|
|||
const $ = require('jquery')
|
||||
|
||||
const SidebarOpener = () => {
|
||||
$('.sidebar-toggler .btn').click(() => {
|
||||
$('.sidebar').toggleClass('is-open')
|
||||
const Sidebar = () => {
|
||||
const menu = document.querySelector('.sidebar')
|
||||
|
||||
if (!menu) {
|
||||
return
|
||||
}
|
||||
|
||||
const stickyMenu = menu.querySelector('.sidebar-sticky')
|
||||
const items = stickyMenu.querySelectorAll('a.nav-link')
|
||||
const currentItem = menu.querySelector('.nav-link.active')
|
||||
|
||||
items.forEach((item) => {
|
||||
item.addEventListener('click', () => {
|
||||
localStorage.setItem('sidebar-item-top', stickyMenu.scrollTop)
|
||||
})
|
||||
})
|
||||
|
||||
const toggler = menu.querySelector('.sidebar-toggler .btn')
|
||||
|
||||
toggler.addEventListener('click', () => {
|
||||
menu.classList.toggle('is-open')
|
||||
})
|
||||
|
||||
if (currentItem) {
|
||||
stickyMenu.scrollTo({
|
||||
top: Math.min(currentItem.offsetTop, localStorage.getItem('sidebar-item-top') ?? 0),
|
||||
behavior: 'smooth'
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = SidebarOpener
|
||||
module.exports = Sidebar
|
||||
|
|
|
@ -53,7 +53,7 @@ const fileManagerBrowser = function (callback) {
|
|||
})
|
||||
}
|
||||
|
||||
if (typeof window.tinymce !== 'undefined') {
|
||||
const createTinymceConfig = function () {
|
||||
window.tinymce.murph = window.tinymce.murph || {}
|
||||
window.tinymce.murph.selector = window.tinymce.murph.selector || '*[data-tinymce]'
|
||||
window.tinymce.murph.configurationBase = window.tinymce.murph.configurationBase || {
|
||||
|
@ -80,6 +80,7 @@ if (typeof window.tinymce !== 'undefined') {
|
|||
}
|
||||
|
||||
window.tinymce.murph.modes = window.tinymce.murph.modes || {}
|
||||
window.tinymceModes = window.tinymceModes || {}
|
||||
|
||||
window.tinymce.murph.modes.default = window.tinymce.murph.modes.default || {
|
||||
plugins: 'print preview importcss searchreplace visualblocks visualchars fullscreen template table charmap hr pagebreak nonbreaking toc insertdatetime advlist lists wordcount textpattern noneditable help charmap quickbars link image code autoresize',
|
||||
|
@ -95,6 +96,11 @@ if (typeof window.tinymce !== 'undefined') {
|
|||
toolbar: 'undo redo | bold italic underline'
|
||||
}
|
||||
|
||||
window.tinymce.murph.modes = {
|
||||
...window.tinymce.murph.modes,
|
||||
...window.tinymceModes
|
||||
}
|
||||
|
||||
tinymce.addI18n('fr_FR', {
|
||||
Redo: 'R\u00e9tablir',
|
||||
Undo: 'Annuler',
|
||||
|
@ -612,17 +618,14 @@ const doInitEditor = () => {
|
|||
}
|
||||
|
||||
module.exports = function () {
|
||||
if (typeof tinymce === 'undefined') {
|
||||
return
|
||||
}
|
||||
|
||||
const observer = new MutationObserver(doInitEditor)
|
||||
const config = { attributes: false, childList: true, subtree: true }
|
||||
observer.observe(document.querySelector('body'), config)
|
||||
|
||||
$(() => {
|
||||
createTinymceConfig()
|
||||
doInitEditor()
|
||||
|
||||
const observer = new MutationObserver(doInitEditor)
|
||||
const config = { attributes: false, childList: true, subtree: true }
|
||||
observer.observe(document.querySelector('body'), config)
|
||||
|
||||
$('body').on('hidden.bs.modal', '.modal', (e) => {
|
||||
if (!$('.tox-dialog').length) {
|
||||
$(e.target).find('.tox-tinymce').each(() => {
|
||||
|
|
|
@ -11,11 +11,11 @@ use <?php echo $entity; ?> as Entity;
|
|||
use <?php echo $factory; ?> as Factory;
|
||||
use <?php echo $form; ?> as Type;
|
||||
use <?php echo $repository_query; ?> as RepositoryQuery;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpFoundation\Session\Session;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||
|
||||
class <?php echo $class_name; ?> extends CrudController
|
||||
{
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
{% extends '@Core/admin/layout.html.twig' %}
|
||||
|
||||
{% set context = context ?? 'index' %}
|
||||
{% set pager_render = pager is defined ? knp_pagination_render(pager) : null %}
|
||||
|
||||
{% block title %}{{ configuration.pageTitle(context)|trans }} {{ parent() ? ('- ' ~ parent()) : '' }}{% endblock %}
|
||||
|
||||
|
@ -67,16 +68,17 @@
|
|||
<div class="row crud-header-filter">
|
||||
<div class="col-auto ml-auto {% if pager.getPaginationData.pageCount > 1 %}mr-3{% endif %}">
|
||||
<button data-modal="{{ path(configuration.pageRoute('filter'), configuration.pageRouteParams('filter')) }}" class="btn btn-sm btn-secondary">
|
||||
<span class="fa fa-search mr-1"></span>
|
||||
{{ 'Filter'|trans }} {% if not filters.isEmpty %}({{ 'yes'|trans }}){% endif %}
|
||||
</button>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
{{ knp_pagination_render(pager) }}
|
||||
{{ pager_render|raw }}
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="crud-header-filter">
|
||||
{{ knp_pagination_render(pager) }}
|
||||
{{ pager_render|raw }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
@ -85,6 +87,7 @@
|
|||
|
||||
{% block list %}
|
||||
{% set isSortable = configuration.isSortableCollection(context) %}
|
||||
{% set colspan = configuration.fields(context)|length + 1 + (configuration.hasBatchAction(context) ? 1 : 0) %}
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table">
|
||||
|
@ -129,10 +132,13 @@
|
|||
|
||||
<a href="{{ url }}">
|
||||
{% if icon is defined %}
|
||||
<span class="{{ icon }}"></span>
|
||||
<span class="no-wrap">
|
||||
<span class="{{ icon }}"></span>
|
||||
{{ label|trans }}
|
||||
</span>
|
||||
{% else %}
|
||||
{{ label|trans }}
|
||||
{% endif %}
|
||||
|
||||
{{ label|trans }}
|
||||
</a>
|
||||
{% else %}
|
||||
{{ label|trans }}
|
||||
|
@ -144,7 +150,7 @@
|
|||
{% endblock %}
|
||||
{% endfor %}
|
||||
{% if configuration.showActions %}
|
||||
<th class="crud-action-column miw-100 text-right">
|
||||
<th class="crud-action-column">
|
||||
{{ 'Actions'|trans }}
|
||||
</th>
|
||||
{% endif %}
|
||||
|
@ -223,7 +229,7 @@
|
|||
{% endfor %}
|
||||
|
||||
{% if configuration.showActions %}
|
||||
<td class="crud-action-column col-2 miw-200 text-right">
|
||||
<td class="crud-action-column">
|
||||
{% block list_item_actions %}
|
||||
{% block list_item_actions_before %}{% endblock %}
|
||||
|
||||
|
@ -281,6 +287,10 @@
|
|||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="float-right mr-2">
|
||||
{{ pager_render|raw }}
|
||||
</div>
|
||||
|
||||
{% if configuration.hasBatchAction(context) %}
|
||||
<div class="mb-2">
|
||||
<form class="form-inline" action="{{ path(configuration.pageRoute('batch'), {
|
||||
|
@ -315,13 +325,8 @@
|
|||
{% endblock %}
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% set count = configuration.fields(context)|length + 1 %}
|
||||
{% if configuration.hasBatchAction(context) %}
|
||||
{% set count = count + 1 %}
|
||||
{% endif %}
|
||||
|
||||
<tr>
|
||||
<td class="col-12 text-center p-4 text-black-50" colspan="{{ count }}">
|
||||
<td class="col-12 text-center p-4 text-black-50" colspan="{{ colspan }}">
|
||||
<div class="display-1">
|
||||
<span class="fa fa-search"></span>
|
||||
</div>
|
||||
|
|
|
@ -197,6 +197,10 @@
|
|||
</div>
|
||||
|
||||
<div>
|
||||
{% if splInfo.isFile and not isLocked %}
|
||||
<button type="submit" class="btn btn-primary" form="form-fm-attributes">{{ 'Save'|trans }}</button>
|
||||
{% endif %}
|
||||
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">{{ 'Close'|trans }}</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
|
|
@ -81,7 +81,7 @@
|
|||
<div class="col-6" style="padding-left: {{ (node.treeLevel - 1) * 30 }}px">
|
||||
{{ node.label }}
|
||||
|
||||
<span class="ml-3 btn-group d-none d-md-inline-block">
|
||||
<span class="ml-3 btn-group d-none d-md-inline-block no-wrap">
|
||||
{% if node.aliasNode %}
|
||||
<span title="{{ node.aliasNode.label }}" data-toggle="tooltip" data-placement="top" class="btn btn-sm border border-secondary btn-light">
|
||||
<span class="fa fa-file-import"></span>
|
||||
|
|
|
@ -13,7 +13,7 @@ class Slugify
|
|||
{
|
||||
public function slugify($data): ?string
|
||||
{
|
||||
return $this->create()->slugify($data);
|
||||
return $this->create()->slugify((string) $data);
|
||||
}
|
||||
|
||||
protected function create(): BaseSlugify
|
||||
|
|
Loading…
Reference in a new issue