diff --git a/brutaldon/forms.py b/brutaldon/forms.py index bb9e8af..5b07b8a 100644 --- a/brutaldon/forms.py +++ b/brutaldon/forms.py @@ -7,3 +7,11 @@ class LoginForm(forms.Form): max_length=256) password = forms.CharField(widget=forms.PasswordInput()) +class SettingsForm(forms.Form): + fullbrutalism = forms.BooleanField(label="Use FULLBRUTALISM mode?", + required=False, + help_text= + """FULLBRUTALISM mode strips away most of the niceties of modern web design when + brutaldon is viewed in a graphical browser. It has no effect in text-only browsers.""") + + diff --git a/brutaldon/static/css/fullbrutalism.css b/brutaldon/static/css/fullbrutalism.css index bccac5e..e7b7672 100644 --- a/brutaldon/static/css/fullbrutalism.css +++ b/brutaldon/static/css/fullbrutalism.css @@ -172,11 +172,21 @@ img { .title { font-size: 3ex; font-weight: bold; + margin-top: 1ex; + margin-bottom: 1ex; } .subtitle { font-size: 1.5ex; font-weight: bold; + margin-top: 0.25ex; + margin-bottom: 0.25ex; } .toot { clear: both; } + +.box { + padding: 4px; + margin: 4px; + border: 8px ridge #CCC; +} diff --git a/brutaldon/templates/base.html b/brutaldon/templates/base.html index 4b21b58..549acd4 100644 --- a/brutaldon/templates/base.html +++ b/brutaldon/templates/base.html @@ -36,6 +36,7 @@ Federated diff --git a/brutaldon/templates/setup/settings.html b/brutaldon/templates/setup/settings.html new file mode 100644 index 0000000..7f182f7 --- /dev/null +++ b/brutaldon/templates/setup/settings.html @@ -0,0 +1,19 @@ +{% extends "base.html" %} +{% load widget_tweaks %} + +{% block content %} +

Settings

+
+ {% csrf_token %} +
+ +
+
+ +
+
+{% endblock %} diff --git a/brutaldon/urls.py b/brutaldon/urls.py index 21c95b4..f2e1fe5 100644 --- a/brutaldon/urls.py +++ b/brutaldon/urls.py @@ -26,5 +26,6 @@ urlpatterns = [ path('note', views.note, name='note'), path('local', views.local, name='local'), path('fed', views.fed, name='fed'), + path('settings', views.settings, name='settings'), path('', views.home), ] diff --git a/brutaldon/views.py b/brutaldon/views.py index 4002d20..6e6ab9b 100644 --- a/brutaldon/views.py +++ b/brutaldon/views.py @@ -1,6 +1,6 @@ from django.http import HttpResponse from django.shortcuts import render, redirect -from brutaldon.forms import LoginForm +from brutaldon.forms import LoginForm, SettingsForm from brutaldon.models import Client, Account from mastodon import Mastodon import datetime @@ -105,3 +105,15 @@ def local(request): def fed(request): return render(request, 'main/timeline.html', {'timeline': 'Federated'}) + +def settings(request): + if request.method == 'POST': + form = SettingsForm(request.POST) + if form.is_valid(): + request.session['fullbrutalism'] = form.cleaned_data['fullbrutalism'] + return redirect(home) + else: + return render(request, 'setup/settings.html', {'form' : form }) + else: + form = SettingsForm(request.session) + return render(request, 'setup/settings.html', { 'form': form })