feat: show references to and from subseries
This commit is contained in:
parent
1f82fab2cd
commit
71a760f05a
|
@ -1431,11 +1431,17 @@ def document_shepherd_writeup_template(request, type):
|
|||
def document_references(request, name):
|
||||
doc = get_object_or_404(Document,name=name)
|
||||
refs = doc.references()
|
||||
if doc.type_id in ["bcp","std","fyi"]:
|
||||
for rfc in doc.contains():
|
||||
refs |= rfc.references()
|
||||
return render(request, "doc/document_references.html",dict(doc=doc,refs=sorted(refs,key=lambda x:x.target.name),))
|
||||
|
||||
def document_referenced_by(request, name):
|
||||
doc = get_object_or_404(Document,name=name)
|
||||
refs = doc.referenced_by()
|
||||
if doc.type_id in ["bcp","std","fyi"]:
|
||||
for rfc in doc.contains():
|
||||
refs |= rfc.referenced_by()
|
||||
full = ( request.GET.get('full') != None )
|
||||
numdocs = refs.count()
|
||||
if not full and numdocs>250:
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
{% extends "base.html" %}
|
||||
{# Copyright The IETF Trust 2015, All Rights Reserved #}
|
||||
{# Copyright The IETF Trust 2015-2023, All Rights Reserved #}
|
||||
{% load origin static ietf_filters %}
|
||||
{% block pagehead %}
|
||||
<link rel="stylesheet" href="{% static "ietf/css/list.css" %}">
|
||||
{% endblock %}
|
||||
{% block title %}References to {{ name }}{% endblock %}
|
||||
{% block title %}References to {{ name|prettystdname }}{% endblock %}
|
||||
{% block content %}
|
||||
{% origin %}
|
||||
<h1>References to {{ name }}</h1>
|
||||
<h1>References to {{ name|prettystdname }}</h1>
|
||||
<p class="alert alert-info my-3">
|
||||
These dependencies are extracted using heuristics looking for strings with particular prefixes. Notably, this means that references to I-Ds by title only are not reflected here. If it's really important, please inspect the documents' references sections directly.
|
||||
</p>
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
{% extends "base.html" %}
|
||||
{# Copyright The IETF Trust 2015, All Rights Reserved #}
|
||||
{# Copyright The IETF Trust 2015-2023, All Rights Reserved #}
|
||||
{% load origin static ietf_filters %}
|
||||
{% block pagehead %}
|
||||
<link rel="stylesheet" href="{% static "ietf/css/list.css" %}">
|
||||
{% endblock %}
|
||||
{% block title %}References from {{ doc.name }}{% endblock %}
|
||||
{% block title %}References from {{ doc.name|prettystdname }}{% endblock %}
|
||||
{% block content %}
|
||||
{% origin %}
|
||||
<h1>References from {{ doc.name }}</h1>
|
||||
<h1>References from {{ doc.name|prettystdname }}</h1>
|
||||
<p class="my-3 alert alert-info">
|
||||
These dependencies are extracted using heuristics looking for strings with particular prefixes. Notably, this means that references to I-Ds by title only are not reflected here. If it's really important, please inspect the documents' references sections directly.
|
||||
</p>
|
||||
|
|
|
@ -6,8 +6,24 @@
|
|||
{% block content %}
|
||||
{% origin %}
|
||||
{{ top|safe }}
|
||||
<h2>{{ doc.name|slice:":3"|upper }} {{ doc.name|slice:"3:"}} consists of:</h2>
|
||||
<h2>{{ doc.name|slice:":3"|upper }} {{ doc.name|slice:"3:"}} {% if doc.contains %}consists of:{% else %}currently contains no RFCs{% endif %}</h2>
|
||||
{% for rfc in doc.contains %}
|
||||
<p><a href="{% url 'ietf.doc.views_doc.document_main' name=rfc.name %}">RFC {{rfc.name|slice:"3:"}}</a> : {{rfc.title}}</p>
|
||||
{% endfor %}
|
||||
<div class="buttonlist">
|
||||
<a class="btn btn-primary btn-sm"
|
||||
href="{% url 'ietf.doc.views_doc.document_references' doc.name %}"
|
||||
rel="nofollow">
|
||||
<i class="bi bi-arrow-left">
|
||||
</i>
|
||||
References
|
||||
</a>
|
||||
<a class="btn btn-primary btn-sm"
|
||||
href="{% url 'ietf.doc.views_doc.document_referenced_by' doc.name %}"
|
||||
rel="nofollow">
|
||||
<i class="bi bi-arrow-right">
|
||||
</i>
|
||||
Referenced by
|
||||
</a>
|
||||
</div>
|
||||
{% endblock %}
|
Loading…
Reference in a new issue