From e2ff3de1b351bdbc2cadffcd348f922a17e36e5e Mon Sep 17 00:00:00 2001
From: Jorran de Wit <jorrandewit@outlook.com>
Date: Fri, 19 May 2017 07:41:30 +0200
Subject: [PATCH] Improve how-to for commentaries

---
 commentaries/factories.py                     |  8 ++--
 .../templates/commentaries/howto.html         | 46 ++++++++++---------
 2 files changed, 28 insertions(+), 26 deletions(-)

diff --git a/commentaries/factories.py b/commentaries/factories.py
index 940e958cb..85961e640 100644
--- a/commentaries/factories.py
+++ b/commentaries/factories.py
@@ -39,10 +39,10 @@ class CommentaryFactory(factory.django.DjangoModelFactory):
     def add_authors(self, create, extracted, **kwargs):
         contributors = list(Contributor.objects.order_by('?')
                             .exclude(pk=self.requested_by.pk).all()[:4])
-        for contrib in contributors:
-            self.author_list += ', %s %s' % (contrib.user.first_name, contrib.user.last_name)
-            if create:
-                self.authors.add(contrib)
+        self.author_list = ', '.join(
+            ['%s %s' % (contrib.user.first_name,
+                        contrib.user.last_name) for contrib in contributors])
+        self.authors.add(*contributors)
 
 
 class VettedCommentaryFactory(CommentaryFactory):
diff --git a/commentaries/templates/commentaries/howto.html b/commentaries/templates/commentaries/howto.html
index e954e8030..eb2cc7633 100644
--- a/commentaries/templates/commentaries/howto.html
+++ b/commentaries/templates/commentaries/howto.html
@@ -6,25 +6,27 @@
   <script type="text/javascript" async src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"></script>
 {% endblock headsup %}
 
-{% block bodysup %}
-
-
-<section>
-  <hr class="hr12">
-  <h1>SciPost Commentaries how-to</h1>
-  <h3>Activation procedure</h3>
-  <p>A Commentary Page can be requested by any registered SciPost Contributor for any published scientific paper or arXiv preprint by filling the <a href="{% url 'commentaries:request_commentary' %}">Commentary request form</a>. After vetting by an Editor, the Commentary Page is activated and made open for Comments from registered SciPost Contributors. Authors can reply to Comments, and Contributors can add Comments to the chain.</p>
-  <ul>
-    <li><a href="{% url 'commentaries:request_commentary' %}">Request opening a SciPost Commentary Page</a></li>
-  </ul>
-  
-  <br/>
-  <h3>Standardized URLs</h3>
-  <p>In order to facilitate localization of commentaries on particular publications, within SciPost, all Commentary Pages have a standardized URL of the form</p>
-  <p>https://scipost.org/commentary/IDENTIFIER</p>
-  <p>where IDENTIFIER is either the (by definition unique and stable) DOI of the published paper, or the arXiv identifier in new (arXiv:####.#####v#) or old (cond-mat/#######v#) style. NOTE: for arXiv, we systematically require the presence of the version number in order to avoid confusion (and yes, we do so even if there exists only one version).</p>
-
-</section>
-
-
-{% endblock bodysup %}
+{% block content %}
+
+<div class="row">
+    <div class="col-12">
+        <h1 class="highlight">SciPost Commentaries how-to</h1>
+    </div>
+</div>
+<div class="row">
+    <div class="col-12">
+        <h2>Activation procedure</h2>
+          <p>A Commentary Page can be requested by any registered SciPost Contributor for any published scientific paper or arXiv preprint by filling the <a href="{% url 'commentaries:request_commentary' %}">Commentary request form</a>. After vetting by an Editor, the Commentary Page is activated and made open for Comments from registered SciPost Contributors. Authors can reply to Comments, and Contributors can add Comments to the chain.</p>
+          <ul>
+            <li><a href="{% url 'commentaries:request_commentary' %}">Request opening a SciPost Commentary Page</a></li>
+          </ul>
+
+          <br/>
+          <h3>Standardized URLs</h3>
+          <p>In order to facilitate localization of commentaries on particular publications, within SciPost, all Commentary Pages have a standardized URL of the form</p>
+          <p class="text-blue">https://scipost.org/commentary/IDENTIFIER</p>
+          <p>where IDENTIFIER is either the (by definition unique and stable) DOI of the published paper, or the arXiv identifier in new (arXiv:####.#####v#) or old (cond-mat/#######v#) style. NOTE: for arXiv, we systematically require the presence of the version number in order to avoid confusion (and yes, we do so even if there exists only one version).</p>
+    </div>
+</div>
+
+{% endblock %}
-- 
GitLab