Add option to make stock-table read-only

- Default table is not read-only
This commit is contained in:
Oliver Walters 2020-03-18 20:37:25 +11:00
parent 1fa4e7f5fb
commit 33ffa2f75f
2 changed files with 4 additions and 1 deletions

View File

@ -9,7 +9,7 @@
<h4>{% trans "Build Outputs" %}</h4> <h4>{% trans "Build Outputs" %}</h4>
<hr> <hr>
{% include "stock_table.html" %} {% include "stock_table.html" with read_only=True %}
{% endblock %} {% endblock %}

View File

@ -3,6 +3,8 @@
<div id='button-toolbar'> <div id='button-toolbar'>
<div class='button-toolbar container-fluid' style='float: right;'> <div class='button-toolbar container-fluid' style='float: right;'>
<button class='btn btn-default' id='stock-export' title='Export Stock Information'>{% trans "Export" %}</button> <button class='btn btn-default' id='stock-export' title='Export Stock Information'>{% trans "Export" %}</button>
{% if read_only %}
{% else %}
<button class="btn btn-success" id='item-create'>{% trans "New Stock Item" %}</button> <button class="btn btn-success" id='item-create'>{% trans "New Stock Item" %}</button>
<div class="dropdown" style='float: right;'> <div class="dropdown" style='float: right;'>
<button id='stock-options' class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">{% trans "Options" %}<span class="caret"></span></button> <button id='stock-options' class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">{% trans "Options" %}<span class="caret"></span></button>
@ -15,6 +17,7 @@
<li><a href='#' id='multi-item-delete' title='Delete selected items'>{% trans "Delete Stock" %}</a></li> <li><a href='#' id='multi-item-delete' title='Delete selected items'>{% trans "Delete Stock" %}</a></li>
</ul> </ul>
</div> </div>
{% endif %}
</div> </div>
</div> </div>