{{!
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements.  See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership.  The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License.  You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
}}

{{#bs-panel heading=sectionLabel collapsible=true dismiss=false open=false }}
    <form class="form-horizontal" role="form">
      {{#each config in sectionConfigs}}
        {{#if config.isSet}}
          {{#view "configSet" configSet=config}}
              <div class="form-group">
                  <label class="col-sm-4 control-label">{{formatWordBreak view.configSet.trigger.label devider='.'}}</label>

                  <div class="col-sm-6">
                    {{view view.configSet.trigger.view
                      checked=view.configSet.trigger.value
                      disabled=view.configSet.trigger.readOnly
                    }}
                  </div>
              </div>
            {{#each config in view.configs}}
              {{partial "common/config"}}
            {{/each}}
          {{/view}}
        {{else}}
          {{partial "common/config"}}
        {{/if}}
      {{/each}}
    </form>
    {{#if isCustom}}
      {{#bs-button clicked="addProperty" class="add-property" type="link"}}{{t configs.add_property}}...{{/bs-button}}
    {{/if}}
{{/bs-panel}}
{{#bs-modal name="addPropertyModal" footerButtonsBinding="addPropertyModalButtons" titleBinding="addPropertyModalTitle"}}
{{! "Add Property"-form}}
    <form class="form-horizontal" role="form">
        <div {{bind-attr class=":form-group newConfig.hasError:has-error"}}>
            <div class="col-sm-4">
                <label class="control-label">{{t common.key}}</label>
            </div>
            <div class="col-sm-6">
              {{input value=newConfig.name class="form-control new-config-name"}}
            </div>
        </div>
        <div {{bind-attr class=":form-group"}}>
            <div class="col-sm-4">
                <label class="control-label">{{t common.value}}</label>
            </div>
            <div class="col-sm-6">
              {{input value=newConfig.value class="form-control new-config-value"}}
            </div>
        </div>
        <div class="form-group">
          {{#if newConfig.hasError}}
              <div class="col-sm-10">
                  <div class="alert alert-danger">
                    {{newConfig.messsage}}
                  </div>
              </div>
          {{/if}}
        </div>
    </form>
{{! "Add Property"-form end}}
{{/bs-modal}}
{{outlet bs-tooltip-box}}