Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sb admin #346

Merged
merged 6 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 16 additions & 17 deletions pythoncms/modules/box__default/page/templates/page/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,26 @@
<h3>New page</h3>
<form action="{{url_for('{}.check_pagecontent'.format(module_name))}}" method="POST">
{{ form.title.label }}
<div class="input-group mb-3">

{{ form.title }}
<span id="error" type="text" vissiblity='hidden'></span>
</div>


{{ form.slug.label }}
<div class="input-group mb-3">

{{ form.slug }}
<span id="error" type="text" vissiblity='hidden'></span>
</div>
<div class="field">


{{ form.lang.label }} <br>
<div class="input-group mb-3">

{{ form.lang }}
</div>
</div>
<div class="field">



{{ form.content.label }} <br>
<div class="input-group mb-3">

{{ form.content }}
</div>
</div>




<input type="hidden" name="csrf_token" value="{{csrf_token()}}">
Expand All @@ -41,12 +40,12 @@ <h3>New page</h3>
</div>
</div>
</div>
<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>
<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>
<script type="text/javascript">
tinymce.init({
selector: '#content',
plugins: `advlist autolink link image imagetools lists
charmap print preview hr anchor pagebreak
plugins: `advlist autolink link image lists
charmap print preview anchor pagebreak
searchreplace wordcount visualblocks visualchars code
fullscreen insertdatetime media nonbreaking
save table directionality template paste
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
</div>
</div>
</div>
<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>
<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>
<script type="text/javascript">
tinymce.init({
selector: '#content',
Expand Down
39 changes: 39 additions & 0 deletions pythoncms/modules/box__default/theme/templates/theme/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

{%block content%}
<br>
<i>Note: change theme in .env file also </i>
<br>
<div class="container">

<br>
Expand Down Expand Up @@ -81,6 +83,43 @@
</table>
</div>
</div>
<br>
<div class="card" style="color: black">
<div class="card-header">
Iconset
</div>
<div class="card-body">
<table class="table">
<thead>
<tr>
<th>Name</th>
<th></th>
</tr>
</thead>
<tbody>
{%for icon in ['fa', 'boxicons']%}
<tr>
<td>{{icon}}</td>
<td>
{%if active_iconset != icon%}
<a class="" href="{{url_for('theme.activate_iconset', name=icon)}}">
<div class="form-check">
<input class="form-check-input" type="radio" value="" disabled="">
</div>
</a>
{%else%}
<div class="form-check">
<input name="" class="form-check-input" type="radio" value="" checked="">
</div>
{%endif%}
</td>
</tr>
{%endfor%}
</tbody>
</table>
</div>
</div>

<div>

</div>
Expand Down
18 changes: 16 additions & 2 deletions pythoncms/modules/box__default/theme/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# from init import db

from modules.box__default.keyvalue.helpers import get_value
from modules.box__default.keyvalue.helpers import set_value

# from shopyo.api.forms import flash_errors

Expand Down Expand Up @@ -67,13 +68,15 @@ def index():

active_front_theme = get_value('ACTIVE_FRONT_THEME')
active_back_theme = get_value('ACTIVE_BACK_THEME')
active_iconset = get_value('ACTIVE_ICONSET')

context.update(
{
"all_front_info": all_front_info,
"all_back_info": all_back_info,
"active_front_theme": active_front_theme,
"active_back_theme": active_back_theme,
"active_iconset": active_iconset
}
)
context.update(module_settings)
Expand All @@ -86,7 +89,7 @@ def index():
@module_blueprint.route("/activate/front/<theme_name>")
@login_required
def activate_front_theme(theme_name):
os.environ['ACTIVE_FRONT_THEME"'] = theme_name
set_value('ACTIVE_FRONT_THEME', theme_name)

# with app.app_context():

Expand All @@ -98,7 +101,18 @@ def activate_front_theme(theme_name):
@module_blueprint.route("/activate/back/<theme_name>")
@login_required
def activate_back_theme(theme_name):
os.environ['ACTIVE_BACK_THEME"'] = theme_name
set_value('ACTIVE_BACK_THEME', theme_name)

# with app.app_context():

# current_app.jinja_loader,
# print(current_app.jinja_loader.list_templates())
return redirect(url_for("{}.index".format(module_info["module_name"])))

@module_blueprint.route("/activate/inconset/<name>")
@login_required
def activate_iconset(name):
set_value('ACTIVE_ICONSET', name) # fa, boxicons

# with app.app_context():

Expand Down
1 change: 1 addition & 0 deletions pythoncms/static/themes/back/sbadmin/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
Loading