diff --git a/src/teams/migrations/0019_team_guide.py b/src/teams/migrations/0050_team_guide.py similarity index 77% rename from src/teams/migrations/0019_team_guide.py rename to src/teams/migrations/0050_team_guide.py index b1bc29af..59375bd5 100644 --- a/src/teams/migrations/0019_team_guide.py +++ b/src/teams/migrations/0050_team_guide.py @@ -1,6 +1,4 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2017-11-25 21:32 -from __future__ import unicode_literals +# Generated by Django 2.1.5 on 2019-03-12 10:00 from django.db import migrations, models @@ -8,7 +6,7 @@ from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ - ('teams', '0018_auto_20171122_2204'), + ('teams', '0049_auto_20180815_1119'), ] operations = [ diff --git a/src/teams/models.py b/src/teams/models.py index 99b6451e..cd68054d 100644 --- a/src/teams/models.py +++ b/src/teams/models.py @@ -15,23 +15,23 @@ logger = logging.getLogger("bornhack.%s" % __name__) TEAM_GUIDE_TEMPLATE=""" -# Preparations +## Preparations ... -# Camp setup +## Camp setup ... -# During camp +## During camp ... -# Takedown +## Takedown ... -# Notes for next year +## Notes for next year 1. Remember to take notes 1. ... diff --git a/src/teams/templates/team_guide.html b/src/teams/templates/team_guide.html index 706c7ba5..283bcf38 100644 --- a/src/teams/templates/team_guide.html +++ b/src/teams/templates/team_guide.html @@ -1,25 +1,37 @@ -{% extends 'base.html' %} +{% extends 'team_base.html' %} {% load commonmark %} {% block title %} Guide for: {{ team.name }} | {{ block.super }} {% endblock %} -{% block content %} +{% block team_content %} -

Guide / Howto for {{ team.name }}

+
+
+

+ Guide / Howto for {{ team.name }} +

+ + Print + +
+
+

+ {% if request.user in team.responsible.all %} + Edit + {% endif %} +

-

-Print -{% if request.user in team.responsible.all %} - Edit -{% endif %} -

- -
-{{ team.guide|unsafecommonmark }} +
+ {{ team.guide|untrustedcommonmark }} +
+
+ {% endblock %} diff --git a/src/teams/templates/team_guide_print.html b/src/teams/templates/team_guide_print.html index ad967177..8d681d65 100644 --- a/src/teams/templates/team_guide_print.html +++ b/src/teams/templates/team_guide_print.html @@ -1,10 +1,11 @@ -{% load commonmark %} +{% load commonmark %} + {{ team.name }} -{{ team.guide|unsafecommonmark }} +{{ team.guide|untrustedcommonmark }} diff --git a/src/teams/urls.py b/src/teams/urls.py index cf40e0c3..55d13a36 100644 --- a/src/teams/urls.py +++ b/src/teams/urls.py @@ -40,6 +40,11 @@ from teams.views.shifts import ( UserShifts, ) +from teams.views.guide import ( + TeamGuideView, + TeamGuidePrintView +) + app_name = 'teams' urlpatterns = [ diff --git a/src/teams/views/base.py b/src/teams/views/base.py index ee5c7c77..cf52084b 100644 --- a/src/teams/views/base.py +++ b/src/teams/views/base.py @@ -46,7 +46,7 @@ class TeamManageView(CampViewMixin, EnsureTeamResponsibleMixin, UpdateView): fields = ['description', 'needs_members', 'public_irc_channel_name', 'public_irc_channel_bot', 'public_irc_channel_managed', 'private_irc_channel_name', 'private_irc_channel_bot', - 'private_irc_channel_managed'] + 'private_irc_channel_managed', 'guide'] slug_url_kwarg = 'team_slug' def get_success_url(self): diff --git a/src/teams/views/guide.py b/src/teams/views/guide.py index f62124e3..07fdc916 100644 --- a/src/teams/views/guide.py +++ b/src/teams/views/guide.py @@ -3,7 +3,7 @@ from django.views.generic import ListView, DetailView from camps.mixins import CampViewMixin -from .models import Team +from ..models import Team class TeamGuideView(LoginRequiredMixin, CampViewMixin, DetailView): @@ -11,6 +11,7 @@ class TeamGuideView(LoginRequiredMixin, CampViewMixin, DetailView): context_object_name = 'team' model = Team slug_url_kwarg = 'team_slug' + active_menu = 'guide' def get_queryset(self): qs = CampViewMixin.get_queryset(self)