Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions snowsune/templates/munch_maker.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{% extends "base.html" %}
{% load static %}

{% block title %}Munch Maker{% endblock %}

{% block meta_description %}FILL ME OUT{% endblock %}
{% block og_title %}Munch Maker{% endblock %}
{% block og_description %}FILL ME OUT LATER{% endblock %}
{% block canonical_url %}https://snowsune.net/MunchMaker/{% endblock %}

{% block extra_css %}
<link rel="stylesheet" href="{% static 'css/munch_maker.css' %}">
{% endblock %}

{% block content %}
<div class="munch-page">
<div class="munch-toolbar">
<h1>Munch Maker</h1>
<a class="munch-toolbar-link"
href="https://git.kitsunehosting.net/snowsune/VoreGamePrototype/releases"
target="_blank" rel="noopener noreferrer">Play on Linux</a>
</div>
<iframe class="munch-frame" src="/godot/index.html" title="Munch Maker"
allow="autoplay; fullscreen; gamepad; pointer-lock"></iframe>
</div>
{% endblock %}
18 changes: 10 additions & 8 deletions snowsune/templates/tools.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,15 @@ <h3>Django admin</h3>
<section class="tools-section tools-section-nsfw" aria-label="NSFW tools">
<h2>NSFW</h2>
<div class="tools-grid">
<!-- Munch Maker -->
<div class="tool-card">
<div class="tool-content">
<h3>Munch Maker</h3>
<p>Still not sold on the name~ Play the prototype and let me know what you think!</p>
<a href="{% url 'munch_maker' %}" class="tool-button">Play Munch Maker</a>
</div>
</div>

<!-- VorePageEditor -->
<div class="tool-card">
<div class="tool-content">
Expand Down Expand Up @@ -187,18 +196,11 @@ <h3>Staff</h3>
<div class="sidebar-section">
<h3>NSFW</h3>
<ul class="sidebar-links">
<li><a href="{% url 'munch_maker' %}">Munch Maker</a></li>
<li><a href="{% url 'tanks_manager:hub' %}">VorePageEditor</a></li>
{% for site in tanks_owned %}
<li><a href="{% url 'tanks_manager:edit' site.slug %}">{{ site.character_name|default:site.slug }}</a></li>
{% endfor %}
{% if not tanks_owned %}
<li>
<form method="post" action="{% url 'tanks_manager:create' %}" class="tools-sidebar-create-form">
{% csrf_token %}
<button type="submit" class="tool-button">Create tank page</button>
</form>
</li>
{% endif %}
<li><a href="https://booru.snowsune.net/" target="_blank" rel="noopener noreferrer">BixiBooru Image Board</a></li>

</ul>
Expand Down
25 changes: 25 additions & 0 deletions snowsune/tests/test_views.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
from django.contrib.auth import get_user_model
from django.test import TestCase
from django.urls import reverse

User = get_user_model()


class MainPageTests(TestCase):
def test_home_page_loads(self):
Expand All @@ -12,6 +15,28 @@ def test_tools_page_loads(self):
"""Test that the tools/apps page loads successfully."""
response = self.client.get(reverse("tools"))
self.assertEqual(response.status_code, 200)
self.assertNotContains(response, "Munch Maker")

def test_munch_maker_requires_login(self):
response = self.client.get(reverse("munch_maker"))
self.assertEqual(response.status_code, 302)
self.assertIn("/login/", response.url)

def test_munch_maker_page_for_logged_in_user(self):
user = User.objects.create_user(username="munch", password="testpass123")
self.client.force_login(user)
response = self.client.get(reverse("munch_maker"))
self.assertEqual(response.status_code, 200)
self.assertContains(response, 'src="/godot/index.html"')
self.assertContains(
response,
"https://git.kitsunehosting.net/snowsune/VoreGamePrototype/releases",
)
self.assertContains(response, "Play on Linux")

tools = self.client.get(reverse("tools"))
self.assertContains(tools, "Munch Maker")
self.assertContains(tools, reverse("munch_maker"))

def test_characters_page_loads(self):
"""Test that the characters page loads successfully."""
Expand Down
2 changes: 2 additions & 0 deletions snowsune/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from django.conf.urls.static import static

from snowsune.views.home import HomeView
from snowsune.views.munch_maker import MunchMakerView
from snowsune.views.projects import ProjectsView
from snowsune.views.tools import ToolsView
from snowsune.views.live_status import live_status_view
Expand All @@ -27,6 +28,7 @@
path("", HomeView.as_view(), name="home"),
path("projects/", ProjectsView.as_view(), name="projects"),
path("tools/", ToolsView.as_view(), name="tools"),
path("MunchMaker/", MunchMakerView.as_view(), name="munch_maker"),
path("calendar/", CalendarView.as_view(), name="calendar"),
path("thank-you/", thank_you_view, name="thank_you"),
path("tos/", TemplateView.as_view(template_name="tos.html"), name="tos"),
Expand Down
6 changes: 6 additions & 0 deletions snowsune/views/munch_maker.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.contrib.auth.mixins import LoginRequiredMixin
from django.views.generic import TemplateView


class MunchMakerView(LoginRequiredMixin, TemplateView):
template_name = "munch_maker.html"
96 changes: 96 additions & 0 deletions static/css/munch_maker.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
/* Keep the site chrome, and give every leftover pixel to the game. */
body {
box-sizing: border-box;
margin: 0;
height: 100dvh;
overflow: hidden;
display: flex;
flex-direction: column;
}

.header,
.footer,
.email-verification-banner {
flex: 0 0 auto;
margin-bottom: 0;
}

.main-layout {
flex: 1 1 auto;
min-height: 0;
margin-bottom: 0;
}

.footer {
margin-bottom: 0;
}

/* The global link sidebar just steals width from the canvas. */
.sidebar {
display: none;
}

.content {
flex: 1;
width: auto;
max-width: none;
min-height: 0;
margin: 0;
padding: 0;
overflow: hidden;
background: #000;
display: flex;
flex-direction: column;
}

.munch-page {
flex: 1 1 auto;
min-height: 0;
display: flex;
flex-direction: column;
}

.munch-toolbar {
display: flex;
align-items: center;
justify-content: space-between;
gap: 1rem;
padding: 0.55rem 0.9rem;
background: var(--tile-background);
color: var(--text-color);
}

.munch-toolbar h1 {
margin: 0;
font-size: 1.15rem;
}

.munch-toolbar-link {
display: inline-block;
background: var(--accent-color);
color: var(--invert-text-color);
padding: 0.45rem 0.9rem;
text-decoration: none;
border-radius: 8px;
font-weight: 600;
border: 2px solid var(--accent-color);
white-space: nowrap;
}

.munch-toolbar-link:visited {
color: var(--invert-text-color);
}

.munch-toolbar-link:hover {
background: var(--accent-hover);
border-color: var(--accent-hover);
}

.munch-frame {
flex: 1 1 auto;
width: 100%;
min-height: 0;
border: 0;
background: #000;
display: block;
}
10 changes: 0 additions & 10 deletions static/css/tools.css
Original file line number Diff line number Diff line change
Expand Up @@ -201,16 +201,6 @@
line-height: 1.45;
}

.tools-sidebar-create-form {
margin: 0;
}

.tools-sidebar-create-form .tool-button {
width: 100%;
box-sizing: border-box;
text-align: center;
}

/* Responsive Bits */
@media (max-width: 768px) {
.tools-container {
Expand Down
Loading