aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xapps/anime/views.py6
-rwxr-xr-xapps/blog/urls.py1
-rwxr-xr-xapps/blog/views.py13
-rwxr-xr-xservices/stream/views.py5
-rwxr-xr-xtemplates/en/core/home.html4
-rwxr-xr-xtemplates/en/pagoda/home.html2
-rwxr-xr-xtemplates/en/pagoda/site_dashboard.html2
-rwxr-xr-xtemplates/en/pagoda/site_verification.html2
-rwxr-xr-xtemplates/ja/core/home.html4
-rwxr-xr-xtemplates/ja/pagoda/home.html2
-rwxr-xr-xtemplates/ja/pagoda/site_verification.html2
-rwxr-xr-xtemplates/partials/_footer.html (renamed from templates/shared/footer.html)0
-rwxr-xr-xtemplates/partials/_header.html (renamed from templates/shared/header.html)0
-rwxr-xr-xtemplates/partials/_left_sidebar.html (renamed from templates/shared/left_sidebar.html)0
-rwxr-xr-xtemplates/partials/_right_sidebar.html (renamed from templates/shared/right_sidebar.html)0
-rwxr-xr-xtemplates/partials/_weblog_list.html (renamed from templates/partials/weblog_list.html)4
-rwxr-xr-xtemplates/shared/administration/manage_storage_buckets_bucket.html (renamed from templates/en/administration/manage_storage_buckets_bucket.html)2
-rwxr-xr-xtemplates/shared/administration/manage_storage_buckets_home.html (renamed from templates/en/administration/manage_storage_buckets_home.html)2
-rwxr-xr-xtemplates/shared/anime/anime.html (renamed from templates/en/anime/anime.html)2
-rwxr-xr-xtemplates/shared/anime/home.html (renamed from templates/en/anime/home.html)2
-rwxr-xr-xtemplates/shared/anime/search.html (renamed from templates/en/anime/search.html)2
-rw-r--r--templates/shared/blog/single_weblog.html1
-rwxr-xr-xtemplates/shared/core/base.html (renamed from templates/shared/base.html)8
-rwxr-xr-xtemplates/shared/journals/single.html (renamed from templates/en/journals/single.html)2
-rwxr-xr-xtemplates/shared/my/journals.html (renamed from templates/en/core/my/journals.html)2
25 files changed, 43 insertions, 27 deletions
diff --git a/apps/anime/views.py b/apps/anime/views.py
index fe1e90dc..4ca9825d 100755
--- a/apps/anime/views.py
+++ b/apps/anime/views.py
@@ -222,7 +222,7 @@ def home(request):
sort="popularity", status="releasing", per_page=16
).get("results", []),
}
- return render(request, f"{LANGUAGE_CODE}/anime/home.html", context)
+ return render(request, f"shared/anime/home.html", context)
def search(request):
@@ -249,7 +249,7 @@ def search(request):
"total_pages": search_results.get("totalPages", 1),
"total_results": search_results.get("totalResults", 0),
}
- return render(request, f"{LANGUAGE_CODE}/anime/search.html", context)
+ return render(request, f"shared/anime/search.html", context)
def anime(request, anime_id, e=None):
@@ -313,6 +313,6 @@ def anime(request, anime_id, e=None):
return render(
request,
- f"{LANGUAGE_CODE}/anime/anime.html",
+ f"shared/anime/anime.html",
context,
)
diff --git a/apps/blog/urls.py b/apps/blog/urls.py
index 226fb9d9..093b745a 100755
--- a/apps/blog/urls.py
+++ b/apps/blog/urls.py
@@ -5,6 +5,7 @@ from .feed import RSSFeed
app_name = "weblog"
urlpatterns = [
+ path("<str:slug>/", views.single_post, name="single_post"),
# path("", views.home, name="home"),
# path("account", views.account, name="account"),
# path("register", views.register, name="register"),
diff --git a/apps/blog/views.py b/apps/blog/views.py
index 2ea99457..41610927 100755
--- a/apps/blog/views.py
+++ b/apps/blog/views.py
@@ -1,3 +1,16 @@
+from django.http import HttpResponseNotFound
+from django.shortcuts import render
+from apps.blog.models import Post
+
+
+def single_post(request, slug):
+ try:
+ post = Post.objects.get(slug=slug)
+ return render(request, "shared/blog/single_weblog.html", {"post": post})
+ except Post.DoesNotExist:
+ return HttpResponseNotFound()
+
+
# import hashlib
# import os
# import random
diff --git a/services/stream/views.py b/services/stream/views.py
index fb5158b2..516c3ba4 100755
--- a/services/stream/views.py
+++ b/services/stream/views.py
@@ -69,9 +69,10 @@ def stream_song(request, song_id: int) -> HttpResponse:
def anime_stream(request):
- url = request.GET.get("url")
if not request.user.is_authenticated:
- return HttpResponseForbidden()
+ return HttpResponseForbidden("Access not allowed")
+
+ url = request.GET.get("url")
if not str(url).endswith(".vtt"):
referrer = request.META.get("HTTP_REFERER")
diff --git a/templates/en/core/home.html b/templates/en/core/home.html
index 8075b6b1..5ecb7a2e 100755
--- a/templates/en/core/home.html
+++ b/templates/en/core/home.html
@@ -1,4 +1,4 @@
-{% extends 'shared/base.html' %}
+{% extends 'shared/core/base.html' %}
{% load static %}
{% block head %}
<link rel="stylesheet" href="{% static 'css/core/home.css' %}">
@@ -48,7 +48,7 @@
<div class="pamphlet pamphlet-banner"></div>
<h1 class="section-title">Contemplations of Late</h1>
<div class="recent-weblogs">
- {% include 'partials/weblog_list.html' with posts=recent_weblogs %}
+ {% include 'partials/_weblog_list.html' with posts=recent_weblogs %}
</div>
<h1 class="section-title">Recent Weeb Degenerecy</h1>
<div class="recent-anime">
diff --git a/templates/en/pagoda/home.html b/templates/en/pagoda/home.html
index 306dfe44..3a4d7dc9 100755
--- a/templates/en/pagoda/home.html
+++ b/templates/en/pagoda/home.html
@@ -1,4 +1,4 @@
-{% extends 'shared/base.html' %}
+{% extends 'shared/core/base.html' %}
{% load static %}
{% block head %}
<link rel="stylesheet" href="{% static 'css/pagoda/pagoda.css' %}">
diff --git a/templates/en/pagoda/site_dashboard.html b/templates/en/pagoda/site_dashboard.html
index a4344c26..ff8c24d0 100755
--- a/templates/en/pagoda/site_dashboard.html
+++ b/templates/en/pagoda/site_dashboard.html
@@ -1,4 +1,4 @@
-{% extends 'shared/base.html' %}
+{% extends 'shared/core/base.html' %}
{% load static %}
{% block head %}
{% endblock head %}
diff --git a/templates/en/pagoda/site_verification.html b/templates/en/pagoda/site_verification.html
index dd5e661d..3944859c 100755
--- a/templates/en/pagoda/site_verification.html
+++ b/templates/en/pagoda/site_verification.html
@@ -1,4 +1,4 @@
-{% extends 'shared/base.html' %}
+{% extends 'shared/core/base.html' %}
{% load static %}
{% block head %}
<style>
diff --git a/templates/ja/core/home.html b/templates/ja/core/home.html
index 6d566a93..3cd42785 100755
--- a/templates/ja/core/home.html
+++ b/templates/ja/core/home.html
@@ -1,4 +1,4 @@
-{% extends 'shared/base.html' %}
+{% extends 'shared/core/base.html' %}
{% load static %}
{% block head %}
<link rel="stylesheet" href="{% static 'css/core/home.css' %}">
@@ -48,7 +48,7 @@
<div class="pamphlet pamphlet-banner"></div>
<h1 class="section-title">最近の考察</h1>
<div class="recent-weblogs">
- {% include 'partials/weblog_list.html' with posts=recent_weblogs %}
+ {% include 'partials/_weblog_list.html' with posts=recent_weblogs %}
</div>
<h1 class="section-title">最近のアニメ活動</h1>
<div class="recent-anime">
diff --git a/templates/ja/pagoda/home.html b/templates/ja/pagoda/home.html
index e3388994..f64a1a14 100755
--- a/templates/ja/pagoda/home.html
+++ b/templates/ja/pagoda/home.html
@@ -1,4 +1,4 @@
-{% extends 'shared/base.html' %}
+{% extends 'shared/core/base.html' %}
{% load static %}
{% block head %}
<link rel="stylesheet" href="{% static 'css/pagoda/pagoda.css' %}">
diff --git a/templates/ja/pagoda/site_verification.html b/templates/ja/pagoda/site_verification.html
index 789b8372..0e1a3b5a 100755
--- a/templates/ja/pagoda/site_verification.html
+++ b/templates/ja/pagoda/site_verification.html
@@ -1,4 +1,4 @@
-{% extends 'shared/base.html' %}
+{% extends 'shared/core/base.html' %}
{% load static %}
{% block head %}
<style>
diff --git a/templates/shared/footer.html b/templates/partials/_footer.html
index 73dc174c..73dc174c 100755
--- a/templates/shared/footer.html
+++ b/templates/partials/_footer.html
diff --git a/templates/shared/header.html b/templates/partials/_header.html
index 13e2ab6d..13e2ab6d 100755
--- a/templates/shared/header.html
+++ b/templates/partials/_header.html
diff --git a/templates/shared/left_sidebar.html b/templates/partials/_left_sidebar.html
index 878fb399..878fb399 100755
--- a/templates/shared/left_sidebar.html
+++ b/templates/partials/_left_sidebar.html
diff --git a/templates/shared/right_sidebar.html b/templates/partials/_right_sidebar.html
index 1c9375cd..1c9375cd 100755
--- a/templates/shared/right_sidebar.html
+++ b/templates/partials/_right_sidebar.html
diff --git a/templates/partials/weblog_list.html b/templates/partials/_weblog_list.html
index f166610e..75817b3d 100755
--- a/templates/partials/weblog_list.html
+++ b/templates/partials/_weblog_list.html
@@ -9,7 +9,7 @@
</div>
<div class="post-content">
<h2>
- <a href="#">{% if request.LANGUAGE_CODE == 'ja' %}{{ post.title_ja }}{% else %}{{ post.title }}{% endif %}</a>
+ <a href="{% url "weblog:single_post" post.slug %}">{% if request.LANGUAGE_CODE == 'ja' %}{{ post.title_ja }}{% else %}{{ post.title }}{% endif %}</a>
</h2>
<div class="author-info">
{% with post.author.userprofile_set.first as authorprofile %}
@@ -26,7 +26,7 @@
</div>
<div class="post-actions">
<div class="post-links">
- <a href="#">{% if request.LANGUAGE_CODE == 'ja' %}続きを読む{% else %}Continue Reading{% endif %}</a> |
+ <a href="{% url "weblog:single_post" post.slug %}">{% if request.LANGUAGE_CODE == 'ja' %}続きを読む{% else %}Continue Reading{% endif %}</a> |
<a href="##comments">{{ post.num_comments }}
{% if request.LANGUAGE_CODE == 'ja' %}
コメント
diff --git a/templates/en/administration/manage_storage_buckets_bucket.html b/templates/shared/administration/manage_storage_buckets_bucket.html
index 13ce36a5..0c6f9268 100755
--- a/templates/en/administration/manage_storage_buckets_bucket.html
+++ b/templates/shared/administration/manage_storage_buckets_bucket.html
@@ -1,4 +1,4 @@
-{% extends 'shared/base.html' %}
+{% extends 'shared/core/base.html' %}
{% load static %}
{% block head %}
<link rel="stylesheet" href="{% static 'css/shared/directory.css' %}">
diff --git a/templates/en/administration/manage_storage_buckets_home.html b/templates/shared/administration/manage_storage_buckets_home.html
index 90bed85b..ceffea44 100755
--- a/templates/en/administration/manage_storage_buckets_home.html
+++ b/templates/shared/administration/manage_storage_buckets_home.html
@@ -1,4 +1,4 @@
-{% extends 'shared/base.html' %}
+{% extends 'shared/core/base.html' %}
{% load static %}
{% block head %}
<link rel="stylesheet" href="{% static 'css/shared/directory.css' %}">
diff --git a/templates/en/anime/anime.html b/templates/shared/anime/anime.html
index 2f9d5cf3..8cacd20a 100755
--- a/templates/en/anime/anime.html
+++ b/templates/shared/anime/anime.html
@@ -1,4 +1,4 @@
-{% extends 'shared/base.html' %}
+{% extends 'shared/core/base.html' %}
{% load static %}
{% block head %}
diff --git a/templates/en/anime/home.html b/templates/shared/anime/home.html
index a35c8b82..17741ed7 100755
--- a/templates/en/anime/home.html
+++ b/templates/shared/anime/home.html
@@ -1,4 +1,4 @@
-{% extends 'shared/base.html' %}
+{% extends 'shared/core/base.html' %}
{% load static %}
{% block head %}
<link rel="stylesheet" href="{% static 'css/anime/anime.css' %}">
diff --git a/templates/en/anime/search.html b/templates/shared/anime/search.html
index 9b489e25..7bd7ffcf 100755
--- a/templates/en/anime/search.html
+++ b/templates/shared/anime/search.html
@@ -1,4 +1,4 @@
-{% extends 'shared/base.html' %}
+{% extends 'shared/core/base.html' %}
{% load static %}
{% load pagination %}
{% block head %}
diff --git a/templates/shared/blog/single_weblog.html b/templates/shared/blog/single_weblog.html
new file mode 100644
index 00000000..b82c7f24
--- /dev/null
+++ b/templates/shared/blog/single_weblog.html
@@ -0,0 +1 @@
+{% extends "shared/core/base.html" %} \ No newline at end of file
diff --git a/templates/shared/base.html b/templates/shared/core/base.html
index c943cfa6..f1c5f2cd 100755
--- a/templates/shared/base.html
+++ b/templates/shared/core/base.html
@@ -30,10 +30,10 @@
</video>
<div id="video-overlay"></div>
<div id="body-wrapper">
- {% include 'shared/header.html' %}
+ {% include 'partials/_header.html' %}
<div id="content-wrapper">
<div id="left-sidebar" {% if user.is_authenticated %}style="border-top-left-radius: 0px;"{% endif %}>
- {% include 'shared/left_sidebar.html' %}
+ {% include 'partials/_left_sidebar.html' %}
</div>
<div id="main-content">
{% block content %}
@@ -41,11 +41,11 @@
{% endblock %}
</div>
<div id="right-sidebar">
- {% include 'shared/right_sidebar.html' %}
+ {% include 'partials/_right_sidebar.html' %}
</div>
</div>
<div id="footer">
- {% include 'shared/footer.html' %}
+ {% include 'partials/_footer.html' %}
</div>
</div>
<div id="scanlines"></div>
diff --git a/templates/en/journals/single.html b/templates/shared/journals/single.html
index 084fea44..045c33df 100755
--- a/templates/en/journals/single.html
+++ b/templates/shared/journals/single.html
@@ -1,4 +1,4 @@
-{% extends 'shared/base.html' %}
+{% extends 'shared/core/base.html' %}
{% load static %}
{% block head %}
<style>
diff --git a/templates/en/core/my/journals.html b/templates/shared/my/journals.html
index b265aed8..846d9cad 100755
--- a/templates/en/core/my/journals.html
+++ b/templates/shared/my/journals.html
@@ -1,4 +1,4 @@
-{% extends 'shared/base.html' %}
+{% extends 'shared/core/base.html' %}
{% load static %}
{% block head %}
<style>