{% extends "portal_base.html" %}

{% block title %}{{ brief.title }}{% endblock %}

{% block portal_title %}{{ brief.title }}{% endblock %}
{% block portal_subtitle %}<span class="status-pill status-pill--{{ brief.status }}">{{ brief.get_status_display }}</span> <span class="dashboard-header__meta">Submitted {{ brief.submitted_at|date:"M j, Y" }}</span>{% endblock %}
{% block portal_actions %}<a href="{% url 'projects:dashboard' %}" class="btn-ghost">Back to projects</a>{% if brief.is_editable_by_client %}<a href="{% url 'projects:edit' pk=brief.pk %}" class="btn-primary">Edit brief</a>{% endif %}{% endblock %}

{% block portal_content %}
    <div class="portal-detail-grid">
      <div class="dashboard-panel portal-card">
        <h2 class="portal-section-title">Overview</h2>
        <dl class="portal-meta-list">
          {% if brief.budget_range %}<div><dt>Budget</dt><dd>{{ brief.get_budget_range_display }}</dd></div>{% endif %}
          <div><dt>Deadline</dt><dd>{% if brief.desired_deadline %}{{ brief.desired_deadline|date:"M j, Y" }}{% else %}Not specified{% endif %}</dd></div>
          <div><dt>Last updated</dt><dd>{{ brief.updated_at|date:"M j, Y, P" }}</dd></div>
        </dl>

        {% if brief.description %}
        <h3 class="portal-subtitle">Description &amp; goals</h3>
        <p class="portal-body-text">{{ brief.description|linebreaksbr }}</p>
        {% endif %}

        {% if brief.reference_links %}
        <h3 class="portal-subtitle">Reference links</h3>
        <p class="portal-body-text">{{ brief.reference_links|linebreaksbr }}</p>
        {% endif %}

        {% if brief.attachments.exists %}
        <h3 class="portal-subtitle">Attachments</h3>
        <ul class="portal-attachment-list">
          {% for attachment in brief.attachments.all %}
          <li>{{ attachment.original_filename }}</li>
          {% endfor %}
        </ul>
        {% endif %}
      </div>

        {% if brief.shows_quote_to_client %}
      <div class="dashboard-panel portal-card">
        <h2 class="portal-section-title">Quote from Tecvico</h2>
        <p class="portal-body-text">{{ brief.quote_text|linebreaksbr }}</p>
      </div>
      {% endif %}

      {% if brief.has_website_notes %}
      <div class="dashboard-panel portal-card">
        <h2 class="portal-section-title">Notes from Tecvico</h2>
        <p class="portal-body-text">{{ brief.website_notes|linebreaksbr }}</p>
      </div>
      {% endif %}
    </div>
{% endblock %}
