Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
04b6ea4b0a |
@ -139,7 +139,7 @@ customColorPalette = [
|
|||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
# CKEDITOR_5_CUSTOM_CSS = 'css/ckeditor-font-color.css' # optional
|
# CKEDITOR_5_CUSTOM_CSS = 'app/static/cybercode/styles/editor.css' # optional
|
||||||
# CKEDITOR_5_FILE_STORAGE = "path_to_storage.CustomStorage" # optional
|
# CKEDITOR_5_FILE_STORAGE = "path_to_storage.CustomStorage" # optional
|
||||||
CKEDITOR_5_CONFIGS = {
|
CKEDITOR_5_CONFIGS = {
|
||||||
'simple': {
|
'simple': {
|
||||||
@ -148,6 +148,7 @@ CKEDITOR_5_CONFIGS = {
|
|||||||
'default': {
|
'default': {
|
||||||
'toolbar': ['heading', '|', 'bold', 'italic', 'link',
|
'toolbar': ['heading', '|', 'bold', 'italic', 'link',
|
||||||
'bulletedList', 'numberedList', 'blockQuote', 'imageUpload', ],
|
'bulletedList', 'numberedList', 'blockQuote', 'imageUpload', ],
|
||||||
|
'contentsCss': ['/static/cybercode/styles/editor.css'],
|
||||||
'language': 'ru',
|
'language': 'ru',
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|||||||
21
app/static/cybercode/styles/editor.css
Normal file
21
app/static/cybercode/styles/editor.css
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
/*!* Пример кастомизации *!*/
|
||||||
|
/*.ck-content {*/
|
||||||
|
/* font-family: 'Arial', sans-serif;*/
|
||||||
|
/* font-size: 48px;*/
|
||||||
|
/* line-height: 1.6;*/
|
||||||
|
/* color: #333;*/
|
||||||
|
/*}*/
|
||||||
|
|
||||||
|
/*.ck-content h2 {*/
|
||||||
|
/* color: #2c3e50;*/
|
||||||
|
/* font-size: 24px;*/
|
||||||
|
/* margin-top: 20px;*/
|
||||||
|
/* margin-bottom: 10px;*/
|
||||||
|
/*}*/
|
||||||
|
|
||||||
|
/*.ck-content p {*/
|
||||||
|
/* color: #3498db;*/
|
||||||
|
/* font-size: 24px;*/
|
||||||
|
/* margin-top: 20px;*/
|
||||||
|
/* margin-bottom: 10px;*/
|
||||||
|
/*}*/
|
||||||
@ -511,4 +511,18 @@ a.service-slide {
|
|||||||
display: -webkit-box;
|
display: -webkit-box;
|
||||||
-webkit-line-clamp: 4;
|
-webkit-line-clamp: 4;
|
||||||
-webkit-box-orient: vertical;
|
-webkit-box-orient: vertical;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ck-content h1 {
|
||||||
|
font-size: 2.5em;
|
||||||
|
margin-top: 1.5em;
|
||||||
|
margin-bottom: 0.5em;
|
||||||
|
color: #333;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.ck-content p {
|
||||||
|
margin-top: 1em;
|
||||||
|
margin-bottom: 1em;
|
||||||
|
text-indent: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@ -19,6 +19,7 @@
|
|||||||
<link href="{% static_with_version 'bootstrap/bootstrap.css' %}" rel="stylesheet">
|
<link href="{% static_with_version 'bootstrap/bootstrap.css' %}" rel="stylesheet">
|
||||||
<link rel="stylesheet" href="{% static_with_version 'cybercode/styles/fonts/fonts.css' %}">
|
<link rel="stylesheet" href="{% static_with_version 'cybercode/styles/fonts/fonts.css' %}">
|
||||||
<link rel="stylesheet" href="{% static_with_version 'cybercode/styles/style.css' %}">
|
<link rel="stylesheet" href="{% static_with_version 'cybercode/styles/style.css' %}">
|
||||||
|
<link rel="stylesheet" href="{% static_with_version 'cybercode/styles/editor.css' %}">
|
||||||
{% block title %}
|
{% block title %}
|
||||||
<title>Кибекод</title>
|
<title>Кибекод</title>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@ -1,16 +1,24 @@
|
|||||||
def validate_file_extension_mp4(value):
|
import os
|
||||||
import os
|
import logging
|
||||||
from django.core.exceptions import ValidationError
|
|
||||||
ext = os.path.splitext(value.name)[1]
|
|
||||||
valid_extensions = ['.mp4']
|
|
||||||
if not ext.lower() in valid_extensions:
|
|
||||||
raise ValidationError('Unsupported file extension.')
|
|
||||||
|
|
||||||
|
error_logger = logging.getLogger('django.error')
|
||||||
|
|
||||||
|
def validate_file_extension_mp4(value):
|
||||||
|
try:
|
||||||
|
ext = os.path.splitext(value.name)[1]
|
||||||
|
valid_extensions = ['.mp4']
|
||||||
|
if not ext.lower() in valid_extensions:
|
||||||
|
error_logger.error(f"Неподдерживаемое расширение файла для файла: {value.name}")
|
||||||
|
except Exception as e:
|
||||||
|
error_logger.error(f"Критическая в validate_file_extension_mp4: {str(e)}")
|
||||||
|
raise
|
||||||
|
|
||||||
def validate_file_extension_webm(value):
|
def validate_file_extension_webm(value):
|
||||||
import os
|
try:
|
||||||
from django.core.exceptions import ValidationError
|
ext = os.path.splitext(value.name)[1]
|
||||||
ext = os.path.splitext(value.name)[1]
|
valid_extensions = ['.webm']
|
||||||
valid_extensions = ['.webm']
|
if not ext.lower() in valid_extensions:
|
||||||
if not ext.lower() in valid_extensions:
|
error_logger.error(f"Неподдерживаемое расширение файла для файла: {value.name}")
|
||||||
raise ValidationError('Unsupported file extension.')
|
except Exception as e:
|
||||||
|
error_logger.error(f"Критическая в validate_file_extension_webm: {str(e)}")
|
||||||
|
raise
|
||||||
Loading…
x
Reference in New Issue
Block a user