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/settings/general.profile.twig

60 lines
3.3 KiB
Twig
Raw Normal View History

2016-01-17 01:58:31 +00:00
{% set birthday = user.birthday|split('-') %}
2015-09-08 21:57:33 +00:00
2015-08-28 20:32:31 +00:00
<form enctype="multipart/form-data" method="post" action="{{ sakura.currentPage }}" id="editProfileForm">
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-08-28 20:32:31 +00:00
<input type="hidden" name="mode" value="profile" />
{% for field in profile.fields %}
<div class="profile-field">
<div>
<h2>{{ field.field_name }}</h2>
2015-08-23 22:08:36 +00:00
</div>
2015-08-28 20:32:31 +00:00
<div>
<input type="{{ field.field_type }}" name="profile_{{ field.field_identity }}" class="inputStyling" placeholder="{{ field.field_description }}"{% if user.profileFields[field.field_identity].value %}{% if field.field_type == 'checkbox' and user.profileFields[field.field_identity].value == 'true' %} checked="checked" value="profile_{{ field.field_identity }}"{% else %} value="{{ user.profileFields[field.field_identity].value }}"{% endif %}{% endif %} />
2015-08-28 20:32:31 +00:00
</div>
{% if field.field_additional %}
{% for id,addit in field.field_additional %}
2015-08-28 20:32:31 +00:00
<div>
<input type="{{ addit[0] }}" id="{{ id }}" name="profile_additional_{{ id }}"{% if user.profileFields[field.field_identity][id] %}{% if addit[0] == 'checkbox' and user.profileFields[field.field_identity][id] == true %} checked="checked"{% else %} value="{{ user.profileFields[field.field_identity][id] }}"{% endif %}{% endif %} />
2015-08-28 20:32:31 +00:00
<label for="{{ id }}" style="font-size: 10px;">{{ addit[1]|raw }}</label>
</div>
{% endfor %}
{% endif %}
</div>
{% endfor %}
<div class="profile-field birthday">
<div>
<h2>Birthday</h2>
</div>
<div style="text-align: center;">
Day: <select name="birthday_day">
2015-09-08 21:57:33 +00:00
<option value="0"{% if not birthday[2] %} selected="selected"{% endif %}>--</option>
2015-08-28 20:32:31 +00:00
{% for i in 1..31 %}
2015-09-08 21:57:33 +00:00
<option value="{{ i }}"{% if birthday[2] == i %} selected="selected"{% endif %}>{{ i }}</option>
2015-08-28 20:32:31 +00:00
{% endfor %}
</select>
Month: <select name="birthday_month">
2015-09-08 21:57:33 +00:00
<option value="0"{% if not birthday[1] %} selected="selected"{% endif %}>--</option>
2015-08-28 20:32:31 +00:00
{% for i in 1..12 %}
2015-09-08 21:57:33 +00:00
<option value="{{ i }}"{% if birthday[1] == i %} selected="selected"{% endif %}>{{ profile.months[i] }}</option>
2015-08-28 20:32:31 +00:00
{% endfor %}
</select>
Year: <select name="birthday_year">
2015-09-08 21:57:33 +00:00
<option value="0"{% if not birthday[0] %} selected="selected"{% endif %}>----</option>
2015-08-28 20:32:31 +00:00
{% for i in "now"|date('Y')..("now"|date('Y') - 100) %}
2015-09-08 21:57:33 +00:00
<option value="{{ i }}"{% if birthday[0] == i %} selected="selected"{% endif %}>{{ i }}</option>
2015-08-28 20:32:31 +00:00
{% endfor %}
</select>
2015-08-23 22:08:36 +00:00
</div>
2015-08-28 20:32:31 +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>
</form>
<script type="text/javascript">
window.addEventListener("load", function() {
2015-09-16 20:34:36 +00:00
prepareAjaxForm('editProfileForm', 'Updating Profile...');
2015-08-28 20:32:31 +00:00
});
</script>