Added tonnes of features, lets see what breaks.
This commit is contained in:
@@ -11,7 +11,9 @@
|
||||
<link rel="shortcut icon" type="image/png" href="{% static 'favicon.ico' %}"/>
|
||||
<title>Geogame</title>
|
||||
</head>
|
||||
|
||||
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
|
||||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
|
||||
<body>
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-light">
|
||||
<img id="logo" src="{% static 'brand.png' %}"></img>
|
||||
@@ -29,7 +31,7 @@
|
||||
<a href="{% url 'profile' %}" class="nav-link">Profile</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="{% url 'game:contribute' %}" class="nav-link">Contribute</a>
|
||||
<a href="{% url 'game:create-challenge' %}" class="nav-link">Contribute</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="{% url 'account_logout' %}" class="nav-link">Logout</a>
|
||||
@@ -58,7 +60,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
|
||||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
|
||||
</body>
|
||||
|
||||
@@ -28,9 +28,6 @@
|
||||
<li class="nav-item">
|
||||
<a href="{% url 'profile' %}" class="nav-link">Profile</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="{% url 'game:contribute' %}" class="nav-link">Contribute</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="{% url 'account_logout' %}" class="nav-link">Logout</a>
|
||||
</li>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-10 offset-lg-1 content">
|
||||
<h1 class="section-header">API key for for {{user.email}}</h1>
|
||||
<h1 class="section-header">Details for {{user.email}}</h1>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -15,7 +15,7 @@
|
||||
{{ form.non_field_errors }}
|
||||
{% csrf_token %}
|
||||
{{form.as_p}}
|
||||
<button type="submit" class="btn btn-primary">Update API Key</button>
|
||||
<button type="submit" class="btn btn-primary">Update User Info</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
49
geogame/templates/main/challenge_list.html
Normal file
49
geogame/templates/main/challenge_list.html
Normal file
@@ -0,0 +1,49 @@
|
||||
{% extends 'game_base.html' %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-10 offset-lg-1 content">
|
||||
<h1 class="section-header">All Challenges</h1>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-10 offset-lg-1 content">
|
||||
<table>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Average</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
{% for challenge in challenges %}
|
||||
<tr>
|
||||
<td>{{challenge.name}}</td>
|
||||
<td>{{challenge.average}}</td>
|
||||
<td><a class="btn btn-success btn-block" href="{% url 'game:new-game' %}?challenge={{challenge.id}}" role="button">Play</a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{% if is_paginated %}
|
||||
<div class="pagination">
|
||||
<span class="page-links">
|
||||
{% if page_obj.has_previous %}
|
||||
<a href="{% url 'supplier:my-suppliers-list' %}?page={{ page_obj.previous_page_number }}">previous</a>
|
||||
{% endif %}
|
||||
<span class="page-current">
|
||||
Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }}.
|
||||
</span>
|
||||
{% if page_obj.has_next %}
|
||||
<a href="{% url 'supplier:my-suppliers-list' %}?page={{ page_obj.next_page_number }}">next</a>
|
||||
{% endif %}
|
||||
</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
||||
35
geogame/templates/main/create_challenge_form.html
Normal file
35
geogame/templates/main/create_challenge_form.html
Normal file
@@ -0,0 +1,35 @@
|
||||
{% extends 'game_base.html' %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-10 offset-lg-1 content">
|
||||
<h1 class="section-header">Create Challenge</h1>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-10 offset-lg-1 content">
|
||||
<form action="" method="POST">
|
||||
{{ form.non_field_errors }}
|
||||
{% csrf_token %}
|
||||
<div class="form-group form-row">
|
||||
<label for="staticName" class="col-sm-4 col-form-label">Name</label>
|
||||
<div class="col-sm-8">
|
||||
{{form.name}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-row">
|
||||
<div class="col-sm-12">
|
||||
<a class="btn btn-danger pull-left" href="{% url 'profile' %}">Cancel</a>
|
||||
<button type="submit" class="btn btn-primary pull-right">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
92
geogame/templates/main/edit_challenge_form.html
Normal file
92
geogame/templates/main/edit_challenge_form.html
Normal file
@@ -0,0 +1,92 @@
|
||||
{% extends 'base.html' %}
|
||||
{% load staticfiles%}
|
||||
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-10 offset-lg-1 content">
|
||||
<h1 class="section-header">Edit Challenge {{challenge.name}}</h1>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-10 offset-lg-1 content">
|
||||
{% if form.errors %}
|
||||
{% for field in form %}
|
||||
{% for error in field.errors %}
|
||||
<div class="alert alert-danger">
|
||||
<strong>{{ error|escape }}</strong>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
{% for error in form.non_field_errors %}
|
||||
<div class="alert alert-danger">
|
||||
<strong>{{ error|escape }}</strong>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>Latitude</th>
|
||||
<th>Longitude</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
{% for coord in coords %}
|
||||
<tr>
|
||||
<td>
|
||||
{{ coord.lat }}
|
||||
</td>
|
||||
<td>
|
||||
{{ coord.lng }}
|
||||
</td>
|
||||
<td style="width:105px">
|
||||
<form action="{% url 'game:coord-delete' pk=coord.pk %}" method="POST">
|
||||
{% csrf_token %}
|
||||
<input type="submit" class="btn btn-danger btn-block" value="Remove" name="delete" style="margin-right:0">
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
|
||||
<hr>
|
||||
|
||||
|
||||
|
||||
|
||||
<form id="coordForm" method="post" action="">
|
||||
{% csrf_token %}
|
||||
<table border="0" cellpadding="0" cellspacing="0">
|
||||
<tbody>
|
||||
{% for form in formset.forms %}
|
||||
<tr>
|
||||
<td>{{ form.lat }}</td>
|
||||
<td>{{ form.lng }}</td>
|
||||
<td style="width:105px"></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{{ formset.management_form }}
|
||||
</form>
|
||||
<input class="btn btn-primary pull-right" type="submit" value="Save" form="coordForm">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="{% static 'dynamic_formsets/jquery.formset.js' %}" type="text/javascript"> </script>
|
||||
<script type="text/javascript">
|
||||
$('#coordForm').formset();
|
||||
// function defer(method) {
|
||||
// if (window.jQuery) {
|
||||
// $('.individual-form').formset();
|
||||
// } else {
|
||||
// setTimeout(function() { defer(method) }, 50);
|
||||
// }
|
||||
// }
|
||||
</script>
|
||||
|
||||
{% endblock %}
|
||||
@@ -14,7 +14,7 @@
|
||||
{% endif %}
|
||||
|
||||
<div class="alert alert-info">
|
||||
Your average guess was {{average_distance}}km away.
|
||||
Your average guess was {{average_distance}}km away.{% if all_average %} The average for this challenge is {{all_average}}km{%endif%}
|
||||
</div>
|
||||
|
||||
<div id="map" class="map"></div>
|
||||
|
||||
@@ -15,17 +15,20 @@
|
||||
{% if has_api_key %}
|
||||
{% if existing_game %}
|
||||
<a class="btn btn-info btn-lg btn-block" href="{% url 'game:round-view' game_pk=existing_game.id round_pk=existing_round.id %}" role="button">Continue Last Game</a>
|
||||
<a class="btn btn-success btn-lg btn-block" href="{% url 'game:new-game' %}" role="button">New Game</a>
|
||||
<a class="btn btn-success btn-lg btn-block" href="{% url 'game:new-game' %}" role="button">New Random Game</a>
|
||||
<a class="btn btn-warning btn-lg btn-block" href="{% url 'game:list-challenge' %}" role="button">View Challenges</a>
|
||||
{% else %}
|
||||
<button type="button" class="btn btn-info btn-lg btn-block" disabled>Continue Last Game</button>
|
||||
<a class="btn btn-success btn-lg btn-block" href="{% url 'game:new-game' %}" role="button">New Game</a>
|
||||
<a class="btn btn-success btn-lg btn-block" href="{% url 'game:new-game' %}" role="button">New Random Game</a>
|
||||
<a class="btn btn-warning btn-lg btn-block" href="{% url 'game:list-challenge' %}" role="button">View Challenges</a>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<div class="alert alert-warning">
|
||||
You must set an api key on your profile page to play the game. Please read the FAQ for more info.
|
||||
</div>
|
||||
<button type="button" class="btn btn-info btn-lg btn-block" disabled>Continue Last Game</button>
|
||||
<button type="button" class="btn btn-success btn-lg btn-block" disabled>New Game</button>
|
||||
<button type="button" class="btn btn-success btn-lg btn-block" disabled>New Random Game</button>
|
||||
<button type="button" class="btn btn-warning btn-lg btn-block" disabled>View Challenges</button>
|
||||
{% endif %}
|
||||
|
||||
{% else %}
|
||||
@@ -60,7 +63,7 @@
|
||||
<p>Sometimes a coordinate with no valid streetview is selected for you, you will just get a black screen.</p>
|
||||
<p>If this occurs please click the "Broken Streetview" button and you will be provided with a new scene and the faulty coordinate will be removed from the database.</p>
|
||||
<p><strong>There isn't a great variety of countries, why?</strong></p>
|
||||
<p>I am relying on crowd sourcing of playable scenes, please consider helping out by <a href="{% url 'game:contribute' %}">adding a few coordinates of your own</a>.</p>
|
||||
<p>I am relying on crowd sourcing of playable scenes, please consider helping out by <a href="{% url 'game:create-challenge' %}">adding a few coordinates of your own</a>.</p>
|
||||
<p>You get to keep track of the coordinates you add, and see how well (or badly) other people do on them!</p>
|
||||
<p>For now I have managed to find some data on uk coordinates that I can use, but its not so easy getting data for other countries.</p>
|
||||
<p><strong>I didn't receive my email reset password, what gives?</strong></p>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<a class="btn btn-primary btn-lg" style="margin-top:16px" href="{% url 'account_change_password' %}">Change Password</a>
|
||||
</p>
|
||||
<p>
|
||||
<a class="btn btn-primary btn-lg" href="{% url 'api-key-view' pk=user.pk %}">API key</a>
|
||||
<a class="btn btn-primary btn-lg" href="{% url 'api-key-view' pk=user.pk %}">Edit Details</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -25,6 +25,7 @@
|
||||
<div class="row">
|
||||
<div class="col-lg-10 offset-lg-1 content">
|
||||
<h3 class="section-header">Played Games</h3>
|
||||
<hr>
|
||||
<p>Coming soon</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -33,7 +34,23 @@
|
||||
<div class="row">
|
||||
<div class="col-lg-10 offset-lg-1 content">
|
||||
<h3 class="section-header">Your Contributions</h3>
|
||||
<p>Coming soon</p>
|
||||
<hr>
|
||||
<table>
|
||||
<tr>
|
||||
<th>Challenge Name</th>
|
||||
<th>Average Score</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
{% for challenge in user_challenges %}
|
||||
<tr>
|
||||
<td>{{challenge.name}}</td>
|
||||
<td>{{challenge.average}}</td>
|
||||
<td><a class="btn btn-warning btn-block" href="{% url 'game:edit-challenge' pk=challenge.pk %}" role="button">Edit</a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
<hr>
|
||||
<a class="btn btn-primary btn-lg" href="{% url 'game:create-challenge' %}">Create a New Challenge</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user