2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-29 20:16:44 +00:00

Merge pull request #2266 from SchrodingersGat/login-tweaks

Login tweaks
This commit is contained in:
Oliver 2021-11-08 10:19:23 +11:00 committed by GitHub
commit a12baadc09
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 47 additions and 24 deletions

View File

@ -34,8 +34,7 @@
} }
.login-header { .login-header {
padding-right: 30px; margin-right: 5px;
margin-right: 30px;
} }
.login-container input { .login-container input {

View File

@ -22,12 +22,12 @@
<a href="https://github.com/inventree/InvenTree/releases">{% inventree_version %}</a>{% include "clip.html" %} <a href="https://github.com/inventree/InvenTree/releases">{% inventree_version %}</a>{% include "clip.html" %}
{% inventree_is_development as dev %} {% inventree_is_development as dev %}
{% if dev %} {% if dev %}
<span class='badge rounded-pill bg-primary'>{% trans "Development Version" %}</span> <span class='badge badge-right rounded-pill bg-primary'>{% trans "Development Version" %}</span>
{% else %} {% else %}
{% if up_to_date %} {% if up_to_date %}
<span class='badge rounded-pill bg-success'>{% trans "Up to Date" %}</span> <span class='badge badge-right rounded-pill bg-success'>{% trans "Up to Date" %}</span>
{% else %} {% else %}
<span class='badge rounded-pill bg-info'>{% trans "Update Available" %}</span> <span class='badge badge-right rounded-pill bg-info'>{% trans "Update Available" %}</span>
{% endif %} {% endif %}
{% endif %} {% endif %}
</td> </td>

View File

@ -71,9 +71,12 @@
{% include "spacer.html" %} {% include "spacer.html" %}
<span class='float-right'><h3>{% inventree_title %}</h3></span> <span class='float-right'><h3>{% inventree_title %}</h3></span>
</div> </div>
<hr>
<div class='container-fluid'>{% block content %}{% endblock %}</div>
</div> </div>
<div class='container-fluid'>
<hr>
{% block content %}
{% endblock %}
</div>
</div> </div>
</div> </div>

View File

@ -32,6 +32,7 @@ for a account and sign in below:{% endblocktrans %}</p>
<input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}" /> <input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}" />
{% endif %} {% endif %}
<hr>
<div class="btn-group float-right" role="group"> <div class="btn-group float-right" role="group">
<button class="btn btn-success" type="submit">{% trans "Sign In" %}</button> <button class="btn btn-success" type="submit">{% trans "Sign In" %}</button>
</div> </div>

View File

@ -14,6 +14,7 @@
{% if redirect_field_value %} {% if redirect_field_value %}
<input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}"/> <input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}"/>
{% endif %} {% endif %}
<hr>
<div class='btn-group float-right' role='group'> <div class='btn-group float-right' role='group'>
<a type='button' class='btn btn-secondary' href='{% url "index" %}'><span class='fas fa-undo-alt'></span> {% trans "Back to Site" %}</a> <a type='button' class='btn btn-secondary' href='{% url "index" %}'><span class='fas fa-undo-alt'></span> {% trans "Back to Site" %}</a>
<button type="submit" class="btn btn-danger btn-block">{% trans 'Sign Out' %}</button> <button type="submit" class="btn btn-danger btn-block">{% trans 'Sign Out' %}</button>

View File

@ -190,6 +190,18 @@ $(document).ready(function () {
{% endif %} {% endif %}
moment.locale('{{ request.LANGUAGE_CODE }}'); moment.locale('{{ request.LANGUAGE_CODE }}');
// Account notifications
{% if messages %}
{% for message in messages %}
showMessage(
'{{ message }}',
{
style: 'info',
}
);
{% endfor %}
{% endif %}
}); });
</script> </script>

View File

@ -19,7 +19,6 @@
renderStockLocation, renderStockLocation,
renderSupplierPart, renderSupplierPart,
renderUser, renderUser,
showAlertDialog,
showAlertOrCache, showAlertOrCache,
showApiError, showApiError,
*/ */
@ -347,10 +346,12 @@ function constructForm(url, options) {
constructCreateForm(OPTIONS.actions.POST, options); constructCreateForm(OPTIONS.actions.POST, options);
} else { } else {
// User does not have permission to POST to the endpoint // User does not have permission to POST to the endpoint
showAlertDialog( showMessage('{% trans "Action Prohibited" %}', {
'{% trans "Action Prohibited" %}', style: 'danger',
'{% trans "Create operation not allowed" %}' details: '{% trans "Create operation not allowed" %}',
); icon: 'fas fa-user-times',
});
console.log(`'POST action unavailable at ${url}`); console.log(`'POST action unavailable at ${url}`);
} }
break; break;
@ -360,10 +361,12 @@ function constructForm(url, options) {
constructChangeForm(OPTIONS.actions.PUT, options); constructChangeForm(OPTIONS.actions.PUT, options);
} else { } else {
// User does not have permission to PUT/PATCH to the endpoint // User does not have permission to PUT/PATCH to the endpoint
showAlertDialog( showMessage('{% trans "Action Prohibited" %}', {
'{% trans "Action Prohibited" %}', style: 'danger',
'{% trans "Update operation not allowed" %}' details: '{% trans "Update operation not allowed" %}',
); icon: 'fas fa-user-times',
});
console.log(`${options.method} action unavailable at ${url}`); console.log(`${options.method} action unavailable at ${url}`);
} }
break; break;
@ -372,10 +375,12 @@ function constructForm(url, options) {
constructDeleteForm(OPTIONS.actions.DELETE, options); constructDeleteForm(OPTIONS.actions.DELETE, options);
} else { } else {
// User does not have permission to DELETE to the endpoint // User does not have permission to DELETE to the endpoint
showAlertDialog( showMessage('{% trans "Action Prohibited" %}', {
'{% trans "Action Prohibited" %}', style: 'danger',
'{% trans "Delete operation not allowed" %}' details: '{% trans "Delete operation not allowed" %}',
); icon: 'fas fa-user-times',
});
console.log(`DELETE action unavailable at ${url}`); console.log(`DELETE action unavailable at ${url}`);
} }
break; break;
@ -384,10 +389,12 @@ function constructForm(url, options) {
// TODO? // TODO?
} else { } else {
// User does not have permission to GET to the endpoint // User does not have permission to GET to the endpoint
showAlertDialog( showMessage('{% trans "Action Prohibited" %}', {
'{% trans "Action Prohibited" %}', style: 'danger',
'{% trans "View operation not allowed" %}' details: '{% trans "View operation not allowed" %}',
); icon: 'fas fa-user-times',
});
console.log(`GET action unavailable at ${url}`); console.log(`GET action unavailable at ${url}`);
} }
break; break;