manager: access context through table object bis (#31222)
Related to #31092.
This commit is contained in:
parent
4a69acd8bd
commit
df8cc6dff5
|
@ -7,6 +7,6 @@
|
|||
<th></th>
|
||||
{% endblock %}
|
||||
{% block table.tbody.last.column %}
|
||||
<td>{% if view.can_change and row.record.direct %}<a class="icon-remove-sign js-remove-object" data-confirm="{% blocktrans with username=row.record.get_full_name role=active_role.name %}Do you really want to remove user "{{ username }}" from role "{{ object }}" ?{% endblocktrans %}" href="#" data-pk-arg="user"></a>{% endif %}</td>
|
||||
<td>{% if table.context.view.can_change and row.record.direct %}<a class="icon-remove-sign js-remove-object" data-confirm="{% blocktrans with username=row.record.get_full_name role=table.context.object %}Do you really want to remove user "{{ username }}" from role "{{ role }}" ?{% endblocktrans %}" href="#" data-pk-arg="user"></a>{% endif %}</td>
|
||||
{% endblock %}
|
||||
{% endif %}
|
||||
|
|
|
@ -7,6 +7,6 @@
|
|||
<th></th>
|
||||
{% endblock %}
|
||||
{% block table.tbody.last.column %}
|
||||
<td>{% if view.can_change %}<a class="icon-remove-sign js-remove-object" href="#" data-pk-arg="permission"></a>{% endif %}</td>
|
||||
<td>{% if table.context.view.can_change %}<a class="icon-remove-sign js-remove-object" href="#" data-pk-arg="permission"></a>{% endif %}</td>
|
||||
{% endblock %}
|
||||
{% endif %}
|
||||
|
|
|
@ -7,6 +7,6 @@
|
|||
<th></th>
|
||||
{% endblock %}
|
||||
{% block table.tbody.last.column %}
|
||||
<td>{% if view.can_change %}<a class="icon-remove-sign js-remove-object" data-confirm="{% blocktrans with name=row.record.name slug=row.record.slug %}Do you really want to remove role "{{ name }}" from service "{{ object }}" ?{% endblocktrans %}" href="#" data-pk-arg="role"></a>{% endif %}</td>
|
||||
<td>{% if table.context.view.can_change %}<a class="icon-remove-sign js-remove-object" data-confirm="{% blocktrans with name=row.record.name slug=table.context.object %}Do you really want to remove role "{{ name }}" from service "{{ slug }}" ?{% endblocktrans %}" href="#" data-pk-arg="role"></a>{% endif %}</td>
|
||||
{% endblock %}
|
||||
{% endif %}
|
||||
|
|
|
@ -24,8 +24,8 @@
|
|||
{% if popup_edit %}
|
||||
rel="popup"
|
||||
{% endif %}
|
||||
{% if url_name %}
|
||||
data-url="{% url url_name pk=row.record.pk %}"
|
||||
{% if table.context.url_name %}
|
||||
data-url="{% url table.context.url_name pk=row.record.pk %}"
|
||||
{% else %}
|
||||
data-url="{{ row.record.pk }}/"
|
||||
{% endif %}
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
{% block page_title %}
|
||||
{% trans "Edit User Roles" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block extrascripts %}
|
||||
{{ block.super }}
|
||||
<script>
|
||||
|
|
|
@ -7,6 +7,6 @@
|
|||
<th></th>
|
||||
{% endblock %}
|
||||
{% block table.tbody.last.column %}
|
||||
<td>{% if view.can_change and row.record.member %}<a class="icon-remove-sign js-remove-object" data-confirm="{% blocktrans with name=row.record.name role=active_role.name %}Do you really want to remove role "{{ name }}" from user "{{ object }}" ?{% endblocktrans %}" href="#" data-pk-arg="role"></a>{% endif %}</td>
|
||||
<td>{% if table.context.view.can_change and row.record.member %}<a class="icon-remove-sign js-remove-object" data-confirm="{% blocktrans with name=row.record.name username=table.context.object.get_full_name %}Do you really want to remove role "{{ name }}" from user "{{ username }}" ?{% endblocktrans %}" href="#" data-pk-arg="role"></a>{% endif %}</td>
|
||||
{% endblock %}
|
||||
{% endif %}
|
||||
|
|
|
@ -319,6 +319,7 @@ def test_manager_one_ou(app, superuser, admin, simple_role, settings):
|
|||
q = response.pyquery.remove_namespaces()
|
||||
assert len(q('table tbody tr')) == 1
|
||||
assert q('table tbody tr').text() == u'simple role'
|
||||
assert q('table tbody tr').attr('data-url') == '/manage/roles/%s/' % simple_role.pk
|
||||
|
||||
form.set('search-internals', True)
|
||||
response = form.submit()
|
||||
|
|
Loading…
Reference in New Issue