Formatting templates and adding some extra info

This commit is contained in:
Denis-Cosmin Nutiu 2017-05-28 16:51:52 +03:00
parent ef3375c3c6
commit e587fe1429
7 changed files with 85 additions and 71 deletions

View file

@ -2,7 +2,7 @@
{% block title %}FOTB - 400 :({% endblock %}
{% block main %}
{{ super() }}
{{ super() }}
<div class="text-center">
<h1>400</h1>
<h2>Bad request!</h2>

View file

@ -2,13 +2,15 @@
{% block title %}FOTB - 404 :({% endblock %}
{% block main %}
{{ super() }}
{{ super() }}
<div class="text-center">
<h1>Oopsy poopsy...</h1>
<h2>Page not found! 404</h2>
<div class="alert alert-warning" role="alert">
<span class="glyphicon glyphicon-fire"></span> If you think this page should be here please contact <a href="mailto:{{ config.ADMIN_EMAIL }}" class="alert-link">{{ config.ADMIN_NAME }}</a>,
describing why it should be here. <strong>Thank you</strong> very much! <span class="glyphicon glyphicon-fire"></span>
<span class="glyphicon glyphicon-fire"></span> If you think this page should be here please contact <a
href="mailto:{{ config.ADMIN_EMAIL }}" class="alert-link">{{ config.ADMIN_NAME }}</a>,
describing why it should be here. <strong>Thank you</strong> very much! <span
class="glyphicon glyphicon-fire"></span>
</div>
</div>
{% endblock %}

View file

@ -2,7 +2,7 @@
{% block title %}FOTB - 405 :({% endblock %}
{% block main %}
{{ super() }}
{{ super() }}
<div class="text-center">
<h1>405</h1>
<h2>Method not allowed!</h2>

View file

@ -2,13 +2,15 @@
{% block title %}FOTB - 500 :({% endblock %}
{% block main %}
{{ super() }}
{{ super() }}
<div class="text-center">
<h1>Oopsy poopsy...</h1>
<h2>Something bad has happened...</h2>
<div class="alert alert-danger" role="alert">
<span class="glyphicon glyphicon-fire"></span> If you want to help fixing this issue please contact <a href="mailto:{{ config.ADMIN_EMAIL }}" class="alert-link">{{ config.ADMIN_NAME }}</a>,
describing in detail how you ended on this page. <strong>Thank you</strong> very much! <span class="glyphicon glyphicon-fire"></span>
<span class="glyphicon glyphicon-fire"></span> If you want to help fixing this issue please contact <a
href="mailto:{{ config.ADMIN_EMAIL }}" class="alert-link">{{ config.ADMIN_NAME }}</a>,
describing in detail how you ended on this page. <strong>Thank you</strong> very much! <span
class="glyphicon glyphicon-fire"></span>
</div>
</div>
{% endblock %}

View file

@ -11,7 +11,9 @@
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Detailed View <small class="pull-right">({{ name.created }})</small></h3>
<h3 class="panel-title">Detailed View
<small class="pull-right">({{ name.created }})</small>
</h3>
</div>
<div class="panel-body">
<div class="progress">

View file

@ -2,69 +2,70 @@
{% block title %}FOTB{% endblock %}
{% block metas %}
<meta charset="UTF-8">
<meta name="author" content="Metonymy">
<meta name="description" content="The scoreboard for the benchmarks!">
<meta name="keywords" content="flask python metonymyqt benchmark scoreboard">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="UTF-8">
<meta name="author" content="Metonymy">
<meta name="description" content="The scoreboard for the benchmarks!">
<meta name="keywords" content="flask python metonymyqt benchmark scoreboard">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
{% endblock %}
{% block styles %}
{{super()}}
<link rel="stylesheet" href="{{url_for('static', filename='style.css')}}">
<link rel="stylesheet" href="{{url_for('static', filename='dataTables.bootstrap.min.css')}}">
<link rel="shortcut icon" href="{{ url_for('static', filename='favicon.ico') }}">
{{ super() }}
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
<link rel="stylesheet" href="{{ url_for('static', filename='dataTables.bootstrap.min.css') }}">
<link rel="shortcut icon" href="{{ url_for('static', filename='favicon.ico') }}">
{% endblock %}
{% block content %}
<div class="navbar navbar-default" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle"
data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/">FOTB</a> </div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li><a href="/">Home</a></li>
<li><a href="{{ url_for("scoreboard.upload") }}">Upload</a></li>
<li><a href="//github.com/Metonimie/benchmark-scoreboard">Fork this Website</a></li>
</ul>
<form method="get" action="{{ url_for('scoreboard.index') }}" class="navbar-form navbar-left">
<div class="form-group">
<input type="text" class="form-control" name="result_name" placeholder="Search for username">
</div>
<button type="submit" class="btn btn-default">Submit</button>
</form>
<div class="navbar navbar-default" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle"
data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/">FOTB</a></div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li><a href="/">Home</a></li>
<li><a href="{{ url_for("scoreboard.upload") }}">Upload</a></li>
<li><a href="//github.com/Metonimie/benchmark-scoreboard">Fork this Website</a></li>
</ul>
<form method="get" action="{{ url_for('scoreboard.index') }}" class="navbar-form navbar-left">
<div class="form-group">
<input type="text" class="form-control" name="result_name" placeholder="Search for username">
</div>
<button type="submit" class="btn btn-default">Submit</button>
</form>
</div>
</div>
</div>
</div>
<header>
{% block header %}
{% endblock %}
<div class="alert alert-info" role="alert">
<strong><span class="glyphicon glyphicon-fire"></span> Heads up!</strong> This application is not complete! If you find any bugs please report them to:
<a href="mailto:{{ config.ADMIN_EMAIL }}" class="alert-link">{{ config.ADMIN_NAME }}</a>
</div>
</header>
<div class="container" role="main">
{% block main %}
{% endblock %}
</div>
<footer class="footer">
<div class="container">
<span class="text-muted">Copyright © 2017 Fellowship of the Bits</span>
<header>
{% block header %}
{% endblock %}
<div class="alert alert-info" role="alert">
<strong><span class="glyphicon glyphicon-fire"></span> Heads up!</strong> If you find any bugs please report
them to:
<a href="mailto:{{ config.ADMIN_EMAIL }}" class="alert-link">{{ config.ADMIN_NAME }}</a>
</div>
</header>
<div class="container" role="main">
{% block main %}
{% endblock %}
</div>
<footer class="footer">
<div class="container">
<span class="text-muted">Copyright © 2017 Fellowship of the Bits</span>
</div>
</footer>
<!-- ♥ Astrid-->
</footer>
<!-- ♥ Astrid-->
{% endblock %}
{% block scripts %}
{{super()}}
<script src="{{url_for('static', filename='jquery.dataTables.min.js')}}"></script>
<script src="{{url_for('static', filename='dataTables.bootstrap.min.js')}}"></script>
{{ super() }}
<script src="{{ url_for('static', filename='jquery.dataTables.min.js') }}"></script>
<script src="{{ url_for('static', filename='dataTables.bootstrap.min.js') }}"></script>
{% endblock %}

View file

@ -2,14 +2,21 @@
{% block title %}FOTB - Uploading{% endblock %}
{% block main %}
{{ super() }}
<div>
<h4>Uploading Data</h4>
<p>Uploading data is simple, all you need to do is send a POST request with content-type <code>application/json</code> to <code>/result</code>.</p>
<p>Your JSON must respect all the required fields, if not, you will get back a <code>400</code> :)</p>
<p>Example: <code>curl -H "Content-Type: application/json" -X POST -d '{"name":"Anonymous", "gpu":"GPU DUMMY TEXT","cpu":"CPU DUMMY TEXT","log":"So this will be a detailed log.","score": 1}' http://localhost:5000/result</code></p>
<p>If the resource has been added sucessfully then the status code of <code>201</code> is returned, any other status code can be considered an error</p>
<p>The <code>name</code> field can be used with the build in search functionality to search for results.</p>
<p>The <code>location</code> header can be inspected for an url to the newly created result.</p>
</div>
{{ super() }}
<div>
<h4>Uploading Data</h4>
<p>Uploading data to the website is simple, all you need to do is send a POST request with content-type
<code>application/json</code> to <code>/result</code>.</p>
<p>Your JSON must respect all the required fields, if not, you will get back a <code>400</code> :)</p>
<p>Example with curl: <code>curl -H "Content-Type: application/json" -X POST -d '{"name":"Anonymous", "gpu":"GPU
DUMMY
TEXT","cpu":"CPU DUMMY TEXT","log":"So this will be a detailed log.","score": 1}'
http://localhost:5000/result</code></p>
<p>If the resource has been added successfully then the status code of <code>201</code> is returned, any other
status code can be considered an error. In case of error the response JSON will contain the error message.
</p>
<p>The <code>name</code> field can be used with the search functionality from the toolbar to search for results.
</p>
<p>The <code>location</code> header of the response contains the location of the submitted result.</p>
</div>
{% endblock %}