admin: add .pb-root-link for AdminSiteShell for links that should not be modified
This commit is contained in:
parent
517b811a99
commit
49397cef70
|
@ -86,9 +86,8 @@
|
|||
</button>
|
||||
<div slot="modal"></div>
|
||||
</pb-modal-button>
|
||||
{# TODO: Fix execute link being modified #}
|
||||
<a class="pf-c-button pf-m-secondary" href="{% url 'passbook_admin:flow-execute' pk=flow.pk %}?next={{ request.get_full_path }}">{% trans 'Execute' %}</a>
|
||||
<a class="pf-c-button pf-m-secondary" href="{% url 'passbook_admin:flow-export' pk=flow.pk %}?next={{ request.get_full_path }}">{% trans 'Export' %}</a>
|
||||
<a class="pf-c-button pf-m-secondary pb-root-link" href="{% url 'passbook_admin:flow-execute' pk=flow.pk %}?next={{ request.get_full_path }}">{% trans 'Execute' %}</a>
|
||||
<a class="pf-c-button pf-m-secondary pb-root-link" href="{% url 'passbook_admin:flow-export' pk=flow.pk %}?next={{ request.get_full_path }}">{% trans 'Export' %}</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
|
|
@ -97,7 +97,7 @@
|
|||
</pb-modal-button>
|
||||
{% get_links provider as links %}
|
||||
{% for name, href in links.items %}
|
||||
<a class="pf-c-button pf-m-tertiary" href="{{ href }}?back={{ request.get_full_path }}">{% trans name %}</a>
|
||||
<a class="pf-c-button pf-m-tertiary pb-root-link" href="{{ href }}?back={{ request.get_full_path }}">{% trans name %}</a>
|
||||
{% endfor %}
|
||||
{% get_htmls provider as htmls %}
|
||||
{% for html in htmls %}
|
||||
|
|
|
@ -95,7 +95,7 @@
|
|||
</pb-modal-button>
|
||||
{% get_links source as links %}
|
||||
{% for name, href in links %}
|
||||
<a class="pf-c-button pf-m-tertiary" href="{{ href }}?back={{ request.get_full_path }}">{% trans name %}</a>
|
||||
<a class="pf-c-button pf-m-tertiary pb-root-link" href="{{ href }}?back={{ request.get_full_path }}">{% trans name %}</a>
|
||||
{% endfor %}
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -90,7 +90,7 @@
|
|||
</pb-modal-button>
|
||||
{% get_links stage as links %}
|
||||
{% for name, href in links.items %}
|
||||
<a class="pf-c-button pf-m-tertiary" href="{{ href }}?back={{ request.get_full_path }}">{% trans name %}</a>
|
||||
<a class="pf-c-button pf-m-tertiary pb-root-link" href="{{ href }}?back={{ request.get_full_path }}">{% trans name %}</a>
|
||||
{% endfor %}
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -92,7 +92,7 @@
|
|||
</pb-modal-button>
|
||||
{% get_links prompt as links %}
|
||||
{% for name, href in links.items %}
|
||||
<a class="pf-c-button pf-m-tertiary" href="{{ href }}?back={{ request.get_full_path }}">{% trans name %}</a>
|
||||
<a class="pf-c-button pf-m-tertiary pb-root-link" href="{{ href }}?back={{ request.get_full_path }}">{% trans name %}</a>
|
||||
{% endfor %}
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -63,7 +63,7 @@
|
|||
<td>
|
||||
<pb-modal-button href="{% url 'passbook_admin:user-update' pk=user.pk %}">
|
||||
<button slot="trigger" class="pf-c-button pf-m-secondary">
|
||||
{% trans 'Update' %}
|
||||
{% trans 'Edit' %}
|
||||
</button>
|
||||
<div slot="modal"></div>
|
||||
</pb-modal-button>
|
||||
|
@ -82,8 +82,8 @@
|
|||
<div slot="modal"></div>
|
||||
</pb-modal-button>
|
||||
{% endif %}
|
||||
<a class="pf-c-button pf-m-tertiary" href="{% url 'passbook_admin:user-password-reset' pk=user.pk %}?back={{ request.get_full_path }}">{% trans 'Reset Password' %}</a>
|
||||
<a class="pf-c-button pf-m-tertiary" href="{% url 'passbook_core:impersonate-init' user_id=user.pk %}">{% trans 'Impersonate' %}</a>
|
||||
<a class="pf-c-button pf-m-tertiary pb-root-link" href="{% url 'passbook_admin:user-password-reset' pk=user.pk %}?back={{ request.get_full_path }}">{% trans 'Reset Password' %}</a>
|
||||
<a class="pf-c-button pf-m-tertiary pb-root-link" href="{% url 'passbook_core:impersonate-init' user_id=user.pk %}">{% trans 'Impersonate' %}</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
|
|
@ -48,7 +48,7 @@ export class AdminSiteShell extends LitElement {
|
|||
this.querySelector("[slot=body]")!.innerHTML = t;
|
||||
}).then(() => {
|
||||
// Ensure anchors only change the hash
|
||||
this.querySelectorAll("a").forEach(a => {
|
||||
this.querySelectorAll<HTMLAnchorElement>("a:not(.pb-root-link)").forEach(a => {
|
||||
if (a.href === "") {
|
||||
return;
|
||||
}
|
||||
|
|
Reference in New Issue