From 01bbcb58fdef17cb11cd28b56fc8ca2274437007 Mon Sep 17 00:00:00 2001
From: "J.-S. Caux" <J.S.Caux@uva.nl>
Date: Mon, 26 Aug 2019 20:37:03 +0200
Subject: [PATCH] Add template_latex_tgz to Proceedings

---
 proceedings/forms.py                          |  1 +
 .../0006_proceedings_template_latex_tgz.py    | 18 +++++++++++++
 proceedings/models.py                         |  6 +++++
 .../partials/proceedings/description.html     | 26 ++++++++++++++-----
 4 files changed, 44 insertions(+), 7 deletions(-)
 create mode 100644 proceedings/migrations/0006_proceedings_template_latex_tgz.py

diff --git a/proceedings/forms.py b/proceedings/forms.py
index 8d5fda042..c0a370a64 100644
--- a/proceedings/forms.py
+++ b/proceedings/forms.py
@@ -21,4 +21,5 @@ class ProceedingsForm(forms.ModelForm):
             'submissions_open',
             'submissions_deadline',
             'submissions_close',
+            'template_latex_tgz',
         )
diff --git a/proceedings/migrations/0006_proceedings_template_latex_tgz.py b/proceedings/migrations/0006_proceedings_template_latex_tgz.py
new file mode 100644
index 000000000..958412143
--- /dev/null
+++ b/proceedings/migrations/0006_proceedings_template_latex_tgz.py
@@ -0,0 +1,18 @@
+# Generated by Django 2.1.8 on 2019-08-26 17:45
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('proceedings', '0005_auto_20190626_1125'),
+    ]
+
+    operations = [
+        migrations.AddField(
+            model_name='proceedings',
+            name='template_latex_tgz',
+            field=models.FileField(blank=True, help_text='Gzipped tarball of the LaTeX template package', max_length=256, upload_to='UPLOADS/TEMPLATES/latex/%Y/', verbose_name='Template (LaTeX, gzipped tarball)'),
+        ),
+    ]
diff --git a/proceedings/models.py b/proceedings/models.py
index cfef72125..949ea1e1e 100644
--- a/proceedings/models.py
+++ b/proceedings/models.py
@@ -45,6 +45,12 @@ class Proceedings(TimeStampedModel):
     submissions_deadline = models.DateField()
     submissions_close = models.DateField()
 
+    # Templates
+    template_latex_tgz = models.FileField(
+        verbose_name='Template (LaTeX, gzipped tarball)',
+        help_text='Gzipped tarball of the LaTeX template package',
+        upload_to='UPLOADS/TEMPLATES/latex/%Y/', max_length=256, blank=True)
+
     objects = ProceedingsQuerySet.as_manager()
 
     class Meta:
diff --git a/proceedings/templates/partials/proceedings/description.html b/proceedings/templates/partials/proceedings/description.html
index f12c62a33..cfb6fbc9c 100644
--- a/proceedings/templates/partials/proceedings/description.html
+++ b/proceedings/templates/partials/proceedings/description.html
@@ -10,13 +10,6 @@
 <h3>{{ proceedings.event_name }} {% if proceedings.event_suffix %}({{ proceedings.event_suffix }}){% endif %}</h3>
 <div class="mb-4">
   Event dates: from {{ proceedings.event_start_date }} to {{ proceedings.event_end_date }}.
-  <div class="my-1">
-    <strong>Submission deadline: {{ proceedings.submissions_deadline }}</strong>.
-  </div>
-  {% if proceedings.open_for_submission %}
-    <a href="{% url 'submissions:submit_manuscript' %}">Submit your manuscript here</a>.
-    Prepare your manuscript according to <a href="{% url 'submissions:author_guidelines' %}">our guidelines</a>, using <a href>our LaTeX template</a>.
-  {% endif %}
 </div>
 {% if proceedings.logo %}
     </div>
@@ -27,6 +20,25 @@
 {% endif %}
 <p>{{ proceedings.event_description|safe|linebreaksbr }}</p>
 
+{% if True or proceedings.open_for_submission %}
+  <h3>Instructions for submitting to these Proceedings:</h3>
+  <ul>
+    <li>
+      Prepare your manuscript according to <a href="{% url 'submissions:author_guidelines' %}">our guidelines</a>, using our template:
+      <ul>
+	{% if proceedings.template_latex_tgz %}
+	  <li><a href="{{ proceedings.template_latex_tgz.url }}">LaTeX (gzipped tarball)</a></li>
+	{% else %}
+	  <li>Template will be available soon!</li>
+	{% endif %}
+      </ul>
+    </li>
+    <li>
+      Submit your manuscript (<strong>deadline: {{ proceedings.submissions_deadline }}</strong>) by going to our <a href="{% url 'submissions:submit_manuscript' %}">submission page</a>, selecting these proceedings.
+    </li>
+  </ul>
+{% endif %}
+
 {% if proceedings.cover_image %}
     </div>
     <div class="col-lg-1"></div>
-- 
GitLab