diff --git a/quest/migrations/0003_quest_anon_name.py b/quest/migrations/0003_quest_anon_name.py
new file mode 100644
index 0000000..afe5371
--- /dev/null
+++ b/quest/migrations/0003_quest_anon_name.py
@@ -0,0 +1,18 @@
+# Generated by Django 2.1.1 on 2018-09-21 16:50
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('quest', '0002_auto_20180905_1344'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='quest',
+ name='anon_name',
+ field=models.CharField(default='Anonymous', max_length=20),
+ ),
+ ]
diff --git a/quest/models.py b/quest/models.py
index e9a4a5c..74e7257 100644
--- a/quest/models.py
+++ b/quest/models.py
@@ -14,6 +14,7 @@ class Quest(models.Model):
owner = models.ForeignKey(
settings.AUTH_USER_MODEL,
on_delete=models.CASCADE)
+ anon_name = models.CharField(max_length=20, default="Anonymous")
class Message(models.Model):
diff --git a/quest/static/quest.js b/quest/static/quest.js
index dfdd152..479fdc3 100644
--- a/quest/static/quest.js
+++ b/quest/static/quest.js
@@ -50,7 +50,7 @@ function load() {
/* Websocket receive */
socket.events['message'] = function(data) {
let msg_str = '
';
- msg_str = '
';
diff --git a/quest/views.py b/quest/views.py
index a73fcb9..9edcb89 100644
--- a/quest/views.py
+++ b/quest/views.py
@@ -6,6 +6,7 @@ from django.shortcuts import render, redirect
from django.http import HttpResponse
from .models import Quest, DiceRoll, PollOption, PollVote, PageTitle
+from .forms import EditQuest
def index(request):
"""
@@ -38,7 +39,13 @@ def edit_quest(request, quest_id, page_num=1):
if quest.owner != request.user:
return redirect('quest:quest', quest_id=quest_id, page_num=page_num)
if request.method == 'POST':
- pass
+ form = EditQuest(request.POST)
+ if form.is_valid():
+ quest.anon_name = form.cleaned_data['anon_name']
+ quest.save()
+ return redirect('quest:quest',quest_id=quest.id, page_num=page_num)
+ else:
+ messages.error(request, "Error")
else:
pass
context = locals()
diff --git a/todo b/todo
index 15654be..4f136c5 100644
--- a/todo
+++ b/todo
@@ -2,18 +2,15 @@ New Features:
Pages/appendixes
Live indicator/countdown
Notifications
-Anonymous names
Banner images
Search page
Front page to show new quests
Webm posting
(you) counter
-Enable namefagging
Account managament/logout
Display profile link in header bar
Tagging system
Quote backlinks
-Make chat hideable
Improvements:
More options for text posts (lists and so on)