This commit is contained in:
22
iris-web/source/app/templates/modals/add_customer.html
Normal file
22
iris-web/source/app/templates/modals/add_customer.html
Normal file
@@ -0,0 +1,22 @@
|
||||
<script>
|
||||
function submit_new_customer() {
|
||||
$.ajax({
|
||||
url: '/customer/add',
|
||||
type: "POST",
|
||||
data: $('form#form_new_customer').serialize(),
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
jsdata = data;
|
||||
if (jsdata.status == "success") {
|
||||
$('#modal_add_customer').modal();
|
||||
notify_success(jsdata.message);
|
||||
} else {
|
||||
$('#modal_customer_message').text(jsdata.message);
|
||||
}
|
||||
},
|
||||
error: function (error) {
|
||||
notify_error(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
@@ -0,0 +1,16 @@
|
||||
{% if attributes and attributes|length > 0 %}
|
||||
<div class="row text-center">
|
||||
<ul class="nav nav-pills nav-default mr-4" id="pills-tab-custom-attr" role="tablist">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active show" id="pills-home-tab-nobd" data-toggle="pill" href="#details" role="tab" aria-controls="pills-home-nobd" aria-selected="false">Info</a>
|
||||
</li>
|
||||
|
||||
{% for ca in attributes %}
|
||||
<li class="nav-item submenu">
|
||||
<a class="nav-link" data-toggle="pill" href="#{{page_uid}}{{ loop.index }}_{{ ca.lower() | replace(' ', '_' ) }}" role="tab" aria-controls="{{page_uid}}{{ loop.index }}_{{ ca.lower() | replace(' ', '_' ) }}" aria-selected="false">{{ca}}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
{% endif %}
|
@@ -0,0 +1,87 @@
|
||||
{% if attributes and attributes|length > 0 %}
|
||||
{% for ca in attributes %}
|
||||
{% set outer_loop = loop %}
|
||||
<div class="tab-pane {%if is_case_page %}{% if outer_loop.index == 1 %}{{"active show"}}{% endif %}{% endif %}"
|
||||
id="{% if is_case_page %}itab_{% endif %}{{page_uid}}{{ outer_loop.index }}_{{ ca.lower() | replace(' ', '_' ) }}"
|
||||
aria-labelledby="{% if is_case_page %}itab_{% endif %}{{page_uid}}{{ outer_loop.index }}_{{ ca.lower() | replace(' ', '_' ) }}-tab">
|
||||
{% for cle in attributes[ca] %}
|
||||
{% set tag_id = cle.lower() | replace(' ', '_' ) %}
|
||||
<div class="form-group row">
|
||||
<div class="col-12">
|
||||
|
||||
{% if attributes[ca][cle]["type"] == "input_string" %}
|
||||
<div class="form-input">
|
||||
<label for="{{ cle }}">{{ cle }} {% if attributes[ca][cle]['mandatory'] %} * {% endif %}
|
||||
</label>
|
||||
<input type="text" id="inpstd_{{page_uid}}{{ loop.index }}_{{ tag_id }}"
|
||||
data-attr-for="{{cle}}" data-ref-tab="{{ca}}" class="form-control col-md-12"
|
||||
{% if attributes[ca][cle]['value'] %} value="{{ attributes[ca][cle]['value'] }}" {% endif %}
|
||||
{% if attributes[ca][cle]['mandatory'] %} required {% endif %}
|
||||
/>
|
||||
</div>
|
||||
{% elif attributes[ca][cle]["type"] == "input_checkbox" %}
|
||||
<div class="form-check">
|
||||
<label class="form-check-label">
|
||||
<input type="checkbox" id="inpchk_{{page_uid}}{{ loop.index }}_{{ tag_id }}"
|
||||
data-attr-for="{{cle}}" data-ref-tab="{{ca}}" class="form-control col-md-12"
|
||||
{% if attributes[ca][cle]['value'] == True %} checked {% endif %}
|
||||
{% if attributes[ca][cle]['mandatory'] %} required {% endif %}
|
||||
/>
|
||||
<span class="form-check-sign"> {{ cle }}{% if attributes[ca][cle]['mandatory'] %} * {% endif %}
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
{% elif attributes[ca][cle]["type"] == "input_textfield" %}
|
||||
<div class="form-input">
|
||||
<label for="{{ cle }}">{{ cle }} {% if attributes[ca][cle]['mandatory'] %} * {% endif %}
|
||||
</label>
|
||||
<textarea class="form-control" id="inpstd_{{page_uid}}{{ loop.index }}_{{ tag_id }}"
|
||||
data-attr-for="{{cle}}" data-ref-tab="{{ca}}"
|
||||
rows="12" style="height:100%;"
|
||||
{% if attributes[ca][cle]['mandatory'] %} required {% endif %}
|
||||
>{{ attributes[ca][cle]['value'] }}</textarea>
|
||||
</div>
|
||||
|
||||
{% elif attributes[ca][cle]["type"] == "input_select" %}
|
||||
<div class="form-inline">
|
||||
|
||||
<label class="my-1 mr-2" for="inpselect_{{page_uid}}{{ loop.index }}_{{ tag_id }}">{{ cle }}</label>
|
||||
<select class="custom-select my-1 mr-sm-2" id="inpselect_{{page_uid}}{{ loop.index }}_{{ tag_id }}"
|
||||
data-attr-for="{{cle}}" data-ref-tab="{{ca}}">
|
||||
{% for opt in attributes[ca][cle]['options'] %}
|
||||
<option {% if opt == attributes[ca][cle]['value'] %} selected {% endif %}>{{ opt }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
{% elif attributes[ca][cle]["type"] == "input_date" %}
|
||||
<div class="form-input">
|
||||
<label class="my-1 mr-2" for="inpstd_{{page_uid}}{{ loop.index }}_{{ tag_id }}">{{ cle }} {% if attributes[ca][cle]['mandatory'] %} * {% endif %}</label>
|
||||
<input type="date" data-attr-for="{{cle}}" data-ref-tab="{{ca}}"
|
||||
id="inpstd_{{page_uid}}{{ loop.index }}_{{ tag_id }}" value="{{ attributes[ca][cle]['value'] }}"
|
||||
{% if attributes[ca][cle]['mandatory'] %} required {% endif %} >
|
||||
</div>
|
||||
|
||||
{% elif attributes[ca][cle]["type"] == "input_datetime" %}
|
||||
<div class="form-input">
|
||||
<label class="my-1 mr-2" for="inpstd_{{page_uid}}{{ loop.index }}_{{ tag_id }}">{{ cle }} {% if attributes[ca][cle]['mandatory'] %} * {% endif %}</label>
|
||||
<input type="datetime-local" data-attr-for="{{cle}}" data-ref-tab="{{ca}}"
|
||||
id="inpstd_{{page_uid}}{{ loop.index }}_{{ tag_id }}" value="{{ attributes[ca][cle]['value'] }}"
|
||||
{% if attributes[ca][cle]['mandatory'] %} required {% endif %}
|
||||
>
|
||||
</div>
|
||||
|
||||
{% elif attributes[ca][cle]["type"] == "raw" %}
|
||||
<p>{{ cle }}</p>
|
||||
|
||||
{% elif attributes[ca][cle]["type"] == "html" %}
|
||||
{{ attributes[ca][cle]['value']| safe }}
|
||||
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
Reference in New Issue
Block a user