diff options
Diffstat (limited to 'ishtar_common/templates/ishtar')
6 files changed, 99 insertions, 67 deletions
diff --git a/ishtar_common/templates/ishtar/blocks/shortcut_menu.html b/ishtar_common/templates/ishtar/blocks/shortcut_menu.html index 67f91dfea..a4855dd10 100644 --- a/ishtar_common/templates/ishtar/blocks/shortcut_menu.html +++ b/ishtar_common/templates/ishtar/blocks/shortcut_menu.html @@ -1,42 +1,46 @@ {% 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> -<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> +<div class="nav-item dropdown navbar-expand-lg navbar-collapse justify-content-end"> + <ul class="navbar-nav"> + <li class="nav-item dropdown"> + <a class="nav-link dropdown-toggle" data-toggle="dropdown" + href="#" role="button" aria-haspopup="true"> + Current.... + <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' %}"> + + <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> + </div> + <div> + <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> + </div> + </form> + </div> + </li> + </ul> </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> -</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 %} 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/wizard/confirm_wizard.html b/ishtar_common/templates/ishtar/wizard/confirm_wizard.html index 7339af9a8..034d6e21a 100644 --- a/ishtar_common/templates/ishtar/wizard/confirm_wizard.html +++ b/ishtar_common/templates/ishtar/wizard/confirm_wizard.html @@ -3,14 +3,9 @@ {% 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 %} diff --git a/ishtar_common/templates/ishtar/wizard/default_wizard.html b/ishtar_common/templates/ishtar/wizard/default_wizard.html index 19076b0de..06e8be05a 100644 --- a/ishtar_common/templates/ishtar/wizard/default_wizard.html +++ b/ishtar_common/templates/ishtar/wizard/default_wizard.html @@ -6,17 +6,9 @@ {% 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> + +{% 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 %} @@ -31,14 +23,12 @@ <table class='formset'> {%if wizard.form.non_form_errors%}<tr class='error'><th colspan='2'>{{wizard.form.non_form_errors}}</th></tr>{%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> {% 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 }}" /> diff --git a/ishtar_common/templates/ishtar/wizard/search.html b/ishtar_common/templates/ishtar/wizard/search.html index e5066cf87..7b8f142e4 100644 --- a/ishtar_common/templates/ishtar/wizard/search.html +++ b/ishtar_common/templates/ishtar/wizard/search.html @@ -5,9 +5,15 @@ {% endblock %} {% block content %} <h2>{{wizard_label}}</h2> -<ul id='form_path'> - <li class='current'><a href='#'>{{current_step.form_label}}</a></li> -</ul> + +<nav aria-label="breadcrumb" role="navigation"> + <ol class="breadcrumb"> + <li class="breadcrumb-item active"> + <a href='#'>{{current_step.form_label}}</a> + </li> + </ol> +</nav> + {% if wizard.form.forms %} <div class='form'> <div class='top_button'><input type="submit" id="submit_form" value="{% trans "Validate" %}"/></div> @@ -20,7 +26,7 @@ <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> {% endif %} diff --git a/ishtar_common/templates/ishtar/wizard/validation_bar.html b/ishtar_common/templates/ishtar/wizard/validation_bar.html index b99b9e689..c6856aa75 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-primary"> + {% 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-primary"> + {% 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> |
