{{ header }}{{ column_left }}

<div id="content" class="OrderSuccessPage">

  <div class="page-header">

    <div class="container-fluid">

      <h1><i class="fa fa-th"></i>&nbsp;{{ heading_title }}</h1>

      <ul class="breadcrumb">

        {% for breadcrumb in breadcrumbs %}

        <li><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>

        {% endfor %}

      </ul>

    </div>

  </div>

  <div class="container-fluid">

    {{ unlicensed_notice }}

    {% if error_warning %}

    <div class="alert alert-danger autoSlideUp"><i class="fa fa-exclamation-circle"></i> {{ error_warning }}

      <button type="button" class="close" data-dismiss="alert">&times;</button>

    </div>

    {% endif %}

    {% if success %}

    <div class="alert alert-success autoSlideUp"><i class="fa fa-check-circle"></i> {{ success }}

      <button type="button" class="close" data-dismiss="alert">&times;</button>

    </div>

    <script>$('.autoSlideUp').delay(3000).fadeOut(600, function(){ $(this).show().css({'visibility':'hidden'}); }).slideUp(600);</script>

    {% endif %}

    <div class="panel panel-default">

      <div class="panel-heading">

        <h3 class="panel-title"><i class="fa fa-list"></i>&nbsp;<span style="vertical-align:middle;font-weight:bold;">Module settings</span></h3>

        <div class="storeSwitcherWidget">

          <div>

            <button type="button" class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown">&nbsp;{{ store.name }} {{ store.store_id == 0 ? " <strong>" ~ text_default ~ "</strong>" }}&nbsp;<span class="caret"></span><span class="sr-only">Toggle Dropdown</span></button>

            <ul class="dropdown-menu" role="menu">

              {% for st in stores %}

              <li><a href="index.php?route=extension/module/{{ moduleNameSmall }}&store_id={{ st.store_id }}&user_token={{ user_token }}">{{ st.name }}</a></li>

              {% endfor %} 

            </ul>

          </div>

        </div>

      </div>

      <div class="panel-body">

        <form action="{{ action }}" method="post" enctype="multipart/form-data" id="form"> 

          <input type="hidden" name="store_id" value="{{ store.store_id }}" />

          <div class="tabbable">

            <div class="tab-navigation form-inline">

              <ul class="nav nav-tabs mainMenuTabs" id="mainTabs">

                <li><a href="#controlpanel" role="tab" data-toggle="tab"><i class="fa fa-power-off"></i>&nbsp;Control Panel</a></li>

                <li><a href="#isense_support" role="tab" data-toggle="tab"><i class="fa fa-external-link"></i>&nbsp;Support</a></li>

              </ul>

              <div class="tab-buttons">

                <button type="submit" class="btn btn-success save-changes"><i class="fa fa-check"></i>&nbsp;Save Changes</button>

                <a onclick="location = '{{ cancel }}'" class="btn btn-warning"><i class="fa fa-times"></i>&nbsp;Cancel</a>

              </div> 

            </div><!-- /.tab-navigation --> 

            <div class="tab-content">

              <div id="controlpanel" class="tab-pane">{{ tab_controlpanel }}</div>

              <div id="isense_support" class="tab-pane">{{ tab_support }}</div>

            </div> <!-- /.tab-content --> 

          </div><!-- /.tabbable -->

        </form>

      </div> 

    </div>

  </div>

</div>

<script>

$('#mainTabs a:first').tab('show'); // Select first tab

$('.module-list').children().first().children('a').click();

if (window.localStorage && window.localStorage['currentTab']) {

  $('.mainMenuTabs a[href="'+window.localStorage['currentTab']+'"]').tab('show');

}

if (window.localStorage && window.localStorage['currentSubTab']) {

  $('a[href="'+window.localStorage['currentSubTab']+'"]').tab('show');

}

$('.fadeInOnLoad').css('visibility','visible');

$('.mainMenuTabs a[data-toggle="tab"]').click(function() {

  if (window.localStorage) {

    window.localStorage['currentTab'] = $(this).attr('href');

  }

});

$('a[data-toggle="tab"]:not(.mainMenuTabs a[data-toggle="tab"], .module_tabs a[data-toggle="tab"], .moduledata_promotedproducts_tabs a[data-toggle="tab"])').click(function() {

  if (window.localStorage) {

    window.localStorage['currentSubTab'] = $(this).attr('href');

  }

});



$(function() {

  showHideStuff($('#Checker'), $('#module_tabs'), 'yes');

  showHideStuff($('#OrderProductsChecker'), $('.orderproductimages'), 'yes');  

  showHideStuff($('#OrderSharingChecker'), $('.addthisurl'), 'yes');

  showHideStuff($('#showrelated'), $('.products'), 'no');

  showHideStuff($('#showrelated'), $('.limitrelated'), 'yes');

  

  

  if($('select[name="ordersuccesspage[DiscountType]"]').val() == 'P'){

    $('#percentageAddon').show();

  } else {

    $('#currencyAddon').show();

  }

  $('select[name="ordersuccesspage[DiscountType]').on('change', function(e){ 

    if($(this).val() == 'P') {

      $('#percentageAddon').show();

      $('#currencyAddon').hide();

    } else {

      $('#currencyAddon').show();

      $('#percentageAddon').hide();

    }	

    if($(this).val() == 'N') {

      $('.discountSettings').hide(300);

    } else {

      $('.discountSettings').show(300);

    }

  });

  if($('select[name="ordersuccesspage[DiscountType]"]').val() == 'N'){

    $('.discountSettings').hide();

  } else {

    $('.discountSettings').show();

  }	

});

</script>

{{ footer }}
