{% extends "chart/base.twig" %}
{% block content %}

{{ parent() }}

{{ hook('publish_before_content') }}

<script type="text/javascript">
dw.backend.ready(function() {
    require(['dw/chart/publish'], function(publish) {
        publish.init('{{ chartUrl }}'{% if publish %}, true{% if republish %}, true{% endif %}{% endif %});
    });
});
</script>
<div class="dw-create-publish chart-editor">
    <div class="row">
        <div class="span5">

            {{ hook('render_chart_actions', chart, user) }}

        </div>
        <div class="span7">
            {% if user.isAbleToPublish %}

            <div class="messages"></div>

            <iframe src="{{ chartUrlLocal }}" id="iframe-vis" style="width:{{ embedWidth }};height:{{ embedHeight }}" allowfullscreen webkitallowfullscreen mozallowfullscreen oallowfullscreen msallowfullscreen></iframe>

            {% else %}

            <iframe src="/chart/{{ chart.id }}/preview" id="iframe-vis" style="width:{{ embedWidth }};height:{{ embedHeight }}" allowfullscreen webkitallowfullscreen mozallowfullscreen oallowfullscreen msallowfullscreen></iframe>


            {% endif %}
        </div>
    </div>

</div>


{% endblock %}
