Skip to content

Commit

Permalink
Working on a landing page. (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kraust authored May 10, 2024
1 parent 44163eb commit 45639ae
Show file tree
Hide file tree
Showing 9 changed files with 92 additions and 0 deletions.
1 change: 1 addition & 0 deletions OSCR_django/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"user.apps.UserConfig",
"combatlog.apps.CombatLogConfig",
"ladder.apps.LadderConfig",
"ui.apps.UIConfig",
]

MIDDLEWARE = [
Expand Down
1 change: 1 addition & 0 deletions OSCR_django/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
path("", include("combatlog.urls.combatlog")),
path("", include("ladder.urls.ladder")),
path("", include("ladder.urls.ladder_entry")),
path("", include("ui.urls.ui")),
]

if settings.ENABLE_DEBUG:
Expand Down
9 changes: 9 additions & 0 deletions ui/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
""" UI Application """

from django.apps import AppConfig


class UIConfig(AppConfig):
"""UI Configuration"""

name = "ui"
9 changes: 9 additions & 0 deletions ui/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
""" UI Application """

from django.apps import AppConfig


class UIConfig(AppConfig):
"""UI Configuration"""

name = "ui"
28 changes: 28 additions & 0 deletions ui/static/css/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
html, body {
background-color: #c82934;
margin: 0;
padding: 0;
max-height: 100vh;
}

.banner {
max-width: 100%;
}

.content-background {
background-color: #1a1a1a;
color: #ffffff;
}

.container {
display: flex;
flex-direction: column;
min-height: 100vh;
}

.content {
margin: .5rem;
padding: .5rem;
flex: 1;
border-radius: .5rem;
}
Binary file added ui/static/img/oscrbanner-slim-dark-label.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions ui/templates/ui.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{% load ladder %}
{% load static %}
<html>
<head>
<link rel="stylesheet" href="{% static 'css/style.css' %}">
</head>
<body>
<div class="container">
<div>
<img src="{% static 'img/oscrbanner-slim-dark-label.png' %}" class='banner'></img>
</div>
<div class="content content-background">
</div>
</div>
</body>
</html>
20 changes: 20 additions & 0 deletions ui/templatetags/ladder.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
""" Ladder Template Tags """

import logging

from django import template
from ladder.models import Ladder

register = template.Library()
LOGGER = logging.getLogger("django")

@register.simple_tag
def get_ladders():
"""Return the list of ladders"""
entries = {}
for ladder in Ladder.objects.all():
if entries.get(ladder.name) is None:
entries[ladder.name] = {}
if entries[ladder.name].get(ladder.difficulty) is None:
entries[ladder.name][ladder.difficulty] = ladder.is_solo
return entries
8 changes: 8 additions & 0 deletions ui/urls/ui.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
""" URL URLs """

from django.urls import include, path
from django.views.generic import TemplateView

urlpatterns = [
path("ui/", TemplateView.as_view(template_name="ui.html")),
]

0 comments on commit 45639ae

Please sign in to comment.