This repository has been archived on 2024-06-26. You can view files and clone it, but cannot push or open issues or pull requests.
sakura/templates/yuuno/old-settings/account.username.twig

25 lines
1.6 KiB
Twig
Raw Normal View History

2016-03-27 22:15:51 +00:00
{% set eligible = user.getUsernameHistory ? (date().timestamp - user.getUsernameHistory()[0].change_time) > 2592000 : true %}
2015-09-16 20:34:36 +00:00
<form enctype="multipart/form-data" method="post" action="{{ sakura.currentPage }}" id="changeUsernameForm">
2016-03-27 22:15:51 +00:00
<input type="hidden" name="sessid" value="{{ session_id() }}" />
<input type="hidden" name="timestamp" value="{{ date().timestamp }}" />
2015-09-16 20:34:36 +00:00
<input type="hidden" name="mode" value="username" />
<h1 class="stylised" style="text-align: center; margin-top: 10px;{% if not eligible %} color: #c44;{% endif %}">You are {% if not eligible %}not {% endif %}eligible for a name change.</h1>
2016-03-31 20:03:25 +00:00
<h3 style="text-align: center;">{% if user.getUsernameHistory %}Your last name change was <time datetime="{{ user.getUsernameHistory[0]['change_time']|date('r') }}">{{ user.getUsernameHistory[0]['change_time']|date(config('date_format')) }}</time>.{% else %}This is your first username change.{% endif %}</h3>
2015-09-16 20:34:36 +00:00
{% if eligible %}
<div class="profile-field">
<div><h2>Username</h2></div>
2016-03-31 20:03:25 +00:00
<div><input type="text" name="username" placeholder="Enter your new username (at least {{ config('username_min_length') }} and at most {{ config('username_max_length') }} characters!)" class="inputStyling" /></div>
2015-09-16 20:34:36 +00:00
</div>
<div class="profile-save">
<input type="submit" value="Save" name="submit" class="inputStyling" />
<input type="reset" value="Reset" name="reset" class="inputStyling" />
</div>
{% endif %}
</form>
<script type="text/javascript">
window.addEventListener("load", function() {
prepareAjaxForm('changeUsernameForm', 'Changing username...');
});
</script>