Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Razzia settings menu #530

Draft
wants to merge 3 commits into
base: next
Choose a base branch
from
Draft
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
9 changes: 9 additions & 0 deletions razzia/templates/settings.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{% extends "admin/stregsystem/razzia/razzia.html" %}

{% block title %}{{razzia.name}} - Members{% endblock %}
{% block breadcrumbs %}<div class="breadcrumbs"><a href="../../">Hjem</a>&nbsp;&rsaquo;&nbsp;<a href="../">Razzia</a>&nbsp;&rsaquo;&nbsp;<a href=".">{{razzia.name}}</a>&nbsp;&rsaquo;&nbsp;Settings</div>{% endblock %}

{% block razzia_content %}
<p><a href="../{{razzia.pk}}">Back to razzia</a></p>
<iframe src="../razzia/{{razzia.id}}/change/?_popup=1" width="400px" height="500px"></iframe>
{% endblock %}
1 change: 1 addition & 0 deletions razzia/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
urlpatterns = [
re_path(r'^admin/razzia/(?P<razzia_id>\d+)/$', views.razzia, name="razzia_view"),
re_path(r'^admin/razzia/(?P<razzia_id>\d+)/members$', views.razzia_members, name="razzia_members_view"),
re_path(r'^admin/razzia/(?P<razzia_id>\d+)/settings$', views.razzia_settings, name="razzia_settings_view"),
re_path(r'^admin/razzia/$', views.razzia_menu, name="razzia_menu"),
re_path(r'^admin/razzia/new$', views.new_razzia, name="razzia_new"),
]
10 changes: 8 additions & 2 deletions razzia/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,19 @@ def razzia_menu(request, new_text=None, title=None):

@permission_required("stregreport.host_razzia")
def new_razzia(request):
razzia = Razzia(name="Foobar V2", turn_interval=datetime.timedelta(minutes=30))
razzia = Razzia(name="Foobar", turn_interval=datetime.timedelta(minutes=30))
razzia.save()

return redirect('razzia_view', razzia_id=razzia.pk)
return redirect('razzia_settings_view', razzia_id=razzia.pk)


@permission_required("stregreport.host_razzia")
def razzia_members(request, razzia_id, title=None):
razzia = get_object_or_404(Razzia, pk=razzia_id)
return render(request, 'members.html', locals())


@permission_required("stregreport.host_razzia")
def razzia_settings(request, razzia_id, title=None):
razzia = get_object_or_404(Razzia, pk=razzia_id)
return render(request, 'settings.html', locals())
Loading