Skip to content

Commit

Permalink
It's Winter. Replace summernote with trix (applied in task/form)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rayvented committed Nov 20, 2023
1 parent 1014203 commit 7aa3207
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 5 deletions.
17 changes: 15 additions & 2 deletions assets/app.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,32 @@
import './bootstrap.js';
import "trix";
import './scripts/tailmater.js';
import './scripts/datatables.js';

import 'trix/dist/trix.css';
import './styles/materialDesignIcons.css';
import './styles/tailmater.css';
import './styles/colors.css';
import './styles/dataTablesTailwind.css';
import './styles/dataTablesApp.css';
import './styles/app.css';
import './scripts/tailmater.js';
import './scripts/datatables.js';

import $ from 'jquery';
global.$ = global.jQuery = $;
import {initFreeFields} from "./scripts/freeField";

document.getElementById('snackbar-trigger')?.click();

(function() {
addEventListener("trix-initialize", function(e) {
const file_tools = document.querySelector(".trix-button-group--file-tools");
file_tools?.remove();
})
addEventListener("trix-file-accept", function(e) {
e.preventDefault();
})
})();

$(document).ready(function() {
initFreeFields();
});
32 changes: 32 additions & 0 deletions assets/styles/tailmater.css
Original file line number Diff line number Diff line change
Expand Up @@ -1075,4 +1075,36 @@ ul.stacked-list > li > div:last-child {

ul.dynamic-list > li {
@apply flex pb-3 gap-x-5;
}

.trix-wrapper {
@apply bg-white shadow-sm rounded border border-gray-300;
}

trix-toolbar {
@apply border-b border-gray-300 px-2 pt-2.5;
}

trix-editor {
@apply border-none p-2;
}

trix-toolbar .trix-button.trix-active {
@apply bg-primary-100;
}

trix-toolbar .trix-button-group.trix-button-group--file-tools {
@apply hidden;
}

trix-editor ol, trix-editor ul {
margin-left: 25px;
}

trix-editor ul {
list-style: disc;
}

trix-editor ol {
list-style: decimal;
}
13 changes: 12 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
},
"dependencies": {
"datatables.net-dt": "^1.13.7",
"h2-invent-apps": "^2.2.0"
"h2-invent-apps": "^2.2.0",
"trix": "^2.0.8"
}
}
8 changes: 7 additions & 1 deletion templates/task/__form.html.twig
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
{{ form_start(form, {attr: {class: not activ ? 'disabled'}}) }}
<fieldset>
{{ form_row(form.title) }}
{{ form_row(form.task) }}
<div class="form-group">
{{ form_label(form.task) }}
<div class="hidden">{{ form_widget(form.task) }}</div>
<div class="trix-wrapper">
<trix-editor input="tasks_task"></trix-editor>
</div>
</div>
{{ form_row(form.endDate) }}
{{ form_row(form.prio) }}
{{ form_row(form.assignedUser) }}
Expand Down

0 comments on commit 7aa3207

Please sign in to comment.