Facelift remaining materials pages

- Legacy-Id: 8938
This commit is contained in:
Ole Laursen 2015-01-28 12:50:09 +00:00
parent 88c9f84664
commit f63a99be1c
6 changed files with 92 additions and 120 deletions

View file

@ -270,24 +270,23 @@ def edit_material_presentations(request, name, acronym=None, date=None, seq=None
if request.method == 'POST':
form = MaterialVersionForm(request.POST,choices=choices)
if form.is_valid():
if request.POST.get("action", "") == "Save":
new_selection = form.cleaned_data['version']
if initial['version'] != new_selection:
if initial['version'] == 'notpresented':
doc.sessionpresentation_set.create(session=session,rev=new_selection)
c = DocEvent(type="added_comment", doc=doc, by=request.user.person)
c.desc = "Added version %s to session: %s" % (new_selection,session)
c.save()
elif new_selection == 'notpresented':
doc.sessionpresentation_set.filter(session=session).delete()
c = DocEvent(type="added_comment", doc=doc, by=request.user.person)
c.desc = "Removed from session: %s" % (session)
c.save()
else:
doc.sessionpresentation_set.filter(session=session).update(rev=new_selection)
c = DocEvent(type="added_comment", doc=doc, by=request.user.person)
c.desc = "Revision for session %s changed to %s" % (session,new_selection)
c.save()
new_selection = form.cleaned_data['version']
if initial['version'] != new_selection:
if initial['version'] == 'notpresented':
doc.sessionpresentation_set.create(session=session,rev=new_selection)
c = DocEvent(type="added_comment", doc=doc, by=request.user.person)
c.desc = "Added version %s to session: %s" % (new_selection,session)
c.save()
elif new_selection == 'notpresented':
doc.sessionpresentation_set.filter(session=session).delete()
c = DocEvent(type="added_comment", doc=doc, by=request.user.person)
c.desc = "Removed from session: %s" % (session)
c.save()
else:
doc.sessionpresentation_set.filter(session=session).update(rev=new_selection)
c = DocEvent(type="added_comment", doc=doc, by=request.user.person)
c.desc = "Revision for session %s changed to %s" % (session,new_selection)
c.save()
return redirect('doc_view',name=doc.name)
else:
form = MaterialVersionForm(choices=choices,initial=initial)

View file

@ -1,23 +1,17 @@
{% extends "base.html" %}
{% extends "ietf.html" %}
{% block title %}Upload Material for Group {{ group.acronym }}{% endblock %}
{% block morecss %}
{{ block.super }}
.material-types li { margin-bottom: 0.5em; }
{% endblock %}
{% block content %}
{% load ietf_filters %}
<h1>Upload Material for Group {{ group.acronym }}</h1>
{% block title %}Upload Material for group {{ group.name }} ({{ group.acronym }}){% endblock %}
<p>Select what kind of material you wish to upload:</p>
{% block content %}
<h1>Upload Material<br><small>{{ group.name }} ({{ group.acronym }})</small></h1>
<ul class="material-types">
{% for t in material_types %}
<li><a href="{% url "group_new_material" acronym=group.acronym doc_type=t.slug %}">{{ t.name }}</a></li>
{% endfor %}
</ul>
<p>Select what kind of material you wish to upload:</p>
<ul class="material-types">
{% for t in material_types %}
<li><a href="{% url "group_new_material" acronym=group.acronym doc_type=t.slug %}">{{ t.name }}</a></li>
{% endfor %}
</ul>
{% endblock content %}

View file

@ -1,47 +1,39 @@
{% extends "base.html" %}
{% extends "ietf.html" %}
{% block title %}{% if action == "new" or action == "revise" %}Upload{% else %}Edit{% endif %} {{ document_type.name }} for Group {{ group.acronym }}{% endblock %}
{% load bootstrap3 %}
{% block morecss %}
{{ block.super }}
form.upload-material td { padding-bottom: 0.6em; }
form.upload-material #id_title, form.upload-material #id_name, form.upload-material #id_abstract { width: 30em; }
form.upload-material .submit-row td { padding-top: 1em; text-align: right; }
{% endblock %}
{% block title %}{% if action == "new" or action == "revise" %}Upload{% else %}Edit{% endif %} {{ document_type.name }} for group {{ group.name }} ({{ group.acronym }}){% endblock %}
{% block content %}
{% load ietf_filters %}
<h1>{% if action == "new" or action == "revise" %}Upload{% else %}Edit{% endif %} {{ document_type.name }} for Group {{ group.acronym }}</h1>
<h1>{% if action == "new" or action == "revise" %}Upload{% else %}Edit{% endif %} {{ document_type.name }}<br><small>{{ group.name }} ({{ group.acronym }})</small></h1>
{% if action == "new" %}
<p>
Below you can upload a file for the group
<a href="{% url "group_materials" acronym=group.acronym %}">{{ group.acronym }}</a>.
The file will appear under the materials tab in the group pages.
<p class="help-block">
Below you can upload a document for the group {{ group.name }}
<a href="{% url "group_materials" acronym=group.acronym %}">({{ group.acronym }})</a>.
The document will appear under the materials tab in the group pages.
</p>
<h3>Upload</h3>
<h2>Upload</h2>
{% elif action == "revise" %}
<p>
Below you can upload a new revision of {{ doc_name }} for the group
<a href="{% url "group_materials" acronym=group.acronym %}">{{ group.acronym }}</a>.
Below you can upload a new revision of {{ doc_name }} for the group {{ group.name }}
<a href="{% url "group_materials" acronym=group.acronym %}">({{ group.acronym }})</a>.
</p>
<h3>Upload New Revision</h3>
<h2>Upload New Revision</h2>
{% endif %}
<form class="upload-material" method="post" enctype="multipart/form-data" data-nameprefix="{{ document_type.slug }}-{{ group.acronym }}-">{% csrf_token %}
<table>
{{ form.as_table }}
<tr class="submit-row">
<td colspan="2">
<a class="button" href="{% if doc_name %}{% url "doc_view" name=doc_name %}{% else %}{% url "group_materials" acronym=group.acronym %}{% endif %}">Cancel</a>
<input class="submit button" type="submit" value="{% if action == "new" or action == "revise" %}Upload{% else %}Save{% endif %}" />
</td>
</tr>
</table>
<form class="upload-material" role="form" method="post" enctype="multipart/form-data" data-nameprefix="{{ document_type.slug }}-{{ group.acronym }}-">
{% csrf_token %}
{% bootstrap_form form %}
{% buttons %}
<a class="btn btn-default pull-right" href="{% if doc_name %}{% url "doc_view" name=doc_name %}{% else %}{% url "group_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>
{% endbuttons %}
</form>
{% endblock content %}

View file

@ -1,23 +1,20 @@
{% extends "base.html" %}
{% extends "ietf.html" %}
{% block title %}
Edit Upcoming Presentations
{% endblock %}
{% load bootstrap3 %}
{% block morecss %}
{{ block.super }}
ul#id_versions { list-style-type: none; padding: 0px; margin: 0px; }
{% endblock %}
{% block title %}Edit Upcoming Presentations{% endblock %}
{% block content %}
{% load ietf_filters %}
<h1>Edit Upcoming Presentations<br><small>{{doc.title}}<br>{{doc.name}}<br>at {{session}}</small></h1>
<h1>Edit Upcoming Presentations of<br/>{{doc.title}}<br/>{{doc.name}}<br/>at {{session}}</h1>
<form role="form" method="post">
{% csrf_token %}
<form method="post">{% csrf_token %}
{{form.as_p}}
<input style="button" type="submit" name="action" value="Save"/>
<input style="button" type="submit" name="action" value="Cancel"/>
{% bootstrap_form form %}
{% buttons %}
<a class="btn btn-default pull-right" href="{% url "doc_view" name=doc.name %}">Back</a>
<button class="btn btn-primary" type="submit">Save</button>
{% endbuttons %}
</form>
{% endblock content %}

View file

@ -1,37 +1,32 @@
{% extends "base.html" %}
{% extends "ietf.html" %}
{% block title %}
Upcoming Presentations
{% endblock %}
{% block title %}Upcoming Presentations{% endblock %}
{% block content %}
{% load ietf_filters %}
<h1>Upcoming Presentations of<br/>{{doc.title}}<br/>{{doc.name}}</h1>
<ul>
{% regroup sessions by has_presentation as is_scheduled_list %}
{% for is_scheduled in is_scheduled_list %}
<li> {{ is_scheduled.grouper|yesno:"Presentation Scheduled,Presentation Not Scheduled"}}
<ul>
{% regroup is_scheduled.list by group as group_list %}
{% for group in group_list %}
{% for session in group.list %}
<li>
{% if week_day %}
<a href="{% url 'ietf.doc.views_material.edit_material_presentations' name=doc.name acronym=group.grouper.acronym seq=forloop.counter week_day=week_day %}">{{ session }}</a>
{% elif date %}
<a href="{% url 'ietf.doc.views_material.edit_material_presentations' name=doc.name acronym=group.grouper.acronym seq=forloop.counter date=date %}">{{ session }}</a>
{% else %}
<a href="{% url 'ietf.doc.views_material.edit_material_presentations' name=doc.name acronym=group.grouper.acronym seq=forloop.counter %}">{{ session }}</a>
{% endif %}
{% if session.versions %} (version{{session.versions|pluralize}} {{session.versions|join:','}}) {% endif %}
</li>
{% endfor %}
{% endfor %}
</ul>
</li>
{% endfor %}
</ul>
<h1>Upcoming Presentations<br><small>{{doc.title}}<br>{{doc.name}}</small></h1>
<ul>
{% regroup sessions by has_presentation as is_scheduled_list %}
{% for is_scheduled in is_scheduled_list %}
<li> {{ is_scheduled.grouper|yesno:"Presentation Scheduled,Presentation Not Scheduled"}}
<ul>
{% regroup is_scheduled.list by group as group_list %}
{% for group in group_list %}
{% for session in group.list %}
<li>
{% if week_day %}
<a href="{% url 'ietf.doc.views_material.edit_material_presentations' name=doc.name acronym=group.grouper.acronym seq=forloop.counter week_day=week_day %}">{{ session }}</a>
{% elif date %}
<a href="{% url 'ietf.doc.views_material.edit_material_presentations' name=doc.name acronym=group.grouper.acronym seq=forloop.counter date=date %}">{{ session }}</a>
{% else %}
<a href="{% url 'ietf.doc.views_material.edit_material_presentations' name=doc.name acronym=group.grouper.acronym seq=forloop.counter %}">{{ session }}</a>
{% endif %}
{% if session.versions %} (version{{session.versions|pluralize}} {{session.versions|join:','}}) {% endif %}
</li>
{% endfor %}
{% endfor %}
</ul>
</li>
{% endfor %}
</ul>
{% endblock content %}

View file

@ -1,11 +1,11 @@
{% extends "group/group_base.html" %}
{% load ietf_filters %}
{% block group_subtitle %}Materials{% endblock %}
{% block morecss %}
{{ block.super }}
.materials .edit-options { float: right; margin-left: 2em; font-style: italic; }
.materials .snippable { width:25em; }
{% endblock %}
@ -16,8 +16,7 @@
{% for doc_type, docs in doc_types %}
<h2>{{ doc_type.name }}</h2>
<table class="ietf-table ietf-doctable materials">
<table class="table table-condensed table-striped materials">
<tr>
<th>Title</th>
<th>Abstract</th>
@ -28,7 +27,7 @@
</tr>
{% for d in docs %}
<tr class="{% cycle "evenrow" "oddrow" %}">
<tr>
<td><a class="title-link" href="{% url "doc_view" name=d.name %}">{{ d.title }}</a></td>
<td class='snippable'>{{ d.abstract|format_snippet }} </td>
<td>{{ d.rev }}</td>
@ -37,7 +36,7 @@
{% for p in past_pres_list %}
{{ p.grouper }}
{% if p.list|length > 1 %}
( {{ p.list|length }} sessions )
({{ p.list|length }} sessions)
{% else %}
{% for pr in p.list %}
{% if pr.rev != d.rev %}
@ -51,7 +50,7 @@
{% for p in meeting_pres_list %}
{{ p.grouper }}
{% if p.list|length > 1 %}
( {{ p.list|length }} sessions )
({{ p.list|length }} sessions)
{% else %}
{% for pr in p.list %}
{% if pr.rev != d.rev %}
@ -73,7 +72,3 @@
{% endif %}
{% endblock %}
{% block content_end %}
<script src="/js/snippet.js" type="text/javascript"></script>
{% endblock %}