Skip to content

Commit 44c36f8

Browse files
fix: sbadmin issues
1 parent db6a68d commit 44c36f8

5 files changed

Lines changed: 73 additions & 26 deletions

File tree

pythoncms/modules/box__default/page/templates/page/dashboard.html

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,26 @@
1212
<h3>New page</h3>
1313
<form action="{{url_for('{}.check_pagecontent'.format(module_name))}}" method="POST">
1414
{{ form.title.label }}
15-
<div class="input-group mb-3">
15+
1616
{{ form.title }}
17-
<span id="error" type="text" vissiblity='hidden'></span>
18-
</div>
17+
18+
1919
{{ form.slug.label }}
20-
<div class="input-group mb-3">
20+
2121
{{ form.slug }}
22-
<span id="error" type="text" vissiblity='hidden'></span>
23-
</div>
24-
<div class="field">
22+
23+
2524
{{ form.lang.label }} <br>
26-
<div class="input-group mb-3">
25+
2726
{{ form.lang }}
28-
</div>
29-
</div>
30-
<div class="field">
27+
28+
29+
3130
{{ form.content.label }} <br>
32-
<div class="input-group mb-3">
31+
3332
{{ form.content }}
34-
</div>
35-
</div>
33+
34+
3635

3736

3837
<input type="hidden" name="csrf_token" value="{{csrf_token()}}">
@@ -41,12 +40,12 @@ <h3>New page</h3>
4140
</div>
4241
</div>
4342
</div>
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>
43+
<script src="https://cdnjs.cloudflare.com/ajax/libs/tinymce/6.8.3/tinymce.min.js" integrity="sha512-eV68QXP3t5Jbsf18jfqT8xclEJSGvSK5uClUuqayUbF5IRK8e2/VSXIFHzEoBnNcvLBkHngnnd3CY7AFpUhF7w==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
4544
<script type="text/javascript">
4645
tinymce.init({
4746
selector: '#content',
48-
plugins: `advlist autolink link image imagetools lists
49-
charmap print preview hr anchor pagebreak
47+
plugins: `advlist autolink link image lists
48+
charmap print preview anchor pagebreak
5049
searchreplace wordcount visualblocks visualchars code
5150
fullscreen insertdatetime media nonbreaking
5251
save table directionality template paste

pythoncms/modules/box__default/page/templates/page/view_page_dashboard.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
</div>
5151
</div>
5252
</div>
53-
<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>
53+
<script src="https://cdnjs.cloudflare.com/ajax/libs/tinymce/6.8.3/tinymce.min.js" integrity="sha512-eV68QXP3t5Jbsf18jfqT8xclEJSGvSK5uClUuqayUbF5IRK8e2/VSXIFHzEoBnNcvLBkHngnnd3CY7AFpUhF7w==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
5454
<script type="text/javascript">
5555
tinymce.init({
5656
selector: '#content',

pythoncms/modules/box__default/theme/templates/theme/index.html

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
{%block content%}
55
<br>
6+
<i>Note: change theme in .env file also </i>
7+
<br>
68
<div class="container">
79

810
<br>
@@ -81,6 +83,43 @@
8183
</table>
8284
</div>
8385
</div>
86+
<br>
87+
<div class="card" style="color: black">
88+
<div class="card-header">
89+
Iconset
90+
</div>
91+
<div class="card-body">
92+
<table class="table">
93+
<thead>
94+
<tr>
95+
<th>Name</th>
96+
<th></th>
97+
</tr>
98+
</thead>
99+
<tbody>
100+
{%for icon in ['fa', 'boxicons']%}
101+
<tr>
102+
<td>{{icon}}</td>
103+
<td>
104+
{%if active_iconset != icon%}
105+
<a class="" href="{{url_for('theme.activate_iconset', name=icon)}}">
106+
<div class="form-check">
107+
<input class="form-check-input" type="radio" value="" disabled="">
108+
</div>
109+
</a>
110+
{%else%}
111+
<div class="form-check">
112+
<input name="" class="form-check-input" type="radio" value="" checked="">
113+
</div>
114+
{%endif%}
115+
</td>
116+
</tr>
117+
{%endfor%}
118+
</tbody>
119+
</table>
120+
</div>
121+
</div>
122+
84123
<div>
85124

86125
</div>

pythoncms/modules/box__default/theme/view.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,15 @@ def index():
6868

6969
active_front_theme = get_value('ACTIVE_FRONT_THEME')
7070
active_back_theme = get_value('ACTIVE_BACK_THEME')
71+
active_iconset = get_value('ACTIVE_ICONSET')
7172

7273
context.update(
7374
{
7475
"all_front_info": all_front_info,
7576
"all_back_info": all_back_info,
7677
"active_front_theme": active_front_theme,
7778
"active_back_theme": active_back_theme,
79+
"active_iconset": active_iconset
7880
}
7981
)
8082
context.update(module_settings)
@@ -106,3 +108,14 @@ def activate_back_theme(theme_name):
106108
# current_app.jinja_loader,
107109
# print(current_app.jinja_loader.list_templates())
108110
return redirect(url_for("{}.index".format(module_info["module_name"])))
111+
112+
@module_blueprint.route("/activate/inconset/<name>")
113+
@login_required
114+
def activate_iconset(name):
115+
set_value('ACTIVE_ICONSET', name) # fa, boxicons
116+
117+
# with app.app_context():
118+
119+
# current_app.jinja_loader,
120+
# print(current_app.jinja_loader.list_templates())
121+
return redirect(url_for("{}.index".format(module_info["module_name"])))

pythoncms/static/themes/back/sbadmin/base.html

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919

2020
<!-- Custom styles for this template-->
2121
<link href="{{url_for('static', filename='themes/back/sbadmin/css/sb-admin-2.min.css')}}" rel="stylesheet">
22-
22+
{%block head%}
23+
{%endblock%}
2324
</head>
2425

2526
<body id="page-top">
@@ -211,7 +212,7 @@ <h6 class="collapse-header"></h6>
211212
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
212213
<span class="mr-2 d-none d-lg-inline text-gray-600 small">Douglas McGee</span>
213214
<img class="img-profile rounded-circle"
214-
src="img/undraw_profile.svg">
215+
src="#">
215216
</a>
216217
<!-- Dropdown - User Information -->
217218
<div class="dropdown-menu dropdown-menu-right shadow animated--grow-in"
@@ -303,12 +304,7 @@ <h5 class="modal-title" id="exampleModalLabel">Ready to Leave?</h5>
303304
<!-- Custom scripts for all pages-->
304305
<script src="{{url_for('static', filename='themes/back/sbadmin/js/sb-admin-2.min.js')}}"></script>
305306

306-
<!-- Page level plugins -->
307-
<script src="{{url_for('static', filename='themes/back/sbadmin/vendor/chart.js/Chart.min.js')}}"></script>
308-
309-
<!-- Page level custom scripts -->
310-
<script src="{{url_for('static', filename='themes/back/sbadmin/js/demo/chart-area-demo.js')}}"></script>
311-
<script src="{{url_for('static', filename='themes/back/sbadmin/js/demo/chart-pie-demo.js')}}"></script>
307+
312308

313309
</body>
314310

0 commit comments

Comments
 (0)