default_manifold_admin_user = 'admin'
default_manifold_admin_password = 'demo'
+ default_myslice_theme = 'onelab'
def __init__ (self):
parser.set ('manifold', 'url', ConfigEngine.default_manifold_url)
parser.set ('manifold', 'admin_user', ConfigEngine.default_manifold_admin_user)
parser.set ('manifold', 'admin_password', ConfigEngine.default_manifold_admin_password)
+
+ parser.add_section('myslice')
+ parser.set ('myslice', 'theme', ConfigEngine.default_myslice_theme)
+
parser.add_section('googlemap')
parser.set ('googlemap','api_key', None)
parser.read (os.path.join(ROOT,'myslice/myslice.ini'))
+++ /dev/null
-<div class="well">
- {% if state %}
- <span class="help-block">{{ state }}</span>
- {% endif %}
- <form action="/login/" method="post" role="form">
- {% csrf_token %}
- {% if next %}
- <input type="hidden" name="next" value="{{ next }}" />
- {% endif %}
- <div class="form-group">
- <label for="username">Email address / Username</label>
- <input type="email" class="form-control" name="username" placeholder="Enter Email / username">
- </div>
- <div class="form-group">
- <label for="password">Password</label>
- <input type="password" class="form-control" name="password" placeholder="Password">
- </div>
- <div class="login-submit">
- <input class="btn btn-default" type="submit" value="Sign In" />
- <span class="lost-password"> | <a href="/portal/pass_reset/">Can't access your account?</a></span>
- </div>
- <div class="login-signup">
- <a href="/portal/register">Try</a> or <a href="/portal/register">Sign Up</a>
- </div>
- </form>
-</div>
+++ /dev/null
-{% insert_str prelude "js/bootstrap.js" %}
-{% insert_str prelude "css/bootstrap.css" %}
-{% insert_str prelude "css/topmenu.css" %}
-{% insert_str prelude "js/logout.js" %}
-<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
- <div class="navbar-header">
- <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-myslice-collapse">
- <span class="sr-only">Toggle navigation</span>
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- </button>
- <a class="navbar-brand" href="/"><img src="{{ STATIC_URL }}img/f4f-logo.png" height="30" alt="Fed4Fire logo" /></a>
- <a href="/" alt="Home" class="logoTxt">Fed4Fire Portal</a>
- </div>
- <div class="collapse navbar-collapse navbar-myslice-collapse topmenu">
- <ul class="nav navbar-nav">
- {% for d in topmenu_items %}
- {% if d.dropdown %}
- {% if d.is_active %} <li class='active'> {% else %} <li class='other'> {% endif %}
- <a class="dropdown-toggle" data-toggle="dropdown" href="{{ d.href }}">{{ d.label }}<b class="caret"></b></a>
- <ul class="dropdown-menu">
- {% for dd in d.contents %}
- <li class='{% if dd.is_active %}active{% else %}other{% endif %}{% if dd.disabled %} disabled{%endif%}'
- {% if dd.domid %} id='{{dd.domid}}'{% endif %}>
- <a href="{{ dd.href }}"> {{ dd.label }} </a> </li>
- {% endfor %}
- </ul>
- </li>
- {% else %}
- <li class='{% if d.is_active %}active{% else %}other{% endif %}{% if d.disabled %} disabled{%endif%}'
- {% if d.domid %} id='{{d.domid}}'{% endif %}>
- <a href="{{ d.href }}"> {{ d.label }} </a> </li>
- {% endif %}
- {% endfor %}
-</div>
-
-
+++ /dev/null
-{# fine for either layout-unfold1.html (logged in) or layout-unfold2.html (needs a login prompt) #}
-{% extends layout_1_or_2 %}
-
-{% block unfold_margin %}
-{% include 'fed4fire/_widget-login.html' %}
-{% endblock unfold_margin %}
-
-{% block unfold_main %}
-<div class='well-lg f4f-title'>
- <h2 style="font-weight: bold;">Welcome to Fed4Fire portal !</h2>
- <h4>New to Fed4fire? Please <a href="/portal/register">register</a> or learn more about <a href="http://fed4fire.eu/" target="_blank">the project</a>.</h3>
-</div>
-<div class='well'>
-<p>
-A federation of experimentation facilities will significantly accelerate Future Internet research. Fed4FIRE will deliver open and easily accessible facilities to the FIRE experimentation communities, which focus on fixed and wireless infrastructures, services and applications, and combinations thereof.
-</p>
-<p>This UI server is connected to the manifold backend running at <code>{{ MANIFOLD_URL }}</code>.</p>
-</div>
-{% endblock unfold_main %}
</tr>
<tr>
<td>
- {% include 'onelab/_widget-login-user.html' %}
+ {% include '_widget-login-user.html' %}
</td>
<td>
<td>SUPPORT</td>
</tr>
<tr>
- <td><img src="{{ STATIC_URL }}img/icon_user_color.png" alt="" /></td>
+ <td><img src="{{ STATIC_URL }}img/icon_authority_color.png" alt="" /></td>
<td><img src="{{ STATIC_URL }}img/icon_slices.png" alt="" /></td>
<td><img src="{{ STATIC_URL }}img/icon_support.png" alt="" /></td>
</tr>
<tr>
<td>
- {% include 'onelab/_widget-login-manager.html' %}
+ {% include '_widget-login-manager.html' %}
</td>
<td>
+++ /dev/null
-<div class="well">
- {% if state %}
- <span class="help-block">{{ state }}</span>
- {% endif %}
- <form action="/login/" method="post" role="form">
- {% csrf_token %}
- {% if next %}
- <input type="hidden" name="next" value="{{ next }}" />
- {% endif %}
- <div class="form-group">
- <label for="username">Email address / Username</label>
- <input type="email" class="form-control" name="username" placeholder="Enter Email / username">
- </div>
- <div class="form-group">
- <label for="password">Password</label>
- <input type="password" class="form-control" name="password" placeholder="Password">
- </div>
- <div class="login-submit">
- <input class="btn btn-default" type="submit" value="Sign In" />
- <span class="lost-password"> | <a href="/portal/pass_reset/">Can't access your account?</a></span>
- </div>
- <div class="login-signup">
- <a href="/portal/register">Try</a>, <a href="/portal/register">Sign Up</a> or <a href="/portal/join">Join</a>
- </div>
- </form>
-</div>
+++ /dev/null
-<div class="well login-widget">
- {% if state %}
- <span class="help-block">{{ state }}</span>
- {% endif %}
- <form action="/login/" method="post" role="form">
- {% csrf_token %}
- {% if next %}
- <input type="hidden" name="next" value="{{ next }}" />
- {% endif %}
- <div class="form-group">
- <label for="username">Email address / Username</label>
- <input type="email" class="form-control" name="username" placeholder="Enter Email / username">
- </div>
- <div class="form-group">
- <label for="password">Password</label>
- <input type="password" class="form-control" name="password" placeholder="Password">
- </div>
- <div class="login-submit">
- <input class="btn btn-default" type="submit" value="Sign In" />
- <span class="lost-password"> | <a href="/portal/pass_reset/">Can't access your account?</a></span>
- </div>
- <div class="login-signup">
- <a href="/portal/register">Try</a> or <a href="/portal/register">Sign Up</a>
- </div>
- </form>
-</div>
+++ /dev/null
-{% insert_str prelude "js/bootstrap.js" %}
-{% insert_str prelude "css/bootstrap.css" %}
-{% insert_str prelude "css/topmenu.css" %}
-{% insert_str prelude "js/logout.js" %}
-<div id="header">
- <div class="wrapper">
- <div class="logo">
- <a href="/"><img src="{{ STATIC_URL }}img/onelab-portal.png" alt="OneLab - Future Internet Testbeds" /></a>
- </div>
-
- <div id="secondary">
- <ul>
- <li>News</li>
- <li>About</li>
- <li><a target="_blank" href="http://www.onelab.eu">Public Website</a></li>
- <li>Intranet</li>
- </ul>
- </div>
- </div>
-
- {% if username %}
- <div id="navigation">
- <div class="wrapper">
- <ul>
- <li>SLICES</li>
- <li>REQUESTS</li>
- <li>INSTITUTION</li>
- <li><a href="/portal/contact/">SUPPORT</a></li>
- <li>|</li>
- <li><a href="/portal/account">{{ username }}</a></li>
- <li><a id="logout" style="cursor:pointer;" data-username="{{ username }}">LOGOUT</a></li>
- </ul>
- </div>
- </div>
- {% else %}
- <div id="navigation">
- <div class="wrapper"></div>
- </div>
- {% endif %}
-</div>
\ No newline at end of file
+++ /dev/null
-{% extends "layout-unfold1.html" %}
-
-{% block unfold_main %}
-<div class="wrapper" id="home-dashboard">
- <ul class="nav nav-tabs">
- <li class="active"><a class="home-tab" data-panel="user" href="#">USER</a></li>
- <li><a class="home-tab" data-panel="manager" href="#">MANAGER</a></li>
- </ul>
- <div class="home-panel" id="user">
- <table>
- <tr>
- <td>ACCOUNT</td>
- <td>SLICES</td>
- <td>SUPPORT</td>
- </tr>
- <tr>
- <td><img src="{{ STATIC_URL }}img/icon_user_color.png" alt="" /></td>
- <td><img src="{{ STATIC_URL }}img/icon_slices.png" alt="" /></td>
- <td><img src="{{ STATIC_URL }}img/icon_support.png" alt="" /></td>
- </tr>
- <tr>
- {% if person %}
- <td class="logged-in">
- <button id="logoutbtn" type="button" class="btn btn-default" data-username="{{ username }}"><span class="glyphicon glyphicon-off"></span> Logout</button>
- <div>
- {% if person.last_name %}
- {{person.first_name}} {{person.last_name}}<br />
- {% endif %}
- <span class="label">Email:</span> <a href='mailto:{{person.email}}'>{{person.email}}</a>
- </div>
- {% else %}
- <td>
- {% include 'onelab/_widget-login-user.html' %}
- {% endif %}
- </td>
- <td>
- {% if person %}
- <button id="slicerequestbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Request a Slice</button>
- {% else %}
- {% endif %}
- </td>
- <td class="support">
- <button id="ticketbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Create Ticket</button>
- <div>
- <a href="/portal/contact">Contact</a> <br />
- <a href="">Documentation</a>
- </div>
- </td>
- </tr>
- </table>
- </div>
- <div class="home-panel" id="manager">
- <table>
- <tr>
- <td>INSTITUTION</td>
- <td>SLICES</td>
- <td>REQUESTS</td>
- </tr>
- <tr>
- <td><img src="{{ STATIC_URL }}img/icon_user_color.png" alt="" /></td>
- <td><img src="{{ STATIC_URL }}img/icon_slices.png" alt="" /></td>
- <td><img src="{{ STATIC_URL }}img/icon_testbed_color.png" alt="" /></td>
- </tr>
- <tr>
- {% if person %}
- <td class="logged-in">
- {% if person.last_name %}
- <div><span id='username'>{{person.first_name}} {{person.last_name}}</span></div> {% endif %}
- <div><b>Email: </b><a href='mailto:{{person.email}}'>{{person.email}}</a></div>
- {% else %}
- <td>
- {% include 'onelab/_widget-login-manager.html' %}
- {% endif %}
- </td>
- <td>
-
- </td>
- <td class="support">
- <div><a href=""></a></div>
- <div><a href=""></a></div>
- </td>
- </tr>
- </table>
- </div>
-</div>
-<script>
- $(document).ready(function() {
- $('a.home-tab').click(function() {
- $('ul.nav-tabs li').removeClass('active');
- $(this).parent().addClass('active');
- $('div.home-panel').hide();
- $('div#'+$(this).data('panel')).show();
- });
- $('button#ticketbtn').click(function() {
- window.location="/portal/contact/";
- })
- ;$('button#slicerequestbtn').click(function() {
- window.location="/portal/slice_request/";
- });
- });
-</script>
-{% endblock unfold_main %}
+import os
from myslice.configengine import ConfigEngine
+from myslice.settings import TEMPLATE_DIRS
class ThemeView (object):
@property
def template(self):
- return self.theme + '/' + self.template_name
\ No newline at end of file
+ # Load a template from the theme directory if it exists
+ # else load it from the common templates dir
+ print "THEME = ",self.theme
+ print "TEMPLATE = ",self.template_name
+ print "TEMPLATE_DIRS = ",TEMPLATE_DIRS
+ filename = self.theme + '_' + self.template_name
+ print any(os.path.exists(os.path.join(d,filename)) for d in TEMPLATE_DIRS)
+ print (os.path.exists(os.path.join(d,filename)) for d in TEMPLATE_DIRS)
+ if any(os.path.exists(os.path.join(d,filename)) for d in TEMPLATE_DIRS):
+ return filename
+ else:
+ return self.template_name
ctx_my_authorities = {}
ctx_delegation_authorities = {}
ctx_sub_authorities = {}
+ dest = {}
# The user need to be logged in
<body>
{% block container %}
{% block topmenu %}
- {% include theme|add:"/_widget-topmenu.html" %}
+ {% include theme|add:"__widget-topmenu.html" %}
{% endblock topmenu %}
{% include 'messages-transient.html' %}
<div class="container"> <div class="row">