Commit 3f368f7c authored by Kostas Papadimitriou's avatar Kostas Papadimitriou
Browse files

helpdesk: Configurable media url

parent a979aa0e
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>Cyclades helpdesk</title> <title>Cyclades helpdesk</title>
<link href="{{ MEDIA_URL }}helpdesk/css/bootstrap.css" rel="stylesheet"> <link href="{{ HELPDESK_MEDIA_URL }}css/bootstrap.css" rel="stylesheet">
<link href="{{ MEDIA_URL }}helpdesk/css/bootstrap-responsive.css" rel="stylesheet"> <link href="{{ HELPDESK_MEDIA_URL }}css/bootstrap-responsive.css" rel="stylesheet">
<link href="{{ MEDIA_URL }}helpdesk/css/extra.css" rel="stylesheet"> <link href="{{ HELPDESK_MEDIA_URL }}css/extra.css" rel="stylesheet">
<style> <style>
</style> </style>
</head> </head>
......
...@@ -54,6 +54,9 @@ from synnefo.logic import backend as servers_backend ...@@ -54,6 +54,9 @@ from synnefo.logic import backend as servers_backend
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
HELPDESK_MEDIA_URL = getattr(settings, 'HELPDESK_MEDIA_URL',
settings.MEDIA_URL + 'helpdesk/')
IP_SEARCH_REGEX = re.compile('([0-9]+)(?:\.[0-9]+){3}') IP_SEARCH_REGEX = re.compile('([0-9]+)(?:\.[0-9]+){3}')
UUID_SEARCH_REGEX = re.compile('([0-9a-z]{8}-([0-9a-z]{4}-){3}[0-9a-z]{12})') UUID_SEARCH_REGEX = re.compile('([0-9a-z]{8}-([0-9a-z]{4}-){3}[0-9a-z]{12})')
VM_SEARCH_REGEX = re.compile('vm(-){0,}(?P<vmid>[0-9]+)') VM_SEARCH_REGEX = re.compile('vm(-){0,}(?P<vmid>[0-9]+)')
...@@ -154,7 +157,9 @@ def index(request): ...@@ -154,7 +157,9 @@ def index(request):
search_query=account) search_query=account)
# show index template # show index template
return direct_to_template(request, "helpdesk/index.html") return direct_to_template(request, "helpdesk/index.html",
extra_context={'HELPDESK_MEDIA_URL':
HELPDESK_MEDIA_URL})
@helpdesk_user_required @helpdesk_user_required
...@@ -240,7 +245,7 @@ def account(request, search_query): ...@@ -240,7 +245,7 @@ def account(request, search_query):
'account_name': account_name, 'account_name': account_name,
'token': request.user['auth_token'], 'token': request.user['auth_token'],
'networks': networks, 'networks': networks,
'UI_MEDIA_URL': settings.UI_MEDIA_URL 'HELPDESK_MEDIA_URL': HELPDESK_MEDIA_URL
} }
return direct_to_template(request, "helpdesk/account.html", return direct_to_template(request, "helpdesk/account.html",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment