open-law/app/templates/user/edit_profile.html

58 lines
4.1 KiB
HTML

<!-- prettier-ignore -->
{% extends 'base.html' %}
{% include 'user/delete_profile_modal.html' %}
{% block content %}
<!-- component -->
<section>
<div class="w-full lg:w-4/12 px-4 mx-auto pt-6">
<div>
<!-- prettier-ignore -->
<div class="w-full lg:max-w-xl p-6 space-y-8 sm:p-8 bg-white rounded-lg shadow-xl dark:bg-gray-800">
{% if current_user.is_activated %}
<!-- prettier-ignore -->
<h2 class="text-2xl font-bold text-gray-900 dark:text-white">Edit your profile</h2>
{% else %}
<!-- prettier-ignore -->
<h2 class="text-2xl font-bold text-gray-900 dark:text-white">Create your profile</h2>
{% endif %}
<div>
<!-- prettier-ignore -->
<label class='block mb-2 text-sm font-medium text-gray-900 dark:text-white'>Account</label>
<input type="text" class='bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500' autocomplete="off" onCopy="return false" readonly value="{{current_user.wallet_id}}">
</div>
<!-- prettier-ignore -->
<form class="mt-8 space-y-6 from" role="form" action="{{ url_for('user.edit_profile') }}" method="post" enctype="multipart/form-data">
{{ form.hidden_tag() }}
<div>
<!-- prettier-ignore -->
{{form.name.label(class='block mb-2 text-sm font-medium text-gray-900 dark:text-white')}}
{{form.name(autocomplete="off", class='bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500')}}
</div>
<!-- prettier-ignore -->
{{form.avatar_img.label(class='block mb-2 text-sm font-medium text-gray-900 dark:text-white')}}
<div class="flex items-center mb-3">
<div>
{% if current_user.avatar_img %}
<img class=" w-14 h-14 rounded-full mr-3" src="data:image/jpeg;base64,{{ current_user.avatar_img }}" alt="user avatar">
{% else %}
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 56 56" stroke-width="1.5" stroke="currentColor" class="w-14 h-14"> <path stroke-linecap="round" stroke-linejoin="round" d="M17.982 18.725A7.488 7.488 0 0012 15.75a7.488 7.488 0 00-5.982 2.975m11.963 0a9 9 0 10-11.963 0m11.963 0A8.966 8.966 0 0112 21a8.966 8.966 0 01-5.982-2.275M15 9.75a3 3 0 11-6 0 3 3 0 016 0z" /> </svg>
{% endif %}
</div>
<div>
{{form.avatar_img(type='file', class='bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500', id="avatar_img",
value=current_user.avatar_img if current_user.avatar_img else "")}}</div>
</div>
<button type="submit" class="w-full px-5 py-3 text-base font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 sm:w-auto dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800">Save changes</button>
</form>
<button type="button" data-modal-target="delete_profile_modal" data-modal-toggle="delete_profile_modal" class="text-red-700 hover:text-white border border-red-700 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center mr-2 mb-2 dark:border-red-500 dark:text-red-500 dark:hover:text-white dark:hover:bg-red-600 dark:focus:ring-red-900">Delete you profile</button>
</div>
</div>
</div>
</section>
{% block right_sidebar %}{% endblock %}
<!-- prettier-ignore -->
{% endblock %}