Redirect to game_detail
The redirect works now. So if you click on a game, it wilk take you there Signed-off-by: Pratyush Desai <pratyush.desai@liberta.casa>
This commit is contained in:
parent
180900c752
commit
fc6593329b
@ -176,23 +176,26 @@
|
|||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div class="navbar">
|
<div class="navbar">
|
||||||
<div class="left">
|
<div class="center">
|
||||||
<pre>
|
<pre>
|
||||||
┬ ┌┬┐ ┬─┐ ┌─┐ ┬─┐ ┐─┐ ┬─┐
|
┬ ┌┬┐ ┬─┐ ┌─┐ ┬─┐ ┐─┐ ┬─┐
|
||||||
│ │ │─│ │ │─┤ └─┐ │─┤
|
│ │ │─│ │ │─┤ └─┐ │─┤
|
||||||
┘─┘ └┴┘ │─┘ └─┘ ┘ │ ──┘ ┘ │
|
┘─┘ └┴┘ │─┘ └─┘ ┘ │ ──┘ ┘ │
|
||||||
|
|
||||||
</pre>
|
</pre>
|
||||||
|
</div>
|
||||||
|
<div class="navbar">
|
||||||
|
<div class="left">
|
||||||
<a href="{% url 'home' %}">Home</a>
|
<a href="{% url 'home' %}">Home</a>
|
||||||
<a href="{% url 'games' %}">Games</a>
|
<a href="{% url 'games' %}">Games</a>
|
||||||
<a href="#">Mods</a>
|
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</div class="navbar>
|
||||||
<!-- <div class="right">
|
<!-- <div class="right">
|
||||||
<div class="search-box">
|
<div class="search-box">
|
||||||
<input type="text" placeholder="Search...">
|
<input type="text" placeholder="Search...">
|
||||||
</div>
|
</div>
|
||||||
<a href="#">Auth / Settings</a> -->
|
<a href="#">Auth / Settings</a> -->
|
||||||
<div class="profile">Dp</div>
|
<!-- <div class="profile">Dp</div> -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -202,10 +205,10 @@
|
|||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
<a href="https://ozFrags.net">Other Communities</a>
|
<a href="https://ozFrags.net">Other Communities</a>
|
||||||
<a href="#">Terms of Service</a>
|
<a href="https://liberta.casa/rules.html">Terms of Service</a>
|
||||||
<a href="#">License: AGPL</a>
|
<a href="#">License: AGPLish</a>
|
||||||
<a href="#">Donate</a>
|
<a href="#">Contribute (WIP)</a>
|
||||||
<a href="ircs://irc.casa/#gibcasa">Support</a>
|
<a href="https://liberta.casa/gamja/#gibcasa">Support</a>
|
||||||
</footer>
|
</footer>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
<div class="game-grid" style="display: flex; flex-wrap: wrap; gap: 10px;">
|
<div class="game-grid" style="display: flex; flex-wrap: wrap; gap: 10px;">
|
||||||
{% for game in games %}
|
{% for game in games %}
|
||||||
<div class="game-box" style="width: 150px; text-align: center;">
|
<div class="game-box" style="width: 150px; text-align: center;">
|
||||||
<a href="{% url 'games' %}">
|
<a href="{% url 'game_detail' game.name %}">
|
||||||
<img src="{{ game.thumbnail.url }}" alt="{{ game.name }}" style="width: 100%; height: auto;">
|
<img src="{{ game.thumbnail.url }}" alt="{{ game.name }}" style="width: 100%; height: auto;">
|
||||||
<p>{{ game.name }}</p>
|
<p>{{ game.name }}</p>
|
||||||
</a>
|
</a>
|
||||||
|
@ -7,7 +7,7 @@ from . import views
|
|||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
path('', views.home, name='home'),
|
path('', views.home, name='home'),
|
||||||
path('games/', views.games, name='games'),
|
path('games/', views.games, name='games'),
|
||||||
path('games/<str:game>/', views.game_detail, name='game_detail'),
|
path('games/<str:game_name>/', views.game_detail, name='game_detail'),
|
||||||
# path('active-servers/', views.active_servers_view, name='active-servers'),
|
# path('active-servers/', views.active_servers_view, name='active-servers'),
|
||||||
# path('games/<str:game_name>/', views.game_servers_view, name='game-servers'),
|
# path('games/<str:game_name>/', views.game_servers_view, name='game-servers'),
|
||||||
]
|
]
|
||||||
|
@ -11,5 +11,6 @@ def games(request):
|
|||||||
return render(request, 'webpanel/games.html', {'games': games})
|
return render(request, 'webpanel/games.html', {'games': games})
|
||||||
|
|
||||||
def game_detail(request, game_name):
|
def game_detail(request, game_name):
|
||||||
game = get_object_or_404(Game, id=game_name)
|
print(f"Looking for game: {game_name}")
|
||||||
|
game = get_object_or_404(Game, name=game_name)
|
||||||
return render(request, 'webpanel/game_detail.html', {'game': game})
|
return render(request, 'webpanel/game_detail.html', {'game': game})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user