Created
April 14, 2015 20:50
-
-
Save mathiasose/e1c31cddb52b7aa52c3a to your computer and use it in GitHub Desktop.
Example frontend for https://github.com/hackerspace-ntnu/primus
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="nb"> | |
| <head> | |
| <title>Hackerspace NTNU</title> | |
| <meta charset="UTF-8"> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootswatch/3.3.2/yeti/bootstrap.min.css"/> | |
| <script src="https://code.jquery.com/jquery-2.1.3.min.js"></script> | |
| </head> | |
| <body class="container"> | |
| <h1></h1> | |
| <ol></ol> | |
| <script> | |
| $.get("http://localhost:8000/contests/1/", function (data) { | |
| $("h1").html(data.name); | |
| data.results.sort(function (a, b) { | |
| return (data.lowest_best ? -1 : 1) * (b.value - a.value); | |
| }); | |
| $(data.results).each(function (i, x) { | |
| $("ol").append("<li><b>" + x.player + "</b>: " + x.value + "</li>") | |
| }); | |
| }); | |
| </script> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment