Skip to content
Merged
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
245 changes: 119 additions & 126 deletions .pnp.cjs

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion client/agenda/AgendaScheduleCalendar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ import {
import FullCalendar from '@fullcalendar/vue3'
import timeGridPlugin from '@fullcalendar/timegrid'
import interactionPlugin from '@fullcalendar/interaction'
import luxonPlugin from '@fullcalendar/luxon2'
import luxonPlugin from '@fullcalendar/luxon3'
import bootstrap5Plugin from '@fullcalendar/bootstrap5'

import AgendaDetailsModal from './AgendaDetailsModal.vue'
Expand Down
19 changes: 10 additions & 9 deletions ietf/group/templatetags/group_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import debug # pyflakes:ignore

from ietf.group.models import Group
from ietf.nomcom.models import NomCom

register = template.Library()

Expand All @@ -19,14 +19,15 @@ def active_nomcoms(user):
if not (user and hasattr(user, "is_authenticated") and user.is_authenticated):
return []

groups = []

groups.extend(Group.objects.filter(
role__person__user=user,
type_id='nomcom',
state__slug='active').distinct().select_related("type"))

return groups
return list(
NomCom.objects.filter(
group__role__person__user=user,
group__type_id='nomcom', # just in case...
group__state__slug='active',
)
.distinct()
.order_by("group__acronym")
)

@register.inclusion_tag('person/person_link.html')
def role_person_link(role, **kwargs):
Expand Down
2 changes: 1 addition & 1 deletion ietf/secr/sreq/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def test_edit(self):
list(TimerangeName.objects.filter(name__in=['thursday-afternoon-early', 'thursday-afternoon-late']).values('name'))
)
self.assertFalse(sessions[0].joint_with_groups.count())
self.assertEqual(list(sessions[1].joint_with_groups.all()), [group3, group4])
self.assertEqual(set(sessions[1].joint_with_groups.all()), {group3, group4})

# Check whether the updated data is visible on the view page
r = self.client.get(redirect_url)
Expand Down
3 changes: 3 additions & 0 deletions ietf/static/css/document_html.scss
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ $font-family-monospace: "Noto Sans Mono", SFMono-Regular, Menlo, Monaco, Consola
pre,
code {
font-size: 1em;
overflow: visible;
}

pre {
Expand Down Expand Up @@ -333,11 +334,13 @@ tbody.meta tr {
page-break-inside: avoid;
}

/*
a:link,
a:visited {
// color: inherit;
// text-decoration: none;
}
*/

.newpage {
page-break-before: always !important;
Expand Down
14 changes: 14 additions & 0 deletions ietf/static/js/login.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
* Disable Submit Button on Form Submit
*/
function onLoginSubmit (ev) {
const submitBtn = document.querySelector('#dt-login-form button[type=submit]')
if (submitBtn) {
submitBtn.disabled = true
submitBtn.innerHTML = 'Signing in...'
}
}

$(function() {
document.querySelector('#dt-login-form').addEventListener('submit', onLoginSubmit)
})
2 changes: 1 addition & 1 deletion ietf/submit/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -3354,7 +3354,7 @@ def test_process_submission_xml(self):
self.assertEqual(output["title"], "Correct Draft Title")
self.assertIsNone(output["abstract"])
self.assertEqual(len(output["authors"]), 1) # not checking in detail, parsing is unreliable
self.assertIsNone(output["document_date"])
self.assertEqual(output["document_date"], date_today())
self.assertIsNone(output["pages"])
self.assertIsNone(output["words"])
self.assertIsNone(output["first_two_pages"])
Expand Down
22 changes: 14 additions & 8 deletions ietf/submit/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1159,7 +1159,7 @@ def process_submission_xml(filename, revision):
for auth in xml_draft.get_author_list()
],
"abstract": None, # not supported from XML
"document_date": None, # not supported from XML
"document_date": xml_draft.get_creation_date(),
"pages": None, # not supported from XML
"words": None, # not supported from XML
"first_two_pages": None, # not supported from XML
Expand Down Expand Up @@ -1213,11 +1213,9 @@ def process_submission_text(filename, revision):
f"Text Internet-Draft revision ({text_draft.revision}) "
f"disagrees with submission revision ({revision})"
)
title = _normalize_title(text_draft.get_title())
if not title:
# This test doesn't work well - the text_draft parser tends to grab "Abstract" as
# the title if there's an empty title.
raise SubmissionError("Could not extract a title from the text")
title = text_draft.get_title()
if title:
title = _normalize_title(title)

# Drops \r, \n, <, >. Based on get_draft_meta() behavior
trans_table = str.maketrans("", "", "\r\n<>")
Expand All @@ -1233,7 +1231,7 @@ def process_submission_text(filename, revision):
return {
"filename": text_draft.filename,
"rev": text_draft.revision,
"title": _normalize_title(text_draft.get_title()),
"title": title,
"authors": authors,
"abstract": text_draft.get_abstract(),
"document_date": text_draft.get_creation_date(),
Expand Down Expand Up @@ -1286,9 +1284,17 @@ def process_and_validate_submission(submission):
submission.title = text_metadata["title"]
submission.authors = text_metadata["authors"]

if not submission.title:
raise SubmissionError("Could not determine the title of the draft")

# Items to get from text only when not available from XML
if xml_metadata and xml_metadata.get("document_date", None) is not None:
submission.document_date = xml_metadata["document_date"]
else:
submission.document_date = text_metadata["document_date"]

# Items always to get from text, even when XML is available
submission.abstract = text_metadata["abstract"]
submission.document_date = text_metadata["document_date"]
submission.pages = text_metadata["pages"]
submission.words = text_metadata["words"]
submission.first_two_pages = text_metadata["first_two_pages"]
Expand Down
2 changes: 1 addition & 1 deletion ietf/submit/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def err(code, text):
fill_in_submission(form, submission, authors, abstract, file_size)
apply_checkers(submission, file_name)

create_submission_event(request, submission, desc="Uploaded submission")
create_submission_event(request, submission, desc="Uploaded submission via api_submit")

errors = validate_submission(submission)
if errors:
Expand Down
10 changes: 5 additions & 5 deletions ietf/templates/base/menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -171,23 +171,23 @@
</li>
{% endfor %}
{% endif %}
{% if user|active_nomcoms %}
{% with user|active_nomcoms as nomcoms %}{% if nomcoms %}
{% if flavor == 'top' %}
<li><hr class="dropdown-divider">
</li>
{% endif %}
<li {% if flavor == 'top' %}class="dropdown-header"{% else %}class="nav-item fw-bolder"{% endif %}>
NomComs
</li>
{% for g in user|active_nomcoms %}
{% for nomcom in nomcoms %}
<li>
<a class="dropdown-item {% if flavor != 'top' %}text-wrap link-primary{% endif %}"
href="{% url "ietf.nomcom.views.private_index" g.nomcom_set.first.year %}">
{{ g.acronym|capfirst }}
href="{% url "ietf.nomcom.views.private_index" nomcom.year %}">
{{ nomcom|capfirst }}
</a>
</li>
{% endfor %}
{% endif %}
{% endif %}{% endwith %}
{% endif %}
{% if flavor == 'top' %}
<li><hr class="dropdown-divider">
Expand Down
6 changes: 4 additions & 2 deletions ietf/templates/meeting/requests.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ <h1 class="title">
</h1>

<h2 class="mt-3">Requests Summary</h2>
<p class="mt-2"><em>This summary section focuses on sessions that have conflict lists to manage. It excludes requests from groups of type "team", such as those for the hackathon or for tutorials.</em></p>
<div class="mt-2">
<table class="table table-sm">
<tbody>
Expand Down Expand Up @@ -98,7 +99,6 @@ <h2 class="mt-5" id="{% firstof area.grouper.acronym "other-groups" %}">
<th scope="col" data-sort="group">Group</th>
<th scope="col" class="d-none d-lg-table-cell" data-sort="count">Length</th>
<th scope="col" class="d-none d-lg-table-cell" data-sort="num">Size</th>
<th scope="col" class="d-none d-lg-table-cell" data-sort="num">Purpose</th>
<th scope="col" class="d-none d-lg-table-cell" data-sort="requester">Requester</th>
<th scope="col" class="d-none d-lg-table-cell" data-sort="ad">AD</th>
<th scope="col" data-sort="constraints">Constraints</th>
Expand All @@ -120,6 +120,9 @@ <h2 class="mt-5" id="{% firstof area.grouper.acronym "other-groups" %}">
<a href="{% url "ietf.secr.sreq.views.edit" num=meeting.number acronym=session.group.acronym %}">
{{ session.group.acronym }}
</a>
{% if session.purpose_id != "regular" %}
<br><span class="badge rounded-pill bg-info">{{session.purpose}}</span>
{% endif %}
{% if session.joint_with_groups.count %}joint with {{ session.joint_with_groups_acronyms|join:' ' }}{% endif %}
{% if session.requested_duration %}
<div class="d-lg-none">
Expand All @@ -139,7 +142,6 @@ <h2 class="mt-5" id="{% firstof area.grouper.acronym "other-groups" %}">
{% if session.requested_duration %}{{ session.requested_duration|stringformat:"s"|slice:"0:4" }}{% endif %}
</td>
<td class="d-none d-lg-table-cell">{{ session.attendees|default:"" }}</td>
<td class="d-none d-lg-table-cell">{% if session.purpose_id != "regular" %}{{session.purpose}}{% endif %}</td>
<td class="d-none d-lg-table-cell">{% person_link session.requested_by_person with_email=False %}</td>
<td class="d-none d-lg-table-cell">
{% if session.group.ad_role %}
Expand Down
6 changes: 5 additions & 1 deletion ietf/templates/registration/login.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{# Copyright The IETF Trust 2015, All Rights Reserved #}
{% extends "base.html" %}
{% load static %}
{% load origin %}
{% load django_bootstrap5 %}
{% block title %}Sign in{% endblock %}
{% block content %}
{% origin %}
<h1>Sign in</h1>
<form method="post">
<form method="post" id="dt-login-form">
{% csrf_token %}
{% bootstrap_form form %}
<div class="mt-4 mb-3">
Expand All @@ -16,4 +17,7 @@ <h1>Sign in</h1>
</div>
Don't have an account? <a href="{% url 'ietf.ietfauth.views.create_account' %}">Create an account</a>.
</form>
{% endblock %}
{% block js %}
<script src="{% static 'ietf/js/login.js' %}"></script>
{% endblock %}
64 changes: 42 additions & 22 deletions ietf/utils/draft.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,46 @@ def get_title(self):

def get_wordcount(self):
raise NotImplementedError

@staticmethod
def _construct_creation_date(year, month, day=None):
"""Construct a date for the document

Roughly follows RFC 7991 section 2.17, but only allows missing day and
assumes the 15th if day is not specified month/year are not current.

year: integer or string with 4-digit year
month: integer or string with numeric or English month. Some abbreviations recognized.
day: integer or string with numeric day of month. Optional.

Raises ValueError if there is a problem interpreting the data
"""
year = int(year)
day = int(day)
if isinstance(month, str):
month = month.lower()
if month in month_names:
month = month_names.index(month) + 1
elif month in month_names_abbrev3:
month = month_names_abbrev3.index(month) + 1
elif month in month_names_abbrev4:
month = month_names_abbrev4.index(month) + 1
elif month.isdigit() and int(month) in range(1, 13):
month = int(month)
else:
raise ValueError("Unrecognized month")
today = date_today()
if not day:
# if the date was given with only month and year, use
# today's date if month and year is today's month and
# year, otherwise pick the middle of the month.
# Don't use today's day for month and year in the past
if month == today.month and year == today.year:
day = today.day
else:
day = 15
return datetime.date(year, month, day)


# ----------------------------------------------------------------------

Expand All @@ -203,7 +243,7 @@ def __init__(self, text, source, name_from_source=False):
"""
super().__init__()
assert isinstance(text, str)
self.source = source
self.source = str(source)
self.rawtext = text
self.name_from_source = name_from_source

Expand Down Expand Up @@ -460,27 +500,7 @@ def get_creation_date(self):
day = int( md.get( 'day', 0 ) )
year = int( md['year'] )
try:
if mon in month_names:
month = month_names.index( mon ) + 1
elif mon in month_names_abbrev3:
month = month_names_abbrev3.index( mon ) + 1
elif mon in month_names_abbrev4:
month = month_names_abbrev4.index( mon ) + 1
elif mon.isdigit() and int(mon) in range(1,13):
month = int(mon)
else:
continue
today = date_today()
if day==0:
# if the date was given with only month and year, use
# today's date if month and year is today's month and
# year, otherwise pick the middle of the month.
# Don't use today's day for month and year in the past
if month==today.month and year==today.year:
day = today.day
else:
day = 15
self._creation_date = datetime.date(year, month, day)
self._creation_date = self._construct_creation_date(year, mon, day)
return self._creation_date
except ValueError:
# mon abbreviation not in _MONTH_NAMES
Expand Down
11 changes: 11 additions & 0 deletions ietf/utils/xmldraft.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,17 @@ def _parse_docname(self):
def get_title(self):
return self.xmlroot.findtext('front/title').strip()

def get_creation_date(self):
date_elt = self.xmlroot.find("front/date")
if date_elt is not None:
try:
year = date_elt.get("year")
month = date_elt.get("month")
return self._construct_creation_date(year, month, date_elt.get("day", None))
except ValueError:
pass
return None

# todo fix the implementation of XMLDraft.get_abstract()
#
# This code was pulled from ietf.submit.forms where it existed for some time.
Expand Down
Loading