Removed links to the old MHonArc mail archives, and related view.
- Legacy-Id: 16179
This commit is contained in:
parent
0dbf3654e9
commit
5def83ef16
|
@ -1,8 +1,6 @@
|
|||
import os
|
||||
from unittest import skipIf
|
||||
|
||||
from pyquery import PyQuery
|
||||
|
||||
from django.conf import settings
|
||||
from django.urls import reverse as urlreverse
|
||||
from django.db.models import Q
|
||||
|
@ -152,27 +150,3 @@ class GroupRoleEmailTests(TestCase):
|
|||
for item in emails:
|
||||
self.assertIn('@', item)
|
||||
|
||||
class GroupDerivedArchiveTests(TestCase):
|
||||
|
||||
def test_group_with_mailarch(self):
|
||||
group = GroupFactory()
|
||||
group.list_archive = 'https://mailarchive.ietf.org/arch/browse/%s/'%group.acronym
|
||||
group.save()
|
||||
url = urlreverse("ietf.group.views.derived_archives",kwargs=dict(acronym=group.acronym))
|
||||
r = self.client.get(url)
|
||||
self.assertEqual(r.status_code, 200)
|
||||
q = PyQuery(r.content)
|
||||
self.assertEqual(url, q('.nav-tabs .active a')[0].attrib['href'])
|
||||
self.assertTrue(group.list_archive in unicontent(r))
|
||||
self.assertTrue('web/%s/current'%group.acronym in unicontent(r))
|
||||
|
||||
def test_group_without_mailarch(self):
|
||||
group = GroupFactory()
|
||||
group.list_archive = 'https://alienarchive.example.com'
|
||||
group.save()
|
||||
url = urlreverse("ietf.group.views.derived_archives",kwargs=dict(acronym=group.acronym))
|
||||
r = self.client.get(url)
|
||||
self.assertEqual(r.status_code, 200)
|
||||
q = PyQuery(r.content)
|
||||
self.assertFalse(q('.nav-tabs .active'))
|
||||
self.assertTrue(group.list_archive in unicontent(r))
|
||||
|
|
|
@ -38,7 +38,6 @@ info_detail_urls = [
|
|||
url(r'^materials/$', views.materials),
|
||||
url(r'^materials/new/$', material_views.choose_material_type),
|
||||
url(r'^materials/new/(?P<doc_type>[\w-]+)/$', material_views.edit_material, { 'action': "new" }, 'ietf.doc.views_material.edit_material'),
|
||||
url(r'^archives/$', views.derived_archives),
|
||||
url(r'^photos/$', views.group_photos),
|
||||
url(r'^reviews/$', views.review_requests),
|
||||
url(r'^reviews/manage/(?P<assignment_status>unassigned)/$', views.manage_review_requests),
|
||||
|
|
|
@ -195,10 +195,7 @@ def construct_group_menu_context(request, group, selected, group_type, others):
|
|||
entries.append(("Photos", urlreverse("ietf.group.views.group_photos", kwargs=kwargs)))
|
||||
entries.append(("Email expansions", urlreverse("ietf.group.views.email", kwargs=kwargs)))
|
||||
if group.list_archive.startswith("http:") or group.list_archive.startswith("https:") or group.list_archive.startswith("ftp:"):
|
||||
if 'mailarchive.ietf.org' in group.list_archive:
|
||||
entries.append(("List archive", urlreverse("ietf.group.views.derived_archives", kwargs=kwargs)))
|
||||
else:
|
||||
entries.append((mark_safe("List archive »"), group.list_archive))
|
||||
entries.append((mark_safe("List archive »"), group.list_archive))
|
||||
if group.has_tools_page():
|
||||
entries.append((mark_safe("Tools »"), "https://tools.ietf.org/%s/%s/" % (group.type_id, group.acronym)))
|
||||
|
||||
|
|
|
@ -757,26 +757,6 @@ def meetings(request, acronym=None, group_type=None):
|
|||
'can_edit':can_edit,
|
||||
}))
|
||||
|
||||
def derived_archives(request, acronym=None, group_type=None):
|
||||
group = get_group_or_404(acronym,group_type) if acronym else None
|
||||
|
||||
list_acronym = None
|
||||
|
||||
m = re.search('mailarchive.ietf.org/arch/search/?\?email_list=([-\w]+)\Z',group.list_archive)
|
||||
if m:
|
||||
list_acronym=m.group(1)
|
||||
|
||||
if not list_acronym:
|
||||
m = re.search('mailarchive.ietf.org/arch/browse/([-\w]+)/?\Z',group.list_archive)
|
||||
if m:
|
||||
list_acronym=m.group(1)
|
||||
|
||||
return render(request, 'group/derived_archives.html',
|
||||
construct_group_menu_context(request, group, "list archive", group_type, {
|
||||
'group':group,
|
||||
'list_acronym':list_acronym,
|
||||
}))
|
||||
|
||||
def chair_photos(request, group_type=None):
|
||||
roles = sorted(Role.objects.filter(group__type=group_type, group__state='active', name_id='chair'),key=lambda x: x.person.last_name()+x.person.name+x.group.acronym)
|
||||
for role in roles:
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
{% extends "group/group_base.html" %}
|
||||
{# Copyright The IETF Trust 2016, All Rights Reserved #}
|
||||
{% load origin %}
|
||||
|
||||
{% block title %}Archives{% if group %} for {{group.acronym}}{% endif %}{% endblock %}
|
||||
|
||||
{% block group_content %}
|
||||
{% origin %}
|
||||
|
||||
{% if list_acronym %}
|
||||
|
||||
<div class="row">
|
||||
<span class="col-xs-4 col-sm-3 col-md-2"><strong>Mailarchive</strong></span><span class="col-xs-8 col-sm-9 col-md-10"><a href="{{group.list_archive}}">{{group.list_archive}}</a></span>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<span class="col-xs-4 col-sm-3 col-md-2"><strong>Mhonarc</strong></span><span class="col-xs-8 col-sm-9 col-md-10"><a href="https://www.ietf.org/mail-archive/web/{{list_acronym}}/current/maillist.html">https://www.ietf.org/mail-archive/web/{{list_acronym}}/current/maillist.html</a></span>
|
||||
</div>
|
||||
|
||||
{% else %}
|
||||
<div class="row">
|
||||
<strong class="col-xs-4 col-sm-3 col-md-2">Archive</strong><span class="col-xs-8 col-sm-9 col-md-10"><a href="{{group.list_archive}}">{{group.list_archive}}</a></span>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
Loading…
Reference in a new issue