{% extends "pages/wiki/base.html" %}

{% block title %}
	{{ page.title }}
{% endblock title %}

{% block content %}

{{ page }}

<!-- Modal -->
<div class="modal fade" id="confirmDelete" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h4 class="modal-title" id="exampleModalLabel">Are you sure?</h4>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body">
        <p>Are you sure you want to delete {{ page.title }}?  This cannot be undone.</p>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-outline-secondary" data-dismiss="modal">No</button>
        <a role="button" class="btn btn-outline-danger" href="{{ url_for('wikidelete', url=page.url) }}">Yes, delete</a>
      </div>
    </div>
  </div>
</div>

{% endblock content %}

{% block sidebar %}

{% if page.tags %}
<hr>
<div class="btn-group" role="group" aria-label="Basic example">
	<button type='button' class="btn btn-secondary btn-sem"><strong>Tags</strong></button>
  {% for tag in page.tags.split(',') %}
    <a role="button" class="btn btn-outline-secondary btn-sm" href="{{ url_for('wikitag', name=tag.strip()) }}">{{ tag|trim }}</a>
  {% endfor %}
</div>
{% endif %}
<br>
<hr>
<a role="button" class="btn btn-outline-primary" href="{{ url_for('wikiedit', url=page.url) }}">Edit</a>
<a role="button" class="btn btn-outline-warning" href="{{ url_for('wikimove', url=page.url) }}">Move</a>
<a role="button" class="btn btn-outline-danger" href="#confirmDelete" data-toggle="modal" class="text-error">Delete</a>
{% endblock sidebar %}
