1
0
mirror of https://github.com/dkmstr/openuds.git synced 2024-12-22 13:34:04 +03:00

Removed legacy html templates.

Added select rendering to template so we can use whatever styles we like
This commit is contained in:
Adolfo Gómez García 2016-04-22 03:06:00 +02:00
parent 56a579e11b
commit f0627db09f
11 changed files with 20 additions and 370 deletions

View File

@ -1,49 +0,0 @@
{% load i18n %}
{% load static %}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>
{% block title %} {% trans "UDS" %}{% endblock %}
</title>
<meta http-equiv="X-UA-Compatible" content="IE=8" />
<meta http-equiv="content-type" content="application/xhtml+xml; charset=utf-8" />
<meta name="robots" content="noindex, nofollow" />
<meta name="author" content="Adolfo Gómez" />
<!-- Adolfo Gómez -->
<link rel="shortcut icon" type="image/x-png" href="{% get_static_prefix %}img/favicon.ico" />
<link rel="stylesheet" href="{% get_static_prefix %}css/reset.css" media="screen,projection,print" type="text/css" />
<link rel="stylesheet" href="{{ css_path }}" media="screen,projection" type="text/css" />
<link rel="stylesheet" href="{% get_static_prefix %}css/smoothness/jquery-ui-1.8.17.custom.css" media="screen,projection" type="text/css" />
<!-- <link rel="stylesheet" href="" media="print" type="text/css" /> -->
<!-- Javascript -->
<script src="{% get_static_prefix %}js/jquery-1.7.1.min.js" type="text/javascript" ></script>
<script src="{% get_static_prefix %}js/jquery-ui-1.8.17.custom.min.js" type="text/javascript" ></script>
{% block script %}{% endblock %}
</head>
<body>
<div id="header">
{% block top %}
{% endblock %}
</div>
<div id="content">
{% block content %}
Contenido
{% endblock %}
</div><!-- content -->
<div id="footer">
{% block footer %}
<div id="vcable"><a href="http://www.virtualcable.es">&copy; 2012 Virtual Cable S.L.</a> </div>
{% endblock %}
</div><!-- footer -->
</body>
</html>

View File

@ -1,25 +0,0 @@
{% extends "uds/internal_page.html" %}
{% load i18n %}
{% load static %}
{% block content %}
{% spaceless %}
<h2>
{% trans "Downloads" %}
</h2>
<div id="downdesc">
<p class="parrafo">{% trans "This page contains a list of downloadables provided by different modules" %}</p>
</div>
<div id="downloadables">
<ul class="archivos">
{% for f in files %}
<li>
<a href="{% url "uds.web.views.download" idDownload=f.id %}">{{ f.name }}</a><dfn>{{ f.comment|safe }}</dfn>
</li>
{% endfor %}
</ul>
</div>
{% endspaceless %}
{% include "uds/snippets/back_to_list.html" %}
{% endblock %}

View File

@ -1,16 +0,0 @@
{% extends "uds/internal_page.html" %}
{% load i18n %}
{% load static %}
{% block title %}
{% trans "Error" %}
{% endblock %}
{% block content %}
<div id="error">
{% trans "Error" %}: <b>{{ errorString }}</b>
</div>
<hr/>
<div>
{% include "uds/snippets/back_to_list.html" %}
{% endblock %}

View File

@ -16,7 +16,7 @@
});
}
}
$(document).ready(function() {
var nonStandard = $('#id_nonStandard').val();
@ -47,9 +47,9 @@
// Check initial value (may default auth is non Standard)
chkNonStandardAuth($('#id_authenticator').val(), nonStandard);
});
</script>
</script>
{% endblock %}
{% block body %}
@ -73,9 +73,18 @@
<div class="form-group">
<input id="id_{{form.user.name}}" name="{{form.user.name}}" type="text" class="form-control" placeholder="{% trans 'username'|capfirst %}" autofocus required>
<input id="id_{{form.password.name}}" name="{{form.password.name}}" type="password" class="form-control" placeholder="{% trans 'password'|capfirst %}" required>
{{ form.authenticator }}
</div>
<button class="btn btn-lg btn-primary btn-block" type="submit"><span class="fa fa-sign-in"></span> {% trans 'Sign in' %}</button>
</div>
{% if form.fields.authenticator.choices|length > 1 %}
<div class="form-group">
<label>{% trans 'Authenticator' %}</label>
<select data-width="100%" data-size="8" data-header="{% trans 'Select authenticator' %}" class="selectpicker show-menu-arrow" name="{{ form.authenticator.name }}" id="id_{{ form.authenticator.name }}">
{% for val, txt in form.fields.authenticator.choices %}
<option value="{{ val }}"{% if form.fields.authenticator.value == x %} selected{% endif %}>{{ txt }}</option>
{% endfor %}
</select>
</div>
{% endif %}
<button class="btn btn-lg btn-primary btn-block" type="submit"><span class="fa fa-sign-in"></span> {% trans 'Sign in' %}</button>
<div id="nonStandard" style="display: none">
<div id="nonStandardLogin" class="form">
non standard logins
@ -89,7 +98,7 @@
</div>
</div>
<div class="row" id="customHtml">
{% autoescape off %}
{% autoescape off %}
{{ customHtml }}
{% endautoescape %}
</div>

View File

@ -1,83 +0,0 @@
{% extends "uds/internal_page.html" %}
{% load i18n %}
{% load static %}
{% block script %}
{{ block.super }}
<script type="text/javascript">
$(document).ready(function() {
var spa = [ '<', 'span', '>', '<', '/span', '>'].join('');
$("ul li ul").hide();
$("ul li ul").before(spa);
$("ul li span").click(function(){
var lista = $(this).parent().children("ul");
if (lista.is(":hidden")) {
lista.slideDown("fast");
$(this).addClass("ampli");
} else {
lista.hide();
$(this).removeClass("ampli");
}
});
});
{% if not java %}
$(function() {
$('#jmessage').dialog({
autoOpen: false,
width: 500,
buttons: {
"Ok": function() {
$(this).dialog("close");
}
}
});
$("a.nojava").click( function() {
$('#jmessage').dialog('open');
return false;
});
});
{% endif %}
</script>
{% endblock script %}
{% block content %}
<div id="services">
<h2>{% trans "Services" %}</h2>
<ul>
{% for ser in services %}
{% if ser.transports %}
<li>
{% with trans=ser.transports|first %}
<a{% if not java and trans.needsJava %} class="nojava"{% endif %} href="{% url "uds.web.views.service" idService=ser.id idTransport=trans.id %}">{{ ser.name }}</a>
{% endwith %}
<ul>
{% for trans in ser.transports %}
<li><a{% if not java and trans.needsJava %} class="nojava"{% endif %} href="{% url "uds.web.views.service" idService=ser.id idTransport=trans.id %}"><img src="{% url "uds.web.views.transportIcon" idTrans=trans.id %}" alt="{{ trans.name }}" />{{ trans.name }}</a></li>
{% endfor %}
</ul>
</li>
{% endif %}
{% endfor %}
</ul>
</div>
{% if not java %}
<div id="jmessage" title="{% trans "Java not found" %}">
<p>{% trans "Java is not available on your browser, and the selected transport needs it." %}</p>
<p>{% trans "Please, install latest version from" %} <a href="http://www.java.com">{% trans "Java website" %}</a> {% trans "and restart browser" %}</p>
</div>
{% endif %}
{% if user.isStaff %}
<div id="adminmsgs">
<p>{% trans "Ip" %}: {{ ip }}</p>
<p>{% trans "Networks" %}: {{ nets }}</p>
<p>{% trans "Transports" %}: {{ transports }}</p>
</div>
{% endif %}
{% endblock content %}

View File

@ -1,44 +0,0 @@
{% extends "uds/base.html" %}
{% load i18n %}
{% load static %}
{% block script %}
<script type="text/javascript">
$(document).ready(function() {
$('#admin ul').hide();
$("#admin").click(function(){
var lista = $('#admin ul');
if (lista.is(":hidden")) {
lista.slideDown("fast");
} else {
lista.hide();
}
});
});
</script>
{% endblock script %}
{% block top %}
<div id="lheader">
<h1><a href="{% url "uds.web.views.index" %}">U<span>d</span>S</a></h1>
</div>
<div id="user">
{% trans "User" %} {{ user.real_name }}
</div>
{% if user.staff_member or user.is_admin %}
{% include "uds/snippets/admin_user.html" %}
{% endif %}
<div id="prefs">
<a href="{% url "uds.web.views.prefs" %}">{% trans "Preferences" %}</a>
</div>
{% if not nolang %}
{% include "uds/snippets/lang.html" %}
{% endif %}
<div id="logout" class="last">
<a href="{% url "uds.web.views.logout" %}"><img src='{% get_static_prefix %}/img/exit.png' alt='{% trans "Log out" %}' title='{% trans "Log out" %}'/></a>
</div>
{% endblock top %}

View File

@ -1,103 +0,0 @@
{% extends "uds/base.html" %}
{% load i18n %}
{% load static %}
{% block title %}
{% trans "Login to UDS" %}
{% endblock %}
{% block script %}
<script src="{% get_static_prefix %}js/PluginDetect_Java.js" type="text/javascript" ></script>
<script type="text/javascript">
function isJavaAvailable() {
if( PluginDetect.isMinVersion('Java', '1,6,0,0','{% get_static_prefix %}/other/getJavaInfo.jar') == 1 )
return true;
//PluginDetect.getVersion('Java', '{% get_static_prefix %}/other/getJavaInfo.jar')
return false;
}
function chkNonStandardAuth(val, nonStandard) {
if( $.inArray(val, nonStandard) >= 0) {
var vv = val;
$("#login").hide(300, function() {
$.get('{%url "uds.web.views.customAuth" idAuth=''%}' + vv, function(data) {
$('#nonStandardLogin').html(data);
$('#nonStandard').show(300);
});
});
}
}
$(document).ready(function() {
$('#id_java').val(isJavaAvailable() ? "y" : "n");
var nonStandard = $('#id_nonStandard').val();
if( nonStandard.length == 0 )
nonStandard = [];
else
nonStandard = nonStandard.split(',');
var standard = $('#id_standard').val();
if( standard.length == 0 )
standard = [];
else
standard = standard.split(',');
$('#id_authenticator').change(function() { chkNonStandardAuth($(this).val(), nonStandard) });
if( standard.length > 0 ) {
$('#backToLogin').click(function() {
$('#id_authenticator').val(standard[0]);
$('#nonStandard').hide(300, function() {
$('#nonStandardLogin').html('');
$("#login").show(300);
});
return false;
});
} else {
$('#divBackToLogin').html('');
}
// Check initial value (may default auth is non Standard)
chkNonStandardAuth($('#id_authenticator').val(), nonStandard);
});
</script>
{% endblock %}
{% block top %}
<div id="lheader">
<h1><a href='{% url "uds.web.views.index" %}'>U<span>d</span>S</a></h1>
</div>
{% include "uds/snippets/lang.html" %}
{% endblock %}
{% block content %}
<div>
<h2>{% trans "Login" %}</h2>
<form id="loginform" name="loginform" method="post" action="">
<div id="login">
{% csrf_token %}
<fieldset class="form">
<legend>{% trans "Login data" %}</legend>
{{ form.as_p }}
</fieldset>
<input type="submit" value="{% trans "Enter" %}" />
</div>
<div id="nonStandard" style="display: none">
<div id="nonStandardLogin" class="form">
non standard logins
</div>
<div id="divBackToLogin">
<a href="#" id="backToLogin" title="{% trans "Back to login" %}">{% trans "Back to login" %}</a>
</div>
</div>
</form>
</div>
<div id="customHtml">
{% autoescape off %}
{{ customHtml }}
{% endautoescape %}
</div>
{% endblock %}

View File

@ -1,21 +0,0 @@
{% extends "uds/internal_page.html" %}
{% load i18n %}
{% load static %}
{% block title %}
{% trans "UDS User Preferences" %}
{% endblock %}
{% block content %}
<div>
<h2>{% trans "Preferences" %}</h2>
<form name="form1" method="post" action="">
{% csrf_token %}
{% autoescape off %}{{ prefs_form }}{% endautoescape %}
<input type="submit" name="submit" value="{% trans "Save Preferences" %}"/>
</form>
{% include "uds/snippets/back_to_list.html" %}
</div>
{% endblock %}

View File

@ -1,8 +0,0 @@
{% extends "uds/internal_page.html" %}
{% load i18n %}
{% load static %}
{% block content %}
{% trans "Service not ready at this moment. Please, try again in a while." %}
{% include "uds/snippets/back_to_list.html" %}
{% endblock %}

View File

@ -1,13 +0,0 @@
{% extends "uds/internal_page.html" %}
{% load i18n %}
{% load static %}
{% block content %}
<div id="transport">
{% autoescape off %}
{{ transport }}
{% endautoescape %}
</div>
<br/>
{% include "uds/snippets/back_to_list.html" %}
{% endblock %}

View File

@ -45,6 +45,9 @@ logger = logging.getLogger(__name__)
class CustomSelect(forms.Select):
bootstrap = False
def render(self, name, value, attrs=None):
if len(self.choices) < 2:
visible = ' style="display: none;"'