<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" href="{$interface_base_url}/css/vendor.css" />
    <link rel="stylesheet" type="text/css" href="{$interface_base_url}/css/backend.css" />
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
    <script src="{$interface_base_url}/javascript/vendor.js"></script>
    <script src="{$interface_base_url}/javascript/configurator.js"></script>

    {if $message}
    {literal}
    <script type="text/javascript">
        $(window).load(function(){
            $('#messageModal').modal('show');
        });
    </script>
    {/literal}
    {/if}
	
</head>
<body>
    <div class="backend elements">
        <nav class="navbar navbar-default navbar-fixed-top">
            <div class="container-fluid">
                <div class="navbar-header">
                    <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                        <span class="sr-only">Navigation ein-/ausblenden</span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                    <a class="navbar-brand" href="//www.xtlive.at/de/xtlive5">
                        <img alt="logo" src="{$interface_base_url}/images/xtlive5.svg">
                    </a>
                </div>
                <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                    <div class="nav navbar-nav">
                        <form name="reloadForm" action="{$current_page}" method="POST">
                            <input type="hidden" name="action" value="">
                            <input type="hidden" name="xtlive_elements_configuration" value="doAction">
                            <button type="button" data-action="reload" class="btn btn-default btn-action navbar-btn">
                                <span class="glyphicon glyphicon-refresh"></span> Neu laden
                            </button>

                            <button type="button" data-action="cleanCache" class="btn btn-default btn-action navbar-btn">
                                <span class="glyphicon glyphicon-repeat"></span> Cache leeren
                            </button>
                        </form>
                    </div>
                    <div class="navbar-right fix-nav navbar-btn">
                        {if $xtlive_manager_link}<a href="#" {$xtlive_manager_link} class="btn btn-primary">Manager</a>{/if}
                        {if $xtlive_template_link}<a href="#" {$xtlive_template_link} class="btn btn-primary">Template</a>{/if}
                        <form method="post" action="{$current_page}" id="merchantForm" style="display: inline-block;">
                            <input type="hidden" name="xtlive_elements_configuration" value="doAction">
                            <input type="hidden" name="action" value="switchMerchant">
                            <input type="hidden" name="newMerchant" value="">
                            <div class="btn-group navbar-btn">

                                {foreach name=aussen from=$stores item=store}
                                {if $store.id eq $currentStore}
                                {assign var=currentStoreName value=$store.shop_domain}
                                {/if}
                                {/foreach}
                                <button type="button" class="btn btn-primary">{if $currentStoreName neq ''}Mandant: {$currentStoreName} {else}Wählen Sie ihren Mandanten{/if}</button>
                                <button type="button" class="btn btn-primary dropdown-toggle" id="dropdownMerchants" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                    <span class="caret"></span>
                                    <span class="sr-only">Menü ein-/ausblenden</span>
                                </button>
                                <ul class="dropdown-menu" aria-labelledby="dropdownMerchants">
                                    {foreach name=aussen from=$stores item=store}
                                    {if $store.id neq $currentStore}
                                    <li><a href="{$store.admin_link}" target="_blank">{$store.shop_domain}</a></li>
                                    {else}
                                    <li><a href="#">{$store.shop_domain}</a></li>
                                    {/if}
                                    {/foreach}
                                </ul>
                            </div>
                        </form>
                        <a href="//www.xtlive.at" target="_blank" class="btn btn-default">www.xtlive.at</a>
                        {*<a href="mailto: help@xtlive.at" class="btn btn-default navbar-btn"><span class="glyphicon glyphicon-info-sign"></span> Support</a>*}
                    </div>
                </div>
            </div>
            </form>
        </nav>
        <div class="container container-main">
            <div class="row">
                <div class="col-md-12">
                    <div class="jumbotron">
                        <h1>Willkommen bei xtlive Elements</h1>
                        {if $currentStoreName neq ''}
                        <h2 id="current-store">Ihr aktueller Mandant: {$currentStoreName}</h2>
                        {/if}
                        <p>Befüllen und warten Sie Ihren Shop im Handumdrehen – Seite anlegen – ein oder mehrere gewünschte xtlive Elemente auswählen – hinzufügen und befüllen – so einfach! Weitere Möglichkeiten und Features entnehmen Sie bitte dem Manual.<br><br> 
Viel Spaß!

                        </p>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-md-12">
                    <h2>Inhalte:</h2>
                    <div class="panel panel-primary">
                        <div class="panel-heading">Hier finden Sie Ihre gesamten Shop-Inhalte.
                            <a href="#" {$newContentJs} class="btn btn-default btn-sm pull-right"> <span class="glyphicon glyphicon-plus-sign"></span> Weitere <strong>Seite</strong> hinzufügen</a>
                        </div>
                        <div id="panelXtLiveElements" class="panel-body elements collapse-fix control-active helper">
                            <div class="list-group">
                                {foreach name=contentloop from=$contentList item=content}
                                <div class="list-item-element">
                                    <a class="list-group-item" data-context=".helper" role="button" data-toggle="collapse" href="#collapseXtLifeElements{$content.content_id}" aria-expanded="false" aria-controls="collapseBeispiel"> <span class="badge">{if !$content.subcontent}0{else}{$content.subcontent|@count}{/if}</span> {$content.content_title} </a>
                                    <div class="nav-list-item">
                                        <form name="editParentForm{$content.id}" action="{$current_page}" method="POST">
                                        <input type="hidden" name="action" value="">
                                        <input type="hidden" name="cid" value="{$content.content_id}">
                                        <input type="hidden" name="xtlive_elements_configuration" value="doAction">
                                        <button type="button" class="btn {if $content.content_status eq '1'}btn-success{else}btn-warning{/if} btn-action btn-sm" data-action="toggleState" data-toggle="tooltip" data-placement="top" title="Element{if $content.content_status eq '1'} inaktiv{else} aktiv{/if} setzen"> <span class="glyphicon glyphicon-eye-{if $content.content_status eq '1'}open{else}close{/if}"></span></button>
                                        <a href="#" {$content.editJs} class="btn btn-default btn-sm" data-toggle="tooltip" data-placement="top" title="Seite bearbeiten"> <span class="glyphicon glyphicon-cog"></span></a>
                                        <button type="button" class="btn btn-default btn-confirm btn-sm" data-action="delete" data-toggle="tooltip" data-placement="top" title="Seite löschen"> <span class="glyphicon glyphicon-trash"></span></button>
                                        </form>
                                    </div>
                                    <div class="collapse" id="collapseXtLifeElements{$content.content_id}">
                                        <div class="collapse-inner">
                                            <div class="table-responsive">
                                                <table class="table table-hover">
                                                    {if $content.subcontent}
                                                    <caption>Ihre xtlive Elemente auf der Seite: <strong>{$content.content_title}</strong></caption>
                                                    <thead>
                                                    <tr>
                                                        <th>Titel </th>
                                                        <th>Sortieren </th>
                                                        <th>Bearbeiten   </th>
                                                    </tr>
                                                    </thead>
                                                    <tbody>
                                                    {foreach name=subcontentloop from=$content.subcontent item=subcontent}
                                                    <tr>
                                                        <th scope="row">
                                                            <a {if !$subcontent.content_demo_mode}{$subcontent.editJs}{/if} type="button" class="btn btn-default btn-xs" data-container="body" data-toggle="popover" data-placement="left" data-src="{img img=$subcontent.content_type|cat:'.jpg' type=p plg=$subcontent.plugin subdir=icons path_only=true}" data-alt="{$subcontent.content_title}"> <span class="glyphicon glyphicon-search"></span> </a> <a href="#" {if $subcontent.content_demo_mode}data-toggle="modal" data-target="#demoModal" {else}{$subcontent.editJs}{/if}>{if $subcontent.content_demo_mode eq '1'}DEMO {/if}{$subcontent.content_title} {if $subcontent.content_type}({$subcontent.content_type}){/if}</a>
                                                        </th>
                                                        <td>
                                                            <form name="sortForm{$subcontent.id}" action="{$current_page}" method="POST">
                                                            <input type="hidden" name="action" value="">
                                                            <input type="hidden" name="cid" value="{$subcontent.content_id}">
                                                            <input type="hidden" name="parent" value="{$content.content_id}">
                                                            <input type="hidden" name="xtlive_elements_configuration" value="doAction">
                                                            <button type="button" class="btn btn-default btn-action btn-sm" data-action="sort-up" data-toggle="tooltip" data-placement="top" title="Element sortieren"{if $smarty.foreach.subcontentloop.first} disabled{/if}><span class="glyphicon glyphicon-chevron-up"></span></button>
                                                            <button type="button" class="btn btn-default btn-action btn-sm" data-action="sort-down" data-toggle="tooltip" data-placement="top" title="Element sortieren"{if $smarty.foreach.subcontentloop.last} disabled{/if}><span class="glyphicon glyphicon-chevron-down"></span></button>
                                                            </form>
                                                        </td>
                                                        <td>
                                                            <form name="editForm{$subcontent.id}" action="{$current_page}" method="POST">
                                                            <input type="hidden" name="action" value="">
                                                            <input type="hidden" name="cid" value="{$subcontent.content_id}">
                                                            <input type="hidden" name="parent" value="{$content.content_id}">
                                                            <input type="hidden" name="xtlive_elements_configuration" value="doAction">
                                                            <button type="button" class="btn {if $subcontent.content_status eq '1'}btn-success{else}btn-warning{/if} btn-action btn-sm" data-action="toggleState" data-toggle="tooltip" data-placement="top" title="Element{if $subcontent.content_status eq '1'} inaktiv{else} aktiv{/if} setzen"> <span class="glyphicon glyphicon-eye-{if $subcontent.content_status eq '1'}open{else}close{/if}"></span></button>
                                                            <a href="#" {if $subcontent.content_demo_mode}data-toggle="modal" data-target="#demoModal" {else}{$subcontent.editJs}{/if} class="btn btn-default btn-sm" data-toggle="tooltip" data-placement="top" title="Element bearbeiten"> <span class="glyphicon glyphicon-pencil"></span></a>
                                                            <button type="button" class="btn btn-default btn-confirm btn-sm" data-action="delete" data-toggle="tooltip" data-placement="top" title="Element löschen"> <span class="glyphicon glyphicon-trash"></span></button>
                                                            {hook key=xtlive_elements_configuration_content_options}
                                                            </form>
                                                        </td>
                                                    </tr>
                                                    {/foreach}
                                                    {else}
                                                    <caption>Derzeit sind keine xtlive Elemente auf der Seite <strong>{$content.content_title}</strong> vorhanden. <br>Diese Seite wird als normale Content-Seite im Webshop dargestellt.</caption>
                                                    {/if}
                                                    </tbody>
                                                </table>
                                            </div>
                                            <button type="button" class="btn btn-primary btn-insert-liveelement btn-md btn-block" data-toggle="modal" data-target="#contentElementsModal" data-parent="{$content.content_id}"> <span class="glyphicon glyphicon-plus-sign"></span> {if !$content.subcontent}Neues{else}Weiteres{/if} <strong>xtlive Element</strong> hinzufügen</button>
                                        </div>
                                    </div>
                                </div>
                                {/foreach}
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="modal modal--confirm fade" id="confirmModal" role="dialog" aria-labelledby="confirmModalLabel">
            <div class="modal-dialog" role="document">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Schließen"><span aria-hidden="true">×</span></button>
                        <h4 class="modal-title" id="confirmModalLabel">Sind Sie sicher, dass Sie das Element löschen möchten?</h4>
                    </div>
                    <div class="modal-footer">
                        <button type="button" data-dismiss="modal" class="btn btn-default btn-action btn-confirm-target">Ja</button>
                        <button type="button" data-dismiss="modal" class="btn btn-default">Nein</button>
                    </div>
                </div>
            </div>
        </div>
        <div class="modal modal--liveelements fade" id="contentElementsModal" tabindex="-1" role="dialog" aria-labelledby="contentElementsModalLabel">
            <div class="modal-dialog" role="document">
                <form name="insertLiveElementForm" action="{$current_page}" method="POST">
                    <input type="hidden" name="action" value="insert">
                    <input type="hidden" name="parent" value="">
                    <input type="hidden" name="xtlive_elements_configuration" value="doAction">
                    <input type="hidden" name="is_special_contentelement_status" value="1">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-label="Schließen"><span aria-hidden="true">×</span></button>
                            <h4 class="modal-title" id="contentElementsModalLabel">Wählen Sie Ihr gewünschtes xtlive Element</h4>
                        </div>
                        <div class="modal-body">
                            <div class="row">
                                {foreach name=contentElementsLoop from=$contentElements item=contentElement}
                                <div class="modal--liveelement--preview">
                                    <label class="label-ctype">
                                        <input type="radio" name="ctype" value="{$contentElement.type}">
                                        <figure>
                                            {if $contentElement.icon}
                                            <img src="{$contentElement.iconPath}/{$contentElement.icon}" class="img-responsive">
                                            {else}
                                            <img src="{$defaultIconPath}/t12.jpg" class="img-responsive">
                                            {/if}
                                            <figcaption>{$contentElement.name}</figcaption>
                                        </figure>
                                    </label>
                                </div>
                                {/foreach}
                            </div>
                            <div class="modal-footer">
                                <button type="submit" class="btn btn-primary btn-lg btn-no"> <span class="glyphicon glyphicon-plus-sign"></span> Hinzufügen</button>
                                <button type="button" class="btn btn-default btn-lg" data-dismiss="modal">Schließen</button>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
        <div class="modal fade" id="messageModal" tabindex="-1" role="dialog" aria-labelledby="messageModalLabel" data-message="<div class='text-center'><i class='fa fa-refresh fa-spin'></i> {txt key=TEXT_XTLIVE_ELEMENTS_CONFIGURATOR_LOADING_MESSAGE}</div>">
            <div class="modal-dialog" role="document">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Schließen"><span aria-hidden="true">×</span></button>
                        <h4 class="modal-title" id="messageModalLabel">Status</h4>
                    </div>
                    <div class="modal-body">
                        <div id="message">
                            {if $message}
                            {$message}
                            {/if}
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default btn-no-loader" data-dismiss="modal">Schließen</button>
                    </div>
                </div>
            </div>
        </div>

        <div class="modal fade" id="demoModal" tabindex="-1" role="dialog" aria-labelledby="demoModalLabel">
            <div class="modal-dialog" role="document">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Schließen"><span aria-hidden="true">×</span></button>
                        <h4 class="modal-title" id="demoModalLabel">Information</h4>
                    </div>
                    <div class="modal-body">
                        <div id="demoMessage">
                            Dies ist ein xtlive Element zu Demonstrationszwecken, welches nur deaktiviert oder gelöscht werden kann.
                            Legen Sie bitte eigene xtlive Elemente an, um diese bearbeiten zu können.
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default btn-no-loader" data-dismiss="modal">Schließen</button>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
</html>