{% extends "base.html" %}

{% block navigation %}
    <ts-sketch-navigation sketch-id="{{ sketch.id }}" active="stories" graphs-enabled="{{ graphs_enabled }}"></ts-sketch-navigation>
{% endblock %}

{% block right_nav %}
    {% if sketch.timelines %}
        <ts-create-story sketch-id="{{ sketch.id }}"></ts-create-story>
    {% endif %}
{% endblock %}

{% block main %}

        <div class="row">
            <div class="col-md-12">
                {% if sketch.has_permission(user=current_user, permission='write') and not sketch.timelines %}
                    <div class="card">
                        <div class="text-center" style="padding:100px;">
                            <h3 style="color:#777"><i class="fa fa-meh-o"></i> No data to analyze</h3>
                            <a class="btn btn-success" href="{{ url_for('sketch_views.timelines', sketch_id=sketch.id) }}"><i class="fa fa-plus"></i> Add timeline</a>
                        </div>
                    </div>
                {% else %}
                    <div class="card" style="padding:30px;">
                        {% if story %}
                            <ts-story sketch-id="{{ sketch.id }}" story-id="{{ story.id }}"></ts-story>
                        {% else %}
                            <h4>Stories</h4>
                            <ts-story-list sketch-id="{{ sketch.id }}" show-create-button="true"></ts-story-list>
                        {% endif %}
                    </div>
                {% endif %}
            </div>
        </div>

{% endblock %}
