diff --git a/eoapublications/management/commands/publicationimport.py b/eoapublications/management/commands/publicationimport.py index b173d8c..818afff 100644 --- a/eoapublications/management/commands/publicationimport.py +++ b/eoapublications/management/commands/publicationimport.py @@ -443,6 +443,11 @@ def handle(self, **options): Newelement.Order = xmlChild.get('order') Newelement.Fulltext = self.process_as_string(xmlChild) Newelement.save() + if xmlChild.tag == "EOAparagraph" and xmlChild.get("class") == "divider": + Newelement.Kind = 'eoadivider' + Newelement.Order = xmlChild.get('order') + Newelement.Fulltext = self.process_as_string(xmlChild) + Newelement.save() if xmlChild.tag == "EOAsection": Newelement.Kind = 'eoasection' Newelement.Order = xmlChild.get('order') diff --git a/eoapublications/migrations/0003_add_divider.py b/eoapublications/migrations/0003_add_divider.py new file mode 100644 index 0000000..afbfa31 --- /dev/null +++ b/eoapublications/migrations/0003_add_divider.py @@ -0,0 +1,18 @@ +# Generated by Django 2.1.11 on 2020-02-28 13:10 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('eoapublications', '0002_auto_20191111_1816'), + ] + + operations = [ + migrations.AlterField( + model_name='element', + name='Kind', + field=models.CharField(choices=[('eoaparagraph', 'Paragraph'), ('eoaquotedparagraph', 'Quoted Paragraph'), ('eoafigure', 'Figure'), ('eoasection', 'Section'), ('eoasubsection', 'Subsection'), ('eoasubsubsection', 'Subsubsection'), ('eoaequation', 'Equation'), ('eoatranscription', 'Transcription'), ('eoatheorem', 'Theorem'), ('eoatable', 'Table'), ('eoafootnote', 'Footnote'), ('eoafacsimilepage', 'Facsimile Page'), ('eoadescription', 'Description'), ('eoaletterhead', 'Letterhead'), ('eoadivider', 'Divider')], max_length=30), + ), + ] diff --git a/eoapublications/models.py b/eoapublications/models.py index 1e66160..e0dcde7 100644 --- a/eoapublications/models.py +++ b/eoapublications/models.py @@ -160,7 +160,8 @@ class Element(models.Model): ('eoafacsimilepage', 'Facsimile Page'), ('eoadescription', 'Description'), # ('eoatheorem', 'Theorem'), - ('eoaletterhead', 'Letterhead') + ('eoaletterhead', 'Letterhead'), + ('eoadivider', 'Divider') ) Kind = models.CharField(max_length=30,choices=KINDS) Boxed = models.BooleanField(default=False) diff --git a/eoapublications/templates/publications/chapter/chapter_base.html b/eoapublications/templates/publications/chapter/chapter_base.html index d712c6c..283f2e4 100644 --- a/eoapublications/templates/publications/chapter/chapter_base.html +++ b/eoapublications/templates/publications/chapter/chapter_base.html @@ -167,6 +167,9 @@

{% include "publications/chapter/eoatable-first.html" %} {% endif %} {% else %} + {% if Element.Kind == 'eoadivider' %} + {% include "publications/chapter/eoadivider.html" %} + {% endif %} {% if Element.Kind == 'eoaparagraph' %} {% include "publications/chapter/eoaparagraph.html" %} {% endif %} diff --git a/eoapublications/templates/publications/chapter/eoadivider.html b/eoapublications/templates/publications/chapter/eoadivider.html new file mode 100644 index 0000000..82aaf65 --- /dev/null +++ b/eoapublications/templates/publications/chapter/eoadivider.html @@ -0,0 +1 @@ +

*