diff options
Diffstat (limited to 'ishtar_common/templates/ishtar')
32 files changed, 958 insertions, 528 deletions
diff --git a/ishtar_common/templates/ishtar/basket_list.html b/ishtar_common/templates/ishtar/basket_list.html index 011ed97a0..43236aeb0 100644 --- a/ishtar_common/templates/ishtar/basket_list.html +++ b/ishtar_common/templates/ishtar/basket_list.html @@ -1,10 +1,19 @@ {% load i18n %} -<table> -<tr>{% for item in basket.items.all %} - <td><a class="display_details" href="#" onclick="load_window('{{item_url}}/{{item.pk}}/');"><i class="fa fa-info-circle" aria-hidden="true"></i></a></td> - <td>{{item.full_label}}</td> - <td><a class='async-link' data-target='#basket-content' href='{{delete_url}}/{{basket.pk}}/{{item.pk}}/'>{% trans "remove" %}</a></td></tr>{% endfor %} -</table> +<ul class="list-group"> + {% for item in basket.items.all %} + <li class="list-group-item"> + <a class="display_details" href="#" + onclick="load_window('{{item_url}}/{{item.pk}}/');"><i class="fa fa-info-circle" aria-hidden="true"></i> + </a> + <span>{{item.full_label}}</span> + <a class='async-link text-danger float-right' + data-target='#basket-content' + href='{{delete_url}}/{{basket.pk}}/{{item.pk}}/'> + <i class="fa fa-times" aria-hidden="true"></i> + </a> + </li> + {% endfor %} +</ul> <script type='text/javascript'> $("a.async-link").click(manage_async_link); </script> diff --git a/ishtar_common/templates/ishtar/blocks/advanced_shortcut_menu.html b/ishtar_common/templates/ishtar/blocks/advanced_shortcut_menu.html index cd7bf88f8..953b0ef40 100644 --- a/ishtar_common/templates/ishtar/blocks/advanced_shortcut_menu.html +++ b/ishtar_common/templates/ishtar/blocks/advanced_shortcut_menu.html @@ -1,49 +1,54 @@ +{% extends "ishtar/blocks/base_shortcut_menu.html" %} {% load i18n %} -{% if menu %} -<form method="post" action="{% url 'update-current-item' %}"> -<fieldset id='shortcut-menu'> -<span class="fa-stack short-menu-close"> - <i class="fa fa-circle fa-stack-2x"></i> - <i class="fa fa-times fa-stack-1x fa-inverse"></i> -</span> -<span class="fa-stack short-menu-open"> - <i class="fa fa-circle fa-stack-2x"></i> - <i class="fa fa-plus fa-stack-1x fa-inverse"></i> -</span> +{% block short_content %} <div class="short-menu-buttons btn-group" role="group"> - <button type="button" class="btn" id='short-menu-simple' title="{% trans 'Simple menu limited to your own items. Be careful only the last 100 items are displayed.' %}">{% trans "simple" %}</button> - <button type="button" class="btn btn-selected" id='short-menu-advanced' title="{% trans 'Advanced menu' %}">{% trans "advanced" %}</button> + <button type="button" class="btn btn-secondary" + id='short-menu-simple' title="{% trans 'Simple menu limited to your own items. Be careful only the last 100 items are displayed.' %}">{% trans "simple" %}</button> + <button type="button" class="btn btn-secondary active" id='short-menu-advanced' title="{% trans 'Advanced menu' %}">{% trans "advanced" %}</button> </div> -<div id='action_current_items'> -<p><i class="icon fa fa-thumb-tack fa-2x" aria-hidden="true" title="{% trans 'Pin an item in order to constrain default searches with this item. By default only your items are displayed. New created and modified items are auto-pin.' %}"></i></p> -<p> -<a href='' onclick='return activate_own_search();' class='activate_own_search{% if SHORTCUT_SEARCH == 'all' %} disabled{% endif %}'><i class="icon fa fa-user" aria-hidden="true" title="{% trans 'Search within my items' %}"></i></a> -<a href='' class='activate_all_search{% if SHORTCUT_SEARCH == 'own' %} disabled{% endif %}' onclick='return activate_all_search();'><i class="icon fa fa-users" aria-hidden="true" title="{% trans 'Search within all items' %}"></i></a> -</p> -<p> -<a href='' onclick='return load_shortcut_menu();' class='disabled'><i class="icon fa fa-2x fa-refresh" aria-hidden="true" title="{% trans 'Refresh menu' %}"></i></a> -</p> +<div id='action_current_items' class="btn-group" role="group"> + <button type="button" onclick='return activate_own_search();' + title="{% trans 'Search within my items' %}" + class='btn btn-secondary activate_own_search{% if SHORTCUT_SEARCH == "own" %} active{% endif %}'> + <i class="icon fa fa-user" aria-hidden="true"></i> + </button> + <button type="button" onclick='return activate_all_search();' + title="{% trans 'Search within all items' %}" + class='btn btn-secondary activate_all_search{% if SHORTCUT_SEARCH == "all" %} active{% endif %}'> + <i class="icon fa fa-users" aria-hidden="true"></i> + </button> + {% comment %} + <p> + <a href='' onclick='return load_shortcut_menu();' class='disabled'><i class="icon fa fa-2x fa-refresh" aria-hidden="true" title="{% trans 'Refresh menu' %}"></i></a> + </p> + {% endcomment %} </div> -<table id='current_items'> -{% for lbl, model_name, current, widget in menu %} -<tr> - <td><label for="current_{{model_name}}">{{lbl}}</label></td> - <td> - {{widget|safe}} - </td>{% with 'show-'|add:model_name as model_url%} - <td><a href='#' onclick='load_current_window("{% url model_url current %}", "{{model_name}}");' class='display_details'><i class="fa fa-info-circle" aria-hidden="true"></i></a></td> - <td><span class='disabled pin-action' onclick='$.get("{% url 'unpin' model_name %}", function(){load_shortcut_menu();});' title="{% trans 'Unpin' %}"> - <i class="fa fa-times"></i> - </span></td> - {% endwith %} -</tr> -{% endfor %} -</table> -</fieldset> -</form> -<script type='text/javascript'> +<p id='current_items'> + {% for lbl, model_name, current, widget in menu %} + <div class="form-group row"> + <label for="current_{{model_name}}" + class="col-sm-4 col-form-label">{{lbl}}</label> + <div class="col-sm-6"> + {{widget|safe}} + </div> + {% with 'show-'|add:model_name as model_url%} + <div class="col-sm-2"> + <a href='#' onclick='load_current_window("{% url model_url current %}", "{{model_name}}");' class='display_details'> + <i class="fa fa-info-circle" aria-hidden="true"></i> + </a> + <a href='#' + class='disabled pin-action text-danger' + onclick='$.get("{% url "unpin" model_name %}", function(){load_shortcut_menu();});' title="{% trans 'Unpin' %}"> + <i class="fa fa-times"></i> + </a> + </div> + {% endwith %} + </div> + </tr> + {% endfor %} +</p> +{% endblock %} + +{% block short_extrajs %} var advanced_menu = true; -{% if SHORTCUT_SHOW == 'off' %}var shortcut_menu_hide = true; -{% else %}var shortcut_menu_hide = false;{% endif %} -</script> -{% endif %} +{% endblock %} diff --git a/ishtar_common/templates/ishtar/blocks/base_shortcut_menu.html b/ishtar_common/templates/ishtar/blocks/base_shortcut_menu.html new file mode 100644 index 000000000..95e030b85 --- /dev/null +++ b/ishtar_common/templates/ishtar/blocks/base_shortcut_menu.html @@ -0,0 +1,46 @@ +{% load i18n %} +{% if current_menu or menu %} +{% comment %} +<button class="navbar-toggler" type="button" + data-toggle="collapse" data-target="#navbar-shortcut" + aria-controls="navbar-shortcut" aria-expanded="false" + aria-label="{% trans 'Toggle navigation' %}"> + <span class="navbar-toggler-icon"></span> +</button> +{% endcomment %} +<div class="navbar-collapse collapse justify-content-end"> + <ul class="navbar-nav" id="navbar-shortcut"> + <li class="nav-item"> + <ol class="breadcrumb"> + {% for lbl in current_selected_labels %} + <li class="breadcrumb-item">{{lbl}}</li> + {% empty %} + {% trans "No default selection" %} + {% endfor %} + </ol> + </li> + <li class="nav-item dropdown"> + <a class="nav-link dropdown-toggle" data-toggle="dropdown" + href="#" role="button" aria-haspopup="true" + id="dropdown-toggle-shortcut-menu"> + <i class="icon fa fa-thumb-tack fa-2x" aria-hidden="true" title="{% trans 'Pin an item in order to constrain default searches with this item. By default only your items are displayed. New created and modified items are auto-pin.' %}"></i> + </a> + <div id="shortcut-menu" class="dropdown-menu dropdown-menu-right"> + <form method="post" action="{% url 'update-current-item' %}"> + <h4>{% trans "Default selection" %}</h4> + {% block short_content %} + {% endblock %} + </form> + </div> + </li> + </ul> +</div> + +<script type='text/javascript'> +{% if SHORTCUT_SHOW == 'off' %}var shortcut_menu_hide = true; +{% else %}var shortcut_menu_hide = false;{% endif %} +{% block short_extrajs %} +{% endblock %} +</script> + +{% endif %} diff --git a/ishtar_common/templates/ishtar/blocks/sheet_creation_section.html b/ishtar_common/templates/ishtar/blocks/sheet_creation_section.html index e6ce31c25..78126a240 100644 --- a/ishtar_common/templates/ishtar/blocks/sheet_creation_section.html +++ b/ishtar_common/templates/ishtar/blocks/sheet_creation_section.html @@ -1,19 +1,21 @@ {% load i18n link_to_window %} {% if item.history_creator.ishtaruser.person %} -<li><label>{% trans "Creation" context "Sheet" %}</label> - <span class='value'> +<div class="col-12 col-md-6 col-lg-4 d-flex flex-wrap row"> + <dt class="col-5">{% trans "Creation" context "Sheet" %}</dt> + <dd class="col-7"> {{item.history_creator.ishtaruser.person}} {{item.history_creator.ishtaruser.person|link_to_window}} <br/> - <small><em>{{item.history_creation_date|date:"DATETIME_FORMAT"}}</em></small> - </span> -</li> + <small class="text-muted">{{item.history_creation_date|date:"DATETIME_FORMAT"}}</small> + </dd> +</div> {% endif %} {% if item.history_creation_date != item.last_edition_date %} -<li><label>{% trans "Modification" context "Sheet" %}</label> - <span class='value'> +<div class="col-12 col-md-6 col-lg-4 d-flex flex-wrap row"> + <dt class="col-5">{% trans "Modification" context "Sheet" %}</dt> + <dd class='col-7'> {{item.history_modifier.ishtaruser.person}} {{item.history_modifier.ishtaruser.person|link_to_window}} <br/> - <small><em>{% firstof item.history_date|date:"DATETIME_FORMAT" item.history.all.0.history_date|date:"DATETIME_FORMAT" %}</em></small> - </span> -</li> + <small class="text-muted">{% firstof item.history_date|date:"DATETIME_FORMAT" item.history.all.0.history_date|date:"DATETIME_FORMAT" %}</small> + </dd> +</div> {% endif %} diff --git a/ishtar_common/templates/ishtar/blocks/sheet_json.html b/ishtar_common/templates/ishtar/blocks/sheet_json.html index 31e6acb84..6aaf4bae7 100644 --- a/ishtar_common/templates/ishtar/blocks/sheet_json.html +++ b/ishtar_common/templates/ishtar/blocks/sheet_json.html @@ -4,8 +4,8 @@ <h3>{{json_section}}</h3> {% endif %} {% for label, value in json_fields %} -{% if forloop.first %}<ul class='form-flex'>{% endif %} - {% field_li label value %} -{% if forloop.last %}</ul>{% endif %} +{% if forloop.first %}<div class='row'>{% endif %} + {% field_flex label value %} +{% if forloop.last %}</div>{% endif %} {% endfor %} {% endfor %} diff --git a/ishtar_common/templates/ishtar/blocks/shortcut_menu.html b/ishtar_common/templates/ishtar/blocks/shortcut_menu.html index 67f91dfea..10113aa59 100644 --- a/ishtar_common/templates/ishtar/blocks/shortcut_menu.html +++ b/ishtar_common/templates/ishtar/blocks/shortcut_menu.html @@ -1,44 +1,43 @@ +{% extends "ishtar/blocks/base_shortcut_menu.html" %} {% load i18n %} -{% if current_menu %} -<form method="post" action="{% url 'update-current-item' %}"> -<fieldset id="shortcut-menu"> -<span class="fa-stack short-menu-close"> - <i class="fa fa-circle fa-stack-2x"></i> - <i class="fa fa-times fa-stack-1x fa-inverse"></i> -</span> -<span class="fa-stack short-menu-open"> - <i class="fa fa-circle fa-stack-2x"></i> - <i class="fa fa-plus fa-stack-1x fa-inverse"></i> -</span> +{% block short_content %} <div class="short-menu-buttons btn-group" role="group"> - <button type="button" class="btn btn-selected" id='short-menu-simple' title="{% trans 'Simple menu limited to your own items. Be careful only the last 100 items are displayed.' %}">{% trans "simple" %}</button> - <button type="button" class="btn" id='short-menu-advanced' title="{% trans 'Advanced menu' %}">{% trans "advanced" %}</button> + <button type="button" class="btn btn-secondary active" + id='short-menu-simple' title="{% trans 'Simple menu limited to your own items. Be careful only the last 100 items are displayed.' %}">{% trans "simple" %}</button> + <button type="button" class="btn btn-secondary" id='short-menu-advanced' title="{% trans 'Advanced menu' %}">{% trans "advanced" %}</button> </div> <div> -<i class="icon fa fa-thumb-tack fa-2x" aria-hidden="true" title="{% trans 'Pin an item in order to constrain default searches with this item. By default only your items are displayed. New created and modified items are auto-pin.' %}"></i> -<table id='current_items'> -{% for lbl, model_name, main_cls, items in current_menu %} -<tr> - <td><label for="current_{{model_name}}">{{lbl}}</label></td> - <td> - <select class='{{main_cls}} chosen-select' id='current_{{model_name}}'> - <option class='normal' value=''>--</option> - {% for val, label, selected, cls in items %}<option{% if cls %} class='{{cls}}'{% endif %} value='{{val}}'{% if selected %} selected="selected"{% endif %}>{% ifequal cls 'basket' %} {% endifequal %}{% ifequal cls 'green' %} {% endifequal %}{% ifequal cls 'orange' %} {% endifequal %}{% ifequal cls 'red' %} {% endifequal %}{{label}}</option> - {% endfor %}</select> - </td>{% with 'show-'|add:model_name as model_url%} - <td><a href='#' onclick='load_current_window("{% url model_url 0 %}", "{{model_name}}");' class='display_details'><i class="fa fa-info-circle" aria-hidden="true"></i></a></td> - <td><span class='pin-action' onclick='$.get("{% url 'unpin' model_name %}", function(){load_shortcut_menu();});' title="{% trans 'Unpin' %}"> - <i class="fa fa-times"></i> - </span></td> - {% endwith %} -</tr> -{% endfor %} -</table> + <p class="alert alert-info mt-2"> + {% trans 'Simple menu limited to your own items. Be careful only the last 100 items are displayed.' %} + </p> + <p id='current_items'> + {% for lbl, model_name, main_cls, items in current_menu %} + <div class="form-group row"> + <label for="current_{{model_name}}" + class="col-sm-4 col-form-label">{{lbl}}</label> + <div class="col-sm-6"> + <select class='{{main_cls}} chosen-select' id='current_{{model_name}}'> + <option class='normal' value=''>--</option> + {% for val, label, selected, cls in items %}<option{% if cls %} class='{{cls}}'{% endif %} value='{{val}}'{% if selected %} selected="selected"{% endif %}>{% ifequal cls 'basket' %} {% endifequal %}{% ifequal cls 'green' %} {% endifequal %}{% ifequal cls 'orange' %} {% endifequal %}{% ifequal cls 'red' %} {% endifequal %}{{label}}</option> + {% endfor %}</select> + </div> + {% with 'show-'|add:model_name as model_url%} + <div class="col-sm-2"> + <a href='#' onclick='load_current_window("{% url model_url 0 %}", "{{model_name}}");' class='display_details'> + <i class="fa fa-info-circle" aria-hidden="true"></i></a> + <a href='#' + class='disabled pin-action text-danger' + onclick='$.get("{% url "unpin" model_name %}", function(){load_shortcut_menu();});' title="{% trans 'Unpin' %}"> + <i class="fa fa-times"></i> + </a> + </div> + {% endwith %} + </div> + {% endfor %} + </p> </div> -</fieldset> -</form> -<script type='text/javascript'>var advanced_menu = false; -{% if SHORTCUT_SHOW == 'off' %}var shortcut_menu_hide = true; -{% else %}var shortcut_menu_hide = false;{% endif %} -</script> -{% endif %} +{% endblock %} + +{% block short_extrajs %} +var advanced_menu = false; +{% endblock %} diff --git a/ishtar_common/templates/ishtar/blocks/window_field.html b/ishtar_common/templates/ishtar/blocks/window_field.html index b52ed78ee..097ae3fd2 100644 --- a/ishtar_common/templates/ishtar/blocks/window_field.html +++ b/ishtar_common/templates/ishtar/blocks/window_field.html @@ -1,3 +1,6 @@ -{% load i18n %}{% if data %}{% if li %}<li>{% else %}<p>{% endif %}<label>{% trans caption %}</label> -<span class='value'>{{pre_data|safe}}{{data|linebreaksbr}}{{post_data|safe}}</span>{% if li %}</li>{% else %}</p>{% endif %} +{% load i18n %}{% if data %}{% if li %}<li>{% elif flex %} + <div class="col-12 col-md-6 col-lg-4 d-flex flex-wrap">{% else %}<p>{% endif %} + <label>{% trans caption %}</label> + <span class='value'>{{pre_data|safe}}{{data|linebreaksbr}}{{post_data|safe }}</span> + {% if li %}</li>{% elif flex %}</div>{% else %}</p>{% endif %} {% endif %} diff --git a/ishtar_common/templates/ishtar/blocks/window_field_flex.html b/ishtar_common/templates/ishtar/blocks/window_field_flex.html new file mode 100644 index 000000000..add2a5520 --- /dev/null +++ b/ishtar_common/templates/ishtar/blocks/window_field_flex.html @@ -0,0 +1,6 @@ +{% load i18n %}{% if data %} + <dl class="col-12 {% if size == 2 %}col-lg-6{% else %}col-md-6 col-lg-4{% endif %} d-flex flex-wrap row"> + <dt class="col-5">{% trans caption %}</dt> + <dd class="col-7">{{pre_data|safe}}{{data|linebreaksbr}}{{post_data|safe }}</dd> + </dl> +{% endif %} diff --git a/ishtar_common/templates/ishtar/blocks/window_field_flex_detail.html b/ishtar_common/templates/ishtar/blocks/window_field_flex_detail.html new file mode 100644 index 000000000..5968f9afa --- /dev/null +++ b/ishtar_common/templates/ishtar/blocks/window_field_flex_detail.html @@ -0,0 +1,6 @@ +{% load i18n %}{% if item %} +<dl class="col-12 col-md-6 col-lg-4 d-flex flex-wrap row"> + <dt class="col-5">{% trans caption %}</dt> + <dd class="col-7">{{item}}{{link}}</dd> +</dl> +{% endif %} diff --git a/ishtar_common/templates/ishtar/blocks/window_field_flex_full.html b/ishtar_common/templates/ishtar/blocks/window_field_flex_full.html new file mode 100644 index 000000000..f44cdc6fd --- /dev/null +++ b/ishtar_common/templates/ishtar/blocks/window_field_flex_full.html @@ -0,0 +1,6 @@ +{% load i18n %}{% if data %} + <dl class="col-12 row"> + <dt class="col-12">{% trans caption %}</dt> + <dd class="col-12">{{pre_data|safe}}{{data|linebreaksbr}}{{post_data|safe }}</dd> + </dl> +{% endif %} diff --git a/ishtar_common/templates/ishtar/blocks/window_field_flex_multiple.html b/ishtar_common/templates/ishtar/blocks/window_field_flex_multiple.html new file mode 100644 index 000000000..60f6361b7 --- /dev/null +++ b/ishtar_common/templates/ishtar/blocks/window_field_flex_multiple.html @@ -0,0 +1,8 @@ +{% load i18n %}{% if data.count %} +<dl class="col-12 col-md-6 col-lg-4 d-flex flex-wrap row"> + <dt class="col-5">{% trans caption %}</dt> + <dd class="col-7">{% for d in data.all %} + {% if forloop.counter0 %} ; {% endif %}{{ d }} + {% endfor %}</dd> +</dl> +{% endif %} diff --git a/ishtar_common/templates/ishtar/blocks/window_field_flex_url.html b/ishtar_common/templates/ishtar/blocks/window_field_flex_url.html new file mode 100644 index 000000000..59f612bc6 --- /dev/null +++ b/ishtar_common/templates/ishtar/blocks/window_field_flex_url.html @@ -0,0 +1,7 @@ +{% load i18n %}{% if link %} +<div class="col-12 col-md-6 col-lg-4 d-flex flex-wrap row"> + <dt class="col-5">{% trans caption %}</dt> + <dd class="col-7"> + <a target="_blank" href='{{link|safe}}'>{% if link_name %}{{link_name}}{% else %}{{link}}{% endif %}</a> + </dd> +{% endif%} diff --git a/ishtar_common/templates/ishtar/blocks/window_nav.html b/ishtar_common/templates/ishtar/blocks/window_nav.html index f212ebff6..89263d0de 100644 --- a/ishtar_common/templates/ishtar/blocks/window_nav.html +++ b/ishtar_common/templates/ishtar/blocks/window_nav.html @@ -1,56 +1,62 @@ {% load i18n %} -{% if previous or next %} - <div class='tool-right'> - {% if previous %} - <a class='history-nav' href="#" onclick='load_window("{% url histo_url item.pk previous|date:"c"%}");$("#{{window_id}}").hide();return false;' title="{%trans 'Previous version'%}"> - <span class="fa-stack"> - <i class="fa fa-circle fa-stack-2x"></i> - <i class="fa fa-step-backward fa-stack-1x fa-inverse"></i> - </span> - <br/>{{previous}} - </a> - {% else %} - <span class='history-nav'> </span> - {% endif %} - {% if next %} - <a class='history-nav' title="{% trans 'Restore this version' %}" href="#" onclick='if(confirm("{%trans 'Are you sure to restore to this version? All changes made since this version will be lost.' %}")){load_url("{% url revert_url item.pk item.history_date|date:"c"%}");closeAllWindows();load_window("{% url show_url item.pk None %}");}'> - <span class="fa-stack fa-lg"> - <i class="fa fa-circle fa-stack-2x"></i> - <i class="fa fa-history fa-stack-1x fa-inverse"></i> - </span> - <br/>{% trans "Restore" %} - </a> - <a class='history-nav' href="#" onclick='load_window("{% url histo_url item.pk next|date:"c" %}");$("#{{window_id}}").hide();return false;' title="{%trans 'Next version'%}"> - <span class="fa-stack"> - <i class="fa fa-circle fa-stack-2x"></i> - <i class="fa fa-step-forward fa-stack-1x fa-inverse"></i> - </span> - <br/>{{next}} - </a> - {% else %} - <span class='history-nav'> </span> - <span class='history-nav'> </span> - {% endif %} +<div class="row toolbar"> + {% if previous or next %} + <div class='col-md-2'> + <div class="btn-group btn-group-sm" role="group" aria-label="{% trans 'History'%}"> + {% if previous %} + <button type="button" class="btn btn-secondary" + data-toggle="tooltip" data-placement="bottom" + title="{{previous}}" + onclick='load_window("{% url histo_url item.pk previous|date:"c"%}");$("#{{window_id}}").hide();return false;'> + <i class="fa fa-step-backward"></i> + </button> + {% endif %} + {% if next %} + <button type="button" class="btn btn-secondary" + data-toggle="tooltip" data-placement="bottom" + onclick='if(confirm("{%trans 'Are you sure to restore to this version? All changes made since this version will be lost.' %}")){load_url("{% url revert_url item.pk item.history_date|date:"c"%}");closeAllWindows();load_window("{% url show_url item.pk None %}");}' + title="{% trans 'Restore this version' %}"> + <i class="fa fa-history"></i> + </button> + <button type="button" class="btn btn-secondary" + data-toggle="tooltip" data-placement="bottom" + onclick='load_window("{% url histo_url item.pk next|date:"c" %}");$("#{{window_id}}").hide();return false;' + title="{{next}}"> + <i class="fa fa-step-forward"></i> + </button> + {% endif %} + </div> </div> -{% endif %} -<div class='tool-left'> + <div class='offset-md-6 col-md-4 text-right'> + {% else %} + <div class='offset-md-8 col-md-4 text-right'> + {% endif %} + <div class="btn-group btn-group-sm" role="group" aria-label="{% trans 'Actions' %}"> {% block extra_actions %}{% endblock %} - {% if modify_url %}<a href='{% url modify_url item.pk %}' title="{% trans 'Modify' %}"> - <span class="fa-stack fa-lg"> - <i class="fa fa-circle fa-stack-2x"></i> - <i class="fa fa-pencil fa-stack-1x fa-inverse"></i> - </span> - </a>{% endif %} - {% if pin_action and item.SLUG %} - <span class='pin-action' onclick='$.get("{% url 'pin' item.SLUG item.pk %}", function(){load_shortcut_menu(); display_info("{% trans 'Item pined in your shortcut menu.' %}")});' title="{% trans 'Pin' %}"> - <span class="fa-stack fa-lg"> - <i class="fa fa-circle fa-stack-2x"></i> - <i class="fa fa-thumb-tack fa-stack-1x fa-inverse"></i> - </span> - </span>{% endif %} - <a class='badge' href='{% url show_url item.pk "odt" %}' title='{% trans "Export as OpenOffice.org file"%}'>ODT</a> <a class='badge' href='{% url show_url item.pk "pdf" %}' title='{% trans "Export as PDF file"%}'>PDF</a> + {% if modify_url %} + <a class="btn btn-secondary" href='{% url modify_url item.pk %}' + title="{% trans 'Modify' %}"> + <i class="fa fa-pencil"></i> + </a> + {% endif %} + {% if pin_action and item.SLUG %} + <a class="btn btn-secondary" href="#" class='pin-action' + onclick='$.get("{% url "pin" item.SLUG item.pk %}", function(){load_shortcut_menu(); display_info("{% trans 'Item pined in your shortcut menu.' %}")});' title="{% trans 'Pin' %}"> + <i class="fa fa-thumb-tack"></i> + </a> + {% endif %} + <a class="btn btn-secondary" href='{% url show_url item.pk "odt" %}' + title='{% trans "Export as OpenOffice.org file"%}'> + ODT <i class="fa fa-file-word-o" aria-hidden="true"></i> + <a class="btn btn-secondary" href='{% url show_url item.pk "pdf" %}' + title='{% trans "Export as PDF file"%}'> + PDF <i class="fa fa-file-pdf-o" aria-hidden="true"></i> + </a> + </div> + </div> </div> -<hr class='clear'> {% if next %} - <p class='info-box'><i class="fa fa-info-circle" aria-hidden="true"></i> <em>{% trans "Relation between items are not historized." %}</em></p> +<div class="alert alert-warning" role="alert"> + {% trans "Relation between items are not historized." %} +</div> {% endif %} diff --git a/ishtar_common/templates/ishtar/blocks/window_tables/dynamic_documents.html b/ishtar_common/templates/ishtar/blocks/window_tables/dynamic_documents.html index 891cd0f6f..96093403d 100644 --- a/ishtar_common/templates/ishtar/blocks/window_tables/dynamic_documents.html +++ b/ishtar_common/templates/ishtar/blocks/window_tables/dynamic_documents.html @@ -1,23 +1,95 @@ {% load i18n %} <h4>{{caption}}</h4> -<table id='grid_{{name}}' class='jqgrid'></table> -<div id='pager_{{name}}'></div> - -<div id='foot_{{name}}' class='gridfooter'> -{% if source_full %} -<a class="badge" href='{{simple_source}}csv{{ source_attrs|safe }}' target='_blank' title="{% trans 'Export as CSV' %}">{% trans "CSV" %}</a> -<a class="badge" href='{{source_full}}csv{{ source_attrs|safe }}' target='_blank' title="{% trans 'Export as CSV - full' %}">{% trans "CSV full" %}</a> -{% else %} -<a class="badge" href="{{simple_source}}csv{{ source_attrs|safe }}" target="_blank" title="{% trans 'Export as CSV' %}">CSV</a> -{% endif %} {{encoding}} + +<div class="modal fade table-modal-lg" tabindex="-1" role="dialog" + aria-hidden="true" id="modal_grid_{{name}}"> + <div class="modal-dialog full modal-lg"> + <div class="modal-content"> + <div class="modal-header"> + <button type="button" class="close" data-dismiss="modal" aria-label="Close"> + <span aria-hidden="true">×</span> + </button> + </div> + <div class="modal-body"> + <div class="current-sheets"></div> + <div class="current-grid"></div> + </div> + </div> + </div> +</div> + +<div id="grid_{{name}}_meta_wrapper"> + <table id='grid_{{name}}' class="display" width="100%"> + <thead> + <tr> + <th></th> + <th></th>{% for col in col_names %} + <th>{{col}}</th> + {% endfor %}</tr> + </thead> + </table> +</div> + +<div id='foot_{{name}}' class="gridfooter row toolbar"> + <div class='col-md-2'> + <div class="btn-group btn-group-sm" role="group"> + <button class="btn btn-secondary" data-toggle="modal" + data-target=".table-modal-lg"> + {% trans "Expand table" %} <i class="fa fa-expand" aria-hidden="true"></i> + </button> + </div> + </div> + <div class='col-md-2'> + <div class="btn-group btn-group-sm" role="group" + aria-label="{% trans 'Export'%}"> + {% if source_full %} + <a class="btn btn-secondary" href='{{simple_source}}csv{{ source_attrs|safe }}' target='_blank' title="{% trans 'Export as CSV' %}">{% trans "CSV" %}</a> + <a class="btn btn-secondary" href='{{source_full}}csv{{ source_attrs|safe }}' target='_blank' title="{% trans 'Export as CSV - full' %}">{% trans "CSV full" %}</a> + {% else %} + <a class="btn btn-secondary" href="{{simple_source}}csv{{ source_attrs|safe }}" target="_blank" title="{% trans 'Export as CSV' %}">CSV</a> + {% endif %} + </div> + </div> +</div> + +<div class="row toolbar justify-content-center"> </div> <script type="text/javascript" language='javascript'> setTimeout( function(){ - $("#grid_{{name}}").jqGrid({ + datatable_options = { + "ajax": { + "url": "{{source}}", + "dataSrc": "rows" + }, + "columns": [ + { "data": "id", "visible": false }, + { "data": "link", "orderable": false },{% for col in extra_cols %} + { "data": "{{col}}", "defaultContent": "-"}{% if not forloop.last %},{% endif %}{% endfor %} + ] + }; + $.extend(datatable_options, datatables_default); + if (datatables_i18n) datatable_options['language'] = datatables_i18n; + + datatable_{{sname}} = jQuery("#grid_{{name}}").DataTable(datatable_options); + + $('#modal_grid_{{name}}').on('show.bs.modal', function (e) { + $('#grid_{{name}}_wrapper').appendTo( + '#modal_grid_{{name}} .modal-body .current-grid'); + $('#grid_{{name}}').DataTable().clear().draw() + }); + + $('#modal_grid_{{name}}').on('hide.bs.modal', function (e) { + $('#grid_{{name}}_wrapper').appendTo( + '#grid_{{name}}_meta_wrapper'); + $('#grid_{{name}}').DataTable().clear().draw() + }); + + {% comment %} + { url:'{{source|safe}}', datatype: "json", mtype: 'GET', @@ -42,6 +114,7 @@ setTimeout( } }); {% if large %}jQuery("#grid_{{name}}").jqGrid('setGridHeight', 272);{% endif %} + {% endcomment %} }, 200); </script> diff --git a/ishtar_common/templates/ishtar/blocks/wizard_breadcrumb.html b/ishtar_common/templates/ishtar/blocks/wizard_breadcrumb.html new file mode 100644 index 000000000..79bca71f1 --- /dev/null +++ b/ishtar_common/templates/ishtar/blocks/wizard_breadcrumb.html @@ -0,0 +1,21 @@ +<form action="." method="post">{% csrf_token %} + <nav aria-label="breadcrumb" role="navigation"> + <ol class="breadcrumb"> + {% for step in previous_steps %} + <li class="breadcrumb-item"> + <button class='change_step' name="form_prev_step" + value="{{forloop.counter0}}">{{step}}</button> + </li> + {% endfor %} + <li class="breadcrumb-item active"> + <a href='#'>{{current_step_label}}</a> + </li> + {% for step in next_steps %} + <li class="breadcrumb-item"> + <button class='change_step' name="form_prev_step" + value="{{forloop.counter|add:previous_step_counter}}">{{step}}</button> + </li> + {% endfor %} + </ol> + </nav> +</form> diff --git a/ishtar_common/templates/ishtar/dashboards/dashboard_main.html b/ishtar_common/templates/ishtar/dashboards/dashboard_main.html index ed61d1265..692e435a3 100644 --- a/ishtar_common/templates/ishtar/dashboards/dashboard_main.html +++ b/ishtar_common/templates/ishtar/dashboards/dashboard_main.html @@ -13,25 +13,40 @@ <link rel="stylesheet" href="{{STATIC_URL}}js/jqplot/jquery.jqplot.min.css?ver={{VERSION}}" /> {% endblock %} {% block content %} - <script> +<script type="text/javascript"> $(function() { - $( "#dash-tabs" ).tabs({ - beforeActivate: function( event, ui ) { - $("#progress").show(); - }, - load: function( event, ui ) { - $("#progress").hide(); - } - }); + $('#dashboard .nav-link').click(function () { + var url = $(this).attr('data-url'); + dynamic_load(url, "#dashboard .card-body"); + $('#dashboard li').removeClass('active'); + $('#dashboard li').removeClass('show'); + $(this).parent().tab('show'); + }) + $('#dashboard li:first-child a').click(); }); + </script> -<div id='dashboard'> - <div id="dash-tabs"> - <ul> - {% for label, app in app_list %} - <li><a href="{% url 'dashboard-main-detail' app %}">{{label}}</a></li>{% endfor %} - <li><a href="{% url 'dashboard-main-detail' 'users' %}">{% trans "Users" %}</a></li> - </ul> - </div> +<div id='dashboard' class="card"> + <div class="card-header"> + <ul class="nav nav-tabs card-header-tabs"> + {% for label, app in app_list %} + <li class="nav-item" id="{{app}}-tab"> + <a class="nav-link" href="#{{app}}-pane" + data-url="{% url 'dashboard-main-detail' app %}">{{label}}</a> + </li>{% endfor %} + <li class="nav-item" id="users-tab"> + <a class="nav-link" href="#users-pane" + data-url="{% url 'dashboard-main-detail' 'users' %}">{% trans "Users" %}</a> + </li> + </ul> + </div> + <div class="card-body tab-content"> + {% for label, app in app_list %} + <div class="tab-pane{% if forloop.counter0 == 0%} active{% endif %}" id="{{app}}-pane" + role="tabpanel" aria-labelledby="{{app}}-tab"></div>{% endfor %} + <div class="tab-pane" id="users-pane" role="tabpanel" + aria-labelledby="users-tab"></div> + </div> </div> + {% endblock %} diff --git a/ishtar_common/templates/ishtar/dashboards/dashboard_main_detail.html b/ishtar_common/templates/ishtar/dashboards/dashboard_main_detail.html index 5ebb05af4..75a7aa542 100644 --- a/ishtar_common/templates/ishtar/dashboards/dashboard_main_detail.html +++ b/ishtar_common/templates/ishtar/dashboards/dashboard_main_detail.html @@ -1,64 +1,134 @@ -{% load i18n date_formating humanize %} -<div class='dashboard' id="{{unique_id}}-tab"> - <div> +{% load i18n date_formating humanize table_form %} +<div id="{{unique_id}}-tab"> <h4>{% trans "Numbers" %}</h4> {% if form %} <div class='form'> <form method='post' action="{% url 'dashboard-main-detail' item_name %}" id='{{unique_id}}_form'> - <table>{% csrf_token %} - {{form}} - </table> - <button id="search_{{unique_id}}" class="submit">{% trans "Change" %}</button> + {% csrf_token %} + {% bs_form form %} + <div class="text-center"> + <button type='button' id="search_{{unique_id}}" + class="btn btn-primary"> + {% trans "Change" %}</button> + </div> </form> </div> {% endif %} <p><strong>{% trans "Total:" %}</strong> {{dashboard.total_number|intcomma}}</p> - <div class='table'> - <div id="chart_{{unique_id}}" style="height:400px; width:700px;"></div> - <p class='info-box'><i class="fa fa-info-circle" aria-hidden="true"></i> {% trans 'Draw rectangle on the graph to zoom. Double-click to reinitialize.' %}</p> - <div class='form chart-img-form'> - <button id="chart_img_display_{{unique_id}}" class='submit'>{% trans "Display as an image" %}</button> - <div id="chart_img_{{unique_id}}" class='chart-img'> - <div id="img_{{unique_id}}"></div> - <p class='info-box'><i class="fa fa-info-circle" aria-hidden="true"></i> {% trans 'Right-click on this image to save it.' %}</p> - </div> + <div> + <div id="chart_{{unique_id}}" + style="height:400px; width:700px; margin-right:auto; margin-left:auto"></div> + <p class='alert alert-info'> + {% trans 'Draw rectangle on the graph to zoom. Double-click to reinitialize.' %} + </p> + <div class='form chart-img-form'> + <div class="text-center"> + <button id="chart_img_display_{{unique_id}}" + type='button' class='btn btn-secondary'> + {% trans "Display as an image" %} + </button> + </div> + <div id="chart_img_{{unique_id}}" class='chart-img'> + <div class="card"> + <div id="img_{{unique_id}}" + class="card-img-top text-center"></div> + <div class="card-body"> + <div class='alert alert-info'> + {% trans 'Right-click on this image to save it.' %} + </div> + </div> + </div> + </div> + </div> </div> - </div> - <div class='clean-table'> - <div class='clean-table-wrap'> - <table> + <hr> + <table class="table table-striped"> {% for idx, lbl, values in dashboard.values %} - <tr class='idx {% if forloop.counter0|divisibleby:"2" %}even{%else%}odd{%endif%}'> + <tr> <th>{{lbl}}</th> {% for value in values reversed %}{% if forloop.parentloop.counter0 %}<td>{% else %}<th>{%endif%}{{value|date_formating }}{% if forloop.parentloop.counter0 %}</td>{% else %}</th>{%endif%}{% endfor%} </tr> {% endfor%} </table> - </div> - </div> + <hr> {% if dashboard.periods %} <h4>{% trans "By years" %}</h4> - <ul> - <li><strong>{% trans "Average:" %}</strong> {{dashboard.average}}</li> - <li><strong>{% trans "Variance:" %}</strong> {{dashboard.variance}}</li> - <li><strong>{% trans "Standard deviation:" %}</strong> {{dashboard.standard_deviation}}</li> - <li><strong>{% trans "Median:" %}</strong> {{dashboard.median}}</li> - <li><strong>{% trans "Mode:" %}</strong> {{dashboard.mode}}</li> - </ul> + <dl class="row"> + <dt class="col-sm-3"> + {% trans "Average:" %} + </dt> + <dd class="col-sm-9"> + {{dashboard.average}} + </dd> + + <dt class="col-sm-3"> + {% trans "Variance:" %} + </dt> + <dd class="col-sm-9"> + {{dashboard.variance}} + </dd> + + <dt class="col-sm-3"> + {% trans "Standard deviation:" %} + </dt> + <dd class="col-sm-9"> + {{dashboard.standard_deviation}} + </dd> + <dt class="col-sm-3"> + {% trans "Median:" %} + </dt> + <dd class="col-sm-9"> + {{dashboard.median}} + </dd> + <dt class="col-sm-3"> + {% trans "Mode:" %} + </dt> + <dd class="col-sm-9"> + {{dashboard.mode}} + </dd> + </dl> + <hr> {% endif %} {% if dashboard.operation_average %} <h4>{% trans "By operations" %}</h4> - <ul> - <li><strong>{% trans "Average:" %}</strong> {{dashboard.operation_average}}</li> - <li><strong>{% trans "Variance:" %}</strong> {{dashboard.operation_variance}}</li> - <li><strong>{% trans "Standard deviation:" %}</strong> {{dashboard.operation_standard_deviation}}</li> - <li><strong>{% trans "Median:" %}</strong> {{dashboard.operation_median}}</li> - <li><strong>{% trans "Mode:" %}</strong> {{dashboard.operation_mode}}</li> - </ul> + <dl class="row"> + <dt class="col-sm-3"> + {% trans "Average:" %} + </dt> + <dd class="col-sm-9"> + {{dashboard.operation_average}} + </dd> + + <dt class="col-sm-3"> + {% trans "Variance:" %} + </dt> + <dd class="col-sm-9"> + {{dashboard.operation_variance}} + </dd> + + <dt class="col-sm-3"> + {% trans "Standard deviation:" %} + </dt> + <dd class="col-sm-9"> + {{dashboard.operation_standard_deviation}} + </dd> + <dt class="col-sm-3"> + {% trans "Median:" %} + </dt> + <dd class="col-sm-9"> + {{dashboard.operation_median}} + </dd> + <dt class="col-sm-3"> + {% trans "Mode:" %} + </dt> + <dd class="col-sm-9"> + {{dashboard.operation_mode}} + </dd> + </dl> + <hr> {% endif %} - <div class='clean-table'> <h4>{% trans "Created last" %}</h4> - <table> + <table class="table table-striped"> <tr><th>{{lbl}}</th><th>{% trans "Created" %}</th><th></th></tr> {% for item in dashboard.lasts %}<tr> <td class='ref'>{{item}}</td> @@ -68,10 +138,9 @@ </a>{%endif%}</td> </tr>{% endfor %} </table> - </div> - <div class='clean-table'> + <hr> <h4>{% trans "Recent changes" %}</h4> - <table> + <table class="table table-striped"> <tr><th>{{lbl}}</th><th>{% trans "Modified" %}</th><th></th></tr> {% for item in dashboard.recents %}<tr> <td class='ref'>{{item}}</td> @@ -81,8 +150,7 @@ </a>{%endif%}</td> </tr>{% endfor %} </table> - </div> - </div> +</div> <script language="javascript" type="text/javascript"> $(document).ready(function(){ @@ -109,8 +177,11 @@ $(document).ready(function(){ if (typeof values_1_{{unique_id}} === 'undefined' || values_1_{{unique_id}}.length == 0){ -$('#chart_img_{{unique_id}}').hide(); -$('#chart_{{unique_id}}').html("<p class='alert'><i class='fa fa-exclamation-triangle' aria-hidden='true'></i> {% trans 'No data for these criteria.' %}</p>"); + $('#chart_img_{{unique_id}}').hide(); + $('#chart_{{unique_id}}').html( + "<p class='alert alert-warning'>{% trans 'No data for these criteria.' %}</p>" + ); + $('#chart_{{unique_id}}').css('height', 'auto'); } else { var showmarker = false; @@ -165,7 +236,6 @@ var plot_{{unique_id}} = $.jqplot('chart_{{unique_id}}', ); $('#chart_img_{{unique_id}}').show('slow'); }); - } $('#search_{{unique_id}}').click(function (){ @@ -176,10 +246,5 @@ $('#search_{{unique_id}}').click(function (){ }); return false; }); - -{% if item_name == 'files' or item_name == "operations" or item_name == "treatments" or item_name == "treatmentfiles" %} -load_jquerydate_{{item_name}}_after(); -load_jquerydate_{{item_name}}_before(); -{% endif %} }); </script> diff --git a/ishtar_common/templates/ishtar/dashboards/dashboard_main_detail_users.html b/ishtar_common/templates/ishtar/dashboards/dashboard_main_detail_users.html index 6ffd8c3c9..f6ead643a 100644 --- a/ishtar_common/templates/ishtar/dashboards/dashboard_main_detail_users.html +++ b/ishtar_common/templates/ishtar/dashboards/dashboard_main_detail_users.html @@ -1,36 +1,32 @@ {% load i18n %} -<div class='dashboard'> - <div> -<script language="javascript" type="text/javascript"> -$(document).ready(function(){ -var values_users = []; -{% for user_type in ishtar_users.types %} -values_users.push(['{{user_type.person__person_types__label}}', {{user_type.number}}]); {% endfor%} - -var plot_users = jQuery.jqplot ('user_chart', [values_users], - { - seriesDefaults: { - renderer: jQuery.jqplot.PieRenderer, - rendererOptions: { - showDataLabels: true - } - }, - legend: { show:true, location: 'e' } - } - ); -}); -</script> - <div id="user_chart" style="height:300px; width:700px;"></div> - <div class='table'> - <table class='resume'> +<div class='dashboard centered'> + <div id="user_chart" style="height:300px; width:700px;margin-left: auto;margin-right: auto;"></div> + <table class='table table-striped'> <tr><th>{% trans "User type" %}</th><th>{% trans "Number" %}</th></tr> - {% for user_type in ishtar_users.types %} + {% for user_type in ishtar_users.types %} <tr> <td class='string'>{{user_type.person__person_types__label}}{#TODO: Display all#}</td> <td>{{user_type.number}}</td> </tr> - {% endfor%} + {% endfor %} </table> - </div> </div> +<script language="javascript" type="text/javascript"> +$(document).ready(function(){ + var values_users = []; + {% for user_type in ishtar_users.types %} + values_users.push(['{{user_type.person__person_types__label}}', {{user_type.number}}]); {% endfor%} + var plot_users = jQuery.jqplot ('user_chart', [values_users], + { + seriesDefaults: { + renderer: jQuery.jqplot.PieRenderer, + rendererOptions: { + showDataLabels: true + } + }, + legend: { show:true, location: 'e' } + } + ); +}); +</script>
\ No newline at end of file diff --git a/ishtar_common/templates/ishtar/form.html b/ishtar_common/templates/ishtar/form.html index 236818c66..b99d504a0 100644 --- a/ishtar_common/templates/ishtar/form.html +++ b/ishtar_common/templates/ishtar/form.html @@ -1,17 +1,34 @@ {% extends "base.html" %} -{% load i18n inline_formset %} +{% load i18n inline_formset table_form %} +{% block pre_container %} +<form enctype="multipart/form-data" action="." method="post"{% if confirm %} + onsubmit='return confirm("{{confirm}}");'{% endif %}>{% csrf_token %} +{% endblock %} {% block content %} <h2>{{page_name}}</h2> <div class='form'> -<form enctype="multipart/form-data" action="." method="post"{% if confirm %} - onsubmit='return confirm("{{confirm}}");'{% endif %}>{% csrf_token %} {% for error in form.non_field_errors %} <p>{{ error }}</p> {% endfor %} -<table> -{{form}} -</table> -<input id="submit_form" type="submit" value="{% if submit_label %}{{submit_label}}{% else%}{% trans "Validate" %}{% endif %}"/> -</form> + {% bs_form form %} </div> {% endblock %} + +{% block footer %} +<div id="footer"> + {% if form.SEARCH_AND_SELECT %} + <p class="confirm-message">{% trans "Search and select an item in the table" %}</p> + {% endif %} + <div id='validation-bar' class="row text-center"> + <div class="col-sm"> + <button type="submit" id="submit_form" name='validate' + value="validate" class="btn btn-success"> + {% if submit_label %}{{submit_label}}{% else%}{% trans "Validate" %}{% endif %} + </button> + </div> + </div> + {% include 'ishtar/blocks/footer.html' %} +</div> +</form> +{% endblock %} + diff --git a/ishtar_common/templates/ishtar/import_list.html b/ishtar_common/templates/ishtar/import_list.html index c72c86d10..ee466ad24 100644 --- a/ishtar_common/templates/ishtar/import_list.html +++ b/ishtar_common/templates/ishtar/import_list.html @@ -1,13 +1,17 @@ {% extends "base.html" %} {% load i18n inline_formset %} + +{% block pre_container %} +<form action="." method="post">{% csrf_token %} +{% endblock %} + {% block content %} <h2>{{page_name}}</h2> <div class='form'> {% if not object_list %} <p>{% trans "No pending imports." %}</p> {% else %} -<form action="." method="post">{% csrf_token %} -<table class="clean-table"> +<table class="table table-striped"> <tr> <th>{% trans "Name" %}</th> <th>{% trans "Type" %}</th> @@ -15,6 +19,10 @@ <th>{% trans "Creation" %}</th> <th>{% trans "Status" %}</th> <th>{% trans "Action" %}</th> + <th>{% trans "Unmatched items" %}</th> + <th>{% trans "Error" %}</th> + <th>{% trans "Control" %}</th> + <th>{% trans "Match" %}</th> </tr> {% for import in object_list %} <tr> @@ -43,24 +51,36 @@ </td> <td> {% if import.need_matching %} - <a href='{% url "import_link_unmatched" import.pk %}'>{% trans "Link unmatched items" %}</a> + <a href='{% url "import_link_unmatched" import.pk %}'>{% trans "Match"%}</a> {% endif %} </td> <td>{% if import.error_file %} - <a href='{{import.error_file.url}}'>{% trans "Error file" %}</a> + <a href='{{import.error_file.url}}'>{% trans "File" context "not a directory" %}</a> {% endif %}</td> <td>{% if import.result_file %} - <a href='{{import.result_file.url}}'>{% trans "Control file" %}</a> + <a href='{{import.result_file.url}}'>{% trans "File" context "not a directory" %}</a> {% endif %}</td> <td>{% if import.match_file %} - <a href='{{import.match_file.url}}'>{% trans "Match file" %}</a> + <a href='{{import.match_file.url}}'>{% trans "File" context "not a directory" %}</a> {% endif %}</td> </tr> {% endfor %} </table> - <input type="submit" onclick="long_wait();return true;" value="{% trans 'Validate' %}" /> -</form> {% endif %} </div> {% endblock %} +{% block footer %} +<div id="footer"> + <div id='validation-bar' class="row text-center"> + <div class="col-sm"> + <button type="submit" id="submit_form" name='validate' + value="validate" class="btn btn-success" onclick="long_wait();return true;"> + {% trans "Validate" %} + </button> + </div> + </div> + {% include 'ishtar/blocks/footer.html' %} +</div> +</form> +{% endblock %} diff --git a/ishtar_common/templates/ishtar/manage_basket.html b/ishtar_common/templates/ishtar/manage_basket.html index 3292318ea..26dd75c4c 100644 --- a/ishtar_common/templates/ishtar/manage_basket.html +++ b/ishtar_common/templates/ishtar/manage_basket.html @@ -4,12 +4,15 @@ <h2>{{page_name}}{% trans ":"%} {{basket}}</h2> <form enctype="multipart/form-data" action="." method="post">{% csrf_token %} <div class='form'> -<p class='alert'> - <i class="fa fa-exclamation-triangle" aria-hidden="true"></i> - {% trans 'Checking "Select all" only selects the current page.' %} -</p> -{{form}} -<button id='add_to' onclick='return false'>{% trans "Add" %}</button> + <div class="alert alert-warning" role="alert"> + {% trans 'Checking "Select all" only selects the current page.' %} + </div> + {{form}} + <div class="text-center"> + <button class="btn btn-primary" type="button" id='add_to'> + {% trans "Add" %} + </button> + </div> <h3>{% trans "Basket content" %}</h3> <div id='basket-content' style='text-align:left'> </div> @@ -27,15 +30,20 @@ </form> <script type='text/javascript' language='javascript'> -function load_list(data){ +function load_list(data, last){ $('#basket-content').html(data); + if (last){ + close_wait(); + } } $('#add_to').click(function(){ - var selected_items = jQuery("#grid_pk").getGridParam('selarrrow'); + var selected_items = datatable_pk.rows( { selected: true } ).data(); if(!selected_items) return false; + $('.modal-progress').modal('show'); for (i = 0, n = selected_items.length; i < n; i++) { - var selected_item = selected_items[i]; + var selected_item = selected_items[i]['id']; + last = i == n - 1; $.ajax({ type: "POST", url: '{{add_url}}', @@ -43,11 +51,14 @@ $('#add_to').click(function(){ basket_id: {{basket.pk}}, item_id: selected_item }, - success: load_list + success: function(data){ + load_list(data, last); + } }); } return false; }); + jQuery(document).ready(function(){ $.get('{{list_url}}', load_list); }); diff --git a/ishtar_common/templates/ishtar/sheet.html b/ishtar_common/templates/ishtar/sheet.html index bfefd5eb6..ee57d312d 100644 --- a/ishtar_common/templates/ishtar/sheet.html +++ b/ishtar_common/templates/ishtar/sheet.html @@ -1,8 +1,4 @@ -{% load i18n %} -{% block main_head %} -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +{% load i18n %}{% block main_head %}<html lang="en"> <head> <title>{% block title %}Ishtar{% if APP_NAME %} - {{APP_NAME}}{%endif%}{% endblock %} </title> @@ -12,68 +8,88 @@ </head> <body> {% endblock %} -<div class="sheet" id='{{window_id}}'> -{% block head_sheet %} -<script type="text/javascript">var last_window='{{window_id}}';</script> -<div class="head"> + <div class="card sheet" id="{{window_id}}"> + <div class="card-header" data-sheet-id="{{sheet_id}}" role="tab" id='head-{{window_id}}'> + <div class="row"> + <div class="col-9"> + <h5 class="mb-0"> + <a data-toggle="collapse" href="#collapse-{{window_id}}" aria-expanded="true" + aria-controls="collapse-{{window_id}}"> + {% block head_title %}{% endblock %} + </a> + </h5> + </div> + <div class='col-2 text-center'> + <a href='#' class='previous_page'> + <span class="fa-stack"> + <i class="fa fa-circle fa-stack-2x"></i> + <i class="fa fa-arrow-left fa-stack-1x fa-inverse"></i> + </span> + </a> + <a href='#' class='next_page'> + <span class="fa-stack"> + <i class="fa fa-circle fa-stack-2x"></i> + <i class="fa fa-arrow-right fa-stack-1x fa-inverse"></i> + </span> + </a> + </div> + <div class='col-1 text-right'> + <a href='#' onclick='$("#{{window_id}}").hide()' title="{% trans 'Close' %}"> + <span class="fa-stack"> + <i class="fa fa-circle fa-stack-2x"></i> + <i class="fa fa-times fa-stack-1x fa-inverse"></i> + </span> + </a> + {% comment %} + <a href='#' onclick='closeAllWindows();' title="{% trans "Close all windows" %}"> + <span class="fa-stack"> + <i class="fa fa-files-o fa-stack-2x"></i> + <i class="fa fa-circle fa-stack-15x"></i> + <i class="fa fa-times fa-stack-1x fa-inverse"></i> + </span> + </a> + {% endcomment %} + </div> + </div> + {% block header_title %}{% endblock %} + </div> -<a href='#' class='previous_page'> -<span class="fa-stack fa-lg"> - <i class="fa fa-circle fa-stack-2x"></i> - <i class="fa fa-arrow-left fa-stack-1x fa-inverse"></i> -</span> -</a> -<div class='close-buttons'> -<a href='#' onclick='$("#{{window_id}}").hide("slow")' title="{% trans 'Close' %}"> -<span class="fa-stack"> - <i class="fa fa-circle fa-stack-2x"></i> - <i class="fa fa-times fa-stack-1x fa-inverse"></i> -</span> -</a> -<a href='#' onclick='closeAllWindows();' title="{% trans "Close all windows" %}"> -<span class="fa-stack"> - <i class="fa fa-files-o fa-stack-2x"></i> - <i class="fa fa-circle fa-stack-15x"></i> - <i class="fa fa-times fa-stack-1x fa-inverse"></i> -</span> -</a> -</div> -<a href='#' class='next_page'> -<span class="fa-stack fa-lg"> - <i class="fa fa-circle fa-stack-2x"></i> - <i class="fa fa-arrow-right fa-stack-1x fa-inverse"></i> -</span> -</a> - -<h1>{% block head_title %}{% endblock %}</h1> -</div> + <div id="collapse-{{window_id}}" class="collapse show" role="tabpanel" + aria-labelledby="heading-{{window_id}}" data-parent="#window"> + {% block toolbar %}{% endblock %} + <div class="card-body"> + {% block head_sheet %} + <script type="text/javascript"> + var last_window='{{window_id}}'; -<script type="text/javascript" language='javascript'> -jQuery(document).ready(function(){ - if (! get_next_table_id({{item.pk}})){ - jQuery('.next_page').hide(); - } - if (! get_previous_table_id({{item.pk}})){ - jQuery('.previous_page').hide(); - } - jQuery(".next_page").click(function() { - load_window("{{current_window_url}}" + get_next_table_id({{item.pk}}) + "/", - '', function(){$("#{{window_id}}").hide();}); - }); - jQuery(".previous_page").click(function() { - load_window("{{current_window_url}}" + get_previous_table_id({{item.pk}}) + "/", - '', function(){$("#{{window_id}}").hide();}); - }); -}); -</script> -{% endblock %} -{% block header_title %}{% endblock %} -<div class="body"> -{% block toolbar %}{% endblock %} -{% block content %} -{% endblock %} -</div> + jQuery(document).ready(function(){ + if (! get_next_table_id({{item.pk}})){ + jQuery('.next_page').hide(); + } + if (! get_previous_table_id({{item.pk}})){ + jQuery('.previous_page').hide(); + } + jQuery(".next_page").click(function() { + load_window("{{current_window_url}}" + get_next_table_id({{item.pk}}) + "/", + '', function(){$("#{{window_id}}").remove();}, + true); + }); + jQuery(".previous_page").click(function() { + load_window("{{current_window_url}}" + get_previous_table_id({{item.pk}}) + "/", + '', function(){$("#{{window_id}}").remove();}, + true); + }); + }); + </script> + {% endblock %} + <div class="body"> + {% block content %} + {% endblock %} + </div> + </div> + </div> + </div> </div> {%block main_foot%} </body> diff --git a/ishtar_common/templates/ishtar/sheet_organization.html b/ishtar_common/templates/ishtar/sheet_organization.html index 403eb7dec..37f7a76ce 100644 --- a/ishtar_common/templates/ishtar/sheet_organization.html +++ b/ishtar_common/templates/ishtar/sheet_organization.html @@ -1,19 +1,24 @@ {% extends "ishtar/sheet.html" %} -{% load i18n window_header window_tables %} +{% load i18n window_header window_field window_tables %} -{% block head_title %}{% trans "Organization" %}{% endblock %} +{% block head_title %}<strong>{% trans "Organization" %}</strong> - {{item.name}}{% endblock %} -{% block content %} +{% block toolbar %} {% window_nav item window_id 'show-organization' 'organization_modify' %} -<p><label>{% trans "Name" %}</label> <span class='value'>{{item.name}}</span></p> -<p><label>{%trans "Created by:"%}</label> <span class='value'>{{ item.history_creator.ishtaruser.person }}</span></p> -{% include "ishtar/blocks/sheet_address_section.html" %} -{% if item.phone %}<p><label>{% trans "Phone" %}</label> <span class='value'>{{item.phone}}</span></p> {% endif %} -{% if item.mobile_phone %}<p><label>{% trans "Mobile phone" %}</label> <span class='value'>{{item.mobile_phone}}</span></p> {% endif %} +{% endblock %} + +{% block content %} +<div class="row"> + {% field_flex "Name" item.name %} + {% field_flex_detail "Created by" item.history_creator.ishtaruser.person %} + {% include "ishtar/blocks/sheet_address_section.html" %} + {% field_flex "Phone" item.phone %} + {% field_flex "Mobile phone" item.mobile_phone %} +</div> +<h3>{%trans "Person in the organization"%}</h3> -<table class='simple'> - <caption>{%trans "Person in the organization"%}</caption> +<table class='table table-striped'> <tr> <th>{% trans "Name" %}</th> <th>{% trans "Surname" %}</th> diff --git a/ishtar_common/templates/ishtar/sheet_person.html b/ishtar_common/templates/ishtar/sheet_person.html index aa5192dc4..d6cee2e61 100644 --- a/ishtar_common/templates/ishtar/sheet_person.html +++ b/ishtar_common/templates/ishtar/sheet_person.html @@ -1,23 +1,26 @@ {% extends "ishtar/sheet.html" %} {% load i18n window_field window_tables window_header %} -{% block head_title %}{% trans "Person"%}{% endblock %} -{% block content %} +{% block head_title %}<strong>{% trans "Person"%}</strong> - {{item}}{% endblock %} + +{% block toolbar %} {% window_nav item window_id 'show-person' 'person_modify' %} -<h3>{% trans "Identity" %}</h3> - -<ul class='form-flex'> -{% field_li "Title" item.full_title %} -{% field_li "Name" item.name %} -{% field_li "Surname" item.surname %} -{% field_li "Raw name" item.raw_name %} -{% field_li_detail "Created by" item.history_creator.ishtaruser.person %} -{% field_li "Email" item.email %} -{% field_li "Type(s)" item.person_types_list %} -</ul> +{% endblock %} + +{% block content %} + +<div class="row"> +{% field_flex "Title" item.full_title %} +{% field_flex "Name" item.name %} +{% field_flex "Surname" item.surname %} +{% field_flex "Raw name" item.raw_name %} +{% field_flex_detail "Created by" item.history_creator.ishtaruser.person %} +{% field_flex "Email" item.email %} +{% field_flex "Type(s)" item.person_types_list %} +</div> {% if item.phone or item.phone2 or item.phone3 or item.mobile_phone %} -<table class='formset table-form'> +<table class='table table-striped'> <caption>{% trans "Phone" %}</caption> <tr> <th>{% trans "Phone type" %}</th> @@ -44,33 +47,33 @@ {% if item.address or item.postal_code or item.town %} <h3>{% trans "Business address" %}</h3> -<ul class='form-flex'> - {% field_li "Address" item.address %} - {% field_li "Address complement" item.address_complement %} - {% field_li "Postal code" item.postal_code %} - {% field_li "Town" item.town %} -</ul>{% endif %} +<div class="row"> + {% field_flex "Address" item.address %} + {% field_flex "Address complement" item.address_complement %} + {% field_flex "Postal code" item.postal_code %} + {% field_flex "Town" item.town %} +</div>{% endif %} {% if item.alt_address or item.alt_postal_code or item.alt_town %} <h3>{% trans "Other address" %}</h3> -<ul class='form-flex'> - {% field_li "Address" item.alt_address %} - {% field_li "Address complement" item.alt_address_complement %} - {% field_li "Postal code" item.alt_postal_code %} - {% field_li "Town" item.alt_town %} -</ul>{% endif %} +<div class="row"> + {% field_flex "Address" item.alt_address %} + {% field_flex "Address complement" item.alt_address_complement %} + {% field_flex "Postal code" item.alt_postal_code %} + {% field_flex "Town" item.alt_town %} +</div>{% endif %} {% if item.attached_to %}<h3>{% trans "Associated organization"%}</h3> -<ul class='form-flex'> - {% field_li_detail "Name" item.attached_to %} - {% field_li "Address" item.attached_to.address %} - {% field_li "Address complement" item.attached_to.address_complement %} - {% field_li "Postal code" item.attached_to.postal_code %} - {% field_li "Town" item.attached_to.town %} - {% field_li "Phone" item.attached_to.phone %} - {% field_li "Mobile phone" item.attached_to.mobile_phone %} -</ul>{% endif %} +<div class="row"> + {% field_flex_detail "Name" item.attached_to %} + {% field_flex "Address" item.attached_to.address %} + {% field_flex "Address complement" item.attached_to.address_complement %} + {% field_flex "Postal code" item.attached_to.postal_code %} + {% field_flex "Town" item.attached_to.town %} + {% field_flex "Phone" item.attached_to.phone %} + {% field_flex "Mobile phone" item.attached_to.mobile_phone %} +</div>{% endif %} {% trans "Associated operations as scientist" as ao %} diff --git a/ishtar_common/templates/ishtar/sheet_source.html b/ishtar_common/templates/ishtar/sheet_source.html index 24477ce2c..a1a8948dc 100644 --- a/ishtar_common/templates/ishtar/sheet_source.html +++ b/ishtar_common/templates/ishtar/sheet_source.html @@ -4,35 +4,42 @@ {% block content %} {% block window_nav %}{% endblock %} {% block general %} -{% block related %} -{% trans "Related item" as related_item_label %} -{% field related_item_label item.owner %} -{% endblock %} {% if item.image %} -<a href='{{item.image.url}}' rel="prettyPhoto" title="{{item.label}}" class='photo'><img src='{{item.thumbnail.url}}'/></a> -{% endif%} +<div class="row"> + <div class="offset-lg-4 col-lg-4 offset-md-3 col-md-6 offset-sm-1 col-sm-10 col-12"> + <div class="card"> + <img class='card-img-top' src="{{item.thumbnail.url}}"> + </div> + </div> +</div> +{% endif %} + +<div class="row"> + {% block related %} + {% trans "Related item" as related_item_label %} + {% field_flex related_item_label item.owner %} + {% endblock %} + {% field_flex "Title" item.title %} + {% field_flex "Index" item.index %} + {% field_flex "Source type" item.source_type %} + {% field_flex "Format type" item.format_type %} + {% field_flex "Scale" item.scale %} + {% trans "Web link" as weblink_label %} + {% field_flex_url weblink_label item.associated_url %} + {% field_flex "Item number" item.item_number %} + {% field_flex "Ref." item.reference %} + {% field_flex "Internal ref." item.internal_reference %} + {% field_flex "Creation date" item.creation_date %} + {% field_flex "Receipt date" item.receipt_date %} + {% field_flex "Receipt date in documentation" item.receipt_date_in_documentation %} + {% field_flex "Has a duplicate" item.duplicate %} + {% field_flex "Description" item.description %} + {% field_flex "Comment" item.comment %} + {% field_flex "Additional information" item.additional_information %} + {% field_flex_full "Authors" item.authors|add_links:'person' %} +</div> -<ul class='form-flex'> -{% field_li "Title" item.title %} -{% field_li "Index" item.index %} -{% field_li "Source type" item.source_type %} -{% field_li "Format type" item.format_type %} -{% field_li "Scale" item.scale %} -{% trans "Web link" as weblink_label %} -{% field_li_url weblink_label item.associated_url %} -{% field_li "Item number" item.item_number %} -{% field_li "Ref." item.reference %} -{% field_li "Internal ref." item.internal_reference %} -{% field_li "Creation date" item.creation_date %} -{% field_li "Receipt date" item.receipt_date %} -{% field_li "Receipt date in documentation" item.receipt_date_in_documentation %} -{% field_li "Has a duplicate" item.duplicate %} -{% field_li "Description" item.description %} -{% field_li "Comment" item.comment %} -{% field_li "Additional information" item.additional_information %} -</ul> -{% field "Authors" item.authors|add_links:'person' %} {% endblock %} {% endblock %} diff --git a/ishtar_common/templates/ishtar/wizard/confirm_wizard.html b/ishtar_common/templates/ishtar/wizard/confirm_wizard.html index 7339af9a8..1128e9561 100644 --- a/ishtar_common/templates/ishtar/wizard/confirm_wizard.html +++ b/ishtar_common/templates/ishtar/wizard/confirm_wizard.html @@ -3,25 +3,31 @@ {% load range %} {% block content %} <h2>{{wizard_label}}</h2> -<form action="." method="post">{% csrf_token %} -<ul id='form_path'> -{% for step in previous_steps %} - <li><button name="form_prev_step" value="{{forloop.counter0}}">{{step}}</button></li> -{% endfor %} - <li class='current'><a href='#'>{{current_step_label}}</a></li> -</ul> -</form> + +{% include "ishtar/blocks/wizard_breadcrumb.html" %} + <form action="." method="post">{% csrf_token %} <div class='form'> {% block "warning_informations" %}{% endblock %} <p>{%if confirm_msg %}{{confirm_msg|safe}}{%else%}{% trans "You have entered the following informations:" %}{%endif%}</p> {% for form_label, form_data in datas %} - <table class='confirm'> - <caption>{{form_label}}</caption> - {% for data in form_data %} - <tr{%if data.2%} class='{{data.2}}'{%endif%}><th>{{data.0}}</th><td>{{data.1}}</td></tr> - {% endfor %} - </table> + + <div class="card"> + {% if form_label %} + <div class="card-header"> + {{form_label}} + </div>{% endif %} + <div class="card-body form-row"> + <table class='table'> + {% for data in form_data %} + <tr{%if data.2%} class='{{data.2}}'{%endif%}><th>{{data.0}}</th><td>{{data.1}}</td></tr> + {% endfor %} + </table> + + </div> + </div> + + {% endfor %} {{wizard.management_form}} {%if not wizard.form.is_hidden %} diff --git a/ishtar_common/templates/ishtar/wizard/default_wizard.html b/ishtar_common/templates/ishtar/wizard/default_wizard.html index 19076b0de..a7a705f59 100644 --- a/ishtar_common/templates/ishtar/wizard/default_wizard.html +++ b/ishtar_common/templates/ishtar/wizard/default_wizard.html @@ -5,21 +5,13 @@ {% endblock %} {% block content %} {% block wizard_head %} -<h2>{{wizard_label}}</h2> -<form action="." method="post">{% csrf_token %} -<ul id='form_path'> -{% for step in previous_steps %} - <li><button class='change_step' name="form_prev_step" value="{{forloop.counter0}}">{{step}}</button></li> -{% endfor %} - <li class='current'><a href='#'>{{current_step_label}}</a></li> -{% for step in next_steps %} - <li><button class='change_step' name="form_prev_step" value="{{forloop.counter|add:previous_step_counter}}">{{step}}</button></li> -{% endfor %} -</ul> -</form> +<h3>{{wizard_label}}</h3> + +{% include "ishtar/blocks/wizard_breadcrumb.html" %} + {% endblock %} {% block wizard_form %} -<form action="." method="post" name='wizard'{% if wizard.form.file_upload %} enctype="multipart/form-data"{% endif %}>{% csrf_token %} +<form action="." class='wizard-form' id="wizard-form" method="post" name='wizard'{% if wizard.form.file_upload %} enctype="multipart/form-data"{% endif %}>{% csrf_token %} <div class='form'> {{ wizard.form.media }} {{ wizard.management_form }} @@ -27,18 +19,19 @@ {% block form_detail %} {% if wizard.form.forms %} {{ wizard.form.management_form }} -<div class='top_button'><input type="submit" id="submit_form" value="{% trans "Validate" %}"/></div> -<table class='formset'> - {%if wizard.form.non_form_errors%}<tr class='error'><th colspan='2'>{{wizard.form.non_form_errors}}</th></tr>{%endif%} + {% if wizard.form.non_form_errors %} + <div class="alert alert-danger" role="alert"> + {{wizard.form.non_form_errors}} + </div> + {% endif %} {% for formsetform in wizard.form.forms %} - {% table_form formsetform %} + {% bs_form formsetform %} {% endfor %} - <tr class='modify'><td colspan="2"><button name="formset_modify" value="{{wizard.steps.current}}">{% trans "Add/Modify" %}</button></td></tr></li> -</table> + <button class="btn btn-success" name="formset_modify" value="{{wizard.steps.current}}"> + {% trans "Add/Modify" %} + </button> {% else %} -{% if not is_search %}<table>{% endif %} -{% table_form wizard.form %} -{% if not is_search %}</table>{% endif %} + {% bs_form wizard.form %} {% endif %} {% endblock %} <input type="hidden" name="{{ step_field }}" value="{{ step0 }}" /> @@ -46,6 +39,9 @@ {% block "footer" %} <div id="footer"> {% block "validation_bar" %} + {% if wizard.form.SEARCH_AND_SELECT %} + <p class="confirm-message">{% trans "Search and select an item in the table" %}</p> + {% endif %} {% include 'ishtar/wizard/validation_bar.html' %} {% endblock %} {% include 'ishtar/blocks/footer.html' %} diff --git a/ishtar_common/templates/ishtar/wizard/parcels_wizard.html b/ishtar_common/templates/ishtar/wizard/parcels_wizard.html index 28ec962f4..6a553d3c1 100644 --- a/ishtar_common/templates/ishtar/wizard/parcels_wizard.html +++ b/ishtar_common/templates/ishtar/wizard/parcels_wizard.html @@ -1,5 +1,5 @@ {% extends "ishtar/wizard/default_wizard.html" %} -{% load i18n range inline_formset %} +{% load i18n range inline_formset table_form %} {% block extra_head %} {{wizard.form.media}} {% endblock %} @@ -9,19 +9,30 @@ {{ wizard.form.media }} {{ wizard.management_form }} {{ wizard.form.management_form }} -{% if automatic_parcel_association %}<p class='alert'><i class="fa fa-exclamation-triangle" aria-hidden="true"></i> <label>{%trans "Existing parcels from the operation will be automatically added to the archaeological file." %}</label></p>{% endif %} - {%if wizard.form.non_form_errors%} -<table class='formset'> -<tr class='error'><th colspan='2'>{{wizard.form.non_form_errors}}</th></tr> -</table>{%endif%} -{{wizard.form.selection_form}} + {% if automatic_parcel_association %} + <div class="alert alert-danger" role="alert"> + {%trans "Existing parcels from the operation will be automatically added to the archaeological file." %} + </div> + {% endif %} + {% if wizard.form.non_form_errors %} + <div class="alert alert-danger" role="alert"> + {{wizard.form.non_form_errors}} + </div>{%endif%} + + {% bs_form wizard.form.selection_form %} + <table class='inline-table' id='parcel-table'> <tr>{% for field in wizard.form.forms.0 %}<th{% if not forloop.last %} rowspan='2'{% endif %}>{{ field.label_tag }}</th>{% endfor %}</tr> <tr><td>({% trans "all"%} <input type='checkbox' name='check-all' class='check-all'/>)</td></tr> {% inline_formset 'Parcels' wizard.form.forms False %} </table> {% if add_all %}<p><input type='checkbox' name='add_all_parcels' id='add_all_parcels'> <label for='add_all_parcels'>{% trans "Add all parcels from the archaeological file" %}</label></p>{% endif %} -<p><button name="formset_modify" value="{{wizard.steps.current}}">{% trans "Add/Modify" %}</button></p> + + <div class="text-center"> + <button class="btn btn-success" name="formset_modify" value="{{wizard.steps.current}}"> + {% trans "Add/Modify" %} + </button> + </div> <input type="hidden" name="{{ step_field }}" value="{{ step0 }}" /> {{ previous_fields|safe }} {% block "footer" %} diff --git a/ishtar_common/templates/ishtar/wizard/search.html b/ishtar_common/templates/ishtar/wizard/search.html index e5066cf87..e1f2433ea 100644 --- a/ishtar_common/templates/ishtar/wizard/search.html +++ b/ishtar_common/templates/ishtar/wizard/search.html @@ -4,10 +4,18 @@ {{wizard.form.media}} {% endblock %} {% block content %} -<h2>{{wizard_label}}</h2> -<ul id='form_path'> - <li class='current'><a href='#'>{{current_step.form_label}}</a></li> -</ul> +<h3>{{wizard_label}}</h3> + +{% comment %} +<nav aria-label="breadcrumb" role="navigation"> + <ol class="breadcrumb"> + <li class="breadcrumb-item active"> + <a href='#'>{{current_step.form_label}}</a> + </li> + </ol> +</nav> +{% endcomment %} +<form action="." class='wizard-form' id="wizard-form" method="post" name='wizard'>{% csrf_token %} {% if wizard.form.forms %} <div class='form'> <div class='top_button'><input type="submit" id="submit_form" value="{% trans "Validate" %}"/></div> @@ -20,8 +28,10 @@ <tr class='modify'><td colspan="2"><button name="formset_modify" value="{{wizard.steps.current}}">{% trans "Add/Modify" %}</button></td></tr></li> </table> {% else %} -<div class='form'> +<div class='form search'> {{ wizard.form.as_p }} </div> +</div> {% endif %} +</form> {% endblock %} diff --git a/ishtar_common/templates/ishtar/wizard/validation_bar.html b/ishtar_common/templates/ishtar/wizard/validation_bar.html index b99b9e689..0a30fb7e1 100644 --- a/ishtar_common/templates/ishtar/wizard/validation_bar.html +++ b/ishtar_common/templates/ishtar/wizard/validation_bar.html @@ -1,8 +1,24 @@ {% load i18n %} -<div id='validation-bar'> - <input type="submit" id="submit_form" name='validate' value="{% trans 'Validate' %}"/> +<div id='validation-bar' class="row text-center"> + <div class="col-sm"> + <button type="submit" id="submit_form" name='validate' + value="validate" class="btn btn-success"> + {% trans 'Validate' %} + </button> + </div> {% if last_step_is_available and next_steps %} - <input type="submit" id="submit_end_form" name='validate_and_end' value="{% trans 'Validate and end' %}"/> + <div class="col-sm"> + <button type="submit" id="submit_end_form" name='validate_and_end' + value="validate_and_end" class="btn btn-success"> + {% trans 'Validate and end' %} + </button> + </div> {% endif %} - <a href="{% url 'reset_wizards' %}" id="reset_wizards" class='button'>{% trans "Cancel" %}</a> + <div class="col-sm"> + <a href="{% url 'reset_wizards' %}" id="reset_wizards"> + <button type="button" class="btn btn-secondary"> + {% trans "Cancel" %} + </button> + </a> + </div> </div> diff --git a/ishtar_common/templates/ishtar/wizard/wizard_done.html b/ishtar_common/templates/ishtar/wizard/wizard_done.html index 2823c1bae..5acd6e78e 100644 --- a/ishtar_common/templates/ishtar/wizard/wizard_done.html +++ b/ishtar_common/templates/ishtar/wizard/wizard_done.html @@ -1,14 +1,24 @@ {% extends "base.html" %} {% load i18n %} + +{% block top_content %} +<div class="alert alert-success alert-dismissible fade show" role="alert"> + {%trans "Item successfully saved"%}<button type="button" class="close" data-dismiss="alert" aria-label="Close"> + <span aria-hidden="true">×</span> +</button> +</div> +{% endblock %} + {% block content %} -<p>{%trans "Item successfully saved"%}</p> {% if redirect or wizard_done_window %} <script type='text/javascript' language='javascript'> {% if redirect %} window.location.href = "{{redirect}}"; {% endif %} {% if wizard_done_window %} -$(function(){ load_window("{{wizard_done_window}}{{item.pk}}/"); }); +$(function(){ + load_window("{{wizard_done_window}}{{item.pk}}/", "", + function (){}, true); }); {% endif %} </script> {% endif %} diff --git a/ishtar_common/templates/ishtar/wizard/wizard_person.html b/ishtar_common/templates/ishtar/wizard/wizard_person.html index e518ecc3d..fc15dbfad 100644 --- a/ishtar_common/templates/ishtar/wizard/wizard_person.html +++ b/ishtar_common/templates/ishtar/wizard/wizard_person.html @@ -1,59 +1,88 @@ {% extends "ishtar/wizard/default_wizard.html" %} {% load i18n range table_form %} {% block form_detail %} +{% if form.non_field_errors %} +<div class="alert alert-danger" role="alert"> + {{form.non_field_errors}} +</div> +{% endif %} -<table class='formset'> - <caption>{% trans "Identity" %}</caption> - {% table_field wizard.form.title %} - {% table_field wizard.form.surname 1 %} - {% table_field wizard.form.name 1 %} - {% table_field wizard.form.raw_name %} - {% table_field wizard.form.email %} - {% table_field wizard.form.attached_to %} -</table> +{% for hidden in form.hidden_fields %} +{{hidden}} +{% if hidden.errors %}<div class="invalid-feedback"> + {{ hidden.errors }} +</div>{% endif %} +{% endfor %} -<hr class='spacer'/> -<table class='formset table-form'> - <caption>{% trans "Phone" %}</caption> - <tr> - <th>{% trans "Phone type" %}</th> - <th>{% trans "Number" context "phone number" %}</th> - </tr> - <tr> - <td>{{ wizard.form.phone_desc.errors }}{{wizard.form.phone_desc|safe}}</td> - <td>{{ wizard.form.phone.errors }}{{wizard.form.phone|safe}}</td> - </tr> - <tr> - <td>{{ wizard.form.phone_desc2.errors }}{{wizard.form.phone_desc2|safe}}</td> - <td>{{ wizard.form.phone2.errors }}{{wizard.form.phone2|safe}}</td> - </tr> - <tr> - <td>{{ wizard.form.phone_desc3.errors }}{{wizard.form.phone_desc3|safe}}</td> - <td>{{ wizard.form.phone3.errors }}{{wizard.form.phone3|safe}}</td> - </tr> - <tr> - <td>{% trans "Mobile phone" %}</td> - <td>{{ wizard.form.mobile_phone.errors }}{{wizard.form.mobile_phone|safe}}</td> - </tr> -</table> -<hr class='spacer'/> +<div class="card"> + <div class="card-header"> + {% trans "Identity" %} + </div> + <div class="card-body form-row"> + {% bs_field wizard.form.surname 1 %} + {% bs_field wizard.form.name 1 %} + {% bs_field wizard.form.title %} + {% bs_field wizard.form.raw_name %} + {% bs_field wizard.form.email %} + {% bs_field wizard.form.attached_to %} + </div> +</div> -<table class='formset'> - <caption>{% trans "Business address" %}</caption> - {% table_field wizard.form.address %} - {% table_field wizard.form.address_complement %} - {% table_field wizard.form.postal_code %} - {% table_field wizard.form.town %} - {% table_field wizard.form.country %} -</table> -<hr class='spacer'/> -<table class='formset'> - <caption>{% trans "Other address" %}</caption> - {% table_field wizard.form.alt_address 0 'Address' %} - {% table_field wizard.form.alt_address_complement 0 'Address complement' %} - {% table_field wizard.form.alt_postal_code 0 'Postal code' %} - {% table_field wizard.form.alt_town 0 'Town' %} - {% table_field wizard.form.alt_country 0 'Country' %} -</table> +<div class="card"> + <div class="card-header"> + {% trans "Phone" %} + </div> + <div class="card-body form-row"> + <table class='table table-striped'> + <tr> + <th>{% trans "Phone type" %}</th> + <th>{% trans "Number" context "phone number" %}</th> + </tr> + <tr> + <td>{{ wizard.form.phone_desc.errors }}{{wizard.form.phone_desc|safe}}</td> + <td>{{ wizard.form.phone.errors }}{{wizard.form.phone|safe}}</td> + </tr> + <tr> + <td>{{ wizard.form.phone_desc2.errors }}{{wizard.form.phone_desc2|safe}}</td> + <td>{{ wizard.form.phone2.errors }}{{wizard.form.phone2|safe}}</td> + </tr> + <tr> + <td>{{ wizard.form.phone_desc3.errors }}{{wizard.form.phone_desc3|safe}}</td> + <td>{{ wizard.form.phone3.errors }}{{wizard.form.phone3|safe}}</td> + </tr> + <tr> + <td>{% trans "Mobile phone" %}</td> + <td>{{ wizard.form.mobile_phone.errors }}{{wizard.form.mobile_phone|safe}}</td> + </tr> + </table> + </div> +</div> + + +<div class="card"> + <div class="card-header"> + {% trans "Business address" %} + </div> + <div class="card-body form-row"> + {% bs_field wizard.form.address %} + {% bs_field wizard.form.address_complement %} + {% bs_field wizard.form.postal_code %} + {% bs_field wizard.form.town %} + {% bs_field wizard.form.country %} + </div> +</div> + +<div class="card"> + <div class="card-header"> + {% trans "Other address" %} + </div> + <div class="card-body form-row"> + {% bs_field wizard.form.alt_address 0 'Address' %} + {% bs_field wizard.form.alt_address_complement 0 'Address complement' %} + {% bs_field wizard.form.alt_postal_code 0 'Postal code' %} + {% bs_field wizard.form.alt_town 0 'Town' %} + {% bs_field wizard.form.alt_country 0 'Country' %} + </div> +</div> {% endblock %} |
