Fixed the URL in the user form in the Mia core application.

This commit is contained in:
依瑪貓 2020-08-09 22:37:15 +08:00
parent 3f772b3116
commit 1f0685b026

View File

@ -36,20 +36,20 @@ First written: 2020/8/9
{% block content %} {% block content %}
<div class="btn-group btn-actions"> <div class="btn-group btn-actions">
<a class="btn btn-primary" role="button" href="{% if form.user %}{% url "mia_core:users.detail" user %}{% else %}{% url "mia_core:users" %}{% endif %}"> <a class="btn btn-primary" role="button" href="{% if form.user %}{% url "mia_core:users.detail" form.user %}{% else %}{% url "mia_core:users" %}{% endif %}">
<i class="fas fa-chevron-circle-left"></i> <i class="fas fa-chevron-circle-left"></i>
{{ _("Back")|force_escape }} {{ _("Back")|force_escape }}
</a> </a>
</div> </div>
<form id="user-form" action="{% if form.user %}{% url "mia_core:users.update" user %}{% else %}{% url "mia_core:users.store" %}{% endif %}" method="POST"> <form id="user-form" action="{% if form.user %}{% url "mia_core:users.update" form.user %}{% else %}{% url "mia_core:users.store" %}{% endif %}" method="POST">
{% csrf_token %} {% csrf_token %}
<input id="exists-url" type="hidden" value="{% url "mia_core:api.users.exists" "ID" %}" /> <input id="exists-url" type="hidden" value="{% url "mia_core:api.users.exists" "ID" %}" />
<input id="user-login-id-original" type="hidden" value="{{ form.user.login_id }}" /> <input id="user-login-id-original" type="hidden" value="{{ form.user.login_id }}" />
<div class="row form-group"> <div class="row form-group">
<label class="col-sm-2 col-form-label" for="user-login-id">{{ _("Log in ID:")|force_escape }}</label> <label class="col-sm-2 col-form-label" for="user-login-id">{{ _("Log in ID:")|force_escape }}</label>
<div class="col-sm-10"> <div class="col-sm-10">
<input id="user-login-id" class="form-control {% if form.login_id.errors %} is-invalid {% endif %}" type="text" name="login-id" value="{{ form.login_id.value|default:"" }}" maxlength="32" required="required" /> <input id="user-login-id" class="form-control {% if form.login_id.errors %} is-invalid {% endif %}" type="text" name="login_id" value="{{ form.login_id.value|default:"" }}" maxlength="32" required="required" />
<div id="user-login-id-error" class="invalid-feedback">{{ form.login_id.errors.0 }}</div> <div id="user-login-id-error" class="invalid-feedback">{{ form.login_id.errors.0 }}</div>
</div> </div>
</div> </div>