diff --git a/scipost_django/proceedings/migrations/0010_add_proceedings_preface.py b/scipost_django/proceedings/migrations/0010_add_proceedings_preface.py new file mode 100644 index 0000000000000000000000000000000000000000..97cb24c137ba56d494e19ffb0067b36ddfe7df4e --- /dev/null +++ b/scipost_django/proceedings/migrations/0010_add_proceedings_preface.py @@ -0,0 +1,23 @@ +# Generated by Django 3.2.18 on 2023-09-07 09:16 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('proceedings', '0009_auto_20210422_0833'), + ] + + operations = [ + migrations.AddField( + model_name='proceedings', + name='preface_text', + field=models.TextField(blank=True), + ), + migrations.AddField( + model_name='proceedings', + name='preface_title', + field=models.CharField(blank=True, max_length=256), + ), + ] diff --git a/scipost_django/proceedings/models.py b/scipost_django/proceedings/models.py index c64c6b220206039a6d7480c40e9811343223c572..cafacbd39d0133f710362b62c196d7449f5ca265 100644 --- a/scipost_django/proceedings/models.py +++ b/scipost_django/proceedings/models.py @@ -58,6 +58,10 @@ class Proceedings(TimeStampedModel): submissions_deadline = models.DateField() submissions_close = models.DateField() + # Proceedings optinal preface + preface_title = models.CharField(max_length=256, blank=True) + preface_text = models.TextField(blank=True) + # Templates template_latex_tgz = models.FileField( verbose_name="Template (LaTeX, gzipped tarball)", diff --git a/scipost_django/proceedings/templates/proceedings/_description.html b/scipost_django/proceedings/templates/proceedings/_description.html index 62e67b901732d90b0829ac7c07a2168795f3702d..fc12d01bbe7fa0d08b7f99452a139e0bb38c14ab 100644 --- a/scipost_django/proceedings/templates/proceedings/_description.html +++ b/scipost_django/proceedings/templates/proceedings/_description.html @@ -1,43 +1,77 @@ -{% if proceedings.cover_image %} - <div class="row"> - <div class="col-md-10"> -{% endif %} +<div class="row"> + <div class="col"> + <div class="row"> + + <div class="col"> + <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> + </div> + + {% if proceedings.logo %} + <div class="col-md-4"> + <img style="max-width: 100%" + class="d-flex me-3" + src="{{ proceedings.logo.url }}" + alt="logo" /> + </div> + {% endif %} -{% if proceedings.logo %} - <div class="row"> - <div class="col-md-8"> -{% endif %} -<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> -{% if proceedings.logo %} - </div> - <div class="col-md-4"> - <img style="max-width: 100%;" class="d-flex me-3" src="{{ proceedings.logo.url }}" alt="logo"/> </div> + + <p>{{ proceedings.event_description|safe|linebreaksbr }}</p> </div> -{% endif %} -<p>{{ proceedings.event_description|safe|linebreaksbr }}</p> -{% if proceedings.picture %} - <figure class="mx-4 my-2"> - <img style="max-width: 100%;" src="{{ proceedings.picture.url }}" alt="picture"/> - {% if proceedings.picture_credit %}<figcaption>{{ proceedings.picture_credit }}</figcaption>{% endif %} - </figure> - <br> -{% endif %} + + {% if proceedings.cover_image %} + <div class="col-2"> + <img style="max-width: 100%" + class="d-flex me-3" + src="{{ proceedings.cover_image.url }}" + alt="cover_image" /> + </div> + {% endif %} + + {% if proceedings.picture %} + <div class="col-12"> + <figure class="mx-4 my-2"> + <img style="max-width: 100%" + src="{{ proceedings.picture.url }}" + alt="picture" /> + + {% if proceedings.picture_credit %}<figcaption>{{ proceedings.picture_credit }}</figcaption>{% endif %} + + </figure> + <br /> + </div> + {% endif %} + +</div> {% if 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 }}" type="application/gzip" download>LaTeX (gzipped tarball)</a></li> - {% else %} - <li>Template will be available soon!</li> - {% endif %} + + {% if proceedings.template_latex_tgz %} + + <li> + <a href="{{ proceedings.template_latex_tgz.url }}" + type="application/gzip" + download>LaTeX (gzipped tarball)</a> + </li> + {% else %} + + <li>Template will be available soon!</li> + {% endif %} + </ul> </li> <li> @@ -46,19 +80,35 @@ </ul> {% endif %} -{% if proceedings.cover_image %} - </div> - <div class="col-md-2"> - <img style="max-width: 100%;" class="d-flex me-3" src="{{ proceedings.cover_image.url }}" alt="cover_image"/> - </div> - </div> -{% endif %} {% if proceedings.fellowships.all.exists %} + <h3>(Guest) Fellows responsible for this Issue</h3> <ul> + {% for fellow in proceedings.fellowships.all %} - <li>{{ fellow.contributor.profile.get_title_display }} {{ fellow.contributor.user.first_name }} {{ fellow.contributor.user.last_name }}{% if fellow.contributor.affiliation.name %}, {{ fellow.contributor.affiliation.name }}{% endif %}</li> + + <li> + {{ fellow.contributor.profile.get_title_display }} {{ fellow.contributor.user.first_name }} {{ fellow.contributor.user.last_name }} + + {% if fellow.contributor.affiliation.name %}, {{ fellow.contributor.affiliation.name }}{% endif %} + + </li> {% endfor %} + + </ul> {% endif %} + +{% if proceedings.preface_title and proceedings.preface_text %} + + <details class="border border-primary bg-primary bg-opacity-10 p-2 my-4"> + <summary> + <div class="p-2 border-bottom border-primary border-opacity-50 d-flex justify-content-between align-content-center"> + <span class="fs-4 fs-bold text-primary">{{ proceedings.preface_title }}</span> <span class="text-muted">(click to expand/contract)</span> + </div> + <p class="details-preview p-2 mb-0">{{ proceedings.preface_text|safe|truncatewords_html:60 }}</p> + </summary> + <p class="card-text p-2">{{ proceedings.preface_text|safe|linebreaksbr }}</p> + </details> +{% endif %} diff --git a/scipost_django/scipost/static/scipost/assets/config/preconfig.scss b/scipost_django/scipost/static/scipost/assets/config/preconfig.scss index 25416435d9e5bc630516ad1a263e3c97958d94f0..b47abe90de8a04b4e4464510922d8bba421bae13 100644 --- a/scipost_django/scipost/static/scipost/assets/config/preconfig.scss +++ b/scipost_django/scipost/static/scipost/assets/config/preconfig.scss @@ -253,4 +253,18 @@ summary { // Rotate the equilateral triangle when summary is open details[open] summary.list-triangle::before { content: "â–¼"; +} + + +// Utilities for details element +// Hide details preview when open +details[open] { + .details-preview { + display: none; + } +} +details[closed] { + .details-preview { + display: unset; + } } \ No newline at end of file