diff --git a/scipost/forms.py b/scipost/forms.py index 39023c20fae3437a7aaee59d354a9182b3f8392e..1999004dd7d297d4e5e26d3902d7caa5547a5486 100644 --- a/scipost/forms.py +++ b/scipost/forms.py @@ -384,7 +384,8 @@ class FeedbackForm(forms.ModelForm): class NominationForm(forms.ModelForm): class Meta: model = Nomination - fields = ['first_name', 'last_name', 'discipline', 'expertises'] + fields = ['first_name', 'last_name', + 'discipline', 'expertises', 'webpage'] def __init__(self, *args, **kwargs): super(NominationForm, self).__init__(*args, **kwargs) diff --git a/scipost/models.py b/scipost/models.py index 21e84677428779edc5f8a39a3e79dc7991d3c464..4ac08a3252b017891e33b473a1a7acc4e9918e29 100644 --- a/scipost/models.py +++ b/scipost/models.py @@ -631,6 +631,7 @@ class Nomination(models.Model): expertises = ChoiceArrayField( models.CharField(max_length=10, choices=SCIPOST_SUBJECT_AREAS), blank=True, null=True) + webpage = models.URLField(default='') nr_A = models.PositiveIntegerField(default=0) in_agreement = models.ManyToManyField(Contributor, related_name='in_agreement_with_nomination', blank=True) @@ -650,14 +651,28 @@ class Nomination(models.Model): self.by) def as_li(self): - html = ('<div class="Nomination" id="nomination_id{{ nomination_id }}">' - '<h3><em> {{ name }}, nominated by {{ proposer }}</em></h3>' - '</div>') + html = ('<div class="Nomination" id="nomination_id{{ nomination_id }}" ' + 'style="background-color: #eeeeee;">' + '<div class="row">' + '<div class="col-4">' + '<h3><em> {{ name }}</em></h3>' + '<p>Nominated by {{ proposer }}</p>' + '</div>' + '<div class="col-4">' + '<p><a href="{{ webpage }}">Webpage</a></p>' + '<p>Discipline: {{ discipline }}</p></div>' + '<div class="col-4"><p>expertise:<ul>') + for exp in self.expertises: + html += '<li>%s</li>' % subject_areas_dict[exp] + html += '</ul></div></div></div>' context = Context({ 'nomination_id': self.id, 'proposer': '%s %s' % (self.by.user.first_name, self.by.user.last_name), - 'name': self.first_name + ' ' + self.last_name,}) + 'name': self.first_name + ' ' + self.last_name, + 'discipline': disciplines_dict[self.discipline], + 'webpage': self.webpage, + }) template = Template(html) return template.render(context) diff --git a/scipost/templates/scipost/VGM_detail.html b/scipost/templates/scipost/VGM_detail.html index e132d6e7f0adf2c0c886a42ec7e0d3dbdc8aa605..b593933875137fb124bb147a905426da77c15dfe 100644 --- a/scipost/templates/scipost/VGM_detail.html +++ b/scipost/templates/scipost/VGM_detail.html @@ -147,7 +147,7 @@ $(document).ready(function(){ </div> <div class="col-1"></div> <div class="col-10"> - <ul> + <ul style="list-style-type: none;"> {% for nomination in nominations %} <li> {{ nomination.as_li }}