<script id="abstract-modal-outer-template" type="text/x-handlebars-template">
    {{! Outer template for the abstract modal dialog }}
    <div class="modal {{modal_class}}">
        <div class="modal-header">
            <a href="#" class="close_modal">&times;</a>
            <h3>{{modal_title}}</h3>
        </div>
        <div class="alert_modal"></div>
        <div class="modal-body"></div>
        <div class="modal-footer">
            <div class="custom_btn_placeholder"></div>
            <button class="btn cancel" data-loading-text="{{#if btn_secondary_text}}{{btn_secondary_text}}{{else}}Cancel{{/if}}">
            {{#if btn_secondary_text}}{{btn_secondary_text}}{{else}}Cancel{{/if}}
            </button>
            <button class="btn btn-primary" data-loading-text="Loading...">
            {{#if btn_primary_text}}{{btn_primary_text}}{{else}}Commit{{/if}}
            </button>
        </div>
    </div>
</script>

<script id="confirmation_dialog-template" type="text/x-handlebars-template"> 
    {{! Template for the confirmation dialog }}
    <div class="alert alert-error error_answer"></div>
    <p>{{print_safe message}}</p>
</script>

<script id="fail_ajax_request-template" type="text/x-handlebars-template">
    {{! Template in case of ajax error }}
    Sorry, something went wrong with the ajax request. Please try again.
</script>

<script id="rename_item-modal-template" type="text/x-handlebars-template">
    {{! Template for the rename item dialog }}
    <div class="alert alert-error error_answer"></div>
    <form class="form">
        <fieldset>
        <legend>Rename {{type}} from {{old_name}} to:</legend>
        <div class="clearfix">
            <label for="new_name">New name</label>
            <div class="input">
                <input class="xlarge" id="focus_new_name" name="new_name" size="30" type="text" />
            </div>
        </div>
        </fieldset>
    </form>
</script>

<script id="renamed_item-alert-template" type="text/x-handlebars-template">
    {{! Confirmation dialog alert }}
    <div class="alert displayed_alert" data-alert="alert">
        <a class="close" href="#">&times;</a>
        <p>You successfully renamed {{type}} from <span class="name">{{old_name}}</span> to <span class="name">{{new_name}}</span>.</p>
    </div>
</script>



<script id="error_input-template" type="text/x-handlebars-template">
  <div class="alert alert-error alert_modal_content" data-alert="alert">
      <a class="close" href="#">&times;</a>
    {{#if ajax_fail}}
    Sorry, something went wrong with the ajax request. Please try again.
    {{#if error}}<br/>Error {{error.status}}: {{error.responseText}}{{/if}}
    {{/if}}
    {{#if port_is_used}}
        <p>Sorry the port you have chosen is already used.<p>
    {{/if}}
    {{#if port_isnt_integer}}
        <p>Please enter an integer for the port.</p>
    {{/if}}
    {{#if database_is_empty}}
        <p>Please do not use an empty name for a database.</p>
    {{/if}}
     {{#if database_exists}}
        <p>The chosen database's name is already being used. please choose another one.</p>
    {{/if}}
    {{#if namespace_is_empty}}
        <p>Please do not use an empty name for a table.</p>
    {{/if}}
    {{#if no_database}}
        <p>You have to select a database.</p>
    {{/if}}
    {{#if namespace_exists}}
        <p>The chosen table is already being used. Please choose another one.</p>
    {{/if}}
    {{#if datacenter_is_empty}}
        <p>Please do not use an empty name for a datacenter.</p>
    {{/if}}
    {{#if datacenter_exists}}
        <p>The chosen datacenter's name is already being used. please choose another one.</p>
    {{/if}}
    {{#if machine_is_empty}}
        <p>Please do not use an empty name for a server.</p>
    {{/if}}
    {{#if machine_exists}}
        <p>The chosen server's name is already being used. please choose another one.</p>
    {{/if}}
    {{#if cache_size_format}}
        <p>The cache size must be an intger.</p>
    {{/if}}
    {{#if cache_size_too_small}}
        <p>The cache size must be bigger than 16MB.</p>
    {{/if}}
    {{#if cache_size_too_big}}
        <p>The cache size must be smaller than 64GB.</p>
    {{/if}}
    {{#if special_char_detected}}
    <p>You can only use alphanumeric characters and underscores for a {{type}}'s name.</p>
    {{/if}}
    {{#if fail_create_secondary_index}}
    <p>The secondary index could not be created. Message returned by the driver:<br/>
    {{message}}</p>
    {{/if}}
  </div>
</script>
