mirror of
https://github.com/retspen/webvirtcloud
synced 2025-07-31 12:41:08 +00:00
replaced ugettext_lazy with gettext_lazy
This commit is contained in:
parent
5172a9f619
commit
1b3fd9d05e
23 changed files with 40 additions and 39 deletions
|
@ -4,7 +4,7 @@ import os
|
|||
from django.shortcuts import render
|
||||
from django.http import HttpResponseRedirect
|
||||
from django.urls import reverse
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from django.contrib.auth.decorators import login_required
|
||||
from django.contrib import messages
|
||||
|
||||
|
@ -27,11 +27,11 @@ def appsettings(request):
|
|||
themes_list = os.listdir(sass_dir.value + "/wvc-theme")
|
||||
except FileNotFoundError as err:
|
||||
error_messages.append(err)
|
||||
addlogmsg(request.user.username, "", err)
|
||||
addlogmsg(request.user.username, "", err)
|
||||
|
||||
# Bootstrap settings related with filesystems, because of that they are excluded from other settings
|
||||
appsettings = AppSettings.objects.exclude(description__startswith="Bootstrap").order_by("name")
|
||||
|
||||
|
||||
|
||||
if request.method == 'POST':
|
||||
if 'SASS_DIR' in request.POST:
|
||||
|
@ -44,23 +44,23 @@ def appsettings(request):
|
|||
except Exception as err:
|
||||
msg = err
|
||||
error_messages.append(msg)
|
||||
|
||||
|
||||
addlogmsg(request.user.username, "", msg)
|
||||
return HttpResponseRedirect(request.get_full_path())
|
||||
|
||||
if 'BOOTSTRAP_THEME' in request.POST:
|
||||
theme = request.POST.get("BOOTSTRAP_THEME", "")
|
||||
scss_var = f"@import '{sass_dir.value}/wvc-theme/{theme}/variables';"
|
||||
scss_bootswatch = f"@import '{sass_dir.value}/wvc-theme/{theme}/bootswatch';"
|
||||
scss_bootswatch = f"@import '{sass_dir.value}/wvc-theme/{theme}/bootswatch';"
|
||||
scss_boot = f"@import '{sass_dir.value}/bootstrap-overrides.scss';"
|
||||
|
||||
try:
|
||||
try:
|
||||
with open(sass_dir.value + "/wvc-main.scss", "w") as main:
|
||||
main.write(scss_var + "\n" + scss_boot + "\n" + scss_bootswatch + "\n")
|
||||
|
||||
|
||||
css_compressed = sass.compile(string=scss_var + "\n"+ scss_boot + "\n" + scss_bootswatch, output_style='compressed')
|
||||
with open("static/css/" + main_css, "w") as css:
|
||||
css.write(css_compressed)
|
||||
css.write(css_compressed)
|
||||
|
||||
bootstrap_theme.value = theme
|
||||
bootstrap_theme.save()
|
||||
|
@ -70,7 +70,7 @@ def appsettings(request):
|
|||
except Exception as err:
|
||||
msg = err
|
||||
error_messages.append(msg)
|
||||
|
||||
|
||||
addlogmsg(request.user.username, "", msg)
|
||||
return HttpResponseRedirect(request.get_full_path())
|
||||
|
||||
|
@ -85,9 +85,8 @@ def appsettings(request):
|
|||
except Exception as err:
|
||||
msg = err
|
||||
error_messages.append(msg)
|
||||
|
||||
|
||||
addlogmsg(request.user.username, "", msg)
|
||||
return HttpResponseRedirect(request.get_full_path())
|
||||
|
||||
return render(request, 'appsettings.html', locals())
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue