Add homepage, link to it from the logo
This commit is contained in:
parent
d225856174
commit
4c642d97cb
|
@ -1,3 +1,4 @@
|
||||||
## Unreleased
|
## Unreleased
|
||||||
* Hide navigation bar items if there are no games/purchases/sessions
|
* Hide navigation bar items if there are no games/purchases/sessions
|
||||||
* Set default version to "git-main" to indicate development environment
|
* Set default version to "git-main" to indicate development environment
|
||||||
|
* Add homepage, link to it from the logo
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
<div class="dark:bg-gray-800 h-screen">
|
<div class="dark:bg-gray-800 h-screen">
|
||||||
<nav class="mb-4 bg-white dark:bg-gray-900 border-gray-200 rounded">
|
<nav class="mb-4 bg-white dark:bg-gray-900 border-gray-200 rounded">
|
||||||
<div class="container flex flex-wrap items-center justify-between mx-auto">
|
<div class="container flex flex-wrap items-center justify-between mx-auto">
|
||||||
<a href="#" class="flex items-center">
|
<a href="{% url 'index' %}" class="flex items-center">
|
||||||
<span class="text-4xl">⌚</span>
|
<span class="text-4xl">⌚</span>
|
||||||
<span class="self-center text-xl font-semibold whitespace-nowrap text-white">Timetracker</span>
|
<span class="self-center text-xl font-semibold whitespace-nowrap text-white">Timetracker</span>
|
||||||
</a>
|
</a>
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
|
{% block title %}{{ title }}{% endblock title %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div class="text-slate-300 mx-auto max-w-screen-lg text-center">
|
||||||
|
{% if session_count > 0 %}
|
||||||
|
You have played a total of {{ session_count }} sessions.
|
||||||
|
{% else %}
|
||||||
|
Start by clicking the links at the top. To track playtime, you need to have at least 1 owned game.
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
{% endblock content %}
|
|
@ -3,6 +3,7 @@ from django.urls import path
|
||||||
from . import views
|
from . import views
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
|
path("", views.index, name="index"),
|
||||||
path("add-game/", views.add_game, name="add_game"),
|
path("add-game/", views.add_game, name="add_game"),
|
||||||
path("add-session/", views.add_session, name="add_session"),
|
path("add-session/", views.add_session, name="add_session"),
|
||||||
path("add-purchase/", views.add_purchase, name="add_purchase"),
|
path("add-purchase/", views.add_purchase, name="add_purchase"),
|
||||||
|
|
|
@ -65,3 +65,7 @@ def add_game(request):
|
||||||
context["form"] = form
|
context["form"] = form
|
||||||
context["title"] = "Add New Game"
|
context["title"] = "Add New Game"
|
||||||
return render(request, "add.html", context)
|
return render(request, "add.html", context)
|
||||||
|
|
||||||
|
def index(request):
|
||||||
|
context = {}
|
||||||
|
return render(request, "index.html", context)
|
||||||
|
|
Loading…
Reference in New Issue