Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Adding feature for parallel text
  • Loading branch information
kthoden committed Apr 29, 2020
1 parent 1ac00ca commit 030e6f2
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 0 deletions.
6 changes: 6 additions & 0 deletions eoapublications/management/commands/publicationimport.py
Expand Up @@ -452,6 +452,12 @@ 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("href") is not None:
Newelement.Kind = 'eoaparagraph'
Newelement.Paralleltextlink = xmlChild.get("href")
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/0005_add_paralleltextlink.py
@@ -0,0 +1,18 @@
# Generated by Django 2.1.11 on 2020-04-07 07:22

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('eoapublications', '0004_add_epigraph'),
]

operations = [
migrations.AddField(
model_name='element',
name='Paralleltextlink',
field=models.TextField(blank=True),
),
]
18 changes: 18 additions & 0 deletions eoapublications/migrations/0006_add_paralleltextlink.py
@@ -0,0 +1,18 @@
# Generated by Django 2.1.11 on 2020-04-07 07:28

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('eoapublications', '0005_add_paralleltextlink'),
]

operations = [
migrations.AlterField(
model_name='element',
name='Paralleltextlink',
field=models.TextField(blank=True, max_length=30),
),
]
18 changes: 18 additions & 0 deletions eoapublications/migrations/0007_add_paralleltextlink.py
@@ -0,0 +1,18 @@
# Generated by Django 2.1.11 on 2020-04-07 07:30

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('eoapublications', '0006_add_paralleltextlink'),
]

operations = [
migrations.AlterField(
model_name='element',
name='Paralleltextlink',
field=models.CharField(blank=True, max_length=30),
),
]
1 change: 1 addition & 0 deletions eoapublications/models.py
Expand Up @@ -171,6 +171,7 @@ class Element(models.Model):
Indentation = models.BooleanField(blank=True,default=False)
Epigraph = models.BooleanField(blank=True,default=False)
Listcharacter = models.CharField(max_length=1000,blank=True)
Paralleltextlink = models.CharField(max_length=30, blank=True)
Fulltext = models.TextField(blank=True)
Caption = models.TextField(blank=True)
Figureimagebig = models.ImageField(upload_to=filepath_chapter, blank=True)
Expand Down
Expand Up @@ -134,6 +134,9 @@ <h1 class="publication-detail__title">
{% if Element.Indexelements %}
<button class="icon-bookmark publications-popup-eye" data-content="{% for Indexelement in Element.Indexelements%} {{ Indexelement.Html }} {% endfor %}" title="" rel="popover" data-title="Keywords, Persons and Locations"></button>
{% endif %}
{% if Element.Paralleltextlink %}
<button class="icon-bookmark publications-popup-para" data-content="There is text (e.g. original transcription, a translation) directly linked to this paragraph: &lt;a href='{{ Element.Paralleltextlink }}'&gt;link&lt;/a&gt;" title="" rel="popover" data-title="Parallel text"></button>
{% endif %}
</div>
{% if forloop.first %}
{% if Element.Kind == 'eoasection' %}
Expand Down

0 comments on commit 030e6f2

Please sign in to comment.