Browse Source

Static url to templates

prieto 7 years ago
parent
commit
09511f3b5f
2 changed files with 8 additions and 6 deletions
  1. 2
    0
      plugins/webui/interface/template/loader.py
  2. 6
    6
      plugins/webui/templates/base.html

+ 2
- 0
plugins/webui/interface/template/loader.py View File

@@ -9,6 +9,7 @@ import leapi_dyncode
9 9
 from .api import api_lodel_templates
10 10
 from .exceptions.not_allowed_custom_api_key_error import NotAllowedCustomAPIKeyError
11 11
 from ...main import root_url as root_url
12
+from ...main import root_url as root_url
12 13
 from ...main import PLUGIN_PATH
13 14
 TEMPLATE_PATH = os.path.realpath(os.path.join(PLUGIN_PATH, 'templates/'))
14 15
 
@@ -46,6 +47,7 @@ class TemplateLoader(object):
46 47
         template.globals['settings'] = Settings
47 48
         template.globals['client'] = WebUiClient
48 49
         template.globals['root_url'] = root_url()
50
+        template.globals['static_url'] = static_url()
49 51
         template.globals['url'] = lambda sufix='': root_url()\
50 52
             + ('' if sufix.startswith('/') else '/')\
51 53
             + sufix

+ 6
- 6
plugins/webui/templates/base.html View File

@@ -1,5 +1,5 @@
1 1
 <!doctype html>
2
-{% set not_connected = client.is_anonymous() %}
2
+<!-- {% set not_connected = client.is_anonymous() %} -->
3 3
 
4 4
 <html lang="en">
5 5
 <head>
@@ -34,13 +34,13 @@
34 34
             <li><a href="list_classes">All types</a></li>
35 35
           </ul>
36 36
           <ul class="nav navbar-nav navbar-right">
37
-             {% if not_connected %}
38
-                <li id="backend-nav"><a href="/{{ root_url }}/admin" class="btn btn-link disabled">Back-end</a></li>
39
-                <li id="signin-nav"><a href="signin">Sign In</a></li>
40
-             {% else %}
37
+             <!--  {% if not_connected %} -->
38
+              <!--   <li id="backend-nav"><a href="/{{ root_url }}/admin" class="btn btn-link disabled">Back-end</a></li> -->
39
+              <!--  <li id="signin-nav"><a href="signin">Sign In</a></li> -->
40
+             <!-- {% else %} -->
41 41
                 <li id="backend-nav"><a href="/{{ root_url }}/admin" class="btn btn-link">Back-end</a></li>
42 42
                 <li id="signout-nav"><a href="signout">Logout</a>
43
-              {% endif %}
43
+              <!-- {% endif %} -->
44 44
           </ul>
45 45
         </div><!--/.nav-collapse -->
46 46
       </div>

Loading…
Cancel
Save