Skip to content

Commit 31f687b

Browse files
committed
allow editing of abstract for existing material
- Legacy-Id: 8435
1 parent 2f56de6 commit 31f687b

3 files changed

Lines changed: 10 additions & 8 deletions

File tree

ietf/doc/urls_material.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from django.conf.urls import patterns, url
22

33
urlpatterns = patterns('ietf.doc.views_material',
4-
url(r'^(?P<action>state|title|revise)/$', "edit_material", name="material_edit"),
4+
url(r'^(?P<action>state|title|abstract|revise)/$', "edit_material", name="material_edit"),
55
url(r'^sessions/$', "material_presentations", name="material_presentations"),
66
)
77

ietf/doc/views_material.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,14 @@ def __init__(self, doc_type, action, group, doc, *args, **kwargs):
5555
del self.fields["name"]
5656

5757
self.fields["title"].initial = doc.title
58+
self.fields["abstract"].initial = doc.abstract
5859
self.fields["state"].initial = doc.get_state().pk if doc.get_state() else None
5960
if doc.get_state_slug() == "deleted":
6061
self.fields["state"].help_text = "Note: If you wish to revise this document, you may wish to change the state so it's not deleted."
6162

62-
if action == "title":
63-
del self.fields["state"]
64-
del self.fields["material"]
65-
elif action == "state":
66-
del self.fields["title"]
67-
del self.fields["material"]
63+
for fieldname in ["title","state","material","abstract"]:
64+
if fieldname != action:
65+
del self.fields[fieldname]
6866

6967
def clean_name(self):
7068
name = self.cleaned_data["name"].strip().rstrip("-")

ietf/templates/doc/document_material.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@
2929
{% if doc.abstract %}
3030
<tr>
3131
<td>Abstract:</td>
32-
<td> {{ doc.abstract | format_snippet }} </td>
32+
<td>
33+
<a {% if not snapshot and can_manage_material %} class="editlink" href="{% url "material_edit" name=doc.name action="abstract" name=doc.name %}"{% endif %}>
34+
{{ doc.abstract | format_snippet }}
35+
</a>
36+
</td>
3337
</tr>
3438
{% endif %}
3539

0 commit comments

Comments
 (0)