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

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>
{% extends "b3theme/base.html" %}
{% load i18n %}
{% block extrahead %}
<link href="{{STATIC_URL}}b3theme/css/plugins/morris/morris-0.4.3.min.css" rel="stylesheet">
<link href="{{STATIC_URL}}b3theme/css/plugins/timeline/timeline.css" rel="stylesheet">
<style type="text/css">
.dl-horizontal dt {
width: 70px;
}
.dl-horizontal dd {
margin-left: 90px;
}
</style>
{% endblock %}
{% block title %}{% trans "Dashboard" %}{% endblock %}
{% block contentplaceholder %}
{% csrf_token %}
<div class="row">
<div class="col-lg-12">
<h1 class="page-header">{% trans "Dashboard" %}</h1>
</div>
<!-- /.col-lg-12 -->
</div>
<div class="row">
<div class="col-lg-8">
<div class="panel panel-primary">
<div class="panel-heading">
<i class="fa fa-clock-o fa-fw"></i> {% trans "Timeline" %} - {% trans "Latest 10" %}
</div>
<!-- /.panel-heading -->
<div class="panel-body">
<ul class="timeline">
{% for route in routes %}
<li class="{% cycle '' 'timeline-inverted' %}">
{% if route.status == 'EXPIRED' or route.status == 'ADMININACTIVE' or route.status == 'INACTIVE' or route.status == 'OUTOFSYNC'%}
{% if route.status == 'EXPIRED' or route.status == 'ADMININACTIVE' or route.status == 'INACTIVE' %}
<div class="timeline-badge"><i class="fa fa-adjust"></i></div>
{% else %}
{% if route.status == 'OUTOFSYNC' %}
<div class="timeline-badge danger"><i class="fa fa-bug"></i></div>
{% else %}
<div class="timeline-badge danger"><i class="fa fa-exclamation"></i></div>
{% endif %}
{% endif %}
{% else %}
{% if route.status == 'ACTIVE' %}
<div class="timeline-badge success"><i class="fa fa-shield"></i></div>
{% else %}
{% if route.status == 'PENDING' %}
<div class="timeline-badge info"><i class="fa fa-spinner"></i></div>
{% else %}
<div class="timeline-badge warning"><i class="fa fa-exclamation"></i></div>
{% endif %}
{% endif %}
{% endif %}
<div class="timeline-panel">
<div class="timeline-heading">
<h4 class="timeline-title">{{route.name}}</h4>
<p>
<small class="text-muted"><i class="fa fa-pencil-square-o"></i> {% trans "Last update" %}: {{route.last_updated}} {% trans "by" %} {{route.applier}}</small>
</p>
<p>
<small class="text-muted"><i class="fa fa-clock-o"></i> {% trans "Expires" %}: {{ route.expires|date:"d M y" }}</small>
</p>
</div>
<div class="timeline-body">
<small>
<p>
{% if route.status == 'EXPIRED' or route.status == 'ADMININACTIVE' or route.status == 'INACTIVE' or route.status == 'OUTOFSYNC'%}
{% if route.status == 'EXPIRED' or route.status == 'ADMININACTIVE' or route.status == 'INACTIVE' %}
<span class="label label-default">DEACTIVATED</span>
{% else %}
{% if route.status == 'OUTOFSYNC' %}
<span class="label label-danger">ERROR</span>
{% else %}
<span class="label label-info">{{route.status}}</span>
{% endif %}
{% endif %}
{% else %}
{% if route.status == 'ACTIVE' %}
<span class="label label-success">{{route.status}}</span>
{% else %}
{% if route.status == 'PENDING' %}
<span class="label label-info">{{route.status}}</span>
{% else %}
<span class="label label-warning">{{route.status}}</span>
{% endif %}
{% endif %}
{% endif %}
</p>
{{ route.get_match|safe|escape }}
<dl class="dl-horizontal">
<dt>Then</dt><dd>{{ route.get_then }}</dd>
</dl>
</small>
<div>
{% ifequal route.status 'ACTIVE' %}
<a href="{% url edit-route route.name %}" class="btn-info btn btn-xs btn-outline" id="edit_button_{{route.pk}}">{% trans "Edit" %}</a>
<button class="del_buttonpre btn-outline btn btn-xs btn-warning" id="{{route.name}}" data-routename="{{route.name}}">{% trans "Deactivate" %}</button>
{% else %}
{% if route.status == 'EXPIRED' or route.status == 'ADMININACTIVE' or route.status == 'INACTIVE' %}
<a href="{% url edit-route route.name %}" class="btn-info btn btn-xs btn-outline" id="edit_button_{{route.pk}}" type="button">{% trans "Reactivate" %}</a>
{% else %}
{% ifequal route.status 'OUTOFSYNC' %}
<a href="{% url edit-route route.name %}" class="btn-info btn btn-xs btn-outline" id="edit_button_{{route.pk}}">{% trans "ReSync" %}</a>
{% else %}
{% ifequal route.status 'ERROR' %}
<a href="{% url edit-route route.name %}" class="btn-info btn btn-xs btn-outline" id="edit_button_{{route.pk}}">{% trans "Fix it!" %}</a>
{% else %}
-
{% endifequal %}
{% endifequal %}
{% endif %}
{% endifequal %}
</div>
</div>
</div>
</li>
{% endfor %}
</ul>
</div>
<!-- /.panel-body -->
</div>
<!-- /.panel -->
</div>
<div class="col-lg-4">
<div class="panel panel-default">
<div class="panel-heading">
<i class="fa fa-tags"></i> {% trans "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 user-profile %}"><i class="fa fa-user"></i> {% trans "My Profile" %}</a>
</div>
<!-- /.panel-body -->
</div>
<!-- /.panel -->
<div class="chat-panel panel panel-info">
<div class="panel-heading">
<i class="fa fa-circle-o"></i> Live status
</div>
<!-- /.panel-heading -->
<div class="panel-body">
{% include "polldash.html" %}
</div>
<!-- /.panel-body -->
</div>
<!-- /.panel -->
</div>
</div>
{% endblock %}
{% block pagejsbottom %}
{% if user.is_authenticated %}
<script type="text/javascript" src="{% url load-js 'pollerdash' %}"></script>
{% endif %}
<script type="text/javascript" src="{{STATIC_URL}}js/jquery.dataTables.js"></script>
<script type="text/javascript" src="{{STATIC_URL}}js/datatables_bootstrap.js"></script>
<script>
var oldhtml;
var last_element = false;
var refreshUrl = "{% url group-routes-ajax %}";
$(document).ready( function(){
$('body').on('click', ".del_buttonpre", function(){
var my = $(this);
if (last_element != false){
last_element.html(oldhtml);
}
oldhtml = my.parent().html();
last_element = my.parent();
var routename = $(this).data("routename");
var btn = '<a href="#" data-toggle="tooltip" title="This will deactivate your rule" data-routename="'+routename+'" class="del_button btn btn-xs btn-warning"> {% trans "Deactivate" %}</a>'
var back = '<a href="#" class="revertbutton btn btn-xs btn-info"><i class="fa fa-undo"></i></a>';
my.parent().html(back+" "+btn);
return false;
});
$('body').on('click', ".del_button", function(){
last_element = false;
var my = $(this);
my.html('Deactivating...')
var routename = $(this).data("routename");
var delurl = "{% url delete-route 'route_placeholder'%}".replace('route_placeholder', routename.toString());
$.ajax({
type: 'POST',
url: delurl,
cache: false,
success: function(data) {
}
});
return false;
});
$('body').on('click', '.revertbutton', function () {
var my = $(this);
my.parent().html(oldhtml);
last_element = false;
return false;
});
$("body").tooltip({ selector: '[data-toggle="tooltip"]' });
});
</script>
{% endblock %}
\ No newline at end of file
{% 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);
},