kopia lustrzana https://github.com/jedie/PyInventory
Fix CKEditor
v0.10.1 toolbar looks like this:  Toolbar with this PR:  Useless icons was removed. (Note: PDF generation doesn't work) Add "Source code" icon (Can help to fix bugs) and add the "About" icon.pull/71/head
rodzic
e233c43072
commit
5e5bf62bf0
|
@ -7,4 +7,17 @@
|
||||||
#footer p, #footer a {
|
#footer p, #footer a {
|
||||||
line-height: 0.3em;
|
line-height: 0.3em;
|
||||||
color: #333;
|
color: #333;
|
||||||
|
}
|
||||||
|
.django-ckeditor-widget {
|
||||||
|
width: 75%;
|
||||||
|
}
|
||||||
|
@media (max-width: 1100px) {
|
||||||
|
.django-ckeditor-widget {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@media (max-width: 767px) {
|
||||||
|
.django-ckeditor-widget {
|
||||||
|
width: 99%;
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -5,6 +5,7 @@
|
||||||
import logging
|
import logging
|
||||||
from pathlib import Path as __Path
|
from pathlib import Path as __Path
|
||||||
|
|
||||||
|
from ckeditor.configs import DEFAULT_CONFIG
|
||||||
from django.utils.translation import gettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
|
@ -168,17 +169,18 @@ DBBACKUP_STORAGE_OPTIONS = {'location': str(__Path(BASE_PATH, 'backups'))}
|
||||||
|
|
||||||
CKEDITOR_BASEPATH = STATIC_URL + 'ckeditor/ckeditor/'
|
CKEDITOR_BASEPATH = STATIC_URL + 'ckeditor/ckeditor/'
|
||||||
CKEDITOR_FILENAME_GENERATOR = 'inventory.ckeditor_upload.get_filename'
|
CKEDITOR_FILENAME_GENERATOR = 'inventory.ckeditor_upload.get_filename'
|
||||||
CKEDITOR_DEFAULT_CONFIG = {
|
CKEDITOR_DEFAULT_CONFIG = DEFAULT_CONFIG
|
||||||
'skin': 'moono-lisa',
|
CKEDITOR_DEFAULT_CONFIG.update({
|
||||||
'removeButtons': 'Language,Cut,Copy,Paste,Undo,Redo,Anchor',
|
'removeButtons': 'Language,Cut,Copy,Paste,Undo,Redo,Anchor',
|
||||||
|
|
||||||
# plugins are here: .../site-packages/ckeditor/static/ckeditor/ckeditor/plugins
|
# plugins are here: .../site-packages/ckeditor/static/ckeditor/ckeditor/plugins
|
||||||
# and here: https://github.com/ckeditor/ckeditor4/tree/major/plugins
|
# and here: https://github.com/ckeditor/ckeditor4/tree/major/plugins
|
||||||
# See also: .../site-packages/ckeditor/static/ckeditor/ckeditor/build-config.js
|
# See also: .../site-packages/ckeditor/static/ckeditor/ckeditor/build-config.js
|
||||||
'removePlugins': (
|
'removePlugins': (
|
||||||
# Generated with .../dev-scripts/ckeditor_info.py
|
# Generated with devshell command:
|
||||||
|
# (inventory) ckeditor_info
|
||||||
'a11yhelp',
|
'a11yhelp',
|
||||||
'about',
|
# 'about',
|
||||||
'adobeair',
|
'adobeair',
|
||||||
'ajax',
|
'ajax',
|
||||||
'autoembed',
|
'autoembed',
|
||||||
|
@ -207,6 +209,7 @@ CKEDITOR_DEFAULT_CONFIG = {
|
||||||
'embedsemantic',
|
'embedsemantic',
|
||||||
'enterkey',
|
'enterkey',
|
||||||
# 'entities',
|
# 'entities',
|
||||||
|
'exportpdf',
|
||||||
# 'filebrowser',
|
# 'filebrowser',
|
||||||
# 'filetools',
|
# 'filetools',
|
||||||
'find',
|
'find',
|
||||||
|
@ -253,7 +256,7 @@ CKEDITOR_DEFAULT_CONFIG = {
|
||||||
# 'showblocks',
|
# 'showblocks',
|
||||||
# 'showborders',
|
# 'showborders',
|
||||||
'smiley',
|
'smiley',
|
||||||
'sourcearea',
|
# 'sourcearea',
|
||||||
'sourcedialog',
|
'sourcedialog',
|
||||||
'specialchar',
|
'specialchar',
|
||||||
'stylescombo',
|
'stylescombo',
|
||||||
|
@ -274,12 +277,33 @@ CKEDITOR_DEFAULT_CONFIG = {
|
||||||
# 'wysiwygarea',
|
# 'wysiwygarea',
|
||||||
'xml',
|
'xml',
|
||||||
),
|
),
|
||||||
'toolbar': 'full',
|
'toolbar_PyInventoryToolbarConfig': [
|
||||||
|
{'name': 'basicstyles', 'items': [
|
||||||
|
'Bold', 'Italic', 'Underline', 'Strike',
|
||||||
|
'-',
|
||||||
|
'RemoveFormat'
|
||||||
|
]},
|
||||||
|
{'name': 'paragraph', 'items': [
|
||||||
|
'NumberedList', 'BulletedList',
|
||||||
|
'-',
|
||||||
|
'Outdent', 'Indent',
|
||||||
|
'-',
|
||||||
|
'Blockquote',
|
||||||
|
'-',
|
||||||
|
'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock',
|
||||||
|
]},
|
||||||
|
{'name': 'links', 'items': ['Link', 'Unlink', 'Anchor']},
|
||||||
|
{'name': 'insert', 'items': ['Image', 'Table', 'HorizontalRule']},
|
||||||
|
'/',
|
||||||
|
{'name': 'styles', 'items': ['Styles', 'Format', 'Font', 'FontSize']},
|
||||||
|
{'name': 'colors', 'items': ['TextColor', 'BGColor']},
|
||||||
|
{'name': 'tools', 'items': ['Maximize', 'ShowBlocks', 'Source']},
|
||||||
|
{'name': 'about', 'items': ['About']},
|
||||||
|
],
|
||||||
|
'toolbar': 'PyInventoryToolbarConfig',
|
||||||
'height': '25em',
|
'height': '25em',
|
||||||
'width': '100%',
|
'width': '100%',
|
||||||
'filebrowserWindowWidth': 940,
|
})
|
||||||
'filebrowserWindowHeight': 725,
|
|
||||||
}
|
|
||||||
CKEDITOR_CONFIGS = {
|
CKEDITOR_CONFIGS = {
|
||||||
'ItemModel.description': CKEDITOR_DEFAULT_CONFIG,
|
'ItemModel.description': CKEDITOR_DEFAULT_CONFIG,
|
||||||
'LocationModel.description': CKEDITOR_DEFAULT_CONFIG
|
'LocationModel.description': CKEDITOR_DEFAULT_CONFIG
|
||||||
|
|
Ładowanie…
Reference in New Issue