Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

more sensible access to wymeditor settings

  • Loading branch information...
commit d0fc75e0ca50ec36e5e0f66660a2673def4fe278 1 parent 5760020
@evildmp authored
View
43 arkestra_utilities/settings.py
@@ -123,50 +123,7 @@
EXPAND_ALL_MENU_BRANCHES = getattr(settings, "EXPAND_ALL_MENU_BRANCHES", False)
-# -------- Semantic editor ----------------------
-
-# ensure that the highest_page_body_heading_level is made available below
-
-WYM_CONTAINERS = getattr(settings, "WYM_CONTAINERS",
- ",\n".join([
- "{'name': 'P', 'title': 'Paragraph', 'css': 'wym_containers_p'}",
- # "{'name': 'H1', 'title': 'Heading_1', 'css': 'wym_containers_h1'}", # I assume you reserve <h1> for your page templates
- "{'name': 'H2', 'title': 'Heading_2', 'css': 'wym_containers_h2'}",
- "{'name': 'H3', 'title': 'Heading_3', 'css': 'wym_containers_h3'}",
- "{'name': 'H4', 'title': 'Heading_4', 'css': 'wym_containers_h4'}",
- "{'name': 'H5', 'title': 'Heading_5', 'css': 'wym_containers_h5'}",
- "{'name': 'H6', 'title': 'Heading_6', 'css': 'wym_containers_h6'}",
- # "{'name': 'PRE', 'title': 'Preformatted', 'css': 'wym_containers_pre'}",
- "{'name': 'BLOCKQUOTE', 'title': 'Blockquote', 'css': 'wym_containers_blockquote'}",
- # "{'name': 'TH', 'title': 'Table_Header', 'css': 'wym_containers_th'}", # not ready for this yet
- ])
- )
-
-
-WYM_TOOLS = getattr(settings, "WYM_TOOLS",
- ",\n".join([
- "{'name': 'Italic', 'title': 'Emphasis', 'css': 'wym_tools_emphasis'}", # and not italic
- "{'name': 'Bold', 'title': 'Strong', 'css': 'wym_tools_strong'}", # not 'bold'
- "{'name': 'InsertUnorderedList', 'title': 'Unordered_List', 'css': 'wym_tools_unordered_list'}",
- "{'name': 'InsertOrderedList', 'title': 'Ordered_List', 'css': 'wym_tools_ordered_list'}",
- "{'name': 'Indent', 'title': 'Indent', 'css': 'wym_tools_indent'}", # should be 'nest'
- "{'name': 'Outdent', 'title': 'Outdent', 'css': 'wym_tools_outdent'}", # should be 'unnest'
- # "{'name': 'Superscript', 'title': 'Superscript', 'css': 'wym_tools_superscript'}",
- # "{'name': 'Subscript', 'title': 'Subscript', 'css': 'wym_tools_subscript'}",
- "{'name': 'Undo', 'title': 'Undo', 'css': 'wym_tools_undo'}",
- "{'name': 'Redo', 'title': 'Redo', 'css': 'wym_tools_redo'}",
- # "{'name': 'Paste', 'title': 'Paste_From_Word', 'css': 'wym_tools_paste'}",
- "{'name': 'ToggleHtml', 'title': 'HTML', 'css': 'wym_tools_html'}",
- #"{'name': 'CreateLink', 'title': 'Link', 'css': 'wym_tools_link'}",
- #"{'name': 'Unlink', 'title': 'Unlink', 'css': 'wym_tools_unlink'}",
- #"{'name': 'InsertImage', 'title': 'Image', 'css': 'wym_tools_image'}",
- # "{'name': 'InsertTable', 'title': 'Table', 'css': 'wym_tools_table'}", # not ready for this yet
- #"{'name': 'Preview', 'title': 'Preview', 'css': 'wym_tools_preview'}",
- ])
- )
-WYM_CLASSES = ""
-WYM_STYLES = ""
# -------- Django ----------------------
LOGIN_REDIRECT_URL = getattr(settings, "LOGIN_REDIRECT_URL", "/admin/") #what happens after login - why is this required?
View
3  arkestra_utilities/widgets/wym_editor.py
@@ -4,8 +4,7 @@
from django.utils.safestring import mark_safe
from django.conf import settings
-from arkestra_utilities.settings import WYM_TOOLS, WYM_CONTAINERS, WYM_CLASSES, WYM_STYLES
-
+from cms.plugins.text.settings import WYM_TOOLS, WYM_CONTAINERS, WYM_CLASSES, WYM_STYLES
class WYMEditor(forms.Textarea):
class Media:
View
16 example_14/example_14/arkestra_settings.py
@@ -35,22 +35,6 @@
from settings import STATIC_URL
SEMANTICEDITOR_MEDIA_URL = os.path.join(STATIC_URL, "semanticeditor/")
-PAGE_TITLE_HEADING_LEVEL = 2
-
-# ensure that the highest_page_body_heading_level is made available below
-
-WYM_CONTAINERS = ",\n".join([
- "{'name': 'P', 'title': 'Paragraph', 'css': 'wym_containers_p'}",
-# "{'name': 'H1', 'title': 'Heading_1', 'css': 'wym_containers_h1'}", # I assume you reserve <h1> for your page templates
- "{'name': 'H2', 'title': 'Heading_2', 'css': 'wym_containers_h2'}",
- "{'name': 'H3', 'title': 'Heading_3', 'css': 'wym_containers_h3'}",
- "{'name': 'H4', 'title': 'Heading_4', 'css': 'wym_containers_h4'}",
- "{'name': 'H5', 'title': 'Heading_5', 'css': 'wym_containers_h5'}",
- "{'name': 'H6', 'title': 'Heading_6', 'css': 'wym_containers_h6'}",
-# "{'name': 'PRE', 'title': 'Preformatted', 'css': 'wym_containers_pre'}",
- "{'name': 'BLOCKQUOTE', 'title': 'Blockquote', 'css': 'wym_containers_blockquote'}",
- # "{'name': 'TH', 'title': 'Table_Header', 'css': 'wym_containers_th'}", # not ready for this yet
-])
# ------------------------ Link system
View
29 example_14/example_14/settings.py
@@ -319,4 +319,33 @@
('cy', gettext('Cymraeg')),
)
+# ------------------------ WYMeditor/SemanticEditor
+
+# these override the settings in cms.plugins.text.settings
+
+WYM_TOOLS = ",\n".join([
+ "{'name': 'Italic', 'title': 'Emphasis', 'css': 'wym_tools_emphasis'}",
+ "{'name': 'Bold', 'title': 'Strong', 'css': 'wym_tools_strong'}",
+ "{'name': 'InsertOrderedList', 'title': 'Ordered_List', 'css': 'wym_tools_ordered_list'}",
+ "{'name': 'InsertUnorderedList', 'title': 'Unordered_List', 'css': 'wym_tools_unordered_list'}",
+ "{'name': 'Indent', 'title': 'Indent', 'css': 'wym_tools_indent'}",
+ "{'name': 'Outdent', 'title': 'Outdent', 'css': 'wym_tools_outdent'}",
+ "{'name': 'Undo', 'title': 'Undo', 'css': 'wym_tools_undo'}",
+ "{'name': 'Redo', 'title': 'Redo', 'css': 'wym_tools_redo'}",
+ "{'name': 'ToggleHtml', 'title': 'HTML', 'css': 'wym_tools_html'}",
+])
+
+WYM_CONTAINERS = ",\n".join([
+ "{'name': 'P', 'title': 'Paragraph', 'css': 'wym_containers_p'}",
+ # "{'name': 'H1', 'title': 'Heading_1', 'css': 'wym_containers_h1'}", # I assume you reserve <h1> for your page templates
+ "{'name': 'H2', 'title': 'Heading_2', 'css': 'wym_containers_h2'}",
+ "{'name': 'H3', 'title': 'Heading_3', 'css': 'wym_containers_h3'}",
+ "{'name': 'H4', 'title': 'Heading_4', 'css': 'wym_containers_h4'}",
+ "{'name': 'H5', 'title': 'Heading_5', 'css': 'wym_containers_h5'}",
+ "{'name': 'H6', 'title': 'Heading_6', 'css': 'wym_containers_h6'}",
+# "{'name': 'PRE', 'title': 'Preformatted', 'css': 'wym_containers_pre'}",
+ "{'name': 'BLOCKQUOTE', 'title': 'Blockquote', 'css': 'wym_containers_blockquote'}",
+ # "{'name': 'TH', 'title': 'Table_Header', 'css': 'wym_containers_th'}", # not ready for this yet
+])
+
from arkestra_settings import *# import pdb; pdb.set_trace()
Please sign in to comment.
Something went wrong with that request. Please try again.