Skip to content

Commit

Permalink
Merge pull request #462 from UCL/feature/37
Browse files Browse the repository at this point in the history
Amending translation public view
  • Loading branch information
acholyn committed Aug 6, 2024
2 parents 02f53a7 + 6b0758e commit ebd8dc5
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 11 deletions.
14 changes: 11 additions & 3 deletions src/rard/templates/research/anonymousfragment_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,17 @@ <h5>{% trans 'Original Text' %} {{ forloop.counter }}</h5>
{% include 'research/partials/section/original_text_details.html' with show_concordances=True original_text=original_text can_edit=perms.research.change_fragment has_object_lock=has_object_lock %}

<div class='mt-3'>
{% for translation in original_text.translation_set.all %}
{% include 'research/partials/translation_preview.html' with translation=translation can_edit=perms.research.change_fragment has_object_lock=has_object_lock %}
{% endfor %}
{% if perms.research.change_fragment and has_object_lock %}
{% for translation in original_text.translation_set.all %}
{% include 'research/partials/translation_preview.html' with translation=translation can_edit=perms.research.change_fragment has_object_lock=has_object_lock %}
{% endfor %}
{% else %}
{% for translation in original_text.translation_set.all %}
{% if translation.approved %}
{% include 'research/partials/translation_preview.html' with translation=translation can_edit=perms.research.change_fragment has_object_lock=has_object_lock %}
{% endif %}
{% endfor %}
{% endif %}
</div>

</section>
Expand Down
14 changes: 11 additions & 3 deletions src/rard/templates/research/fragment_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,17 @@ <h5>{% trans 'Original Text' %} {{ forloop.counter }}</h5>
{% include 'research/partials/section/original_text_details.html' with show_concordances=True original_text=original_text can_edit=perms.research.change_fragment has_object_lock=has_object_lock %}

<div class='mt-3'>
{% for translation in original_text.translation_set.all %}
{% include 'research/partials/translation_preview.html' with translation=translation can_edit=perms.research.change_fragment has_object_lock=has_object_lock %}
{% endfor %}
{% if perms.research.change_fragment and has_object_lock %}
{% for translation in original_text.translation_set.all %}
{% include 'research/partials/translation_preview.html' with translation=translation can_edit=perms.research.change_fragment has_object_lock=has_object_lock %}
{% endfor %}
{% else %}
{% for translation in original_text.translation_set.all %}
{% if translation.approved %}
{% include 'research/partials/translation_preview.html' with translation=translation can_edit=perms.research.change_fragment has_object_lock=has_object_lock %}
{% endif %}
{% endfor %}
{% endif %}
</div>

</section>
Expand Down
4 changes: 2 additions & 2 deletions src/rard/templates/research/partials/translation_preview.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

{% load i18n humanize %}

<div class="card mb-3 bg-light {% if translation.approved %}border-success{% endif %}">
<div class="card mb-3 bg-light {% if translation.approved and has_object_lock %}border-success{% endif %}">
<div class="card-body">
<div class='card-text'>
<div class='d-flex justify-content-between'>
<div class='alphabetum'>
{{ translation.translated_text|safe }}
</div>
{% if translation.approved %}
{% if translation.approved and has_object_lock %}
<div class='text-success mt-n3'>
<small>{% trans 'Approved' %}</small>
</div>
Expand Down
14 changes: 11 additions & 3 deletions src/rard/templates/research/testimonium_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,17 @@ <h5>{% trans 'Original Text' %} {{ forloop.counter }}</h5>


<div class='mt-3'>
{% for translation in original_text.translation_set.all %}
{% include 'research/partials/translation_preview.html' with translation=translation can_edit=perms.research.change_testimonium has_object_lock=has_object_lock %}
{% endfor %}
{% if perms.research.change_testimonium and has_object_lock %}
{% for translation in original_text.translation_set.all %}
{% include 'research/partials/translation_preview.html' with translation=translation can_edit=perms.research.change_testimonium has_object_lock=has_object_lock %}
{% endfor %}
{% else %}
{% for translation in original_text.translation_set.all %}
{% if translation.approved %}
{% include 'research/partials/translation_preview.html' with translation=translation can_edit=perms.research.change_testimonium has_object_lock=has_object_lock %}
{% endif %}
{% endfor %}
{% endif %}
</div>


Expand Down

0 comments on commit ebd8dc5

Please sign in to comment.