Ejemplo n.º 1
0
def getAircraftMainPage():
    response = '<html><head>  <title>Aircrafts</title>  <meta charset="utf-8">  <meta name="viewport" content="width=device-width, initial-scale=1"><link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"><script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script><script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script></head><body><div class="container">\
    <h1>Fl&uuml;ge</h1> \
    <table class="table table-hover"> \
    <thead><tr><th></th><th>FlugID</th><th>Startflughafen</th><th>Zielflughafen</th></tr></thead>' \
               '<tbody>'
    aircrafts = dataService.requestAircraftData(False)
    for i in range(0,len(aircrafts) - 1):
        aircraft= aircrafts[i]
        flightId = aircraft[jsonReader.flightId()]
        startAirport = aircraft[jsonReader.startAirport()]
        targetAirport = aircraft[jsonReader.targetAirport()]
        planeTypeCode = aircraft[jsonReader.planeTypeCode()]
        if flightId <> "" and startAirport <> "" and targetAirport <> "":
            response = response + '<tr onclick="location.href= \'aircrafts/' + flightId + '?type=' + planeTypeCode + '\'\">' \
                                  '<td>' + bucketService.getThumbnailImg(planeTypeCode) + ' </td>' \
                                  '<td>' + str(flightId) + ' </td>' \
                                  '<td>' + str(startAirport) + '</td>' \
                                  '<td>' + str(targetAirport) + '</td>' \
                                  '</tr>'
    response = response + '</tbody>  </table></div>'
    return response