Display currency list under currency settings page

This commit is contained in:
Oliver Walters 2019-09-07 19:23:58 +10:00
parent 9726ea4f99
commit 873faee040
4 changed files with 63 additions and 12 deletions

View File

@ -88,6 +88,12 @@
width: 100%; width: 100%;
} }
.basecurrency {
color: #050;
font-style: italic;
font-weight: bold;
}
.bomselect { .bomselect {
max-width: 250px; max-width: 250px;
} }

View File

@ -6,4 +6,49 @@
{% block settings %} {% block settings %}
<table class='table table-striped table-condensed' id='currency-table'/>
</table>
{% endblock %}
{% block js_ready %}
{{ block.super }}
$("#currency-table").bootstrapTable({
url: "{% url 'api-currency-list' %}",
sortable: true,
search: true,
formatNoMatches: function() { return "No currencies found"; },
rowStyle: function(row, index) {
if (row.base) {
return {classes: 'basecurrency'};
} else {
return {};
}
},
columns: [
{
field: 'pk',
title: 'ID',
visible: false,
},
{
field: 'symbol',
title: 'Symbol',
},
{
field: 'suffix',
title: 'Currency',
},
{
field: 'description',
title: 'Description',
},
{
field: 'value',
title: 'Value',
}
]
});
{% endblock %} {% endblock %}

View File

@ -1,11 +1,11 @@
<ul class='nav nav-pills nav-stacked'> <ul class='nav nav-pills nav-stacked'>
<li{% ifequal tab 'user' %} class='active'{% endifequal %}> <li{% ifequal tab 'user' %} class='active'{% endifequal %}>
<a href="{% url 'settings-user' %}">User</a> <a href="{% url 'settings-user' %}"><span class='glyphicon glyphicon-user'></span> User</a>
</li> </li>
<li{% ifequal tab 'currency' %} class='active'{% endifequal %}> <li{% ifequal tab 'currency' %} class='active'{% endifequal %}>
<a href="{% url 'settings-currency' %}">Currency</a> <a href="{% url 'settings-currency' %}"><span class='glyphicon glyphicon-usd'></span> Currency</a>
</li> </li>
<li{% ifequal tab 'part' %} class='active'{% endifequal %}> <li{% ifequal tab 'part' %} class='active'{% endifequal %}>
<a href="{% url 'settings-part' %}">Part</a> <a href="{% url 'settings-part' %}"><span class='glyphicon glyphicon-briefcase'></span> Part</a>
</li> </li>
</ul> </ul>

View File

@ -7,16 +7,16 @@
{% block settings %} {% block settings %}
<div class='row'> <div class='row'>
<div class='col-sm-6'> <div class='col-sm-6'>
<h4>User Information</h4> <h4>User Information</h4>
</div>
<div class='col-sm-6'>
<div class='btn-group' style='float: right;'>
<div class='btn btn-primary' type='button' id='edit-user' title='Edit User Information'>Edit</div>
<div class='btn btn-primary' type='button' id='edit-password' title='Change Password'>Set Password</div>
</div> </div>
<div class='col-sm-6'> </div>
<div class='btn-group' style='float: right;'> </div>
<div class='btn btn-primary' type='button' id='edit-user' title='Edit User Information'>Edit</div>
<div class='btn btn-primary' type='button' id='edit-password' title='Change Password'>Set Password</div>
</div>
</div>
</div>
<table class='table table-striped table-condensed'> <table class='table table-striped table-condensed'>
<tr> <tr>