forked from ietf-tools/datatracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathedit_material.html
More file actions
87 lines (87 loc) · 3.31 KB
/
edit_material.html
File metadata and controls
87 lines (87 loc) · 3.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
{% extends "base.html" %}
{# Copyright The IETF Trust 2015, All Rights Reserved #}
{% load origin %}
{% load django_bootstrap5 %}
{% block title %}
{% if action == "new" or action == "revise" %}
Upload
{% else %}
Edit
{% endif %}
{{ material_type|lower }} for
{% if group is not None %}
group {{ group.name }} ({{ group.acronym }})
{% elif doc.meeting_related %}
{{ doc.get_related_meeting }}
{% endif %}
{% endblock %}
{% block content %}
{% origin %}
<h1 class="mb-3">
{% if action == "new" or action == "revise" %}
Upload
{% else %}
Edit
{% endif %}
{{ material_type|lower }}
<br>
<small class="text-body-secondary">
{% if group is not None %}
{{ group.name }} ({{ group.acronym }})
{% elif doc.meeting_related %}
{{ doc.get_related_meeting }}
{% if doc.get_related_proceedings_material %}{{ doc.get_related_proceedings_material }}{% endif %}
{% endif %}
</small>
</h1>
{% if action == "new" %}
<p>
{% if group is not None %}
Below you can upload a document for the group {{ group.name }}
<a href="{% url "ietf.group.views.materials" acronym=group.acronym %}">({{ group.acronym }})</a>.
The document will appear under the materials tab in the group pages.
{% elif doc.meeting_related %}
Below you can upload a document for the {{ doc.get_related_meeting }} meeting.
{% endif %}
</p>
{% elif action == "revise" %}
<p>
{% if group is not None %}
Below you can upload a new revision of {{ doc_name }} for the group {{ group.name }}
<a href="{% url "ietf.group.views.materials" acronym=group.acronym %}">({{ group.acronym }})</a>.
{% elif doc.meeting_related %}
Below you can upload a new revision of {{ doc_name }} for the {{ doc.get_related_meeting }} meeting.
{% endif %}
</p>
{% endif %}
<form class="upload-material"
method="post"
enctype="multipart/form-data"
data-nameprefix="{{ document_type.slug }}-{{ group.acronym }}-">
{% csrf_token %}
{% bootstrap_form form %}
<a class="btn btn-secondary float-end"
href="{% if doc_name %}{% url "ietf.doc.views_doc.document_main" name=doc_name %}{% else %}{% url "ietf.group.views.materials" acronym=group.acronym %}{% endif %}">
Back
</a>
<button class="btn btn-primary" type="submit">
{% if action == "new" or action == "revise" %}
Upload
{% else %}
Save
{% endif %}
</button>
</form>
{% endblock %}
{% block js %}
<script>
$(document).ready(function () {
$("form.upload-material input#id_title").on("change keyup", function () {
var v = $(this).val();
var slug = $(this).parents("form").data("nameprefix");
slug += v.toLowerCase().replace(/ /g,'-').replace(/[-]+/g, '-').replace(/[^a-z-]+/g,'');
$(this).parents("form").find("input#id_name").val(slug);
});
});
</script>
{% endblock %}