Skip to content

Commit

Permalink
Merge branch 'main' into authors-label-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nickmwangemi committed Jul 23, 2023
2 parents be071c8 + 82ffc07 commit 239622a
Show file tree
Hide file tree
Showing 14 changed files with 40 additions and 7 deletions.
4 changes: 2 additions & 2 deletions africanlii/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def after_import_row(self, row, row_result, row_number=None, **kwargs):
ratification=Ratification.objects.get(pk=row_result.object_id),
country=row.get("country"),
ratification_date=row.get("ratification_date"),
signature_date=row.get("deposit_date"),
deposit_date=row.get("signature_date"),
signature_date=row.get("signature_date"),
deposit_date=row.get("deposit_date"),
)
r.save()
Binary file modified africanlii/static/images/cso-agp-logo-horizontal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified africanlii/static/images/eu_logo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified africanlii/static/images/indigo-trust-logo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions africanlii/templates/africanlii/_ratification_table.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ <h2>{% trans 'Ratified documents' %}</h2>
<thead>
<tr>
<th>{% trans 'Title' %}</th>
<th>{% trans 'Signature Date' %}</th>
<th>{% trans 'Ratification Date' %}</th>
<th>{% trans 'Deposit Date' %}</th>
<th>{% trans 'Signature Date' %}</th>
</tr>
</thead>
<tbody>
Expand All @@ -15,9 +15,9 @@ <h2>{% trans 'Ratified documents' %}</h2>
<td>
<a href="{% url 'document_detail' frbr_uri=ratification_country.ratification.work.frbr_uri|strip_first_character %}">{{ ratification_country.ratification.work.title }}</a>
</td>
<td>{{ ratification_country.signature_date.isoformat }}</td>
<td>{{ ratification_country.ratification_date.isoformat }}</td>
<td>{{ ratification_country.deposit_date.isoformat }}</td>
<td>{{ ratification_country.signature_date.isoformat }}</td>
</tr>
{% endfor %}
</tbody>
Expand Down
Binary file added liiweb/static/images/banner-small.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions liiweb/templates/liiweb/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
{% block hero-img %}
<img class="hero__background-img"
src="{% static 'images/banner.jpg' %}"
srcset="{% static 'images/banner-small.jpg' %} 770w,
{% static 'images/banner.jpg' %} 1920w"
sizes="100vw"
alt="{{ APP_NAME }}"
height="40"/>
{% endblock %}
Expand Down
18 changes: 18 additions & 0 deletions peachjam/migrations/0092_documentcontent_content_xml.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 3.2.16 on 2023-07-21 16:10

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("peachjam", "0091_peachjamsettings_mailchimp_form_url"),
]

operations = [
migrations.AddField(
model_name="documentcontent",
name="content_xml",
field=models.TextField(blank=True, null=True, verbose_name="document XML"),
),
]
13 changes: 12 additions & 1 deletion peachjam/models/core_document_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import tempfile

import magic
from cobalt.akn import datestring
from cobalt.akn import StructuredDocument, datestring
from cobalt.uri import FrbrUri
from countries_plus.models import Country
from django.conf import settings
Expand Down Expand Up @@ -813,11 +813,22 @@ class DocumentContent(models.Model):
content_text = models.TextField(
blank=True, null=True, verbose_name=_("document text")
)
# option XML content of the document
content_xml = models.TextField(
blank=True, null=True, verbose_name=_("document XML")
)

class Meta:
verbose_name = _("document content")
verbose_name_plural = _("document contents")

def akn_doc(self):
"""Get a cobalt StructureDocument instance for this document's XML, assuming it is AKN XML."""
if self.content_xml:
return StructuredDocument.for_document_type(self.document.frbr_uri_doctype)(
self.content_xml
)

@classmethod
def update_or_create_for_document(cls, document):
"""Extract the content from a document, whatever its format is."""
Expand Down
1 change: 1 addition & 0 deletions peachjam/pipelines.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from docpipe.xmlutils import unwrap_element

DOC_MIMETYPES = [
"application/vnd.oasis.opendocument.text",
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"application/msword",
"application/rtf",
Expand Down
Binary file modified peachjam/static/images/laws-africa-logo-horizontal-white.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified peachjam/static/images/laws-africa-logo-horizontal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified peachjam/static/images/laws-africa-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions peachjam/templates/peachjam/_ratifications.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@
<thead>
<tr>
<th>{% trans 'Country' %}</th>
<th>{% trans 'Signature Date' %}</th>
<th>{% trans 'Ratification Date' %}</th>
<th>{% trans 'Deposit Date' %}</th>
<th>{% trans 'Signature Date' %}</th>
</tr>
</thead>
<tbody>
{% for ratification in ratification.countries.all %}
<tr>
<td>{{ ratification.country.name }}</td>
<td>{{ ratification.signature_date.isoformat }}</td>
<td>{{ ratification.ratification_date.isoformat }}</td>
<td>{{ ratification.deposit_date.isoformat }}</td>
<td>{{ ratification.signature_date.isoformat }}</td>
</tr>
{% endfor %}
</tbody>
Expand Down

0 comments on commit 239622a

Please sign in to comment.