diff --git a/ietf/meeting/tests_views.py b/ietf/meeting/tests_views.py index 4012c398a..d829997f3 100644 --- a/ietf/meeting/tests_views.py +++ b/ietf/meeting/tests_views.py @@ -271,6 +271,17 @@ class MeetingTests(TestCase): self.assertTrue(row.find('a:contains("Slideshow")')) self.assertFalse(row.find("a:contains(\"Bad Slideshow\")")) + # test with a loggged-in wg chair + self.client.login(username="marschairman", password="marschairman+password") + r = self.client.get(urlreverse("ietf.meeting.views.materials", kwargs=dict(num=meeting.number))) + self.assertEqual(r.status_code, 200) + q = PyQuery(r.content) + row = q('#content td div:contains("%s")' % str(session.group.acronym)).closest("tr") + self.assertTrue(row.find('a:contains("Agenda")')) + self.assertTrue(row.find('a:contains("Minutes")')) + self.assertTrue(row.find('a:contains("Slideshow")')) + self.assertFalse(row.find("a:contains(\"Bad Slideshow\")")) + self.assertTrue(row.find('a:contains("Edit materials")')) # FIXME: missing tests of .pdf/.tar generation (some code can # probably be lifted from similar tests in iesg/tests.py) diff --git a/ietf/templates/meeting/edit_materials_button.html b/ietf/templates/meeting/edit_materials_button.html index 70dea65d0..467ab051a 100644 --- a/ietf/templates/meeting/edit_materials_button.html +++ b/ietf/templates/meeting/edit_materials_button.html @@ -1,6 +1,9 @@ {% load ietf_filters session_filters %} {% if session|can_manage_materials:user and not session.past_cutoff_date %} {% with gt=session.group.type_id %} +{%comment%} Edit +{%endcomment%} + Edit materials {% endwith %} {% endif %} diff --git a/ietf/templates/meeting/group_materials.html b/ietf/templates/meeting/group_materials.html index 9ab1bb631..9c1898d4f 100644 --- a/ietf/templates/meeting/group_materials.html +++ b/ietf/templates/meeting/group_materials.html @@ -1,5 +1,5 @@ {# Copyright The IETF Trust 2015, All Rights Reserved #}{% load origin %}{% origin %} -{% load ietf_filters proceedings_filters %} +{% load ietf_filters proceedings_filters managed_groups %} {% comment %} @@ -8,9 +8,9 @@ {% endcomment %} {% if session.name %} -
{{ session.name }}{% include "meeting/edit_materials_button.html" %}
+
{{ session.name }}
{% else %} -
{{session.group.acronym}}{% include "meeting/edit_materials_button.html" %}
+
{{session.group.acronym}}
{% if session.group.state.slug == "bof" %} {{ session.group.state.slug|upper }} {% endif %} @@ -18,7 +18,11 @@ {% if session.status_id == 'canceled' %} - Session cancelled + {% if user and user.is_authenticated and user|managed_groups %} + Session cancelled + {% else %} + Session cancelled + {% endif %} {% else %} {% if session.agenda %} @@ -57,6 +61,11 @@ {% endfor %} {% endwith %} + {% if user and user.is_authenticated and user|managed_groups %} + +
{% include "meeting/edit_materials_button.html" %}
+ + {% endif %} {% endif %} diff --git a/ietf/templates/meeting/materials.html b/ietf/templates/meeting/materials.html index ceaa6d812..17ec8f543 100644 --- a/ietf/templates/meeting/materials.html +++ b/ietf/templates/meeting/materials.html @@ -2,7 +2,7 @@ {# Copyright The IETF Trust 2015, All Rights Reserved #} {% load origin %} -{% load ietf_filters staticfiles %} +{% load ietf_filters staticfiles managed_groups %} {% block pagehead %} @@ -40,11 +40,20 @@ - - - - - + {% if user and user.is_authenticated and user|managed_groups %} + + + + + + + {% else %} + + + + + + {% endif %} @@ -63,11 +72,20 @@
GroupAgendaMinutesSlidesDraftsGroupAgendaMinutesSlidesDrafts GroupAgendaMinutesSlidesDrafts
- - - - - + {% if user and user.is_authenticated and user|managed_groups %} + + + + + + + {% else %} + + + + + + {% endif %} @@ -88,11 +106,20 @@
GroupAgendaMinutesSlidesDraftsGroupAgendaMinutesSlidesDrafts GroupAgendaMinutesSlidesDrafts
- - - - - + {% if user and user.is_authenticated and user|managed_groups %} + + + + + + + {% else %} + + + + + + {% endif %} @@ -113,11 +140,20 @@
GroupAgendaMinutesSlidesDraftsGroupAgendaMinutesSlidesDrafts GroupAgendaMinutesSlidesDrafts
- - - - - + {% if user and user.is_authenticated and user|managed_groups %} + + + + + + + {% else %} + + + + + + {% endif %} @@ -137,11 +173,20 @@
GroupAgendaMinutesSlidesDraftsGroupAgendaMinutesSlidesDrafts GroupAgendaMinutesSlidesDrafts
- - - - - + {% if user and user.is_authenticated and user|managed_groups %} + + + + + + + {% else %} + + + + + + {% endif %}
GroupAgendaMinutesSlidesDraftsGroupAgendaMinutesSlidesDrafts GroupAgendaMinutesSlidesDrafts