Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Model addition: divider
  • Loading branch information
kthoden committed Feb 28, 2020
1 parent a93a88f commit 9c362de
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 1 deletion.
5 changes: 5 additions & 0 deletions eoapublications/management/commands/publicationimport.py
Expand Up @@ -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')
Expand Down
18 changes: 18 additions & 0 deletions 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),
),
]
3 changes: 2 additions & 1 deletion eoapublications/models.py
Expand Up @@ -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)
Expand Down
Expand Up @@ -167,6 +167,9 @@ <h1 class="publication-detail__title">
{% 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 %}
Expand Down
@@ -0,0 +1 @@
<p class="divider" style="text-align: center;font-size: 20pt;">*</p>

0 comments on commit 9c362de

Please sign in to comment.