{% extends 'base.html' %}

{% block content %}
  <div class="container mt-4">
    <h2>{{ title }}</h2>
    <form method="post">
      {% csrf_token %}
      {{ form.as_p }}
      <button type="submit" class="btn btn-primary">Save</button>
      {% if form.instance.pk %}
      <a href="{% url 'portfolio_detail' pk=form.instance.pk %}" class="btn btn-secondary">Cancel</a>
      {% else %}
      <a href="{% url 'portfolio_list' %}" class="btn btn-secondary">Cancel</a>
      {% endif %}
    </form>
  </div>
{% endblock %}