{% set hide_left_bar = True %}
{% extends g.theme.master %}
{% block title %}{{user.display_name}} / Profile{% endblock %}
{% block header %}{{ user.display_name|default(user.username) }}{% endblock %}
{% block extra_css %}
<link rel="stylesheet" type="text/css"
href="{{g.app_static('css/user_profile.css')}}"/>
{% endblock %}
{% block head %}
<link rel="alternate" type="application/rss+xml" title="RSS" href="feed.rss">
<link rel="alternate" type="application/atom+xml" title="Atom" href="feed.atom">
{% endblock %}
{% block actions %}
<a href="{{c.app.url}}feed.rss" title="Follow"><b data-icon="{{g.icons['feed'].char}}" class="ico {{g.icons['feed'].css}}"></b></a>
{% endblock %}
{% block content %}
{% if user.preferences.email_address %}
<p>{{lib.gravatar(user)}}</p>
{% endif %}
<div class="project-list grid-18">
<b>Projects</b>
<ul>
{% for p in user.my_projects() %}
{% if h.has_access(p, 'read')() %}
<li>
<a class="project-name" href="{{p.url()}}">{{p.name}}</a>
</li>
{% endif %}
{% endfor %}
</ul>
</div>
<div class="grid-24">
<div class="grid-24" style="margin:0;"><b>Personal data</b></div>
{% if user.get_pref('sex') == 'Male' or user.get_pref('sex') == 'Female' %}
<div class="grid-24" style="margin:0;">
<div class="grid-4">Gender:</div>
<div class="grid-8">{{user.get_pref('sex')}}</div>
</div>
{% endif %}
{% if user.get_pref('birthdate') %}
<div class="grid-24" style="margin:0;">
<div class="grid-4">Birthdate:</div>
<div class="grid-8">
{{ user.get_pref('birthdate').strftime('%d %B %Y')}}
</div>
</div>
{% endif %}
{% if user.get_pref('localization').country or user.get_pref('localization').city %}
<div class="grid-24" style="margin:0;">
<div class="grid-4">Localization:</div>
<div class="grid-8">
{% if user.get_pref('localization').city %}
{{user.get_pref('localization').city}}{{ ',' if user.get_pref('localization').country else '' }}
{% endif %}
{% if user.get_pref('localization').country %}
{{user.get_pref('localization').country}}
{% endif %}
</div>
</div>
{% endif %}
{% if user.get_pref('timezone') %}
<div class="grid-24" style="margin:0;">
<div class="grid-4">Timezone:</div>
<div class="grid-8">
{{user.get_pref('timezone')}}
</div>
</div>
{% endif %}
{% if user.get_pref('socialnetworks')|length > 0 %}
<div class="grid-24" style="margin:0;">
<div class="grid-4">Social networks:</div>
<div class="grid-18">
{{user.get_pref('display_name')}}'s account(s):
<ul>
{% for i in user.get_pref('socialnetworks') %}
<li>{{i.socialnetwork}}: <a href="{{i.accounturl}}">{{i.accounturl}}</a></li>
{% endfor %}
</ul>
</div>
</div>
{% endif %}
{% if user.get_pref('webpages')|length > 0 %}
<div class="grid-24" style="margin:0;">
<div class="grid-4">Websites:</div>
<div class="grid-18">
{{user.get_pref('display_name')}}'s website(s):
<ul>
{% for i in user.get_pref('webpages') %}
<li><a href="{{i}}">{{i}}</a></li>
{% endfor %}
</ul>
</div>
</div>
{% endif %}
{% if user.get_pref('telnumbers')|length > 0 %}
<div class="grid-24" style="margin:0;">
<div class="grid-4">Telephone number(s):</div>
<div class="grid-18">
{{user.get_pref('display_name')}}'s telephone number(s):
<ul>
{% for i in user.get_pref('telnumbers') %}
<li>{{i}}</li>
{% endfor %}
</ul>
</div>
</div>
{% endif %}
{% if user.get_pref('skypeaccount') %}
<div class="grid-24" style="margin:0;">
<div class="grid-4">Skype account:</div>
<div class="grid-8">{{user.get_pref('skypeaccount')}}</div>
</div>
{% endif %}
{% if user.get_pref('timezone') and user.get_availability_timeslots() |length > 0 %}
<div class="grid-24" style="margin:0;">
<div class="grid-4">Availability:</div>
{% if c.user.get_pref('timezone') %}
<div class="grid-18" id="timeslotsconverted" style="visibility: visible; display:none;">
{{user.get_pref('display_name')}}'s availability time-slots.
<div style="float:right;">
See timeslots in:
<a href="JavaScript:void(0);" onclick="changeTimezone('utc')">UTC</a> |
<a href="JavaScript:void(0);" onclick="changeTimezone('local')">
{{user.get_pref('display_name')}}'s local time
</a> |
<b>Your local time</b>
</div>
<ul>
{% for i in user.get_localized_availability(c.user.get_pref('timezone')) %}
<li>{{i.week_day}}: from {{i.start_time.strftime("%H:%M")}} to {{i.end_time.strftime("%H:%M")}} </li>
{% endfor %}
</ul>
</div>
{% endif %}
<div class="grid-18" id="timeslotsutc" style="visibility: visible; display:block;">
{{user.get_pref('display_name')}}'s availability time-slots.
<div style="float:right;">
See timeslots in:
<b>UTC</b> |
<a href="JavaScript:void(0);" onclick="changeTimezone('local')">
{{user.get_pref('display_name')}}'s local time
</a>
{% if c.user.get_pref('timezone') %} |
<a href="JavaScript:void(0);" onclick="changeTimezone('converted')">
Your local time
</a>
{% endif %}
</div>
<ul>
{% for i in user.get_localized_availability('utc') %}
<li>{{i.week_day}}: from {{i.start_time.strftime("%H:%M")}} to {{i.end_time.strftime("%H:%M")}} </li>
{% endfor %}
</ul>
</div>
<div class="grid-18" id="timeslotslocal" style="visibility: visible; display:none;">
{{user.get_pref('display_name')}}'s availability time-slots.
<div style="float:right;">
See timeslots in:
<a href="JavaScript:void(0);" onclick="changeTimezone('utc')">UTC</a> |
<b>
{{user.get_pref('display_name')}}'s local time
</b>
{% if c.user.get_pref('timezone') %} |
<a href="JavaScript:void(0);" onclick="changeTimezone('converted')">
Your local time
</a>
{% endif %}
</div>
<ul>
{% for i in user.get_availability_timeslots() %}
<li>{{i.week_day}}: from {{i.start_time.strftime("%H:%M")}} to {{i.end_time.strftime("%H:%M")}} </li>
{% endfor %}
</ul>
</div>
</div>
</div>
{% endif %}
{% if user.get_inactive_periods(include_past_periods=False)|length > 0 %}
<div class="grid-24">
<div class="grid-4">Inactive periods:</div>
<div class="grid-18">
This user won't be able to work on the forge in the following period(s):
<ul>
{% for p in user.get_inactive_periods(include_past_periods=False) %}
<li>From {{p.start_date.strftime('%d %B %Y')}} to {{p.end_date.strftime('%d %B %Y')}}.</li>
{% endfor %}
</div>
</div>
{% endif %}
</div><!-- end of Personal data section -->
<div class="grid-24">
<b>Current {{user.get_pref('display_name')}}'s skills list</b>
<div class="grid-24">
{% if user.get_skills()|length > 0 %}
<table>
<thead>
<tr>
<th>Skill</th>
<th>Level</th>
<th>Comments</th>
</tr>
</thead>
<tbody>
{% for s in user.get_skills() %}
<tr>
<td>{{s.skill.fullpath}}</td>
<td>{{s.level}}</td>
<td>{{s.comment}}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<div class="grid-24">At the moment, {{user.get_pref('display_name')}}'s skills list is empty!</div>
{% endif %}
</div>
</div>
{% if c.user.username == user.username %}
<div class="address-list grid-18">
<b>Email Addresses</b>
<ul>
{% for email in user.email_addresses %}
<li>
{{lib.email_gravatar(email, size=24)}}
{% if email == user.preferences.email_address %}
<span class="prime email-address">{{email}}</span>
{% else %}
<span class="email-address">{{email}}</span>
{% endif %}
</li>
{% endfor %}
</ul>
</div>
<div class="openid-list grid-18">
<b>OpenIDs</b>
<ul>
{% for openid in user.open_ids %}
<li>
<span class="openid">{{openid}}</span>
</li>
{% endfor %}
</ul>
</div>
{% endif %}
{% endblock %}
{% block extra_js %}
<script type="text/javascript">
function changeTimezone(opt){
$("#timeslotslocal").hide();
$("#timeslotsutc").hide();
$("#timeslotsconverted").hide();
$("#timeslots" + opt).show();
}
</script>
{% endblock %}