From 974a285a739dc30d0cd07fdf910b5ce152b9c830 Mon Sep 17 00:00:00 2001 From: "J.-S. Caux" <J.S.Caux@uva.nl> Date: Sun, 7 Feb 2016 10:47:38 +0100 Subject: [PATCH] Improve theses info output --- scipost/models.py | 1 + scipost/static/scipost/SciPost.css | 4 ++++ static/scipost/SciPost.css | 4 ++++ theses/models.py | 11 ++++++++--- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/scipost/models.py b/scipost/models.py index 19ede8e2a..e31b84a5a 100644 --- a/scipost/models.py +++ b/scipost/models.py @@ -9,6 +9,7 @@ from .models import * SCIPOST_DISCIPLINES = ( ('physics', 'Physics'), ) +disciplines_dict = dict(SCIPOST_DISCIPLINES) CONTRIBUTOR_RANKS = ( # ranks determine the type of Contributor: diff --git a/scipost/static/scipost/SciPost.css b/scipost/static/scipost/SciPost.css index f329eb2b9..12062470e 100644 --- a/scipost/static/scipost/SciPost.css +++ b/scipost/static/scipost/SciPost.css @@ -191,6 +191,10 @@ hr.hr12 { margin: 0px; padding: 0px; } +.flex-whitebox0v { + margin: 0px 10px; + padding: 0px; +} body { /* font-family: Merriweather, sans-serif; */ diff --git a/static/scipost/SciPost.css b/static/scipost/SciPost.css index f329eb2b9..12062470e 100644 --- a/static/scipost/SciPost.css +++ b/static/scipost/SciPost.css @@ -191,6 +191,10 @@ hr.hr12 { margin: 0px; padding: 0px; } +.flex-whitebox0v { + margin: 0px 10px; + padding: 0px; +} body { /* font-family: Merriweather, sans-serif; */ diff --git a/theses/models.py b/theses/models.py index 31c6d6bf3..d0ee55208 100644 --- a/theses/models.py +++ b/theses/models.py @@ -53,6 +53,10 @@ class ThesisLink(models.Model): header = '<table>' header += '<tr><td>Title: </td><td> </td><td>' + self.title + '</td></tr>' header += '<tr><td>Author(s): </td><td> </td><td>' + self.author + '</td></tr>' + header += '<tr><td>Type: </td><td></td><td>' + thesis_type_dict[self.type] + '</td></tr>' + header += '<tr><td>Discipline: </td><td></td><td>' + disciplines_dict[self.discipline] + '</td></tr>' + header += '<tr><td>Domain: </td><td></td><td>' + journals_domains_dict[self.domain] + '</td></tr>' + header += '<tr><td>Specialization: </td><td></td><td>' + journals_spec_dict[self.specialization] + '</td></tr>' header += '<tr><td>URL: </td><td> </td><td><a href="' + self.pub_link + '">' + self.pub_link + '</a></td></tr>' header += '<tr><td>Degree granting institution: </td><td> </td><td>' + self.institution + '</td></tr>' header += '<tr><td>Defense date: </td><td> </td><td>' + str(self.defense_date) + '</td></tr>' @@ -61,8 +65,9 @@ class ThesisLink(models.Model): def header_as_li (self): header = '<li><div class="flex-container">' - header += '<div class="flex-whitebox0"><p><a href="/theses/thesis/' + str(self.id) + '">' + self.title + '</a></p>' - header += '<p>' + thesis_type_dict[self.type] + ' thesis by ' + self.author + '</p><p> (published ' + str(self.defense_date) + ')</p></div>' - header += '<div class="flex-whitebox0"><p>Latest activity: ' + self.latest_activity.strftime('%Y-%m-%d %H:%M') + '</p></div>' + header += '<div class="flex-whitebox0v"><p><a href="/theses/thesis/' + str(self.id) + '">' + self.title + '</a></p>' + header += '<p>' + thesis_type_dict[self.type] + ' thesis by ' + self.author + '</p>' + header += '<p>in ' + disciplines_dict[self.discipline] + ', ' + journals_domains_dict[self.domain] + ' ' + journals_spec_dict[self.specialization] + '</p></div>' + header += '<div class="flex-whitebox0v"><p>Defense date: ' + str(self.defense_date) + '</p><p>Latest activity: ' + self.latest_activity.strftime('%Y-%m-%d %H:%M') + '</p></div>' header += '</div></li>' return header -- GitLab