{% extends 'base/module.twig' %}

{% block content %}
<div class="container-fluid">

  <div v-show="tabs[0].active">

    <span class="visible-block text-x-large text-dark bottom-margin-medium">{tab_setting}</span>

    <div class="row">
      <div class="col-xs-12 col-md-8">
        <base-card
          class="padding-large bottom-margin-large"
        >

          <validation-provider
            tag="div"
            class="bottom-margin-large"
            name="galeriapage_status"
            rules=""
            v-slot="{ errors, valid }">
            <base-select
              name="galeriapage_status"
              :label="entry_status"
              v-model="configurations.galeriapage_status"
              :valid="valid"
              :disabled="disableForm">
              <option v-for="(value, key) in Type_Status.getEnumList()" :value="key" :key="key">{ value }</option>
            </base-select>
          </validation-provider>

          <validation-provider
            tag="div"
            class="bottom-margin-large"
            name="galeriapage_email"
            rules="required|email"
            v-slot="{ errors, valid }">
            <base-input
              :label="entry_email"
              name="galeriapage_email"
              v-model="configurations.galeriapage_email"
              :valid="valid"
              :error="errors[0]"
              :disabled="disableForm"
              :required="true">
            </base-input>
          </validation-provider>

          <validation-provider
            tag="div"
            class="bottom-margin-large"
            name="galeriapage_password"
            rules="required"
            v-slot="{ errors, valid }">
            <base-input
              :label="entry_password"
              name="galeriapage_password"
              v-model="configurations.galeriapage_password"
              :valid="valid"
              :error="errors[0]"
              :disabled="disableForm"
              :required="true">
            </base-input>
          </validation-provider>

        </base-card>
      </div>
      <div class="col-xs-12 col-md-4">
        <base-card
          class="padding-large bottom-margin-large"
        >

          <validation-provider
            tag="div"
            class="bottom-margin-large"
            name="galeriapage_environment"
            rules=""
            v-slot="{ errors, valid }">
            <base-select
              name="galeriapage_environment"
              :label="entry_environment"
              v-model="configurations.galeriapage_environment"
              :valid="valid"
              :disabled="disableForm">
              <option v-for="(value, key) in Type_Environment.getEnumList()" :value="key" :key="key">{ value }</option>
            </base-select>
          </validation-provider>

          <base-button
            class="right-margin-small bottom-margin-large"
            apperance="primary"
            size="medium"
            :full="true"
            :disabled="disableForm"
            :loading="loadingBtnStatus"
            @click.native="validateStatusApi">
            { button_verify_status }
          </base-button>

          <base-button
            class="right-margin-small"
            apperance="primary"
            size="medium"
            :full="true"
            :disabled="disableForm"
            :loading="loadingBtnLogin"
            @click.native="validateLogin">
            { button_verify_login }
          </base-button>

        </base-card>
      </div>
    </div>

  </div>

  <div v-show="tabs[1].active">

    <span class="visible-block text-x-large text-dark bottom-margin-medium">{tab_listing}</span>

    <base-card
      class="padding-large bottom-margin-large col-xs-12 col-md-8"
    >

      <validation-provider
        tag="div"
        class="bottom-margin-large"
        name="galeriapage_initial_description"
        rules=""
        v-slot="{ errors, valid }">
        <base-textarea
          :label="entry_initial_description"
          :description="entry_initial_description_text"
          name="galeriapage_initial_description"
          v-model="configurations.galeriapage_initial_description"
          :error="errors[0]"
          :valid="valid"
          rows="5"
          :disabled="disableForm">
        </base-textarea>
      </validation-provider>

      <validation-provider
        tag="div"
        class="bottom-margin-large"
        name="galeriapage_final_description"
        rules=""
        v-slot="{ errors, valid }">
        <base-textarea
          :label="entry_final_description"
          :description="entry_final_description_text"
          name="galeriapage_final_description"
          v-model="configurations.galeriapage_final_description"
          :error="errors[0]"
          :valid="valid"
          rows="5"
          :disabled="disableForm">
        </base-textarea>
      </validation-provider>

    </base-card>

  </div>

  <div v-show="tabs[2].active">

    <market-price
      :market-price="marketPriceObject"
      :invalid-form="invalid"
      :loading-btn="loadingBtn"
      @alert="(alertObject) => alert = alertObject"
      @updatedvalue="(value) => mktPrice = value"
      @deleted="(mktPriceId) => mktPriceDelete = [...mktPriceDelete, mktPriceId]"
      @errors="setErrors"
    >
    </market-price>

  </div>

  <div v-show="tabs[3].active">

    <span class="visible-block text-x-large text-dark bottom-margin-medium">{tab_order}</span>

    <base-card
      class="padding-large bottom-margin-large col-xs-12 col-md-8"
    >

      <span class="text-small text-dark visible-block bottom-margin-large">{ text_galeriapage_observation }</span>

      <validation-provider
        tag="div"
        class="bottom-margin-large"
        name="gp_order_status_waiting_payment"
        :rules="{
            handlerValidation: {
              valid: validateDuplicateStatus.valid[configurations.gp_order_status_waiting_payment],
              message: validateDuplicateStatus.message,
            }
        }"
        v-slot="{ errors, valid }">
        <base-select
          name="gp_order_status_waiting_payment"
          :label="entry_order_status_waiting_payment"
          v-model="configurations.gp_order_status_waiting_payment"
          :valid="valid"
          :error="errors[0]"
          :disabled="disableForm">
          <option v-for="(value, key) in order_statuses" :value="value.order_status_id" :key="value.order_status_id">{ value.name }</option>
        </base-select>
      </validation-provider>

      <validation-provider
        tag="div"
        class="bottom-margin-large"
        name="gp_order_status_approved"
        rules=""
        v-slot="{ errors, valid }">
        <base-select
          name="gp_order_status_approved"
          :label="entry_gp_order_status_approved"
          v-model="configurations.gp_order_status_approved"
          :valid="valid"
          :error="errors[0]"
          :disabled="disableForm">
          <option v-for="(value, key) in order_statuses" :value="value.order_status_id" :key="value.order_status_id">{ value.name }</option>
        </base-select>
      </validation-provider>

      <validation-provider
        tag="div"
        class="bottom-margin-large"
        name="gp_order_status_processing"
        rules=""
        v-slot="{ errors, valid }">
        <base-select
          name="gp_order_status_processing"
          :label="entry_gp_order_status_processing"
          :description="text_gp_order_status_processing"
          v-model="configurations.gp_order_status_processing"
          :valid="valid"
          :error="errors[0]"
          :disabled="disableForm">
          <option v-for="(value, key) in order_statuses" :value="value.order_status_id" :key="value.order_status_id">{ value.name }</option>
        </base-select>
      </validation-provider>

      <validation-provider
        tag="div"
        class="bottom-margin-large"
        name="gp_order_status_invoiced"
        rules=""
        v-slot="{ errors, valid }">
        <base-select
          name="gp_order_status_invoiced"
          :label="entry_gp_order_status_invoiced"
          v-model="configurations.gp_order_status_invoiced"
          :valid="valid"
          :error="errors[0]"
          :disabled="disableForm">
          <option v-for="(value, key) in order_statuses" :value="value.order_status_id" :key="value.order_status_id">{ value.name }</option>
        </base-select>
      </validation-provider>

      <validation-provider
        tag="div"
        class="bottom-margin-large"
        name="gp_order_status_send"
        rules=""
        v-slot="{ errors, valid }">
        <base-select
          name="gp_order_status_send"
          :label="entry_gp_order_status_send"
          v-model="configurations.gp_order_status_send"
          :valid="valid"
          :error="errors[0]"
          :disabled="disableForm">
          <option v-for="(value, key) in order_statuses" :value="value.order_status_id" :key="value.order_status_id">{ value.name }</option>
        </base-select>
      </validation-provider>

      <validation-provider
        tag="div"
        class="bottom-margin-large"
        name="gp_order_status_delivered"
        rules=""
        v-slot="{ errors, valid }">
        <base-select
          name="gp_order_status_delivered"
          :label="entry_gp_order_status_delivered"
          v-model="configurations.gp_order_status_delivered"
          :valid="valid"
          :error="errors[0]"
          :disabled="disableForm">
          <option v-for="(value, key) in order_statuses" :value="value.order_status_id" :key="value.order_status_id">{ value.name }</option>
        </base-select>
      </validation-provider>

      <validation-provider
        tag="div"
        class="bottom-margin-large"
        name="gp_order_status_canceled"
        rules=""
        v-slot="{ errors, valid }">
        <base-select
          name="gp_order_status_canceled"
          :label="entry_gp_order_status_canceled"
          v-model="configurations.gp_order_status_canceled"
          :valid="valid"
          :error="errors[0]"
          :disabled="disableForm">
          <option v-for="(value, key) in order_statuses" :value="value.order_status_id" :key="value.order_status_id">{ value.name }</option>
        </base-select>
      </validation-provider>

    </base-card>

  </div>

</div>
{% endblock %}