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
2016-04-01 23:44:31 +02:00

77 lines
3.5 KiB
Twig

{% extends 'settings/general/master.twig' %}
{% set mode = 'Profile' %}
{% block description %}
<p>These are the external account links etc. on your profile, shouldn't need any additional explanation for this one.</p>
{% endblock %}
{% set months = {
1: "January",
2: "February",
3: "March",
4: "April",
5: "May",
6: "June",
7: "July",
8: "August",
9: "September",
10: "October",
11: "November",
12: "December",
} %}
{% set birthday = user.birthday|split('-') %}
{% block settingsContent %}
<form enctype="multipart/form-data" method="post" action="{{ route('settings.general.profile') }}">
{% for field in fields %}
<div class="profile-field" id="{{ field.id }}">
<div>
<h2>{{ field.name }}</h2>
</div>
<div>
<input type="{{ field.type }}" name="profile_{{ field.id }}" class="inputStyling" placeholder="{{ field.description }}"{% if user.profileFields[field.id].value %}{% if field.type == 'checkbox' and user.profileFields[field.id].value == 'true' %} checked="checked" value="profile_{{ field.id }}"{% else %} value="{{ user.profileFields[field.id].value }}"{% endif %}{% endif %} />
</div>
{% if field.additional %}
{% for id,addit in field.additional %}
<div>
<input type="{{ addit[0] }}" id="{{ id }}" name="profile_additional_{{ id }}"{% if user.profileFields[field.id][id] %}{% if addit[0] == 'checkbox' and user.profileFields[field.id][id] == true %} checked="checked"{% else %} value="{{ user.profileFields[field.id][id] }}"{% endif %}{% endif %} />
<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">
<option value="0"{% if not birthday[2] %} selected="selected"{% endif %}>--</option>
{% for i in 1..31 %}
<option value="{{ i }}"{% if birthday[2] == i %} selected="selected"{% endif %}>{{ i }}</option>
{% endfor %}
</select>
Month: <select name="birthday_month">
<option value="0"{% if not birthday[1] %} selected="selected"{% endif %}>--</option>
{% for i in 1..12 %}
<option value="{{ i }}"{% if birthday[1] == i %} selected="selected"{% endif %}>{{ months[i] }}</option>
{% endfor %}
</select>
Year: <select name="birthday_year">
<option value="0"{% if not birthday[0] %} selected="selected"{% endif %}>----</option>
{% for i in "now"|date('Y')..("now"|date('Y') - 100) %}
<option value="{{ i }}"{% if birthday[0] == i %} selected="selected"{% endif %}>{{ i }}</option>
{% endfor %}
</select>
</div>
</div>
<div class="profile-save">
<button name="session" value="{{ session_id() }}" class="inputStyling">Save</button>
<button type="reset" class="inputStyling">Reset</button>
</div>
</form>
{% endblock %}