-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Conditionally split the edit_translation html template based on version
- Loading branch information
Showing
4 changed files
with
218 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
85 changes: 85 additions & 0 deletions
85
wagtail_localize/templates/wagtail_localize/admin/edit_translation_legacy.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
{% extends "wagtailadmin/generic/edit.html" %} | ||
{% load i18n wagtailadmin_tags %} | ||
|
||
{% block bodyclass %}page-editor{% endblock %} | ||
|
||
{% block titletag %}{% blocktrans with instance=translation.source.as_instance locale=translation.target_locale %}Translation of {{ instance }} into {{ locale }}{% endblocktrans %}{% endblock %} | ||
|
||
{% block content %} | ||
{% if is_page %} | ||
<div class="w-sticky w-top-0 w-z-header"> | ||
{% include 'wagtailadmin/shared/headers/page_edit_header.html' with page=instance page_for_status=instance page_perms=page_perms content_type=instance.content_type %} | ||
{% include "wagtailadmin/shared/side_panels.html" with page=instance page_for_status=instance page_perms=page_perms content_type=instance.content_type in_explorer=True %} | ||
</div> | ||
{% else %} | ||
<div class="w-sticky w-top-0 w-z-header"> | ||
{% include 'wagtail_localize/admin/includes/generic_header.html' %} | ||
</div> | ||
{% include "wagtailadmin/shared/header.html" with title=instance icon="snippet" merged=1 only %} | ||
{% endif %} | ||
|
||
<header class="w-flex w-flex-col sm:w-flex-row w-items-center w-justify-between w-bg-grey-50 w-px-0 w-py-0 w-mb-0 w-relative w-top-0 w-min-h-slim-header"> | ||
<div class="w-pl-slim-header sm:w-pl-5 w-min-h-slim-header sm:w-pr-2 w-w-full w-flex-1 w-overflow-x-auto w-box-border"> | ||
<div class="w-flex w-flex-1 w-items-center w-overflow-hidden w-p-4 header-meta--locales"> | ||
{% if source_translation.editUrl %} | ||
<a href="{{ source_translation.editUrl }}">{{ source_translation.locale.displayName }}</a> | ||
{% else %} | ||
{{ source_translation.locale.displayName }} | ||
{% endif %} | ||
<svg aria-hidden="true" class="icon icon-arrow-right w-w-4 w-h-4"> | ||
<use href="#icon-arrow-right"></use> | ||
</svg> | ||
{% if translations %} | ||
<div class="c-dropdown t-inverted" data-dropdown="" style="display: inline-block"> | ||
<a | ||
href="javascript:void(0)" | ||
class="c-dropdown__button u-btn-current button button-small button-nobg text-notransform" | ||
> | ||
{{ target_locale.get_display_name }} | ||
<div | ||
data-dropdown-toggle="" | ||
class="o-icon c-dropdown__toggle c-dropdown__togle--icon [ icon icon-arrow-down ]" | ||
style="padding-left: 5px;" | ||
> | ||
{% icon name="arrow-down" %} | ||
{% icon name="arrow-up" %} | ||
</div> | ||
</a> | ||
<div class="t-dark"> | ||
<ul class="c-dropdown__menu u-toggle u-arrow u-arrow--tl u-background"> | ||
{% for label, url in translations %} | ||
<li class="c-dropdown__item "> | ||
<a href="{{ url }}" aria-label="" class="u-link is-live"> | ||
{{ label }} | ||
</a> | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
</div> | ||
</div> | ||
{% else %} | ||
{{ target_locale.get_display_name }} | ||
{% endif %} | ||
</div> | ||
</div> | ||
</header> | ||
<div class="js-translation-editor" data-props="{{ props }}"> | ||
{# Generates the CSRF token hidden input. This is read by the JavaScript. #} | ||
{% csrf_token %} | ||
</div> | ||
{% endblock %} | ||
|
||
{% block extra_js %} | ||
{% include "wagtailadmin/pages/_editor_js.html" %} | ||
|
||
<script src="{% url 'wagtail_localize:javascript_catalog' %}"></script> | ||
<script src="{% versioned_static 'wagtailadmin/js/page-chooser-modal.js' %}"></script> | ||
<script src="{% versioned_static 'wagtailadmin/js/page-chooser.js' %}"></script> | ||
<script src="{% versioned_static 'wagtailimages/js/image-chooser-modal.js' %}"></script> | ||
<script src="{% versioned_static 'wagtailimages/js/image-chooser.js' %}"></script> | ||
<script src="{% versioned_static 'wagtaildocs/js/document-chooser-modal.js' %}"></script> | ||
<script src="{% versioned_static 'wagtaildocs/js/document-chooser.js' %}"></script> | ||
<script src="{% versioned_static 'wagtailadmin/js/chooser-modal.js' %}"></script> | ||
<script src="{% versioned_static 'wagtailsnippets/js/snippet-chooser.js' %}"></script> | ||
<script src="{% versioned_static 'wagtail_localize/js/wagtail-localize.js' %}"></script> | ||
{% endblock %} |
Oops, something went wrong.