Compare commits

...

38 commits

Author SHA1 Message Date
Simon Vieille 26cbaa8469 Merge branch 'develop' 2024-05-03 17:58:22 +02:00
Simon Vieille 7897bafcc2
fix undefined window.tinymce.murph 2024-05-03 17:57:43 +02:00
Simon Vieille 63a8a60e2d Merge branch 'develop' 2024-03-31 16:57:56 +02:00
Simon Vieille d01e9d618b
add border color on tinymce editor 2024-03-31 16:57:46 +02:00
Simon Vieille 96347a1730 Merge branch 'develop' 2024-03-31 16:50:47 +02:00
Simon Vieille aeb0e6c109 allow to use window.tinymceModes to add or override tinymce modes 2024-03-31 16:50:18 +02:00
Simon Vieille 64258a2d8c Merge branch 'develop' 2024-03-25 15:27:12 +01:00
Simon Vieille 70329ceeda
fix template of CrudController (maker) 2024-03-25 15:27:06 +01:00
Simon Vieille 1adb1ebe2b Merge branch 'develop' 2024-03-25 13:04:17 +01:00
Simon Vieille f57cc8e4d6
fix hidden save button in file manager 2024-03-25 13:04:16 +01:00
Simon Vieille b21967028e Merge branch 'develop' 2024-03-25 13:03:01 +01:00
Simon Vieille 5b22851674
fix hidden save button in file manager 2024-03-25 13:02:20 +01:00
Simon Vieille 4082bb171a
fix use of IsGranted is CrudController 2024-02-04 16:48:44 +01:00
Simon Vieille dc19617fb1 Merge branch 'develop' 2024-02-04 16:33:34 +01:00
Simon Vieille dbd2036fb0
rollback commit 614ae40 (add IsGranted in all methods of the CrudController maker template) 2024-02-04 16:33:30 +01:00
Simon Vieille 8e2566abc8
rollback commit 614ae40 (add IsGranted in all methods of the CrudController maker template) 2024-02-04 16:33:22 +01:00
Simon Vieille 66e1a9c87f
rollback commit 614ae40 (add IsGranted in all methods of the CrudController maker template) 2024-02-04 16:31:21 +01:00
Simon Vieille 6709c0a303
update changelog 2024-02-04 16:17:49 +01:00
Simon Vieille 614ae40901 add IsGranted in all methods of the CrudController maker template 2024-02-04 16:16:22 +01:00
Simon Vieille 430bff9433
fix default crud sort 2024-02-02 20:04:19 +01:00
Simon Vieille 6441da8a27
fix default crud sort 2024-02-02 20:03:57 +01:00
Simon Vieille 801e3317e7
update changelog 2024-02-02 20:02:00 +01:00
Simon Vieille f7604d2a45
fix default crud sort 2024-02-02 20:01:23 +01:00
Simon Vieille 8a632a1b14
update Murph version constant 2024-02-01 18:46:33 +01:00
Simon Vieille 4701090134
update changelog 2024-01-27 15:49:58 +01:00
Simon Vieille c40c7e3362
fix type casting in slugifier 2024-01-27 15:49:39 +01:00
Simon Vieille 8edbf0cc08
add default default on node's code when slugify 2023-11-27 10:32:38 +01:00
Simon Vieille 175321bc2d
fix issue on file manager when a file is selected in the file in the file picker 2023-11-16 23:06:00 +01:00
Simon Vieille 5d6531d197
fix sidebar scroll algo 2023-11-14 23:21:24 +01:00
Simon Vieille 90603f62e0
add side bar scroll animation 2023-11-14 23:08:09 +01:00
Simon Vieille 053f4aa5b8
add auto-scroll on current sidebar item 2023-11-14 23:03:43 +01:00
Simon Vieille 79754d45c1
add auto-scroll on current sidebar item
remove jquery from sidebar module
2023-11-14 22:51:40 +01:00
Simon Vieille c98ea50f30
fix undefined pager on index 2023-11-13 16:06:06 +01:00
Simon Vieille 0f1bc761b2
add no-wrap around the thead sort link 2023-11-10 19:42:45 +01:00
Simon Vieille 50dbb07314
update changelog 2023-11-10 19:35:48 +01:00
Simon Vieille 72e783f865
fix render of the URL when the window is small 2023-11-10 19:35:39 +01:00
Simon Vieille ee28c9abb7
copy the pager in the bottom of the index table
remove the with class of the action column
2023-11-10 19:28:20 +01:00
Simon Vieille 2bd6836a7f
fix issue on file manager when a file is selected in the file in the file picker 2023-11-09 17:19:09 +01:00
14 changed files with 128 additions and 47 deletions

View file

@ -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

View file

@ -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);

View file

@ -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);

View file

@ -3,7 +3,7 @@
namespace App\Core;
if (!defined('MURPH_VERSION')) {
define('MURPH_VERSION', 'v1.23.0');
define('MURPH_VERSION', 'v1.24.1');
}
/**

View file

@ -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 {

View file

@ -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')()

View file

@ -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)
}

View file

@ -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

View file

@ -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(() => {

View file

@ -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
{

View file

@ -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>

View file

@ -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 %}

View file

@ -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>

View file

@ -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