{% extends "base.html" %}

{% block title %}{{ object.name }} - {{ block.super }}{% endblock title %}


{% block content %}
<h1>{{ object.name }}</h1>

<ul>
  <li>Created on: {{ object.created }}</li>
  {% if is_guardian %}
  <li><a href="{{ object.get_edit_url }}">Edit community</a></li>
  {% endif %}
  {% if object.website %}
  <li><a href="{{ object.website }}">Website</a></li>
  {% endif %}

</ul>

<p>
  {% if object.guardian %}
  <a href="">Contact the guardian of this community: {{ object.guardian.profile.get_absolute_url }}</a>
  {% else %}
  <a href="{% url 'hub_application' %}">Apply to be the guardian of this community</a>
  {% endif %}
</p>

{% if not is_member and not is_owner %}
<form method="post" action="{{ object.get_membership_url }}">
  <p>
    {% csrf_token %}
    <button type="submit">Subscribe to this community</button>
  </p>
</form>
{% endif %}

{{ object.description|linebreaks }}

{% endblock content %}

{% extends "base.html" %}

{% block title %}{{ object.name }} - {{ block.super }}{% endblock title %}


{% block content %}
<h1>{{ object.name }}{% if not object.is_published %}(DRAFT){% endif %}</h1>

<ul>
  <li>Created on: {{ object.created }}</li>
  {% if is_guardian %}
  <li><a href="{{ object.get_edit_url }}">Edit community</a></li>
  {% endif %}
  {% if object.website %}
  <li><a href="{{ object.website }}">Website</a></li>
  {% endif %}

</ul>

<p>
  {% if object.guardian %}
  <a href="">Contact the guardian of this community: {{ object.guardian.profile.get_absolute_url }}</a>
  {% else %}
  <a href="{% url 'hub_application' %}">Apply to be the guardian of this community</a>
  {% endif %}
</p>

{% if not is_member and not is_owner %}
<form method="post" action="{{ object.get_membership_url }}">
  <p>
    {% csrf_token %}
    <button type="submit">Subscribe to this community</button>
  </p>
</form>
{% endif %}

{{ object.description|linebreaks }}

{% endblock content %}

Make evident when a community is draft mode.
Make evident when a community is draft mode.

When a community is in draft mode is only visible
to the guardian.
