diff --git a/journals/migrations/0074_journal_style.py b/journals/migrations/0074_journal_style.py new file mode 100644 index 0000000000000000000000000000000000000000..5127c9c1ae24f1992a070cfe8d94a6ad2f91400d --- /dev/null +++ b/journals/migrations/0074_journal_style.py @@ -0,0 +1,18 @@ +# Generated by Django 2.1.8 on 2019-09-23 09:14 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('journals', '0073_auto_20190923_1017'), + ] + + operations = [ + migrations.AddField( + model_name='journal', + name='style', + field=models.TextField(blank=True, help_text="CSS styling for the journal; the Journal's DOI should be used as class", null=True), + ), + ] diff --git a/journals/models/journal.py b/journals/models/journal.py index 7e5672e4d2b748a55eba510c47bbac4ed6407024..d974ad7679b8e16f379a41fdcb3d1f71a9fb0266 100644 --- a/journals/models/journal.py +++ b/journals/models/journal.py @@ -31,6 +31,10 @@ class Journal(models.Model): choices=JOURNAL_STRUCTURE, default=ISSUES_AND_VOLUMES) refereeing_period = models.DurationField(default=datetime.timedelta(days=28)) + style = models.TextField(blank=True, null=True, + help_text=('CSS styling for the journal; the Journal\'s DOI ' + 'should be used as class')) + objects = JournalQuerySet.as_manager() def __str__(self): diff --git a/journals/templates/journals/base.html b/journals/templates/journals/base.html index 6445c6ecab71aecafaed1168023b7d207811ac19..f650eea44e7af96a7cb31fb32ef2c6270de838b6 100644 --- a/journals/templates/journals/base.html +++ b/journals/templates/journals/base.html @@ -2,6 +2,12 @@ {% load staticfiles %} +{% if journal.style %} + {% block headsup %} + <style>{{ journal.style }}</style> + {% endblock headsup %} +{% endif %} + {% block pagetitle %}: {{ journal }}{% endblock pagetitle %} {% block body_class %}{{ block.super }} journals{% endblock %} @@ -35,6 +41,7 @@ </div> {% endblock %} + {% block secondary_footer %} <footer class="secondary container-fluid py-2"> <div class="row my-1">