-
Notifications
You must be signed in to change notification settings - Fork 378
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
200 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Copyright The IETF Trust 2023, All Rights Reserved | ||
from django.db import migrations | ||
|
||
|
||
def forward(apps, schema_editor): | ||
StateType = apps.get_model("doc", "StateType") | ||
for slug in ["bcp", "std", "fyi"]: | ||
StateType.objects.create(slug=slug, label=f"{slug} state") | ||
|
||
|
||
def reverse(apps, schema_editor): | ||
StateType = apps.get_model("doc", "StateType") | ||
StateType.objects.filter(slug__in=["bcp", "std", "fyi"]).delete() | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("doc", "0017_move_dochistory"), | ||
] | ||
|
||
operations = [migrations.RunPython(forward, reverse)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Copyright The IETF Trust 2023, All Rights Reserved | ||
|
||
from django.db import migrations | ||
|
||
|
||
def forward(apps, schema_editor): | ||
DocTypeName = apps.get_model("name", "DocTypeName") | ||
DocRelationshipName = apps.get_model("name", "DocRelationshipName") | ||
for slug, name, prefix in [ | ||
("std", "Standard", "std"), | ||
("bcp", "Best Current Practice", "bcp"), | ||
("fyi", "For Your Information", "fyi"), | ||
]: | ||
DocTypeName.objects.create( | ||
slug=slug, name=name, prefix=prefix, desc="", used=True | ||
) | ||
DocRelationshipName.objects.create( | ||
slug="contains", | ||
name="Contains", | ||
revname="Is part of", | ||
desc="This document contains other documents (e.g., STDs contain RFCs)", | ||
used=True, | ||
) | ||
|
||
|
||
def reverse(apps, schema_editor): | ||
DocTypeName = apps.get_model("name", "DocTypeName") | ||
DocRelationshipName = apps.get_model("name", "DocRelationshipName") | ||
DocTypeName.objects.filter(slug__in=["std", "bcp", "fyi"]).delete() | ||
DocRelationshipName.objects.filter(slug="contains").delete() | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("name", "0009_rfc_doctype_names"), | ||
] | ||
|
||
operations = [migrations.RunPython(forward, reverse)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{% extends "base.html" %} | ||
{# Copyright The IETF Trust 2023, All Rights Reserved #} | ||
{% load origin %} | ||
{% load static %} | ||
{% block title %}{{doc.type.name}}s{% endblock %} | ||
{% block content %} | ||
{% origin %} | ||
{{ top|safe }} | ||
<h2>{{ doc.name|slice:":3"|upper }} {{ doc.name|slice:"3:"}} consists of:</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 %} | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{# Copyright The IETF Trust 2015, All Rights Reserved #} | ||
{% load origin %} | ||
{% origin %} | ||
{% load ietf_filters %} | ||
<h1> | ||
{{ doc.name|slice:":3"|upper }} {{ doc.name|slice:"3:"}} | ||
</h1> | ||
<ul class="nav nav-tabs my-3"> | ||
{% for name, t, url, active, tooltip in tabs %} | ||
<li {% if tooltip %}title="{{ tooltip }}"{% endif %} class="nav-item"> | ||
<a class="nav-link {% if t == selected %}active{% endif %}{% if not active %}disabled{% endif %}" | ||
{% if active %}href="{{ url }}"{% endif %}> | ||
{{ name|capfirst_allcaps }} | ||
</a> | ||
</li> | ||
{% endfor %} | ||
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{% extends "base.html" %} | ||
{# Copyright The IETF Trust 2023, All Rights Reserved #} | ||
{% load origin %} | ||
{% load static %} | ||
{% block title %}{{type.name}}s{% endblock %} | ||
{% block content %} | ||
{% origin %} | ||
<h1>{{type.name}}s</h1> | ||
{% for doc in docs %} | ||
<div class="card mb-3" id={{doc.name}}> | ||
<div class="card-header"><a href="{% url 'ietf.doc.views_doc.document_main' name=doc.name %}">{{doc.name}}</a></div> | ||
<div class="card-body"> | ||
{% for rfc in doc.contains %} | ||
<p><a href="{% url 'ietf.doc.views_doc.document_main' name=rfc.name %}"">{{rfc.name}}</a> : {{rfc.title}}</p> | ||
{% endfor %} | ||
</div> | ||
</div> | ||
{% endfor %} | ||
{% endblock %} |