{% extends "base.html" %}

{% block title %}{% if object %}Edit Brand{% else %}Add Brand{% endif %}{% endblock %}

{% block content %}
<main>
  <div class="header">
    <h1>{% if object %}Edit <span>{{ object.name }}</span>{% else %}Add a New <span>Brand</span>{% endif %}</h1>
  </div>

  <div class="login-form-container">
    <form method="post" class="incident-card">
      {% csrf_token %}
      
      <div class="form-group">
        <label for="{{ form.name.id_for_label }}">Brand Name</label>
        {{ form.name }}
      </div>
      
      <div class="form-group">
        <label for="{{ form.website.id_for_label }}">Website</label>
        {{ form.website }}
      </div>

      <div class="form-group">
        <label for="{{ form.logo_url.id_for_label }}">Logo URL</label>
        {{ form.logo_url }}
      </div>
      
      <div class="card-footer">
        <button type="submit" class="btn btn-review">{% if object %}Update Brand{% else %}Save Brand{% endif %}</button>
        <a href="{% url 'brand-list' %}" class="btn btn-secondary">Cancel</a>
      </div>
    </form>
  </div>
</main>
{% endblock %}
