Old show page

This commit is contained in:
boyska 2014-02-24 18:40:43 +01:00
parent 1f80488bbf
commit 4f8bb54b56
3 changed files with 134 additions and 45 deletions

75
server/pages/old.html Normal file
View file

@ -0,0 +1,75 @@
<!DOCTYPE html>
<html>
<head>
<title>TechREC</title>
<link rel="icon" href="/static/img/icon.ico" />
<link rel="stylesheet" type="text/css" href="/static/css/pure-min.css" />
<link rel="stylesheet" type="text/css" href="/static/css/jquery-ui.min.css" />
<link rel="stylesheet" type="text/css" href="/static/css/techrec.css">
<link rel="stylesheet" type="text/css" href="/static/css/font-awesome.css" />
<script src="/static/js/jquery-1.9.1.min.js"></script>
<script src="/static/js/jquery-ui.min.js"></script>
<script src="/static/js/jquery.ui.datepicker-it.min.js"></script>
</head>
<body>
<div id="main">
<h1>Scarica registrazione passata</h1>
<div id="rec-normal" class="pure-g-r">
<div class="pure-u-1-8"></div>
<div class="pure-u-3-4">
<form class="pure-form">
<label for="name" required placeholder="Corrispondenza dalla Luna">Nome</label>
<input type="text" id="name" name="name" size="40" required placeholder="Corrispondenza dalla Luna">
<fieldset>
<legend>Da</legend>
<div class="pure-u-1-3">
<label for="from-date">Giorno</label>
<input type="text" id="from-date" name="from-date" size="10" maxlength="10" required>
</div>
<div class="pure-u-1-4">
<label for="from-hour">Ore</label>
<input type="time" id="from-hour" name="from-hour" size="2" maxlength="2" max="23" min="0" required>
</div>
<div class="pure-u-1-4">
<label for="from-min">Minuti</label>
<input type="time" id="from-min" name="from-min" size="2" maxlength="2" max="59" min="0" required>
</div>
</fieldset>
<fieldset>
<legend>A</legend>
<div class="pure-u-1-3">
<label for="to-date">Giorno</label>
<input type="text" id="to-date" name="from-date" size="10" required>
</div>
<div class="pure-u-1-4">
<label for="to-hour">Ore</label>
<input type="time" id="to-hour" name="from-hour" size="2" maxlength="2" max="23" min="0" required>
</div>
<div class="pure-u-1-4">
<label for="to-min">Minuti</label>
<input type="time" id="to-min" name="from-min" size="2" maxlength="2" max="59" min="0" required>
</div>
</fieldset>
<div style="margin-top: 2em; text-align: center;">
<button type="submit" id="download" class="pure-button pure-button-primary" style="font-size: 150%;">
<i class="fa fa-download"></i>Scarica
</button>
</div> <!-- download -->
</form>
</div> <!-- 3/4 -->
<div class="pure-u-1-8"></div>
</div> <!-- grid -->
</div> <!-- main -->
<script src="/static/js/old.js" type="text/javascript">
</script>
</body>
</html>
<!-- vim: set ts=2 sw=2 noet: -->

View file

@ -1,45 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title> TechREC </title>
<link rel="stylesheet" type="text/css" href="/static/css/style.css">
<script src="/static/js/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="/static/js/reclibrary.js"></script>
<script type="text/javascript" src="/static/js/tempo.js"> </script>
</head>
<body>
<div id="pagecontainer">
<h1> techr*c </h1>
<h2> <a href="/new.html"> Nuova registrazione</a> </h2>
<div id="buttonscontainer">
<form action="#" method="POST" id="searchform">
<input type="text" id="recid" name="recid" placeholder="Codice Registrazione" /> <br />
<input type="text" id="name" name="name" placeholder="name" /> <br />
<input type="text" id="starttime" name="starttime" placeholder="Start: 2012/11/24 22:37:361" />(timepicker http://puna.net.nz/timepicker.htm#) <br />
<input type="text" id="endtime" name="endtime" placeholder="End: 2012/11/24 22:37:36" /> <br />
<input type="submit" value="Cerca" />
</form>
</div>
<div id="searchresult">
</div>
</div>
<div id="footer">
techbl*c
</div>
</body>
</html>

59
server/static/js/old.js Normal file
View file

@ -0,0 +1,59 @@
/* BEGIN Validation */
function form_check() {
"use strict";
var errs = [];
function err(msg, element) {
errs.unshift({ msg: msg, el: element});
}
if($('#name').val() == '') {
errs.unshift("Nome mancante", $('#name'));
}
if(parseInt($('#to-hour').val(), 10) - parseInt($('#from-hour').val(), 10) > 5) {
errs.unshift("Too long");
}
if(parseInt($('#to-hour').val(), 10) - parseInt($('#from-hour').val(), 10) < 0) {
//TODO: better date handling
errs.unshift("Inverted from/to ?");
}
return errs;
}
function update_form_check(errors) {
"use strict";
/* This function reads results and changes "things" consequently */
if(errors.length > 0) {
console.log(errors);
$('#download').addClass("pure-button-disabled");
} else { /* everything fine */
$('#download').removeClass("pure-button-disabled");
}
}
/* END validation */
$(function() {
"use strict";
$( "#from-date" ).datepicker({
defaultDate: "+0d",
changeMonth: true,
numberOfMonths: 1,
onClose: function( selectedDate ) {
if($('#to-date').val() == '') {
$('#to-date').datepicker("setDate", selectedDate);
}
$("#to-date").datepicker("option", "minDate", selectedDate);
}
});
$( "#to-date" ).datepicker({
defaultDate: "+0d",
changeMonth: true,
numberOfMonths: 1,
onClose: function( selectedDate ) {
$("#from-date").datepicker("option", "maxDate", selectedDate);
}
});
$('#to-date, #from-date').datepicker($.datepicker.regional['it']);
$('form input').change(function() {
update_form_check(form_check());
})
});