-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
model verbose name fix, widget html refactoring
- Loading branch information
1 parent
c91d8e5
commit b8c4ed8
Showing
4 changed files
with
73 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
VERSION='1.1.0' | ||
VERSION='1.1.1' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
129 changes: 67 additions & 62 deletions
129
permissions_widget/templates/permissions_widget/widget.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,72 +1,77 @@ | ||
{% load permissions_widget_tags %} | ||
{% load permissions_widget_tags i18n %} | ||
|
||
<table class="table"> | ||
<tr> | ||
<th colspan="{{ permission_types|length|add:"1" }}"><h2>Standard permissions</h2></th> | ||
</tr> | ||
<tr> | ||
<td></td> | ||
{% for permission_type in permission_types %} | ||
<th> | ||
{{ permission_type|capfirst }} | ||
</th> | ||
{% endfor %} | ||
</tr> | ||
|
||
{% for row in table %} | ||
{% ifchanged row.app %} | ||
<thead> | ||
<tr> | ||
<th colspan="{{ permission_types|length|add:"1" }}"> | ||
{{ row.app|capfirst }} | ||
</th> | ||
<th colspan="{{ permission_types|length|add:"1" }}"><h2>Standard permissions</h2></th> | ||
</tr> | ||
{% endifchanged %} | ||
{% ifchanged row.model %} | ||
<tr> | ||
<td> | ||
{{ row.model|capfirst }} | ||
</td> | ||
{% for permission_type in permission_types %} | ||
{% with row.permissions|get_item:permission_type as permission %} | ||
<td> | ||
{% if permission %} | ||
<input name="{{ name }}" title="{{ permission.name }}" {% if permission.value in value %}checked="checked"{% endif %} value="{{ permission.value }}" type="checkbox" /> | ||
{% endif %} | ||
</td> | ||
{% endwith %} | ||
{% endfor %} | ||
</tr> | ||
{% endifchanged %} | ||
{% endfor %} | ||
|
||
{% if permission_types_custom %} | ||
<tr> | ||
<th colspan="{{ permission_types|length|add:"1" }}"><h2>Custom permissions</h2></th> | ||
<th>{% trans 'App & Model' %}</th> | ||
{% for permission_type in permission_types %} | ||
<th> | ||
{{ permission_type|capfirst }} | ||
</th> | ||
{% endfor %} | ||
</tr> | ||
{% endif %} | ||
{% for row in table %} | ||
{% ifchanged row.model %} | ||
{% with permission_types_custom|get_for_model:row as permissions %} | ||
{% if permissions %} | ||
<tr> | ||
<th colspan="{{ permission_types|length|add:"1" }}"> | ||
{{ row.app|capfirst }} | | ||
{{ row.model|capfirst }} | ||
</th> | ||
</tr> | ||
{% for permission in permissions %} | ||
</thead> | ||
<tbody> | ||
{% for row in table %} | ||
{% ifchanged row.app %} | ||
<tr> | ||
<th colspan="{{ permission_types|length|add:"1" }}"> | ||
{{ row.app|capfirst }} | ||
</th> | ||
</tr> | ||
{% endifchanged %} | ||
|
||
{% ifchanged row.model %} | ||
<tr> | ||
<td> | ||
{{ row.model|capfirst }} | ||
</td> | ||
{% for permission_type in permission_types %} | ||
{% with row.permissions|get_item:permission_type as permission %} | ||
<td> | ||
{% if permission %} | ||
<input name="{{ name }}" title="{{ permission.name }}" {% if permission.value in value %}checked="checked"{% endif %} value="{{ permission.value }}" type="checkbox" /> | ||
{% endif %} | ||
</td> | ||
{% endwith %} | ||
{% endfor %} | ||
</tr> | ||
{% endifchanged %} | ||
{% endfor %} | ||
|
||
{% if permission_types_custom %} | ||
<tr> | ||
<td> | ||
{{ permission.name }} | ||
</td> | ||
<td> | ||
<input name="{{ name }}" title="{{ permission.name }}" {% if permission.value in value %}checked="checked"{% endif %} value="{{ permission.value }}" type="checkbox" /> | ||
</td> | ||
<td colspan="{{ permission_types|length|add:"-1" }}"> </td> | ||
<th colspan="{{ permission_types|length|add:"1" }}"><h2>Custom permissions</h2></th> | ||
</tr> | ||
{% endfor %} | ||
{% endif %} | ||
{% endwith %} | ||
{% endifchanged %} | ||
{% endfor %} | ||
|
||
{% for row in table %} | ||
{% ifchanged row.model %} | ||
{% with permission_types_custom|get_for_model:row as permissions %} | ||
{% if permissions %} | ||
<tr> | ||
<th colspan="{{ permission_types|length|add:"1" }}"> | ||
{{ row.app|capfirst }} | | ||
{{ row.model|capfirst }} | ||
</th> | ||
</tr> | ||
{% for permission in permissions %} | ||
<tr> | ||
<td> | ||
{{ permission.name }} | ||
</td> | ||
<td> | ||
<input name="{{ name }}" title="{{ permission.name }}" {% if permission.value in value %}checked="checked"{% endif %} value="{{ permission.value }}" type="checkbox" /> | ||
</td> | ||
<td colspan="{{ permission_types|length|add:"-1" }}"> </td> | ||
</tr> | ||
{% endfor %} | ||
{% endif %} | ||
{% endwith %} | ||
{% endifchanged %} | ||
{% endfor %} | ||
</tbody> | ||
</table> |