byceps/byceps

View on GitHub
byceps/blueprints/site/user/avatar/templates/site/user/avatar/update_form.html

Summary

Maintainability
Test Coverage
{% extends 'layout/base.html' %}
{% from 'macros/forms.html' import form_buttons, form_field %}
{% from 'macros/icons.html' import render_icon %}
{% set simple_layout = true %}
{% set current_page = 'user_avatar' %}
{% set page_title = _('Upload avatar image') %}

{% block body %}

  <h1 class="title">{{ page_title }}</h1>

  <form action="{{ url_for('.update') }}" method="post" enctype="multipart/form-data" class="disable-submit-button-on-submit">
    <div class="main-body-box">
    {%- with %}
      {%- set caption %}
        {{ _('Allowed formats') }}: {{ allowed_types|sort|join(', ') }}<br>
        {{ _('Maximum image dimensions') }}: {{ maximum_dimensions.width }} &times; {{ maximum_dimensions.height }} {{ _('pixels') }}<br>
        {{ _('Maximum file size') }}: 150 KB<br>
        {{ _('If the image is not square it will be cropped.') }}
      {%- endset %}
      {{ form_field(form.image, maxlength=150000, accept='image/*', autofocus='autofocus', caption=caption) }}
    {%- endwith %}
    </div>

    {{ form_buttons(render_icon('upload') + ' ' + _('Upload')) }}
  </form>

{%- endblock %}