Add simple /doc/review-<foo> page for displaying a review, fix a
couple of bugs - Legacy-Id: 11362
This commit is contained in:
parent
6a35431356
commit
0ed3d554d6
|
@ -571,6 +571,21 @@ def document_main(request, name, rev=None):
|
|||
),
|
||||
context_instance=RequestContext(request))
|
||||
|
||||
|
||||
if doc.type_id == "review":
|
||||
basename = "{}-{}.txt".format(doc.name, doc.rev)
|
||||
pathname = os.path.join(doc.get_file_path(), basename)
|
||||
content = get_document_content(basename, pathname, split=False)
|
||||
|
||||
return render(request, "doc/document_review.html",
|
||||
dict(doc=doc,
|
||||
top=top,
|
||||
content=content,
|
||||
revisions=revisions,
|
||||
latest_rev=latest_rev,
|
||||
snapshot=snapshot,
|
||||
))
|
||||
|
||||
raise Http404
|
||||
|
||||
|
||||
|
|
|
@ -390,7 +390,7 @@ def complete_review(request, name, request_id):
|
|||
|
||||
review.type = DocTypeName.objects.get(slug="review")
|
||||
review.rev = "00"
|
||||
review.title = "Review of {}".format(review_req.doc.name)
|
||||
review.title = "Review of {}-{}".format(review_req.doc.name, review_req.reviewed_rev)
|
||||
review.group = review_req.team
|
||||
if review_submission == "link":
|
||||
review.external_url = form.cleaned_data['review_url']
|
||||
|
@ -402,9 +402,9 @@ def complete_review(request, name, request_id):
|
|||
type="new_revision",
|
||||
doc=review,
|
||||
by=request.user.person,
|
||||
rev=doc.rev,
|
||||
rev=review.rev,
|
||||
desc='New revision available',
|
||||
time=doc.time,
|
||||
time=review.time,
|
||||
)
|
||||
|
||||
# save file on disk
|
||||
|
|
73
ietf/templates/doc/document_review.html
Normal file
73
ietf/templates/doc/document_review.html
Normal file
|
@ -0,0 +1,73 @@
|
|||
{% extends "base.html" %}
|
||||
{# Copyright The IETF Trust 2016, All Rights Reserved #}
|
||||
{% load origin %}
|
||||
{% load staticfiles %}
|
||||
{% load ietf_filters %}
|
||||
|
||||
{% block title %}{{ doc.title }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% origin %}
|
||||
{{ top|safe }}
|
||||
|
||||
{% include "doc/revisions_list.html" %}
|
||||
|
||||
<table class="table table-condensed">
|
||||
<thead id="message-row">
|
||||
<tr>
|
||||
{% if doc.rev != latest_rev %}
|
||||
<th colspan="3" class="alert-warning">The information below is for an old version of the document</th>
|
||||
{% else %}
|
||||
<th colspan="3"></th>
|
||||
{% endif %}
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody class="meta">
|
||||
<tr>
|
||||
<th class="col-md-1">Team</th>
|
||||
<td class="edit col-md-1"></td>
|
||||
<td class="col-md-10">
|
||||
{{ doc.group.name }}
|
||||
<a href="{{ doc.group.about_url }}">({{ doc.group.acronym }})</a>
|
||||
|
||||
{% if snapshot %}
|
||||
<span class="label label-warning">Snapshot</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>Title</th>
|
||||
<td class="edit"></td>
|
||||
<td>{{ doc.title }}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>State</th>
|
||||
<td class="edit"></td>
|
||||
<td>{{ doc.get_state.name }}</td>
|
||||
</tr>
|
||||
|
||||
{% if doc.external_url %}
|
||||
<tr>
|
||||
<th>Posted at</th>
|
||||
<td class="edit"></td>
|
||||
<td><a href="{{ doc.external_url }}">{{ doc.external_url }}</a></td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
|
||||
<tr>
|
||||
<th>Last updated</th>
|
||||
<td class="edit"></td>
|
||||
<td>{{ doc.time|date:"Y-m-d" }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h2>{{ doc.type.name }}<br><small>{{ doc.name }}</small></h2>
|
||||
|
||||
{% if doc.rev and content != None %}
|
||||
{{ content|fill:"80"|safe|linebreaksbr|keep_spacing|sanitize_html|safe }}
|
||||
{% endif %}
|
||||
{% endblock %}
|
Loading…
Reference in a new issue