diff --git a/commentaries/models.py b/commentaries/models.py index 105338d435c0495d92d396d963600250e9963da1..7f8f4e67e7ddea0df15d60dfab04a5c66c9364ca 100644 --- a/commentaries/models.py +++ b/commentaries/models.py @@ -44,3 +44,14 @@ class Commentary(models.Model): def __str__ (self): return self.pub_title + def header_as_table (self): + header = '<table>' + header += '<tr><td>Title: </td><td> </td><td>' + self.pub_title + '</td></tr>' + header += '<tr><td>Author(s): </td><td> </td><td>' + self.author_list + '</td></tr>' + if self.type == 'published': + header += '<tr><td>DOI: </td><td> </td><td><a href="' + self.pub_DOI_link + '">' + self.pub_DOI_link + '</a></td></tr>' + elif self.type == 'preprint': + header += '<tr><td>arxiv Link: </td><td> </td><td><a href="' + self.arxiv_link + '">' + self.arxiv_link + '</a></td></tr>' + header += '<tr><td>Date: </td><td> </td><td>' + str(self.pub_date) + '</td></tr>' + header += '</table>' + return header diff --git a/commentaries/templates/commentaries/commentary_detail.html b/commentaries/templates/commentaries/commentary_detail.html index 5ee30ce8f64933f56f4fffa6ff822ef24484f578..2e75a4b68972ce2236f5fb4d9e86ef911ccf1a32 100644 --- a/commentaries/templates/commentaries/commentary_detail.html +++ b/commentaries/templates/commentaries/commentary_detail.html @@ -39,19 +39,18 @@ --> <section> <div class="flex-greybox"> - <h1>SciPost Commentary Page (for non-SciPost publications)</h1> + <h1>SciPost Commentary Page (non-SciPost publications)</h1> <button id="ratingsbutton">Toggle ratings view</button> </div> -</section> -<section> <hr class="hr12"> <div class="row"> <div class="col-4"> <h2>Original publication: </h2> </div> </div> - + {{ commentary.header_as_table|safe }} +<!-- <table> <tr><td>Title: </td><td>{{ commentary.pub_title }}</td></tr> <tr><td>Author(s): </td><td>{{ commentary.author_list }}</td></tr> @@ -59,6 +58,7 @@ <tr><td>DOI Link: </td><td><a href="{{ commentary.pub_DOI_link }}">{{ commentary.pub_DOI_link }}</a></td></tr> <tr><td>Date published: </td><td>{{ commentary.pub_date }}</td></tr> </table> +--> <h3>Abstract:</h3> <p>{{ commentary.pub_abstract }}</p> diff --git a/submissions/templates/submissions/submission_detail.html b/submissions/templates/submissions/submission_detail.html index 7f1ee7ae98180590d1d94da4a109ffde2ed580ba..b8bdf099b65969ceac2da29abbb309eb1dee758d 100644 --- a/submissions/templates/submissions/submission_detail.html +++ b/submissions/templates/submissions/submission_detail.html @@ -28,19 +28,11 @@ {% if user.is_authenticated %} <section> - <hr class="hr12"> - <div class="row"> - <div class="col-10"> - <h1>SciPost Submission Page (for papers submitted to SciPost)</h1> - </div> - <div class="col-2"> - <br/> - <button id="ratingsbutton">Toggle ratings view</button> - </div> + <div class="flex-greybox"> + <h1>SciPost Submission Page (for papers submitted to SciPost)</h1> + <button id="ratingsbutton">Toggle ratings view</button> </div> -</section> -<section> <hr class="hr12"> <div class="row"> <div class="col-4"> @@ -78,13 +70,9 @@ {% if reports %} <section> <hr class="hr12"> - <div class="row"> - <div class="col-10"> - <h2>Reports on this Submission</h2> - </div> - <div class="col-2"> - <button id="reportsbutton">Toggle reports view</button> - </div> + <div class="flex-breybox"> + <h2>Reports on this Submission</h2> + <button id="reportsbutton">Toggle reports view</button> </div> <div id="reportslist"> @@ -235,13 +223,9 @@ {% if comments %} <section> <hr class="hr12"> - <div class="row"> - <div class="col-10"> - <h2>Comments on this Submission</h2> - </div> - <div class="col-2"> - <button id="commentsbutton">Toggle comments view</button> - </div> + <div class="flex-greybox"> + <h2>Comments on this Submission</h2> + <button id="commentsbutton">Toggle comments view</button> </div> <div id="commentslist"> @@ -379,7 +363,9 @@ {% if user.is_authenticated and submission.open_for_commenting and user.contributor.rank > 0 %} <section> <hr class="hr12"/> - <h1>Contribute a Comment:</h1> + <div class="flex-greybox"> + <h1>Contribute a Comment:</h1> + </div> <form action="{% url 'submissions:submission' submission.id %}" method="post"> {% csrf_token %} {% load crispy_forms_tags %}