Show Permission Restrictions in a Table (#5457)
This commit is contained in:
parent
d6902b5010
commit
8283cd3fbb
2 changed files with 16 additions and 13 deletions
|
|
@ -111,7 +111,7 @@ frappe.views.ListView = class ListView extends frappe.views.BaseList {
|
|||
}
|
||||
}
|
||||
|
||||
show_restrictions(match_rules_list) {
|
||||
show_restrictions(match_rules_list=[]) {
|
||||
frappe.msgprint(frappe.render_template('list_view_permission_restrictions', {
|
||||
condition_list: match_rules_list
|
||||
}), 'Restrictions');
|
||||
|
|
|
|||
|
|
@ -1,13 +1,16 @@
|
|||
<div class="level">
|
||||
{% for(var i=0; i < condition_list.length; i++) { var conditions=condition_list[i]; %}
|
||||
<div class="level-item">
|
||||
{% if (i > 0) { %}
|
||||
<span style="margin-right: 10px;">{{ __("Or") }}</span>{% } %} {% for(key in conditions) { %}
|
||||
<span class="label label-default" style="margin-right: 10px;">
|
||||
{% if(conditions[key].length) { %} {{ key }} = {{ frappe.utils.comma_or(conditions[key]) }} {% } else { %} {{ __("{0} is
|
||||
not set", [key]) }} {% } %}
|
||||
</span>
|
||||
<table class="table table-bordered" style="margin: 0;">
|
||||
<thead>
|
||||
<th>{{ __("Field") }}</th>
|
||||
<th>{{ __("Value") }}</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for (let condition of condition_list ) { %}
|
||||
{% for (let key in condition) { %}
|
||||
<tr>
|
||||
<td>{{ __(key) }}</td>
|
||||
<td>{{ frappe.utils.comma_or(condition[key]) }}</td>
|
||||
</tr>
|
||||
{% } %}
|
||||
{% } %}
|
||||
</div>
|
||||
{% } %}
|
||||
</div>
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue