{% extends "account/base.html" %}
{% load kegweblib %}
{% load crispy_forms_tags %}

{% block title %}Untappd Settings | {{ block.super }}{% endblock %}
{% block pagetitle %}Untappd Settings{% endblock %}

{% block kb-account-main %}

{% if profile %}
<h4>Untappd Account</h4>
<div class="well">
<p class="lead">
    Untappd is currently linked to <b>{{ profile.first_name }} {{ profile.last_name }}</b>.
</p>
<p>
<form method="post" action="{% url "plugin-untappd-redirect" %}">
    {% csrf_token %}
    <button type="submit" class="btn btn-info" name="submit-link">
      <i class="icon-repeat icon-white"></i> Re-link Account</button>
    </button>
    <button type="submit" class="btn btn-danger" name="submit-remove">
      <i class="icon-remove icon-white"></i> Remove Account</button>
    </button>
</form>
</p>
</div>

{% else %}
<h4>Link Untappd Account</h4>
<div class="well">
    <p class="lead">
      Link an Untappd account to your Kegbot account.  
    <p>
    <form method="post" action="{% url "plugin-untappd-redirect" %}">
        {% csrf_token %}
        <button type="submit" class="btn btn-info" name="submit">
          <i class="icon-share-alt icon-white"></i> Link Account</button>
        </button>
    </form>
</p>
</div>
{% endif %}

<h4>Settings</h4>
<div class="well">
<p class="lead">
  Control how Kegbot will use use your account. 
</p>
<form method="post" action="">
   {% csrf_token %}
   {{ settings_form|crispy }}
    <button type="submit" class="btn btn-success" name="submit-settings">
      <i class="icon-edit icon-white"></i> Update Settings</button>
    </button>
</form>
</div>

{% endblock %}
