.+)$', 'url_login'),
url(r'^testemail/$', 'test_email'),
url(r'^create/$', 'create_account', name='create_account'),
diff --git a/ietf/secr/groups/views.py b/ietf/secr/groups/views.py
index feb55d6c1..be14d3fb2 100644
--- a/ietf/secr/groups/views.py
+++ b/ietf/secr/groups/views.py
@@ -5,7 +5,7 @@ from django.shortcuts import render_to_response, get_object_or_404, redirect
from django.template import RequestContext
from ietf.group.models import Group, GroupMilestone, ChangeStateGroupEvent, GroupEvent, GroupURL, Role
-from ietf.group.utils import save_group_in_history, get_charter_text
+from ietf.group.utils import save_group_in_history, get_charter_text, setup_default_community_list_for_group
from ietf.ietfauth.utils import role_required
from ietf.person.models import Person
from ietf.secr.groups.forms import GroupModelForm, GroupMilestoneForm, RoleForm, SearchForm
@@ -102,6 +102,9 @@ def add(request):
awp.group = group
awp.save()
+ if group.features.has_documents:
+ setup_default_community_list_for_group(group)
+
# create GroupEvent(s)
# always create started event
ChangeStateGroupEvent.objects.create(group=group,
diff --git a/ietf/static/ietf/css/ietf.css b/ietf/static/ietf/css/ietf.css
index 21ebd7f27..2aacf362b 100644
--- a/ietf/static/ietf/css/ietf.css
+++ b/ietf/static/ietf/css/ietf.css
@@ -448,3 +448,14 @@ form.navbar-form input.form-control.input-sm { width: 141px; }
padding: inherit;
outline: inherit;
}
+
+/* Community lists */
+
+label#list-feeds {
+ display: inline-block;
+ font-weight: normal;
+}
+
+.email-subscription button[type=submit] {
+ margin-left: 3em;
+}
diff --git a/ietf/static/ietf/js/ietf.js b/ietf/static/ietf/js/ietf.js
index f40e3a5b7..709ec3374 100644
--- a/ietf/static/ietf/js/ietf.js
+++ b/ietf/static/ietf/js/ietf.js
@@ -100,24 +100,20 @@ $(document).ready(function () {
}
// search results
- $('.community-list-add-remove-doc').click(function(e) {
+ $('.track-untrack-doc').click(function(e) {
e.preventDefault();
- var trigger = $(this);
- $.ajax({
+ var trigger = $(this);
+ $.ajax({
url: trigger.attr('href'),
- type: 'GET',
+ type: 'POST',
cache: false,
dataType: 'json',
success: function(response){
if (response.success) {
- trigger.parent().find(".tooltip").remove();
- trigger.find("span.fa").toggleClass("fa-bookmark fa-bookmark-o");
- if (trigger.hasClass('btn')) {
- trigger.attr('disabled', true).blur();
- } else {
- trigger.contents().unwrap().blur();
+ trigger.parent().find(".tooltip").remove();
+ trigger.addClass("hide");
+ trigger.parent().find(".track-untrack-doc").not(trigger).removeClass("hide");
}
- }
}
});
});
diff --git a/ietf/static/ietf/js/manage-community-list.js b/ietf/static/ietf/js/manage-community-list.js
new file mode 100644
index 000000000..f6c1ade8b
--- /dev/null
+++ b/ietf/static/ietf/js/manage-community-list.js
@@ -0,0 +1,27 @@
+$(document).ready(function () {
+ $("[name=rule_type]").on("click change keypress", function () {
+ var form = $(this).closest("form");
+ var ruleType = $(this).val();
+ var emptyForms = $(".empty-forms");
+
+ var currentFormContent = form.find(".form-content-placeholder .rule-type");
+ if (!ruleType || !currentFormContent.hasClass(ruleType)) {
+ // move previous back into the collection
+ if (currentFormContent.length > 0)
+ emptyForms.append(currentFormContent);
+ else
+ currentFormContent.html(""); // make sure it's empty
+
+ // insert new
+ if (ruleType)
+ form.find(".form-content-placeholder").append(emptyForms.find("." + ruleType));
+ }
+ });
+
+ $("[name=rule_type]").each(function () {
+ // don't trigger the handler if we have a form with errors
+ var placeholderContent = $(this).closest("form").find(".form-content-placeholder >");
+ if (placeholderContent.length == 0 || placeholderContent.hasClass("rule-type"))
+ $(this).trigger("change");
+ });
+});
diff --git a/ietf/submit/tests.py b/ietf/submit/tests.py
index c4be4dfc8..563640ac7 100644
--- a/ietf/submit/tests.py
+++ b/ietf/submit/tests.py
@@ -19,6 +19,7 @@ from ietf.person.models import Person
from ietf.group.models import Group
from ietf.doc.models import Document, DocAlias, DocEvent, State, BallotDocEvent, BallotPositionDocEvent, DocumentAuthor
from ietf.submit.models import Submission, Preapproval
+from ietf.group.utils import setup_default_community_list_for_group
class SubmitTests(TestCase):
def setUp(self):
@@ -163,7 +164,8 @@ class SubmitTests(TestCase):
def submit_new_wg(self, formats):
# submit new -> supply submitter info -> approve
draft = make_test_data()
-
+ setup_default_community_list_for_group(draft.group)
+
# prepare draft to suggest replace
sug_replaced_draft = Document.objects.create(
name="draft-ietf-ames-sug-replaced",
diff --git a/ietf/submit/utils.py b/ietf/submit/utils.py
index 375cd1d26..09bf6d465 100644
--- a/ietf/submit/utils.py
+++ b/ietf/submit/utils.py
@@ -13,6 +13,7 @@ from ietf.group.models import Group
from ietf.ietfauth.utils import has_role
from ietf.name.models import StreamName
from ietf.person.models import Person, Email
+from ietf.community.utils import update_name_contains_indexes_with_new_doc
from ietf.submit.mail import announce_to_lists, announce_new_version, announce_to_authors
from ietf.submit.models import Submission, SubmissionEvent, Preapproval, DraftSubmissionStateName
from ietf.utils import unaccent
@@ -126,7 +127,7 @@ def post_submission(request, submission):
if not (group.type_id == "individ" and draft.group and draft.group.type_id == "area"):
# don't overwrite an assigned area if it's still an individual
# submission
- draft.group_id = group.pk
+ draft.group = group
draft.rev = submission.rev
draft.pages = submission.pages
draft.abstract = submission.abstract
@@ -205,6 +206,8 @@ def post_submission(request, submission):
new_replaces, new_possibly_replaces = update_replaces_from_submission(request, submission, draft)
+ update_name_contains_indexes_with_new_doc(draft)
+
announce_to_lists(request, submission)
announce_new_version(request, submission, draft, state_change_msg)
announce_to_authors(request, submission)
diff --git a/ietf/templates/base/menu.html b/ietf/templates/base/menu.html
index 608b34f1b..5a394dc8f 100644
--- a/ietf/templates/base/menu.html
+++ b/ietf/templates/base/menu.html
@@ -1,5 +1,5 @@
{# Copyright The IETF Trust 2015, All Rights Reserved #}{% load origin %}{% origin %}
-{% load ietf_filters community_tags wg_menu streams_menu active_groups_menu %}
+{% load ietf_filters managed_groups wg_menu streams_menu active_groups_menu %}
{% if flavor != "top" %}
{% include "base/menu_user.html" %}
@@ -51,14 +51,14 @@
Approve a draft
{% endif %}
- {% get_user_managed_lists user as community_lists %}
- {% if community_lists %}
- My tracked docs
- {% for cl in community_lists.group %}
- {{ cl.short_name }} {{cl.group.type.slug}} docs
+ {% if user and user.is_authenticated %}
+ My tracked docs
+
+ {% for g in user|managed_groups %}
+ {{ g.acronym }} {{ g.type.slug }} docs
{% endfor %}
{% else %}
- Sign in to track docs
+ Sign in to track docs
{% endif %}
{% if user|has_role:"Area Director,Secretariat" %}
diff --git a/ietf/templates/community/public/atom.xml b/ietf/templates/community/atom.xml
similarity index 100%
rename from ietf/templates/community/public/atom.xml
rename to ietf/templates/community/atom.xml
diff --git a/ietf/templates/community/customize_display.html b/ietf/templates/community/customize_display.html
deleted file mode 100644
index 57032786a..000000000
--- a/ietf/templates/community/customize_display.html
+++ /dev/null
@@ -1,24 +0,0 @@
-{# Copyright The IETF Trust 2015, All Rights Reserved #}
-{% load origin %}{% origin %}
-{% load bootstrap3 %}
-
-
diff --git a/ietf/templates/community/display_field.html b/ietf/templates/community/display_field.html
deleted file mode 100644
index 843377c18..000000000
--- a/ietf/templates/community/display_field.html
+++ /dev/null
@@ -1,2 +0,0 @@
-{# Copyright The IETF Trust 2015, All Rights Reserved #}{% load origin %}{% origin %}
-{{ value|safe }}
diff --git a/ietf/templates/community/list_menu.html b/ietf/templates/community/list_menu.html
new file mode 100644
index 000000000..f1c1fc62e
--- /dev/null
+++ b/ietf/templates/community/list_menu.html
@@ -0,0 +1,22 @@
+
diff --git a/ietf/templates/community/manage_clist.html b/ietf/templates/community/manage_clist.html
index a6e32521e..624e9b3aa 100644
--- a/ietf/templates/community/manage_clist.html
+++ b/ietf/templates/community/manage_clist.html
@@ -49,8 +49,8 @@
{{ doc.display_name }}
{{ doc.get_state }}
- {{ doc.title }}
- Remove
+ {{ doc.title }}
+ Remove
{% endfor %}
diff --git a/ietf/templates/community/manage_list.html b/ietf/templates/community/manage_list.html
new file mode 100644
index 000000000..89ff91bb5
--- /dev/null
+++ b/ietf/templates/community/manage_list.html
@@ -0,0 +1,143 @@
+{% extends "base.html" %}
+{# Copyright The IETF Trust 2015, All Rights Reserved #}
+{% load origin %}
+{% load bootstrap3 %}
+{% load staticfiles %}
+
+{% block pagehead %}
+
+
+{% endblock %}
+
+{% block title %}Manage {{ clist.long_name }}{% endblock %}
+
+{% block content %}
+ {% origin %}
+ Manage {{ clist.long_name }}
+
+ This page depends on Javascript being enabled to work properly.
+
+ {% bootstrap_messages %}
+
+ The list currently tracks {{ total_count }} document{{ total_count|pluralize }} .
+
+ Back to list
+
+ Individual documents
+
+ {% if individually_added %}
+ The list tracks {{ individually_added|length }} individually added document{{ individually_added|length|pluralize }}:
+
+
+ {% for d in individually_added %}
+
+ {{ d.name }}
+
+
+
+
+ {% endfor %}
+
+
+ {% else %}
+ The list does not track any individually added documents yet.
+ {% endif %}
+
+ {% if clist.group %}
+ Add individual documents here:
+ {% else %}
+ Conveniently track individual documents in your personal list with the track icon in search results .
+
+ You can also add documents here:
+ {% endif %}
+
+
+
+
+ Search rules
+
+ You can track documents with a search rule. When a document fulfills the search criteria, it will automatically show up in the list.
+
+ {% if rules %}
+
+
+ Rule Value Documents
+
+
+ {% for rule in rules %}
+
+ {{ rule.get_rule_type_display }}
+
+ {% if "group" in rule.rule_type or "area" in rule.rule_type %}
+ {{ rule.group.acronym }}
+ {% elif "state_" in rule.rule_type %}
+ {{ rule.state }}
+ {% elif "author" in rule.rule_type or rule.rule_type == "ad" or "shepherd" in rule.rule_type %}
+ {{ rule.person }}
+ {% elif "name_contains" in rule.rule_type %}
+ {{ rule.text }}
+ {% endif %}
+
+ {{ rule.matching_documents_count }} match{{ rule.matching_documents_count|pluralize:"es" }}
+
+
+
+
+ {% endfor %}
+
+
+
+ {% else %}
+
+ No rules defined.
+
+ {% endif %}
+
+
+
+
+
Add a new rule
+
+
+
+
+
+
+{% endblock %}
+
+{% block js %}
+
+
+
+{% endblock %}
diff --git a/ietf/templates/community/public/notification_email.txt b/ietf/templates/community/notification_email.txt
similarity index 51%
rename from ietf/templates/community/public/notification_email.txt
rename to ietf/templates/community/notification_email.txt
index 6db28028d..73a130d9f 100644
--- a/ietf/templates/community/public/notification_email.txt
+++ b/ietf/templates/community/notification_email.txt
@@ -3,14 +3,14 @@ Hello,
This is a notification from the {{ clist.long_name }}.
-Document: {{ notification.doc }},
-https://datatracker.ietf.org/doc/{{ notification.doc }}
+Document: {{ event.doc }},
+https://datatracker.ietf.org/doc/{{ event.doc_id }}/
Change:
-{{ notification.desc|textify|striptags }}
+{{ event.desc|textify|striptags }}
Best regards,
- The datatracker draft tracking service
+ The Datatracker draft tracking service
(for the IETF Secretariat)
{% endautoescape %}
diff --git a/ietf/templates/community/public/subscribe.html b/ietf/templates/community/public/subscribe.html
deleted file mode 100644
index 1ad53d026..000000000
--- a/ietf/templates/community/public/subscribe.html
+++ /dev/null
@@ -1,30 +0,0 @@
-{% extends "base.html" %}
-{# Copyright The IETF Trust 2015, All Rights Reserved #}
-{% load origin %}
-
-{% load bootstrap3 %}
-
-{% block title %}Subscribe to {{ cl.long_name }}{% endblock %}
-
-{% block content %}
- {% origin %}
-
- {% if success %}
- Subscription successful
-
- We have sent an email to your email address with instructions to complete your subscription.
- {% else %}
- Subscribe to {{ cl.long_name }}
-
- Subscribe to the email list for notifications of {% if significant %}significant {% endif %}changes on {{ cl.long_name }}.
-
-
- {% endif %}
-{% endblock %}
diff --git a/ietf/templates/community/public/subscribe_email.txt b/ietf/templates/community/public/subscribe_email.txt
deleted file mode 100644
index b0a8b3fc8..000000000
--- a/ietf/templates/community/public/subscribe_email.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-{% autoescape off %}
-Hello,
-
-In order to complete your subscription for {% if significant %}significant {% endif %}changes on {{ clist.long_name }}, please follow this link or copy it and paste it in your web browser:
-
-https://{{ domain }}{% if significant %}{% url "confirm_significant_subscription" clist.id to_email today auth %}{% else %}{% url "confirm_subscription" clist.id to_email today auth %}{% endif %}
-
-Best regards,
-
- The datatracker login manager service
- (for the IETF Secretariat)
-{% endautoescape %}
diff --git a/ietf/templates/community/public/subscription_confirm.html b/ietf/templates/community/public/subscription_confirm.html
deleted file mode 100644
index 55cce1f35..000000000
--- a/ietf/templates/community/public/subscription_confirm.html
+++ /dev/null
@@ -1,16 +0,0 @@
-{% extends "base.html" %}
-{# Copyright The IETF Trust 2015, All Rights Reserved #}
-{% load origin %}
-
-{% block title %}Subscription to {{ cl.long_name }}{% endblock %}
-
-{% block content %}
- {% origin %}
- Subscription to {{ cl.long_name }}
-
- Your email address {{ email }} has been successfully subscribed to {{ cl.long_name }}.
-
-
- Back
-
-{% endblock %}
diff --git a/ietf/templates/community/public/unsubscribe.html b/ietf/templates/community/public/unsubscribe.html
deleted file mode 100644
index 7f7ad4013..000000000
--- a/ietf/templates/community/public/unsubscribe.html
+++ /dev/null
@@ -1,34 +0,0 @@
-{% extends "base.html" %}
-{# Copyright The IETF Trust 2015, All Rights Reserved #}
-{% load origin %}
-
-{% load bootstrap3 %}
-
-{% block title %}Cancel subscription to {{ cl.long_name }}{% endblock %}
-
-{% block content %}
- {% origin %}
-
- {% if success %}
- Cancellation successful
-
-
- You will receive a confirmation email shortly containing further instructions on how to cancel your subscription.
-
- {% else %}
- Cancel subscription to {{ cl.long_name }}
-
-
- Cancel your subscription to the email list for notifications of {% if significant %}significant {% endif %}changes on {{ cl.long_name }}.
-
-
-
- {% endif %}
-{% endblock %}
diff --git a/ietf/templates/community/public/unsubscribe_email.txt b/ietf/templates/community/public/unsubscribe_email.txt
deleted file mode 100644
index 7b93d2f30..000000000
--- a/ietf/templates/community/public/unsubscribe_email.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-{% autoescape off %}
-Hello,
-
-In order to complete the cancelation of your subscription to {% if significant %}significant {% endif %}changes on {{ clist.long_name }}, please follow this link or copy it and paste it in your web browser:
-
-https://{{ domain }}{% if significant %}{% url "confirm_significant_unsubscription" clist.id to_email today auth %}{% else %}{% url "confirm_unsubscription" clist.id to_email today auth %}{% endif %}
-
-Best regards,
-
- The datatracker login manager service
- (for the IETF Secretariat)
-{% endautoescape %}
diff --git a/ietf/templates/community/public/unsubscription_confirm.html b/ietf/templates/community/public/unsubscription_confirm.html
deleted file mode 100644
index 8f9a109d7..000000000
--- a/ietf/templates/community/public/unsubscription_confirm.html
+++ /dev/null
@@ -1,18 +0,0 @@
-{% extends "base.html" %}
-{# Copyright The IETF Trust 2015, All Rights Reserved #}
-{% load origin %}
-
-{% block title %}Cancelled subscription to {{ cl.long_name }}{% endblock %}
-
-{% block content %}
- {% origin %}
- Cancelled subscription to {{ cl.long_name }}
-
-
- Your email address {{ email }} has been successfully removed from the {{ cl.long_name }} {% if significant %}significant {% endif %}changes mailing list.
-
-
-
- Back
-
-{% endblock %}
diff --git a/ietf/templates/community/public/view_list.html b/ietf/templates/community/public/view_list.html
deleted file mode 100644
index 2a475af17..000000000
--- a/ietf/templates/community/public/view_list.html
+++ /dev/null
@@ -1,23 +0,0 @@
-{% extends "base.html" %}
-{# Copyright The IETF Trust 2015, All Rights Reserved #}
-{% load origin %}
-
-{% block pagehead %}
-
-
-{% endblock %}
-
-{% block title %}{{ cl.long_name }}{% endblock %}
-
-{% block content %}
- {% origin %}
- {{ cl.long_name }}
-
- Subscribe to notification email lists:
-
-
- {% include "community/view_list.html" %}
-{% endblock %}
diff --git a/ietf/templates/community/raw_view.html b/ietf/templates/community/raw_view.html
deleted file mode 100644
index 9ec31ca12..000000000
--- a/ietf/templates/community/raw_view.html
+++ /dev/null
@@ -1,50 +0,0 @@
-{# Copyright The IETF Trust 2015, All Rights Reserved #}
-{% load origin %}{% origin %}
-{% load community_tags %}
-{% load future %}
-
-{% with cl.get_rfcs_and_drafts as documents %}
- {% with dc.get_active_fields as fields %}
- Internet-Drafts
-
-
-
- {% for field in fields %}
- {{ field.description }}
- {% endfor %}
-
-
-
- {% for doc in documents.1 %}
-
- {% for field in fields %}
- {% show_field field doc %}
- {% endfor %}
-
- {% endfor %}
-
-
- {% endwith %}
-
- {% with dc.get_active_fields as fields %}
- RFCs
-
-
-
- {% for field in fields %}
- {{ field.rfcDescription }}
- {% endfor %}
-
-
-
- {% for doc in documents.0 %}
-
- {% for field in fields %}
- {% show_field field doc %}
- {% endfor %}
-
- {% endfor %}
-
-
- {% endwith %}
-{% endwith %}
diff --git a/ietf/templates/community/subscription.html b/ietf/templates/community/subscription.html
new file mode 100644
index 000000000..0a4c337e5
--- /dev/null
+++ b/ietf/templates/community/subscription.html
@@ -0,0 +1,58 @@
+{% extends "base.html" %}
+{# Copyright The IETF Trust 2015, All Rights Reserved #}
+{% load origin %}
+
+{% load bootstrap3 %}
+
+{% block title %}Subscription to {{ clist.long_name }}{% endblock %}
+
+{% block content %}
+ {% origin %}
+
+ Subscription to {{ clist.long_name }}
+
+ {% bootstrap_messages %}
+
+ Get notified when changes happen to any of the tracked documents.
+
+ {% if existing_subscriptions %}
+ Existing subscriptions
+
+
+ {% for s in existing_subscriptions %}
+
+
+
+ {% endfor %}
+
+
+ Back to list
+
+ {% endif %}
+
+ Add new subscription
+
+ The email addresses you can choose between are those registered in your profile .
+
+ {% if form.fields.email.queryset %}
+
+ {% else %}
+
+
+ Back to list
+ {% endif %}
+{% endblock %}
diff --git a/ietf/templates/community/track_document.html b/ietf/templates/community/track_document.html
new file mode 100644
index 000000000..b592495f2
--- /dev/null
+++ b/ietf/templates/community/track_document.html
@@ -0,0 +1,16 @@
+{# Copyright The IETF Trust 2015, All Rights Reserved #}
+{% load origin %}{% origin %}
+{% load bootstrap3 %}
+
+{% block title %}Track document {{ name }}{% endblock %}
+
+{% bootstrap_messages %}
+
+
diff --git a/ietf/templates/community/untrack_document.html b/ietf/templates/community/untrack_document.html
new file mode 100644
index 000000000..ef5156363
--- /dev/null
+++ b/ietf/templates/community/untrack_document.html
@@ -0,0 +1,16 @@
+{# Copyright The IETF Trust 2015, All Rights Reserved #}
+{% load origin %}{% origin %}
+{% load bootstrap3 %}
+
+{% block title %}Remove tracking of document {{ name }}{% endblock %}
+
+{% bootstrap_messages %}
+
+
diff --git a/ietf/templates/community/view_list.html b/ietf/templates/community/view_list.html
index deb71d692..e329180ae 100644
--- a/ietf/templates/community/view_list.html
+++ b/ietf/templates/community/view_list.html
@@ -1,4 +1,23 @@
+{% extends "base.html" %}
{# Copyright The IETF Trust 2015, All Rights Reserved #}
-{% load origin %}{% origin %}
-{% load community_tags %}
-{% get_clist_view cl %}
+{% load origin %}
+{% load bootstrap3 %}
+
+{% block title %}{{ clist.long_name }}{% endblock %}
+
+{% block content %}
+ {% origin %}
+ {{ clist.long_name }}
+
+ {% bootstrap_messages %}
+
+ {% if can_manage_list %}
+
+
+ Manage list
+
+ {% endif %}
+
+ {% include "doc/search/search_results.html" with skip_no_matches_warning=True %}
+ {% include "community/list_menu.html" %}
+{% endblock %}
diff --git a/ietf/templates/doc/document_draft.html b/ietf/templates/doc/document_draft.html
index b2ac520e9..184b0cab7 100644
--- a/ietf/templates/doc/document_draft.html
+++ b/ietf/templates/doc/document_draft.html
@@ -501,11 +501,8 @@
{% if user.is_authenticated %}
- {% if tracking_document %}
-
- {% else %}
-
- {% endif %}
+
+
{% endif %}
{% if can_edit and iesg_state %}
diff --git a/ietf/templates/doc/search/search_form.html b/ietf/templates/doc/search/search_form.html
index 573a63c09..4133b12d3 100644
--- a/ietf/templates/doc/search/search_form.html
+++ b/ietf/templates/doc/search/search_form.html
@@ -42,10 +42,10 @@
{{ form.olddrafts }} Internet-Draft (expired, replaced or withdrawn)
- {% for doc_type in form.doctypes %}
+ {% for value, label in form.fields.doctypes.choices %}
-
- {{doc_type|safe|capfirst_allcaps}}
+
+ {{ label|safe|capfirst_allcaps}}
{% endfor %}
@@ -54,7 +54,7 @@