Commit 53b58b64 authored by Leonidas Poulopoulos's avatar Leonidas Poulopoulos

Update to new theme

parent af737c00
{% load i18n %}
<script type="text/javascript">
$(document).ready(function(){
$("#add_port_form").unbind('submit');
$("#add_port_form").submit(function(){
$("#port_diag").parents('.ui-dialog').first().find('.ui-button').first().click();
return false;
});
});
</script>
{% load widget_tweaks %}
<form id="add_port_form" method="POST" class="form-horizontal">
{% csrf_token %}
<div class="control-group {% if form.port.errors %} error {% endif %}">
<label class="control-label" for="inputEmail">Port</label>
<div class="control">{{ form.port }}
{% if form.port.errors %}
<span class="help-block">{{ form.port.errors|join:", " }}</span>
{% endif %}
</div>
<div class="form-group {% if form.port.errors %} has-error {% endif %}">
<div class="col-md-5">
{% render_field form.port class+="form-control" placeholder="Port number, eg. 8088" %}
{% if form.port.errors %} <span class="help-block"> {{ form.port.errors|join:", " }} </span>
{% endif %}
</div>
<div class="col-md-4">
<button class="btn-warning btn btn-md btn-outline" id="canceladdportbtn" type="button">{% trans "Cancel" %}</button>
<button class="btn-success btn btn-md btn-outline" id="addportbtn" type="button">{% trans "Add" %}</button>
</div>
</div>
</form>
This diff is collapsed.
<!DOCTYPE html>
<html>
{% load i18n %}
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>GRNET FoD :: {% block title %}{% endblock %}</title>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="expires" CONTENT="Wed, 26 Feb 1997 08:21:57 GMT">
<link REL="SHORTCUT ICON" HREF="{{STATIC_URL}}favicon.ico">
<!-- Core CSS - Include with every page -->
<link href="{{STATIC_URL}}b3theme/css/bootstrap.min.css" rel="stylesheet">
<link href="{{STATIC_URL}}b3theme/font-awesome/css/font-awesome.css" rel="stylesheet">
{% block extrahead %}{% endblock %}
<!-- SB Admin CSS - Include with every page -->
<link href="{{STATIC_URL}}b3theme/css/sb-admin.css" rel="stylesheet">
{% block extraheadbottom %}{% endblock %}
<style>
.navbar-brand {
float: left;
font-size: 18px;
height: 20px;
line-height: 20px;
padding: 1px;
}
.footer {
border-top: 1px solid #E5E5E5;
color: #777777;
padding-bottom: 40px;
padding-top: 40px;
text-align: center;
}
</style>
</head>
<body>
<div id="wrapper">
<nav class="navbar navbar-default navbar-static-top" role="navigation" style="margin-bottom: 0">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".sidebar-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="{% url dashboard %}"><img src="{{STATIC_URL}}fodlogo2.png">&nbsp;</a>
</div>
<!-- /.navbar-header -->
<ul class="nav navbar-top-links navbar-right">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">{% trans "Language" %}: {% for lang in LANGUAGES %}{% ifequal LANGUAGE_CODE lang.0 %}{% trans lang.1 %}{% endifequal %}{% endfor %}<b class="caret"></b></a>
<ul class="dropdown-menu">
<form action="{% url django.views.i18n.set_language %}" method="post" style="display:inline;" id="langform">
{% csrf_token %}
<input name="next" type="hidden" value="{{ next }}" />
<input id="langsel" name="language" type="hidden" value="" />
</form>
{% for lang in LANGUAGES %}
<li>
<a class="select_lang" href="#" onclick="setlang('{{ lang.0 }}'); return false;" title="{{lang.1}}">{% trans lang.1 %}{% ifequal LANGUAGE_CODE lang.0 %} <i class="icon-ok"></i>{% endifequal %}</a>
</li>
{% endfor %}
</ul>
</li>
<!-- /.dropdown -->
{% if user.is_authenticated %}
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
<i class="fa fa-user fa-fw"></i> <i class="fa fa-caret-down"></i>
</a>
<ul class="dropdown-menu dropdown-user" role="menu" >
<li role="presentation" class="dropdown-header">{{user}}</li>
<li class="divider"></li>
{% if user.get_profile.peer %}
<li>
<a href="{% url user-profile %}"><i class="fa fa-user fa-fw"></i>{% trans "My profile" %}</a>
</li>
{% endif %}
{% if user.is_superuser %}
<li class="divider"></li>
<li><a href="{% url admin:index %}"><i class="fa fa-cogs"></i> {% trans "Admin" %}</a>
</li>
{% endif %}
<li class="divider"></li>
<li><a href="{% url logout %}"><i class="fa fa-sign-out fa-fw"></i> {% trans "Logout" %}</a>
</li>
</ul>
<!-- /.dropdown-user -->
</li>
{% else %}
<li><a href="{% url login %}">{% trans "Shibboleth Login" %}</a></li>
{% endif %}
<!-- /.dropdown -->
</ul>
<!-- /.navbar-top-links -->
</nav>
<!-- /.navbar-static-top -->
{% block sidenav %}
<nav class="navbar-default navbar-static-side" role="navigation">
{% if user.is_authenticated %}
<div class="sidebar-collapse">
<ul class="nav" id="side-menu">
<li>
<a href="{% url dashboard %}"><i class="fa fa-dashboard fa-fw"></i> {% trans "Dashboard" %}</a>
</li>
<li>
<a href="{% url group-routes %}"><i class="fa fa-shield fa-fw"></i> {% trans "Rules" %}</a>
</li>
<li>
<a href="{% url add-route %}"><i class="fa fa-plus-circle fa-fw"></i> {% trans "Add Rule" %}</a>
</li>
{% if perms.accounts.overview %}<li>
<a href="{% url overview %}"><i class="fa fa-desktop fa-fw"></i> {% trans "Overview" %}</a>
</li>{% endif %}
{% if user.is_superuser %}
<li><a href="{% url admin:index %}"><i class="fa fa-cogs fa-fw"></i> {% trans "Admin" %}</a>
</li>
{% endif %}
{% if user.get_profile.peer %}
<li>
<a href="{% url user-profile %}"><i class="fa fa-user fa-fw"></i> {% trans "My profile" %}</a>
</li>
{% endif %}
</ul>
<!-- /#side-menu -->
</div>
{% endif %}
<!-- /.sidebar-collapse -->
</nav>
<!-- /.navbar-static-side -->
{% endblock %}
<div id="page-wrapper">
{% if messages %}
<div class="row">
<div class="lg-col-12">
<div id="messages">
{% for message in messages %}
<div {% if message.tags %} class="alert alert-{{ message.tags }} alert-dismissable"{% endif %}>
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
{{ message }}</span><br />
{% endfor %}
</div>
</div>
</div>
{% endif %}
{% block contentplaceholder %}
{% endblock %}
</div>
<!-- /#page-wrapper -->
</div>
<!-- /#wrapper -->
{% block footerblock %}
{% include "footer.html" %}
{% endblock %}
<!-- Core Scripts - Include with every page -->
<script src="{{STATIC_URL}}b3theme/js/jquery-1.10.2.js"></script>
<script src="{{STATIC_URL}}js/jquery_csrf_protect.js" type="text/javascript"></script>
<script src="{{STATIC_URL}}b3theme/js/bootstrap.min.js"></script>
<script src="{{STATIC_URL}}b3theme/js/plugins/metisMenu/jquery.metisMenu.js"></script>
<script type="text/javascript" src="{{STATIC_URL}}js/jquery.cookie.js"></script>
{% block pagejs %}{% endblock %}
<!-- SB Admin Scripts - Include with every page -->
<script src="{{STATIC_URL}}b3theme/js/sb-admin.js"></script>
<!-- Page-Level Scripts - Use for reference -->
{% block pagejsbottom %}{% endblock %}
<script type="text/javascript">
function setlang(lang){
$("#langsel").val(lang);
$("#langform").submit();
}
</script>
</body>
</html>
This diff is collapsed.
{% extends "base.html" %}
{% extends "b3theme/base.html" %}
{% load widget_tweaks %}
{% load i18n %}
{% block sidenav %}{% endblock %}
{% block extraheadbottom %}
<style>
@media (min-width: 768px) {
#page-wrapper {
border-left: none;
margin: 0;
}
}
</style>
{% endblock %}
{% block title %}{% if error %}{% if inactive %}{% trans "Activation Pending" %}{% else %}{% trans "Error" %}{% endif %}{% endif %}{% endblock %}
{% block extrahead %}
{% block pagejsbottom %}
<script type="text/javascript">
$(document).ready(function(){
$("#ttip").tooltip();
......@@ -11,19 +24,24 @@
</script>
{% endblock %}
{% block content %}
<div class="container-fluid">
<div class="row-fluid">
<div class="span2">
</div><!--/span-->
<div class="span10">
<div class="row-fluid">
<!--/span-->
{% if error %}{% if inactive %}<h3 class="muted">{% trans "Activation Pending" %}</h3>{% else %}<h3 class="muted">{% trans "Error" %}</h3>{% endif %}{% endif %}
<hr><br>
<div class="span10 alert {% if missing_attributes %}alert-error{% else %}alert-info{% endif %}">
{% block contentplaceholder %}
<div class="container">
<div class="row">
<div class="col-lg-12">
<h1 class="page-header">{% if error %}{% if inactive %}{% trans "Activation Pending" %}{% else %}{% trans "Error" %}{% endif %}{% endif %}</h1>
</div>
<!-- /.col-lg-12 -->
</div>
<div class="row">
<div class="col-lg-12">
<div class="panel {% if error %}{% if inactive %}panel-primary{% else %}panel-danger{% endif %}{% endif %}">
<div class="panel-heading">
<i class="fa fa-info-circle"></i> {% if error %}{% if inactive %}{% trans "Activation Pending" %}{% else %}{% trans "Error" %}{% endif %}{% endif %}
</div>
<!-- /.panel-heading -->
<div class="panel-body">
<div class="alert {% if missing_attributes %}alert-danger{% else %}alert-info{% endif %}">
{% if missing_attributes %}
<p>{% trans "One or more required shibboleth attributes were not released towards this service" %}</p>
{% endif %}
......@@ -44,10 +62,14 @@
</p>
{% endif %}
</div>
<!--/span-->
</div><!--/row-->
</div><!--/span-->
</div><!--/span-->
</div><!--/.fluid-container-->
</div>
</div>
</div>
</div>
</div>
{% endblock %}
This diff is collapsed.
<div >
<ul class="chat" id="inbox">
{% for message in messages %}
{% include "poll_message.html" %}
{% endfor %}
</ul>
<input type="hidden" name="hid_mid" id="hid_mid" value=''/>
</div>
\ No newline at end of file
// Copyright 2009 FriendFeed
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may
// not use this file except in compliance with the License. You may obtain
// a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations
// under the License.
var xhrlp = '';
$(document).ready(function() {
if (!window.console) window.console = {};
if (!window.console.log) window.console.log = function() {};
$("#messageform").live("submit", function() {
$("#messageform").on("submit", function() {
newMessage($(this));
return false;
});
$("#messageform").live("keypress", function(e) {
$("#messageform").on("keypress", function(e) {
if (e.keyCode == 13) {
newMessage($(this));
return false;
......@@ -29,8 +17,7 @@ $(document).ready(function() {
$("#message").select();
{% if user.is_authenticated %}
updater.start();
updater.poll();
updater.poll();
{% endif %}
});
......@@ -101,7 +88,7 @@ var updater = {
poll: function() {
{% if user.is_authenticated %}
if (updater.errorSleepTime > 128000){
window.setTimeout('location.reload()', 500);
oTable.fnReloadAjax(refreshUrl);
}
timeout = {{timeout}};
$.ajax({url: "{% url fetch-updates %}", type: "POST", dataType: "json",
......@@ -133,7 +120,7 @@ var updater = {
onError: function(response, text) {
if (text == 'timeout'){
window.setTimeout('location.reload()', 3000);
oTable.fnReloadAjax(refreshUrl);
}
updater.errorSleepTime *= 2;
console.log("Poll error; sleeping for", updater.errorSleepTime, "ms");
......@@ -155,10 +142,7 @@ var updater = {
updater.showMessage(messages[i]);
}
$("#hid_mid").val('UPDATED');
if (($('#console').dialog('isOpen')) == false){
blink("#consolebutton");
window.setTimeout('location.reload()', 3000);
}
oTable.fnReloadAjax(refreshUrl);
},
existingMessages: function(response) {
......@@ -169,6 +153,7 @@ var updater = {
updater.cursor = response.cursor;
var messages = response.messages;
updater.cursor = messages[messages.length - 1].id;
var i = messages.length
for (var i = 0; i < messages.length; i++) {
updater.showMessage(messages[i]);
}
......@@ -177,10 +162,24 @@ var updater = {
showMessage: function(message) {
var existing = $("#m" + message.id);
if (existing.length > 0) return;
var node = $(message.html);
var username = message.body.split("]")[0].replace("[","");
var mbody = message.body.replace("["+username+"] ","");
var htmlnode = '<li class="left clearfix">\
<div class="chat-body clearfix" style="margin-left: 0px;"> \
<div class="header"> \
<small class="pull-right text-muted"> \
<i class="fa fa-clock-o fa-fw"></i> '+ message.time +' \
</small>\
</div>\
<p><small><strong class="primary-font">'+username+'</strong>:\
'+ mbody+'\
</small></p>\
</div>\
</li>';
var node = $(htmlnode);
node.hide();
// $('#inbox').val($('#inbox').val()+message.text);
$("#inbox").append(node);
$("#inbox").prepend(node);
node.slideDown();
}
};
......
var xhrlp = '';
$(document).ready(function() {
if (!window.console) window.console = {};
if (!window.console.log) window.console.log = function() {};
$("#messageform").on("submit", function() {
newMessage($(this));
return false;
});
$("#messageform").on("keypress", function(e) {
if (e.keyCode == 13) {
newMessage($(this));
return false;
}
});
$("#message").select();
{% if user.is_authenticated %}
updater.start();
updater.poll();
{% endif %}
});
function newMessage(form) {
var message = form.formToDict();
var disabled = form.find("input[type=submit]");
disabled.disable();
$.postJSON("{% url fetch-new %}", message, function(response) {
updater.showMessage(response);
if (message.id) {
form.parent().remove();
} else {
form.find("input[type=text]").val("").select();
disabled.enable();
}
});
}
function getCookie(name) {
var r = document.cookie.match("\\b" + name + "=([^;]*)\\b");
return r ? r[1] : undefined;
}
jQuery.postJSON = function(url, args, callback) {
$.ajax({url: url, dataType: "json", type: "POST",
success: function(response) {
if (callback) callback(response);
}, error: function(response) {
console.log("ERROR:", response);
}});
};
jQuery.fn.formToDict = function() {
var fields = this.serializeArray();
var json = {}
for (var i = 0; i < fields.length; i++) {
json[fields[i].name] = fields[i].value;
}
if (json.next) delete json.next;
return json;
};
jQuery.fn.disable = function() {
this.enable(false);
return this;
};
jQuery.fn.enable = function(opt_enable) {
if (arguments.length && !opt_enable) {
this.attr("disabled", "disabled");
} else {
this.removeAttr("disabled");
}
return this;
};
var updater = {
errorSleepTime: 500,
cursor: null,
start: function() {
$.ajax({url: "{% url fetch-existing %}", type: "POST", dataType: "json",
success: updater.onFetchExisting,
error: updater.onError});
},
poll: function() {
{% if user.is_authenticated %}
if (updater.errorSleepTime > 128000){
window.setTimeout('location.reload()', 500);
}
timeout = {{timeout}};
$.ajax({url: "{% url fetch-updates %}", type: "POST", dataType: "json",
success: updater.onSuccess,
timeout: timeout,
error: updater.onError});
{% endif %}
},
onSuccess: function(response) {
try {
updater.newMessages(response);
} catch (e) {
updater.onError();
return;
}
updater.errorSleepTime = 500;
window.setTimeout(updater.poll, 0);
},
onFetchExisting: function(response) {
try {
updater.existingMessages(response);
} catch (e) {
updater.onError();
return;
}
},
onError: function(response, text) {
if (text == 'timeout'){
window.setTimeout('location.reload()', 3000);
}
updater.errorSleepTime *= 2;
console.log("Poll error; sleeping for", updater.errorSleepTime, "ms");
window.setTimeout(updater.poll, updater.errorSleepTime);
},
newMessages: function(response) {
if (!response.messages) return;
if (response.messages.length == 0){
return true;
}
updater.cursor = response.cursor;
var messages = response.messages;
updater.cursor = messages[messages.length - 1].id;
console.log(messages.length, "new messages, cursor:", updater.cursor);
for (var i = 0; i < messages.length; i++) {
updater.showMessage(messages[i]);
}
$("#hid_mid").val('UPDATED');
window.setTimeout('location.reload()', 2000);
},
existingMessages: function(response) {
if (!response.messages) return;
if (response.messages.length == 0){
return true;
}
updater.cursor = response.cursor;
var messages = response.messages;
updater.cursor = messages[messages.length - 1].id;
var i = messages.length
for (var i = 0; i < messages.length; i++) {
updater.showMessage(messages[i]);
}
},
showMessage: function(message) {
var existing = $("#m" + message.id);
if (existing.length > 0) return;
var username = message.body.split("]")[0].replace("[","");
var mbody = message.body.replace("["+username+"] ","");
var htmlnode = '<li class="left clearfix">\
<span style="font-size: 25px; color: #55C1E7" class="chat-img pull-left"> \
<i class="fa fa-exclamation-circle"></i> \
</span> \
<div class="chat-body clearfix"> \
<div class="header"> \
<strong class="primary-font">'+username+'</strong> \
<small class="pull-right text-muted"> \
<i class="fa fa-clock-o fa-fw"></i> '+ message.time +' \
</small>\
</div>\
<p>\
'+ mbody+'\
</p>\
</div>\
</li>';
var node = $(htmlnode);
node.hide();
// $('#inbox').val($('#inbox').val()+message.text);
$("#inbox").prepend(node);
node.slideDown();
}
};
function blink(selector){
$(selector).animate({color: "#EE5F5B"}, 500, function(){
$(this).animate({ color: "white" }, 500, function(){
blink(this);
});
});
}
{% extends "base.html" %}
{% extends "b3theme/base.html" %}
{% load i18n %}
{% block title %}{% trans "My profile" %}{% endblock %}
{% block breadcrumbs %} <li class="active"><span class="divider">/</span>{% trans "My profile" %}</li>{% endblock %}
{% block content %}
<h4>{% trans "My profile" %}</h4>
<hr>
<div id="profile">
<div class="row">
<div class="span2"><strong>{% trans "Username" %}:</strong></div>
<div class="span8">{{user.username}}</div>
</div>
<div class="row">
<div class="span2"><strong>{% trans "First name" %}:</strong></div>
<div class="span8">{{user.first_name}}</div>
</div>
<div class="row">
<div class="span2"><strong>{% trans "Last name" %}:</strong></div>
<div class="span8">{{user.last_name}}</div>
</div>
<div class="row">
<div class="span2"><strong>{% trans "Email" %}:</strong></div>
<div class="span8">{{user.email}}</div>
</div>
</div>
<br>
<div>
<div class="row">
<div class="span2"><strong>{% trans "My Networks" %}:</strong></div>
<div class="span8"></div>
</div>
<table class="table table-striped table-bordered">
{% block contentplaceholder %}
<div class="row">
<div class="col-lg-12">
<h1 class="page-header">{% trans "My profile" %}</h1>
</div>
<!-- /.col-lg-12 -->
</div>
<div class="row">
<div class="col-md-8">
<div class="panel panel-primary">
<div class="panel-heading">
<i class="fa fa-bolt"></i> {% trans "My Networks" %}
</div>
<!-- /.panel-heading -->
<div class="panel-body">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>{% trans "Organization" %}</th><th>{% trans "Networks" %}</th>
......@@ -48,7 +36,43 @@
</td></tr>
{% endfor %}
</table>
</div>
</div>
</div>
</div>
<div class="col-md-4">
<div class="panel panel-default">
<div class="panel-heading">
<i class="fa fa-tags"></i> Shortcuts
</div>
<!-- /.panel-heading -->
<div class="panel-body">
<a class="btn btn-sm btn-outline btn-success" id="routebutton" href="{% url add-route %}"><i class="fa fa-plus-circle"></i> {% trans "Add Rule" %}</a>
<a class="btn btn-sm btn-outline btn-primary" href="{% url group-routes %}"><i class="fa fa-shield fa-fw"></i> {% trans "My Rules" %}</a>
<a class="btn btn-sm btn-outline btn-info" href="{% url dashboard %}"><i class="fa fa-dashboard"></i> {% trans "Dashboard" %}</a>
</div>
<!-- /.panel-body -->
</div>
<div class="panel panel-info">
<div class="panel-heading">
<i class="fa fa-user"></i> {% trans "My Profile" %}
</div>
<!-- /.panel-heading -->
<div class="panel-body">
<dl class="dl-horizontal">
<dt>{% trans "Username" %}:</dt><dd>{{user.username}}</dd>
<dt>{% trans "First name" %}:</dt><dd>{{user.first_name}}</dd>
<dt>{% trans "Last name" %}:</dt><dd>{{user.last_name}}</dd>
<dt>{% trans "Email" %}:</dt><dd>{{user.email}}</dd>
</dl>
</div>
</div>
</div>
</div>
{% endblock %}
......