|
1 | 1 | {% extends "groups/base.html" %} |
2 | 2 | {% set title = _('Change {group} group avatar')|f(group=profile.group.name) %} |
3 | 3 |
|
| 4 | +{# Build breadcrumb trail #} |
| 5 | +{% set crumbs = [(url('groups.list'), _('Groups')), (url('groups.profile', profile.slug), profile.group.name), (None, _('Change Avatar'))] %} |
| 6 | + |
4 | 7 | {% block content %} |
5 | | - <article id="change-avatar" class="main"> |
6 | | - <h1>{{ title }}</h1> |
7 | | - <form method="post" action="" enctype="multipart/form-data"> |
8 | | - {% csrf_token %} |
9 | | - <ul> |
10 | | - {{ form.as_ul()|safe }} |
11 | | - </ul> |
12 | | - <div class="submit"> |
13 | | - <input type="submit" value="{{ pgettext('avatar', 'Upload') }}" /> |
14 | | - <a href="{{ url('groups.profile', profile.slug) }}">{{ _('Cancel') }}</a> |
15 | | - </div> |
16 | | - </form> |
| 8 | + <article id="change-avatar"> |
| 9 | + <div class="avatar-edit-container"> |
| 10 | + <header class="avatar-edit-header"> |
| 11 | + <h1 class="sumo-page-heading">{{ title }}</h1> |
| 12 | + <p class="avatar-edit-description">{{ _('Upload a new avatar for your group. Supported formats: JPG, PNG') }}</p> |
| 13 | + </header> |
| 14 | + |
| 15 | + <form method="post" action="" enctype="multipart/form-data" id="avatar-form"> |
| 16 | + {% csrf_token %} |
| 17 | + |
| 18 | + <div class="avatar-edit-content"> |
| 19 | + <div class="avatar-preview-section"> |
| 20 | + <h2 class="section-title">{{ _('Preview') }}</h2> |
| 21 | + <div class="avatar-preview-wrapper"> |
| 22 | + <img id="avatar-preview" |
| 23 | + src="{% if profile.avatar %}{{ profile.avatar.url }}{% else %}{{ webpack_static('sumo/img/default-FFA-avatar.png') }}{% endif %}" |
| 24 | + alt="{{ _('Avatar preview') }}" |
| 25 | + class="avatar-preview-image" /> |
| 26 | + <div id="avatar-overlay" class="avatar-overlay hidden"> |
| 27 | + <span>{{ _('Preview') }}</span> |
| 28 | + </div> |
| 29 | + </div> |
| 30 | + <p class="avatar-preview-help">{{ _('This is how your avatar will appear') }}</p> |
| 31 | + </div> |
| 32 | + |
| 33 | + <div class="avatar-upload-section"> |
| 34 | + <h2 class="section-title">{{ _('Upload New Avatar') }}</h2> |
| 35 | + |
| 36 | + {% if form.errors %} |
| 37 | + <div class="form-errors"> |
| 38 | + {% for field in form %} |
| 39 | + {% for error in field.errors %} |
| 40 | + <p class="error-message">{{ error }}</p> |
| 41 | + {% endfor %} |
| 42 | + {% endfor %} |
| 43 | + {% for error in form.non_field_errors() %} |
| 44 | + <p class="error-message">{{ error }}</p> |
| 45 | + {% endfor %} |
| 46 | + </div> |
| 47 | + {% endif %} |
| 48 | + |
| 49 | + <div class="form-field"> |
| 50 | + <div class="file-input-wrapper"> |
| 51 | + {{ form.avatar }} |
| 52 | + <label for="id_avatar" class="file-input-label sumo-button secondary-button"> |
| 53 | + <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"> |
| 54 | + <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path> |
| 55 | + <polyline points="17 8 12 3 7 8"></polyline> |
| 56 | + <line x1="12" y1="3" x2="12" y2="15"></line> |
| 57 | + </svg> |
| 58 | + {{ _('Choose File') }} |
| 59 | + </label> |
| 60 | + <span id="file-name" class="file-name">{{ _('No file chosen') }}</span> |
| 61 | + </div> |
| 62 | + |
| 63 | + {% if form.avatar.help_text %} |
| 64 | + <p class="form-help-text">{{ form.avatar.help_text }}</p> |
| 65 | + {% endif %} |
| 66 | + </div> |
| 67 | + |
| 68 | + <div class="form-actions"> |
| 69 | + <button type="submit" class="sumo-button primary-button"> |
| 70 | + <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"> |
| 71 | + <polyline points="20 6 9 17 4 12"></polyline> |
| 72 | + </svg> |
| 73 | + {{ pgettext('avatar', 'Upload') }} |
| 74 | + </button> |
| 75 | + <a href="{{ url('groups.profile', profile.slug) }}" class="sumo-button secondary-button"> |
| 76 | + {{ _('Cancel') }} |
| 77 | + </a> |
| 78 | + </div> |
| 79 | + </div> |
| 80 | + </div> |
| 81 | + </form> |
| 82 | + </div> |
17 | 83 | </article> |
18 | 84 | {% endblock %} |
0 commit comments