Fix position of action buttons in image editor on mobile (#3771)

pull/4285/head
Julian Gallo 2018-02-14 08:26:35 -05:00 zatwierdzone przez Thibaud Colas
rodzic 8c0170bb62
commit 9e67741f2b
4 zmienionych plików z 60 dodań i 51 usunięć

Wyświetl plik

@ -8,6 +8,7 @@ Changelog
* Animate the chevron icon when opening sub-menus in the admin (Carlo Ascani)
* Fix: Status button on 'edit page' now links to the correct URL when live and draft slug differ (LB (Ben Johnston))
* Fix: Image title text in the gallery and in the chooser now wraps for long filenames (LB (Ben Johnston), Luiz Boaretto)
* Fix: Move image editor action buttons to the bottom of the form on mobile (Julian Gallo)
2.0 (xx.xx.xxxx) - IN DEVELOPMENT

Wyświetl plik

@ -275,6 +275,7 @@ Contributors
* Dave Bell
* Ben Weatherman
* Carlo Ascani
* Julian Gallo
Translators
===========

Wyświetl plik

@ -22,6 +22,7 @@ Bug fixes
* Status button on 'edit page' now links to the correct URL when live and draft slug differ (LB (Ben Johnston))
* Image title text in the gallery and in the chooser now wraps for long filenames (LB (Ben Johnston), Luiz Boaretto)
* Fix: Move image editor action buttons to the bottom of the form on mobile (Julian Gallo)
Upgrade considerations
======================

Wyświetl plik

@ -31,11 +31,12 @@
{% trans "Editing" as editing_str %}
{% include "wagtailadmin/shared/header.html" with title=editing_str subtitle=image.title icon="image" %}
<div class="row row-flush nice-padding">
<form action="{% url 'wagtailimages:edit' image.id %}" method="POST" enctype="multipart/form-data" novalidate>
{% csrf_token %}
<div class="col5">
<form action="{% url 'wagtailimages:edit' image.id %}" method="POST" enctype="multipart/form-data" novalidate>
{% csrf_token %}
<div class="row row-flush nice-padding">
<div class="col5">
<ul class="fields">
{% for field in form %}
@ -48,59 +49,64 @@
{% endif %}
{% endfor %}
<li>
<input type="submit" value="{% trans 'Save' %}" class="button" />
{% if user_can_delete %}
<a href="{% url 'wagtailimages:delete' image.id %}" class="button button-secondary no">{% trans "Delete image" %}</a>
{% endif %}
</li>
</ul>
</form>
</div>
<div class="col5 divider-after">
<h2 class="label">{% trans "Focal point (optional)" %}</h2>
<p>{% trans "To define this image's most important region, drag a box over the image below." %} {% if image.focal_point %}({% trans "Current focal point shown" %}){% endif %}</p>
{% image image max-800x600 as rendition %}
<div class="focal-point-chooser"
style="max-width: {{ rendition.width }}px; max-height: {{ rendition.height }}px;"
data-focal-point-x="{{ image.focal_point_x }}"
data-focal-point-y="{{ image.focal_point_y }}"
data-focal-point-width="{{ image.focal_point_width }}"
data-focal-point-height="{{ image.focal_point_height }}">
<img {{ rendition.attrs }} data-original-width="{{ image.width|unlocalize }}" data-original-height="{{ image.height|unlocalize }}" class="show-transparency">
<div class="current-focal-point-indicator{% if not image.has_focal_point %} hidden{% endif %}"></div>
</div>
<br />
<button class="button button-secondary no remove-focal-point">{% trans "Remove focal area" %}</button>
</div>
<div class="col2 ">
{% if url_generator_enabled %}
<a href="{% url 'wagtailimages:url_generator' image.id %}" class="button bicolor icon icon-link">{% trans "URL Generator" %}</a>
<hr />
{% endif %}
<div class="col5 divider-after">
<h2 class="label">{% trans "Focal point (optional)" %}</h2>
<p>{% trans "To define this image's most important region, drag a box over the image below." %} {% if image.focal_point %}({% trans "Current focal point shown" %}){% endif %}</p>
{% image image original as original_image %}
{% image image max-800x600 as rendition %}
<dl>
<dt>{% trans "Max dimensions" %}</dt>
<dd>{{ original_image.width }}x{{ original_image.height }}</dd>
<dt>{% trans "Filesize" %}</dt>
<dd>{% if filesize %}{{ filesize|filesizeformat }}{% else %}{% trans "File not found" %}{% endif %}</dd>
<div class="focal-point-chooser"
style="max-width: {{ rendition.width }}px; max-height: {{ rendition.height }}px;"
data-focal-point-x="{{ image.focal_point_x }}"
data-focal-point-y="{{ image.focal_point_y }}"
data-focal-point-width="{{ image.focal_point_width }}"
data-focal-point-height="{{ image.focal_point_height }}">
{% usage_count_enabled as uc_enabled %}
{% if uc_enabled %}
<dt>{% trans "Usage" %}</dt>
<dd>
<a href="{{ image.usage_url }}">{% blocktrans count usage_count=image.get_usage.count %}Used {{ usage_count }} time{% plural %}Used {{ usage_count }} times{% endblocktrans %}</a>
</dd>
<img {{ rendition.attrs }} data-original-width="{{ image.width|unlocalize }}" data-original-height="{{ image.height|unlocalize }}" class="show-transparency">
<div class="current-focal-point-indicator{% if not image.has_focal_point %} hidden{% endif %}"></div>
</div>
<br />
<button class="button button-secondary no remove-focal-point" type="button">{% trans "Remove focal area" %}</button>
</div>
<div class="col2 ">
{% if url_generator_enabled %}
<a href="{% url 'wagtailimages:url_generator' image.id %}" class="button bicolor icon icon-link">{% trans "URL Generator" %}</a>
<hr />
{% endif %}
</dl>
{% image image original as original_image %}
<dl>
<dt>{% trans "Max dimensions" %}</dt>
<dd>{{ original_image.width }}x{{ original_image.height }}</dd>
<dt>{% trans "Filesize" %}</dt>
<dd>{% if filesize %}{{ filesize|filesizeformat }}{% else %}{% trans "File not found" %}{% endif %}</dd>
{% usage_count_enabled as uc_enabled %}
{% if uc_enabled %}
<dt>{% trans "Usage" %}</dt>
<dd>
<a href="{{ image.usage_url }}">{% blocktrans count usage_count=image.get_usage.count %}Used {{ usage_count }} time{% plural %}Used {{ usage_count }} times{% endblocktrans %}</a>
</dd>
{% endif %}
</dl>
</div>
</div>
</div>
<div class="row row-flush nice-padding">
<div class="col5">
<input type="submit" value="{% trans 'Save' %}" class="button" />
{% if user_can_delete %}
<a href="{% url 'wagtailimages:delete' image.id %}" class="button button-secondary no">{% trans "Delete image" %}</a>
{% endif %}
</div>
</div>
</form>
{% endblock %}