{% extends "dashboard_base.html" %}
{% load markdown_deux_tags %}
{% load avatar_tags %}

{% block header_title %}Account{% endblock %}

{% block content %}
<div class="content-main">
    <div class="container">
        <div class="row">
            <div class="col-md-12">
                {% if worker.user == user %}
                <h2>Your Profile</h2>
                {% else %}
                <h2>Worker Profile</h2>
                {% endif %}
                <div class="row">
                    {% with object as worker %}
                    <div class="col-md-3">
                        <div class="th" >{% avatar object 250 %}</div>
                        {% if user.is_authenticated %}
                        <ul class="social-btns">
                            {% if worker.skype %}<li><a class="btn btn-default" href="skype:{{worker.skype}}"><i class="fa fa-skype"></i> {{worker.skype}}</a></li>{% endif %}
                            {% if worker.github %}<li><a href="http://github.com/{{worker.github}}"><i class="fa fa-github"></i> {{worker.github}}</a></li>{% endif %}
                            {% if worker.twitter %}<li><a href="http://twitter.com/#/{{worker.twitter}}"><i class="fa fa-twitter"></i> {{worker.twitter}}</a></li>{% endif %}
                            {% if worker.facebook %}<li><a href="http://facebook.com/{{worker.facebook}}"><i class="fa fa-facebook"></i> {{worker.facebook}}</a></li>{% endif %}
                            {% if worker.instagram %}<li><a href="http://instagram.com/{{worker.instagram}}"><i class="fa fa-instagram"></i> {{worker.instagram}}</a></li>{% endif %}
                            {% if worker.linkedin %}<li><a href="http://linkedin.com/{{worker.linkedin}}"><i class="fa fa-linkedin"></i> {{worker.linkedin}}</a></li>{% endif %}
                        </ul>
                        {% else %}
                        <div class="clearfix"></div>
                        <p>Register or login to view worker contact information</p>
                        {% endif %}
                    </div>
                    <div class="col-md-6">
                        <h2 style="font-size:24pt">{% if worker.name %}{{worker.name}} ({{worker.user.username}}){% else %}{{worker}}{% endif %}</h2>
                        <hr />
                        <div class="why">
                            {% if worker.user == user %}
                            {% if worker.why %}{{worker.why|markdown}}
                            {% else %}<p>Update your profile and tell folks why you're a member of Code 4 Maine!</p>
                            {% endif %}
                            {% else %}
                            <p>This worker has not created a profile yet.</p>
                            {% endif %}
                        </div>
                        
                        {% if worker.website %}<h4>My personal webiste is {{worker.website|urlize}}</h4>{% endif %}
        
                        {% if worker.city %}<h4>They live in {{worker.city}}</h4>{% endif %}
        
                        {% if worker.user == user %}
                        <p><a href="{% url 'worker-update' %}" class="btn btn-primary">Update your profile</a></p>
                        {% endif %}
                    </div>
                    {% endwith %}
                </div>
            </div>
        </div>
    </div>
</div>
  
{% endblock %}
