From 0d3bb724a1535dc40ff8f7680d78f73de6b77856 Mon Sep 17 00:00:00 2001
From: "J.-S. Caux" <J.S.Caux@uva.nl>
Date: Mon, 18 Feb 2019 05:38:36 +0100
Subject: [PATCH] Add auto-generated toc for Proceedings issue

---
 .../proceedings/proceedings_details.html      | 39 +++++++++++++++----
 .../proceedings/proceedings_toc.html          |  7 ++++
 2 files changed, 39 insertions(+), 7 deletions(-)
 create mode 100644 proceedings/templates/proceedings/proceedings_toc.html

diff --git a/proceedings/templates/proceedings/proceedings_details.html b/proceedings/templates/proceedings/proceedings_details.html
index 546baa99b..323999529 100644
--- a/proceedings/templates/proceedings/proceedings_details.html
+++ b/proceedings/templates/proceedings/proceedings_details.html
@@ -16,13 +16,18 @@
 
     {% include 'partials/proceedings/summary.html' with proceedings=proceedings %}
 
-{% comment %}
-            <form method="post" action="{% url 'colleges:fellowship_terminate' fellowship.id %}" class="d-inline">
-                {% csrf_token %}
-                <button type="submit" class="btn btn-danger">Terminate Fellowship</button>
-            </form>
-            <a href="{% url 'colleges:fellowship_edit' fellowship.id %}" class="btn btn-info ml-2">Edit Fellowship</a>
-            {% endcomment %}
+    {% comment %}
+    <form method="post" action="{% url 'colleges:fellowship_terminate' fellowship.id %}" class="d-inline">
+      {% csrf_token %}
+      <button type="submit" class="btn btn-danger">Terminate Fellowship</button>
+    </form>
+    <a href="{% url 'colleges:fellowship_edit' fellowship.id %}" class="btn btn-info ml-2">Edit Fellowship</a>
+    {% endcomment %}
+
+    <h3>Table of contents</h3>
+    <p>
+      View the table of contents in <a href="javascript:;" data-toggle="modal" data-target="#textocmodal">TeX format</a>
+    </p>
 
 
     <h3 class="mt-3">All Guest Fellowships of this Proceedings</h3>
@@ -60,6 +65,7 @@
     </table>
 
     <h3>All Submissions for this Proceedings Issue</h3>
+
     <table class="table table-hover">
         <thead>
             <tr>
@@ -82,4 +88,23 @@
         </tbody>
     </table>
 
+
+
+<div class="modal" id="textocmodal" tabindex="-1" role="dialog" aria-hidden="true" aria-labelledby="textocmodal">
+    <div class="modal-dialog modal-lg" role="document">
+        <div class="modal-content">
+            <div class="modal-body">
+                <div class="pb-4">
+                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
+                        <span aria-hidden="true">&times;</span>
+                    </button>
+                </div>
+                <div>{% include 'proceedings/proceedings_toc.html' with proceedings=proceedings %}</div>
+            </div>
+        </div>
+    </div>
+</div>
+
+
+
 {% endblock %}
diff --git a/proceedings/templates/proceedings/proceedings_toc.html b/proceedings/templates/proceedings/proceedings_toc.html
new file mode 100644
index 000000000..a9a8645a4
--- /dev/null
+++ b/proceedings/templates/proceedings/proceedings_toc.html
@@ -0,0 +1,7 @@
+<pre>
+\begin{itemize}
+{% for pub in proceedings.issue.publications.all|dictsort:"paper_nr" %}
+\item {{ pub.author_list }}, {\it {{ pub.title }} }, {{ pub.paper_nr }}
+{% endfor %}
+\end{itemize}
+</pre>
-- 
GitLab