Browse Source

Static url to templates

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

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

1
 <!doctype html>
1
 <!doctype html>
2
-{% set not_connected = client.is_anonymous() %}
2
+<!-- {% set not_connected = client.is_anonymous() %} -->
3
 
3
 
4
 <html lang="en">
4
 <html lang="en">
5
 <head>
5
 <head>
34
             <li><a href="list_classes">All types</a></li>
34
             <li><a href="list_classes">All types</a></li>
35
           </ul>
35
           </ul>
36
           <ul class="nav navbar-nav navbar-right">
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
                 <li id="backend-nav"><a href="/{{ root_url }}/admin" class="btn btn-link">Back-end</a></li>
41
                 <li id="backend-nav"><a href="/{{ root_url }}/admin" class="btn btn-link">Back-end</a></li>
42
                 <li id="signout-nav"><a href="signout">Logout</a>
42
                 <li id="signout-nav"><a href="signout">Logout</a>
43
-              {% endif %}
43
+              <!-- {% endif %} -->
44
           </ul>
44
           </ul>
45
         </div><!--/.nav-collapse -->
45
         </div><!--/.nav-collapse -->
46
       </div>
46
       </div>

Loading…
Cancel
Save