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

moved config to http-vue-loader #4374

Merged
merged 12 commits into from
Jul 4, 2018
53 changes: 4 additions & 49 deletions medusa/server/web/config/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,7 @@

"""Base handler for Config pages."""

from __future__ import unicode_literals
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

__future__ imports should usually stay. This one in particular.
Basically, they're the first steps of making Python 2 compatible with Python 3.
Sorry for not being more explicit...


import os

from medusa import (
app,
db,
)
from medusa.server.web.core import PageTemplate, WebRoot
from medusa.version_checker import CheckVersion

from tornroutes import route

Expand Down Expand Up @@ -44,45 +35,9 @@ def ConfigMenu():

def index(self):
"""
Render the Help & Info page
Render the Help & Info page.

[Converted to VueRouter]
"""
t = PageTemplate(rh=self, filename='index.mako')

try:
import pwd
app_user = pwd.getpwuid(os.getuid()).pw_name
except ImportError:
try:
import getpass
app_user = getpass.getuser()
except Exception:
app_user = 'Unknown'

try:
import locale
app_locale = locale.getdefaultlocale()
except Exception:
app_locale = 'Unknown', 'Unknown'

try:
import ssl
ssl_version = ssl.OPENSSL_VERSION
except Exception:
ssl_version = 'Unknown'

app_version = ''
if app.VERSION_NOTIFY:
updater = CheckVersion().updater
if updater:
app_version = updater.get_cur_version()

main_db_con = db.DBConnection()
cur_branch_major_db_version, cur_branch_minor_db_version = main_db_con.checkDBVersion()

return t.render(
submenu=self.ConfigMenu(), title='Medusa Configuration',
header='Medusa Configuration', topmenu='config',
app_user=app_user, app_locale=app_locale, ssl_version=ssl_version,
app_version=app_version, cur_branch_major_db_version=cur_branch_major_db_version,
cur_branch_minor_db_version=cur_branch_minor_db_version
)
return t.render(submenu=self.ConfigMenu(), topmenu='config')
2 changes: 1 addition & 1 deletion themes-default/slim/views/layouts/main.mako
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
## @NOTE: These will be usable on all pages
%>
<script src="js/lib/vue.js"></script>
<script src="js/lib/http-vue-loader.min.js"></script>
<script src="js/lib/http-vue-loader.js"></script>
<script src="js/lib/[email protected]"></script>
<script src="js/lib/vue-in-viewport-mixin.min.js"></script>
<script src="js/lib/vue-router.min.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion themes/dark/templates/layouts/main.mako
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
## @NOTE: These will be usable on all pages
%>
<script src="js/lib/vue.js"></script>
<script src="js/lib/http-vue-loader.min.js"></script>
<script src="js/lib/http-vue-loader.js"></script>
<script src="js/lib/[email protected]"></script>
<script src="js/lib/vue-in-viewport-mixin.min.js"></script>
<script src="js/lib/vue-router.min.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion themes/light/templates/layouts/main.mako
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
## @NOTE: These will be usable on all pages
%>
<script src="js/lib/vue.js"></script>
<script src="js/lib/http-vue-loader.min.js"></script>
<script src="js/lib/http-vue-loader.js"></script>
<script src="js/lib/[email protected]"></script>
<script src="js/lib/vue-in-viewport-mixin.min.js"></script>
<script src="js/lib/vue-router.min.js"></script>
Expand Down