Archive download is nicer

This commit is contained in:
boyska 2014-04-23 21:16:46 +02:00
parent cfa08ddb72
commit 5b69411b15
3 changed files with 20 additions and 46 deletions

View file

@ -53,8 +53,10 @@ $(function() {
parseInt(rec.starttime, 10)).toLocaleString()
);
var duration = $('<td/>').text(delta(rec.endtime, rec.starttime));
var fn = $('<td/>').append($('<a/>').prop('href', '/output/' +
rec.filename).text(rec.filename));
var fn = $("<td/>").append($("<a/>").prop("href", "/output/" +
rec.filename).addClass("pure-button pure-button-small")
.html( $("<i/>").addClass("fa fa-download").css("color", "green"))
.append(" Scarica") );
var row = $('<tr/>').append(name).append(start).append(duration).append(fn);
$('#ongoing-recs-table tbody').append(row);
}
@ -85,7 +87,7 @@ $(function() {
<th>Nome</th>
<th>Inizio</th>
<th>Durata</th>
<th>Filename</th>
<th>File</th>
</tr>
</tbody>
</table>

View file

@ -22,6 +22,10 @@
.pure-button-enorme {
font-size: 300% !important;
}
.pure-button-small {
font-size: 85% !important;
}
.arancione {
color: darkorange;
}
@ -38,3 +42,14 @@
.ongoing-one:nth-child(odd) {
background: #dddddd;
}
/* Archive */
#ongoing-recs-table td {
text-align: center;
}
#ongoing-recs-table td:first-child {
text-align: left;
}
#ongoing-recs-table td:last-child {
text-align: right;
}

View file

@ -1,43 +0,0 @@
/*
TODO:
prendere lo stato !!!
*/
$(document).ready(function(){
$("#searchform").submit(
function (event) {
event.preventDefault();
dataString = $(this).serialize();
var request = $.getJSON('/api/search', dataString);
$("#searchresult").html(" ");
request.done( function(data) {
$.each(data, function(key, val) {
console.log("Extract " + key );
var divstring = "<div class=\"searchresult\" id=\""+ rs_trxarea(key) +"\"> </div>";
$("#searchresult").append( divstring );
// var str = newformstr( key ); // new form
var str = "";
str += "<div class=\"namevalues\">"+val.name+" - <a href=\"\">Scarica</a> <a href=\"\" id=\"delete-"+val.id+"\">Cancella</a></div>";
str += "<div class=\"namevalues\">RECID: "+val.recid+" ID: "+ val.id + " Active " + val.active + "</div>";
str += "<div class=\"timevalues\">["+val.starttime+" >>> "+val.endtime+"]</div>"
$("#"+rs_trxarea(key)).html(str);
$("#delete-"+val.id).click(function(evt) {
evt.preventDefault();
recDelete(val.recid, rs_trxarea(key) );
}
); // End of delete link handler
});
});
});
$("#searchform").submit();
});
// vim: set ts=4 sw=4 noet: