Skip to content

Commit 4bf53e5

Browse files
Merge pull request #336 from shopyo/feat/tinymce
feat: tinymce editors
2 parents 0013aad + 27c1850 commit 4bf53e5

11 files changed

Lines changed: 33 additions & 24 deletions

File tree

β€ŽMANIFEST.inβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ include dev_requirements.txt
33
exclude config.json
44
recursive-include {projname} *
55
recursive-exclude {projname}/instance *
6+
recursive-exclude {projname}/migrations *
67
recursive-exclude {projname}/static/modules *
78
recursive-exclude {projname}/.tox *
89
recursive-exclude __pycache__ *

β€Žpythoncms/modules/box__default/appadmin/admin.pyβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from shopyo.api.html import notify_warning
88

99
login_manager.login_view = "auth.login"
10-
login_manager.login_message = notify_warning("Please login for access")
10+
# login_manager.login_message = "Please login for access"
1111

1212

1313
@login_manager.user_loader

β€Žpythoncms/modules/box__default/auth/view.pyβ€Ž

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,13 +134,12 @@ def login():
134134
@login_required
135135
def logout():
136136
logout_user()
137-
flash("Successfully logged out", "ok")
138137

139138
if "next" not in request.args:
140-
next_url = url_for("dashboard.index")
139+
next_url = url_for("www.index")
141140
else:
142141
if request.args.get("next") == "":
143-
next_url = url_for("dashboard.index")
142+
next_url = url_for("www.index")
144143
else:
145144
next_url = get_safe_redirect(request.args.get("next"))
146145
return redirect(next_url)

β€Žpythoncms/modules/box__default/page/templates/page/dashboard.htmlβ€Ž

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
{%block head%}
44
<script src="{{url_for('static', filename='jquery_3.2.1.min.js')}}"></script>
5+
56
{%endblock%}
67
{% block content %}
78
<br>
@@ -40,17 +41,19 @@ <h3>New page</h3>
4041
</div>
4142
</div>
4243
</div>
43-
<script type="text/javascript" src="{{ url_for('static', filename='tinymce/tinymce.min.js') }}"></script>
44+
<script src="https://cdnjs.cloudflare.com/ajax/libs/tinymce/6.3.1/tinymce.min.js" integrity="sha512-eV68QXP3t5Jbsf18jfqT8xclEJSGvSK5uClUuqayUbF5IRK8e2/VSXIFHzEoBnNcvLBkHngnnd3CY7AFpUhF7w==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
4445
<script type="text/javascript">
4546
tinymce.init({
4647
selector: '#content',
47-
plugins: [
48-
'advlist autolink link image imagetools lists charmap print preview hr anchor pagebreak spellchecker',
49-
'searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking',
50-
'save table contextmenu directionality template paste textcolor codesample'
51-
],
48+
plugins: `advlist autolink link image imagetools lists
49+
charmap print preview hr anchor pagebreak
50+
searchreplace wordcount visualblocks visualchars code
51+
fullscreen insertdatetime media nonbreaking
52+
save table directionality template paste
53+
codesample`
54+
,
5255
imagetools_toolbar: "rotateleft rotateright | flipv fliph | editimage imageoptions",
53-
toolbar: 'insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | print preview media fullpage | forecolor backcolor emoticons | codesample',
56+
toolbar: 'insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | print preview media fullpage | forecolor backcolor emoticons | codesample | table tabledelete | tableprops tablerowprops tablecellprops | tableinsertrowbefore tableinsertrowafter tabledeleterow | tableinsertcolbefore tableinsertcolafter tabledeletecol',
5457
relative_urls: false,
5558
images_upload_url: "",
5659
image_title: true,
@@ -65,6 +68,7 @@ <h3>New page</h3>
6568
{ text: 'Python', value: 'python' }
6669
],
6770
width: "100%",
71+
promotion: false
6872
});
6973
</script>
7074
<script type="text/javascript">

β€Žpythoncms/modules/box__default/page/templates/page/view_page_dashboard.htmlβ€Ž

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
{%block head%}
44
<script src="{{url_for('static', filename='jquery_3.2.1.min.js')}}"></script>
5+
56
{%endblock%}
67
{% block content %}
78
<br>
@@ -36,7 +37,7 @@
3637
<div class="field">
3738
{{ form.content.label }} <br>
3839
<div class="input-group mb-3">
39-
<textarea class="form-control" name="content">{{ form.content }}</textarea>
40+
<textarea id="content" class="form-control" name="content">{{ form.content }}</textarea>
4041
</div>
4142
</div>
4243

@@ -48,17 +49,19 @@
4849
</div>
4950
</div>
5051
</div>
51-
<script type="text/javascript" src="{{ url_for('static', filename='tinymce/tinymce.min.js') }}"></script>
52+
<script src="https://cdnjs.cloudflare.com/ajax/libs/tinymce/6.3.1/tinymce.min.js" integrity="sha512-eV68QXP3t5Jbsf18jfqT8xclEJSGvSK5uClUuqayUbF5IRK8e2/VSXIFHzEoBnNcvLBkHngnnd3CY7AFpUhF7w==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
5253
<script type="text/javascript">
5354
tinymce.init({
5455
selector: '#content',
55-
plugins: [
56-
'advlist autolink link image imagetools lists charmap print preview hr anchor pagebreak spellchecker',
57-
'searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking',
58-
'save table contextmenu directionality template paste textcolor codesample'
59-
],
56+
plugins: `advlist autolink link image imagetools lists
57+
charmap print preview hr anchor pagebreak
58+
searchreplace wordcount visualblocks visualchars code
59+
fullscreen insertdatetime media nonbreaking
60+
save table directionality template paste
61+
codesample`
62+
,
6063
imagetools_toolbar: "rotateleft rotateright | flipv fliph | editimage imageoptions",
61-
toolbar: 'insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | print preview media fullpage | forecolor backcolor emoticons | codesample',
64+
toolbar: 'insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | print preview media fullpage | forecolor backcolor emoticons | codesample | table tabledelete | tableprops tablerowprops tablecellprops | tableinsertrowbefore tableinsertrowafter tabledeleterow | tableinsertcolbefore tableinsertcolafter tabledeletecol',
6265
relative_urls: false,
6366
images_upload_url: "",
6467
image_title: true,
@@ -73,6 +76,7 @@
7376
{ text: 'Python', value: 'python' }
7477
],
7578
width: "100%",
79+
promotion: false
7680
});
7781
</script>
7882
<script type="text/javascript">

β€Žpythoncms/static/themes/back/sneat/authbase.htmlβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
<span class="app-brand-logo demo">
7070
<img width=40 height=40 src="{{ url_for('static', filename='logo.svg') }}">
7171
</span>
72-
<span class="app-brand-text demo text-body fw-bolder">PyCMS</span>
72+
<span class="app-brand-text demo text-body fw-bolder">PythonCMS</span>
7373
</a>
7474
</div>
7575
{%block content%}

β€Žpythoncms/static/themes/back/sneat/base.htmlβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
<span class="app-brand-logo demo">
8383
<img width=40 height=40 src="{{ url_for('static', filename='logo.svg') }}">
8484
</span>
85-
<span class="app-brand-text demo menu-text fw-bolder ms-2">PyCMS</span>
85+
<span class="app-brand-text demo menu-text fw-bolder ms-2">PythonCMS</span>
8686
</a>
8787

8888
<a href="javascript:void(0);" class="layout-menu-toggle menu-link text-large ms-auto d-block d-xl-none">

β€Žpythoncms/static/themes/back/sneat/login.htmlβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{%extends 'sneat/authbase.html' %}
22

33
{%block content%}
4-
<h4 class="mb-2">Welcome to PyCMS! πŸ‘‹</h4>
4+
<h4 class="mb-2">Welcome to PythonCMS! πŸ‘‹</h4>
55
<p class="mb-4">Please sign-in to your account and start the adventure</p>
66

77
<form id="formAuthentication" class="mb-3" action="{{url_for('auth.login')}}" method="POST">

β€Žpythoncms/static/themes/back/sneat/unconfirmed.htmlβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{%extends 'sneat/authbase.html' %}
22

33
{%block content%}
4-
<h4 class="mb-2">Welcome to PyCMS! πŸ‘‹</h4>
4+
<h4 class="mb-2">Welcome to PythonCMS! πŸ‘‹</h4>
55
<!-- <p class="mb-4">Please sign-in to your account and start the adventure</p> -->
66
<div >
77

β€Žpythoncms/static/themes/front/editorial/base.htmlβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<title>Editorial by HTML5 UP</title>
1010
<meta charset="utf-8" />
1111
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
12+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.1/css/all.min.css" integrity="sha512-MV7K8+y+gLIBoVD59lQIYicR65iaqukzvf/nwasF0nqhPay5w/9lJmVM2hMDcnK1OnMGCdVK+iQrJ7lzPJQd1w==" crossorigin="anonymous" referrerpolicy="no-referrer" />
1213
<link rel="stylesheet" href="{{url_for('static', filename='themes/front/editorial/assets/css/main.css')}}" />
1314
</head>
1415
<body class="is-preload">

0 commit comments

Comments
Β (0)