mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-19 21:45:39 +00:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
31
InvenTree/templates/InvenTree/settings/login.html
Normal file
31
InvenTree/templates/InvenTree/settings/login.html
Normal file
@ -0,0 +1,31 @@
|
||||
{% extends "panel.html" %}
|
||||
{% load i18n %}
|
||||
{% load inventree_extras %}
|
||||
|
||||
{% block label %}login{% endblock %}
|
||||
|
||||
|
||||
{% block heading %}
|
||||
{% trans "Login Settings" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<table class='table table-striped table-condensed'>
|
||||
{% include "InvenTree/settings/header.html" %}
|
||||
<tbody>
|
||||
{% include "InvenTree/settings/setting.html" with key="LOGIN_ENABLE_REG" icon="fa-info-circle" %}
|
||||
{% include "InvenTree/settings/setting.html" with key="LOGIN_ENABLE_SSO" icon="fa-info-circle" %}
|
||||
{% include "InvenTree/settings/setting.html" with key="LOGIN_ENABLE_PWD_FORGOT" icon="fa-info-circle" %}
|
||||
{% include "InvenTree/settings/setting.html" with key="LOGIN_MAIL_REQUIRED" icon="fa-info-circle" %}
|
||||
<tr>
|
||||
<td>{% trans 'Signup' %}</td>
|
||||
<td colspan='4'></td>
|
||||
</tr>
|
||||
{% include "InvenTree/settings/setting.html" with key="LOGIN_SIGNUP_MAIL_TWICE" icon="fa-info-circle" %}
|
||||
{% include "InvenTree/settings/setting.html" with key="LOGIN_SIGNUP_PWD_TWICE" icon="fa-info-circle" %}
|
||||
{% include "InvenTree/settings/setting.html" with key="LOGIN_SIGNUP_SSO_AUTO" icon="fa-info-circle" %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{% endblock %}
|
@ -68,6 +68,12 @@
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class='list-group-item' title='{% trans "Login" %}'>
|
||||
<a href='#' class='nav-toggle' id='select-login'>
|
||||
<span class='fas fa-fingerprint'></span> {% trans "Login" %}
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class='list-group-item' title='{% trans "Barcodes" %}'>
|
||||
<a href='#' class='nav-toggle' id='select-barcodes'>
|
||||
<span class='fas fa-qrcode'></span> {% trans "Barcodes" %}
|
||||
|
@ -25,6 +25,7 @@
|
||||
{% if user.is_staff %}
|
||||
|
||||
{% include "InvenTree/settings/global.html" %}
|
||||
{% include "InvenTree/settings/login.html" %}
|
||||
{% include "InvenTree/settings/barcode.html" %}
|
||||
{% include "InvenTree/settings/currencies.html" %}
|
||||
{% include "InvenTree/settings/report.html" %}
|
||||
|
@ -2,6 +2,8 @@
|
||||
|
||||
{% load i18n %}
|
||||
{% load inventree_extras %}
|
||||
{% load socialaccount %}
|
||||
{% load crispy_forms_tags %}
|
||||
|
||||
{% block label %}account{% endblock %}
|
||||
|
||||
@ -10,6 +12,8 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% mail_configured as mail_conf %}
|
||||
|
||||
<div class='btn-group' style='float: right;'>
|
||||
<div class='btn btn-primary' type='button' id='edit-user' title='{% trans "Edit User Information" %}'>
|
||||
<span class='fas fa-user-cog'></span> {% trans "Edit" %}
|
||||
@ -32,12 +36,119 @@
|
||||
<td>{% trans "Last Name" %}</td>
|
||||
<td>{{ user.last_name }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{% trans "Email Address" %}</td>
|
||||
<td>{{ user.email }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div class='panel-heading'>
|
||||
<h4>{% trans "E-Mail" %}</h4>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
{% if user.emailaddress_set.all %}
|
||||
<p>{% trans 'The following e-mail addresses are associated with your account:' %}</p>
|
||||
|
||||
<form action="{% url 'account_email' %}" class="email_list" method="post">
|
||||
{% csrf_token %}
|
||||
<fieldset class="blockLabels">
|
||||
|
||||
{% for emailaddress in user.emailaddress_set.all %}
|
||||
<div class="ctrlHolder">
|
||||
<label for="email_radio_{{forloop.counter}}" class="{% if emailaddress.primary %}primary_email{%endif%}">
|
||||
|
||||
<input id="email_radio_{{forloop.counter}}" type="radio" name="email" {% if emailaddress.primary or user.emailaddress_set.count == 1 %}checked="checked"{%endif %} value="{{emailaddress.email}}"/>
|
||||
|
||||
{{ emailaddress.email }}
|
||||
{% if emailaddress.verified %}
|
||||
<span class="verified">{% trans "Verified" %}</span>
|
||||
{% else %}
|
||||
<span class="unverified">{% trans "Unverified" %}</span>
|
||||
{% endif %}
|
||||
{% if emailaddress.primary %}<span class="primary">{% trans "Primary" %}</span>{% endif %}
|
||||
</label>
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
<div class="buttonHolder">
|
||||
<button class="btn btn-primary secondaryAction" type="submit" name="action_primary" >{% trans 'Make Primary' %}</button>
|
||||
<button class="btn btn-primary secondaryAction" type="submit" name="action_send" {% if not mail_conf %}disabled{% endif %}>{% trans 'Re-send Verification' %}</button>
|
||||
<button class="btn btn-primary primaryAction" type="submit" name="action_remove" >{% trans 'Remove' %}</button>
|
||||
</div>
|
||||
|
||||
</fieldset>
|
||||
</form>
|
||||
|
||||
{% else %}
|
||||
<p><strong>{% trans 'Warning:'%}</strong>
|
||||
{% trans "You currently do not have any e-mail address set up. You should really add an e-mail address so you can receive notifications, reset your password, etc." %}
|
||||
</p>
|
||||
|
||||
{% endif %}
|
||||
|
||||
{% if can_add_email %}
|
||||
<br>
|
||||
<h4>{% trans "Add E-mail Address" %}</h4>
|
||||
|
||||
<form method="post" action="{% url 'account_email' %}" class="add_email">
|
||||
{% csrf_token %}
|
||||
{{ add_email_form|crispy }}
|
||||
<button class="btn btn-primary" name="action_add" type="submit">{% trans "Add E-mail" %}</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
<br>
|
||||
</div>
|
||||
|
||||
<div class='panel-heading'>
|
||||
<h4>{% trans "Social Accounts" %}</h4>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
{% if social_form.accounts %}
|
||||
<p>{% blocktrans %}You can sign in to your account using any of the following third party accounts:{% endblocktrans %}</p>
|
||||
|
||||
|
||||
<form method="post" action="{% url 'socialaccount_connections' %}">
|
||||
{% csrf_token %}
|
||||
|
||||
<fieldset>
|
||||
{% if social_form.non_field_errors %}
|
||||
<div id="errorMsg">{{ social_form.non_field_errors }}</div>
|
||||
{% endif %}
|
||||
|
||||
{% for base_account in social_form.accounts %}
|
||||
{% with base_account.get_provider_account as account %}
|
||||
<div>
|
||||
<label for="id_account_{{ base_account.id }}">
|
||||
<input id="id_account_{{ base_account.id }}" type="radio" name="account" value="{{ base_account.id }}"/>
|
||||
<span class="socialaccount_provider {{ base_account.provider }} {{ account.get_brand.id }}">
|
||||
<span class='brand-icon' brand_name='{{account.get_brand.id}}'></span>{{account.get_brand.name}}</span>
|
||||
{{ account }}
|
||||
</label>
|
||||
</div>
|
||||
{% endwith %}
|
||||
{% endfor %}
|
||||
|
||||
<div>
|
||||
<button class="btn btn-primary" type="submit">{% trans 'Remove' %}</button>
|
||||
</div>
|
||||
|
||||
</fieldset>
|
||||
|
||||
</form>
|
||||
|
||||
{% else %}
|
||||
<p>{% trans 'You currently have no social network accounts connected to this account.' %}</p>
|
||||
{% endif %}
|
||||
|
||||
<br>
|
||||
<h4>{% trans 'Add a 3rd Party Account' %}</h4>
|
||||
<div>
|
||||
{% include "socialaccount/snippets/provider_list.html" with process="connect" %}
|
||||
</div>
|
||||
{% include "socialaccount/snippets/login_extra.html" %}
|
||||
<br>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class='panel-heading'>
|
||||
<h4>{% trans "Theme Settings" %}</h4>
|
||||
</div>
|
||||
@ -105,4 +216,18 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block js_ready %}
|
||||
(function() {
|
||||
var message = "{% trans 'Do you really want to remove the selected e-mail address?' %}";
|
||||
var actions = document.getElementsByName('action_remove');
|
||||
if (actions.length) {
|
||||
actions[0].addEventListener("click", function(e) {
|
||||
if (! confirm(message)) {
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
}
|
||||
})();
|
||||
{% endblock %}
|
@ -14,6 +14,7 @@
|
||||
<div class='row'>
|
||||
<table class='table table-striped table-condensed'>
|
||||
<tbody>
|
||||
{% include "InvenTree/settings/setting.html" with key="FORMS_CLOSE_USING_ESCAPE" icon="fa-window-close" user_setting=True %}
|
||||
{% include "InvenTree/settings/setting.html" with key="PART_SHOW_QUANTITY_IN_FORMS" icon="fa-hashtag" user_setting=True %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
@ -83,7 +83,7 @@
|
||||
<tr>
|
||||
<td><span class='fas fa-mobile-alt'></span></td>
|
||||
<td>{% trans "Mobile App" %}</td>
|
||||
<td><a href="https://inventree.readthedocs.io/en/latest/app/app">https://inventree.readthedocs.io/en/latest/app/app</a></td>
|
||||
<td><a href="{% inventree_docs_url %}/app/app">{% inventree_docs_url %}/app/app</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class='fas fa-bug'></span></td>
|
||||
|
@ -1,6 +1,5 @@
|
||||
{% load static %}
|
||||
{% load i18n %}
|
||||
{% load crispy_forms_tags %}
|
||||
{% load inventree_extras %}
|
||||
|
||||
<!DOCTYPE html>
|
||||
@ -12,57 +11,79 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<!-- CSS -->
|
||||
<link rel="stylesheet" href="{% static 'fontawesome/css/brands.css' %}">
|
||||
<link rel="stylesheet" href="{% static 'fontawesome/css/solid.css' %}">
|
||||
<link rel="stylesheet" href="{% static 'css/bootstrap_3.3.7_css_bootstrap.min.css' %}">
|
||||
<link rel="stylesheet" href="{% static 'select2/css/select2.css' %}">
|
||||
<link rel="stylesheet" href="{% static 'css/inventree.css' %}">
|
||||
<link rel="stylesheet" href="{% static 'fontawesome/css/brands.css' %}">
|
||||
<link rel="stylesheet" href="{% static 'fontawesome/css/solid.css' %}">
|
||||
|
||||
<script type='text/javascript' src="{% static 'fontawesome/js/solid.js' %}"></script>
|
||||
<script type='text/javascript' src="{% static 'fontawesome/js/brands.js' %}"></script>
|
||||
<script type='text/javascript' src="{% static 'fontawesome/js/fontawesome.js' %}"></script>
|
||||
<link rel="stylesheet" href="{% get_color_theme_css user.get_username %}">
|
||||
|
||||
<style>
|
||||
.login-error {
|
||||
color: #F88;
|
||||
}
|
||||
</style>
|
||||
|
||||
<title>
|
||||
{% inventree_title %}
|
||||
{% inventree_title %} | {% block head_title %}{% endblock %}
|
||||
</title>
|
||||
|
||||
{% block extra_head %}
|
||||
{% endblock %}
|
||||
</head>
|
||||
|
||||
<body class='login-screen'>
|
||||
<!--
|
||||
Background Image Attribution: https://unsplash.com/photos/Ixvv3YZkd7w
|
||||
-->
|
||||
|
||||
<div class='main body-wrapper login-screen'>
|
||||
|
||||
<div class='login-container'>
|
||||
<div class="row">
|
||||
<div class='container-fluid'>
|
||||
|
||||
<div class='clearfix content-heading login-header'>
|
||||
<img class="pull-left" src="{% static 'img/inventree.png' %}" width="60" height="60"/>
|
||||
<span><h3>{% inventree_title %} </h3></span>
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
<div class='container-fluid'>
|
||||
|
||||
<p>{% trans "Forgotten your password?" %}</p>
|
||||
<p>{% trans "Enter your email address below." %}</p>
|
||||
<p>{% trans "An email will be sent with password reset instructions." %}</p>
|
||||
|
||||
<form method="POST">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<button class="btn btn-primary" type="submit">{% trans "Send email" %}</button>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
<span><h3>{% inventree_title %}</h3></span>
|
||||
</div>
|
||||
<hr>
|
||||
<div class='container-fluid'>{% block content %}{% endblock %}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{% block extra_body %}
|
||||
{% endblock %}
|
||||
|
||||
</body>
|
||||
{% include 'notification.html' %}
|
||||
</div>
|
||||
|
||||
<!-- Scripts -->
|
||||
<script type="text/javascript" src="{% static 'script/jquery_3.3.1_jquery.min.js' %}"></script>
|
||||
<!-- general InvenTree -->
|
||||
<script type='text/javascript' src="{% static 'script/inventree/notification.js' %}"></script>
|
||||
|
||||
<!-- dynamic javascript templates -->
|
||||
<script type='text/javascript' src="{% url 'inventree.js' %}"></script>
|
||||
|
||||
<script type='text/javascript' src="{% static 'fontawesome/js/solid.js' %}"></script>
|
||||
<script type='text/javascript' src="{% static 'fontawesome/js/brands.js' %}"></script>
|
||||
<script type='text/javascript' src="{% static 'fontawesome/js/fontawesome.js' %}"></script>
|
||||
|
||||
|
||||
<script type='text/javascript'>
|
||||
|
||||
$(document).ready(function () {
|
||||
// notifications
|
||||
{% if messages %}
|
||||
{% for message in messages %}
|
||||
showAlertOrCache('alert-info', '{{message}}', true);
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
showCachedAlerts();
|
||||
|
||||
inventreeDocReady();
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
31
InvenTree/templates/account/email_confirm.html
Normal file
31
InvenTree/templates/account/email_confirm.html
Normal file
@ -0,0 +1,31 @@
|
||||
{% extends "account/base.html" %}
|
||||
|
||||
{% load i18n %}
|
||||
{% load account %}
|
||||
|
||||
{% block head_title %}{% trans "Confirm E-mail Address" %}{% endblock %}
|
||||
|
||||
|
||||
{% block content %}
|
||||
<h1>{% trans "Confirm E-mail Address" %}</h1>
|
||||
|
||||
{% if confirmation %}
|
||||
|
||||
{% user_display confirmation.email_address.user as user_display %}
|
||||
|
||||
<p>{% blocktrans with confirmation.email_address.email as email %}Please confirm that <a href="mailto:{{ email }}">{{ email }}</a> is an e-mail address for user {{ user_display }}.{% endblocktrans %}</p>
|
||||
|
||||
<form method="post" action="{% url 'account_confirm_email' confirmation.key %}">
|
||||
{% csrf_token %}
|
||||
<button type="submit" class="btn btn-primary btn-block">{% trans 'Confirm' %}</button>
|
||||
</form>
|
||||
|
||||
{% else %}
|
||||
|
||||
{% url 'account_email' as email_url %}
|
||||
|
||||
<p>{% blocktrans %}This e-mail confirmation link expired or is invalid. Please <a href="{{ email_url }}">issue a new e-mail confirmation request</a>.{% endblocktrans %}</p>
|
||||
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
52
InvenTree/templates/account/login.html
Normal file
52
InvenTree/templates/account/login.html
Normal file
@ -0,0 +1,52 @@
|
||||
{% extends "account/base.html" %}
|
||||
|
||||
{% load i18n account socialaccount crispy_forms_tags inventree_extras %}
|
||||
|
||||
{% block head_title %}{% trans "Sign In" %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
{% settings_value 'LOGIN_ENABLE_REG' as enable_reg %}
|
||||
{% settings_value 'LOGIN_ENABLE_PWD_FORGOT' as enable_pwd_forgot %}
|
||||
{% settings_value 'LOGIN_ENABLE_SSO' as enable_sso %}
|
||||
{% mail_configured as mail_conf %}
|
||||
|
||||
<h1>{% trans "Sign In" %}</h1>
|
||||
|
||||
{% if enable_reg %}
|
||||
{% get_providers as socialaccount_providers %}
|
||||
{% if socialaccount_providers %}
|
||||
<p>{% blocktrans with site.name as site_name %}Please sign in with one
|
||||
of your existing third party accounts or <a class="btn btn-primary btn-small" href="{{ signup_url }}">sign up</a>
|
||||
for a account and sign in below:{% endblocktrans %}</p>
|
||||
{% else %}
|
||||
<p>{% blocktrans %}If you have not created an account yet, then please
|
||||
<a href="{{ signup_url }}">sign up</a> first.{% endblocktrans %}</p>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
<form class="login" method="POST" action="{% url 'account_login' %}">
|
||||
{% csrf_token %}
|
||||
{{ form|crispy }}
|
||||
{% if redirect_field_value %}
|
||||
<input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}" />
|
||||
{% endif %}
|
||||
|
||||
<div class="btn-toolbar">
|
||||
<button class="btn btn-primary col-md-8" type="submit">{% trans "Sign In" %}</button>
|
||||
{% if mail_conf and enable_pwd_forgot %}
|
||||
<a class="btn btn-primary" href="{% url 'account_reset_password' %}">{% trans "Forgot Password?" %}</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</form>
|
||||
|
||||
{% if enable_sso %}
|
||||
<br>
|
||||
<h4 class="text-center">{% trans 'or use SSO' %}</h4>
|
||||
<div>
|
||||
{% include "socialaccount/snippets/provider_list.html" with process="login" %}
|
||||
</div>
|
||||
{% include "socialaccount/snippets/login_extra.html" %}
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
21
InvenTree/templates/account/logout.html
Normal file
21
InvenTree/templates/account/logout.html
Normal file
@ -0,0 +1,21 @@
|
||||
{% extends "account/base.html" %}
|
||||
|
||||
{% load i18n %}
|
||||
|
||||
{% block head_title %}{% trans "Sign Out" %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1>{% trans "Sign Out" %}</h1>
|
||||
|
||||
<p>{% trans 'Are you sure you want to sign out?' %}</p>
|
||||
|
||||
<form method="post" action="{% url 'account_logout' %}">
|
||||
{% csrf_token %}
|
||||
{% if redirect_field_value %}
|
||||
<input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}"/>
|
||||
{% endif %}
|
||||
<button type="submit" class="btn btn-primary btn-block">{% trans 'Sign Out' %}</button>
|
||||
</form>
|
||||
|
||||
|
||||
{% endblock %}
|
30
InvenTree/templates/account/password_reset.html
Normal file
30
InvenTree/templates/account/password_reset.html
Normal file
@ -0,0 +1,30 @@
|
||||
{% extends "account/base.html" %}
|
||||
|
||||
{% load i18n account crispy_forms_tags inventree_extras %}
|
||||
|
||||
{% block head_title %}{% trans "Password Reset" %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
{% settings_value 'LOGIN_ENABLE_PWD_FORGOT' as enable_pwd_forgot %}
|
||||
{% mail_configured as mail_conf %}
|
||||
|
||||
<h1>{% trans "Password Reset" %}</h1>
|
||||
{% if user.is_authenticated %}
|
||||
{% include "account/snippets/already_logged_in.html" %}
|
||||
{% endif %}
|
||||
|
||||
{% if mail_conf and enable_pwd_forgot %}
|
||||
<p>{% trans "Forgotten your password? Enter your e-mail address below, and we'll send you an e-mail allowing you to reset it." %}</p>
|
||||
|
||||
<form method="POST" action="{% url 'account_reset_password' %}" class="password_reset">
|
||||
{% csrf_token %}
|
||||
{{ form|crispy }}
|
||||
<input type="submit" class="btn btn-primary btn-block" value="{% trans 'Reset My Password' %}" />
|
||||
</form>
|
||||
{% else %}
|
||||
<div class='alert alert-block alert-danger'>
|
||||
<p>{% trans "This function is currently disabled. Please contact an administrator." %}</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
23
InvenTree/templates/account/password_reset_from_key.html
Normal file
23
InvenTree/templates/account/password_reset_from_key.html
Normal file
@ -0,0 +1,23 @@
|
||||
{% extends "account/base.html" %}
|
||||
|
||||
{% load i18n crispy_forms_tags %}
|
||||
{% block head_title %}{% trans "Change Password" %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1>{% if token_fail %}{% trans "Bad Token" %}{% else %}{% trans "Change Password" %}{% endif %}</h1>
|
||||
|
||||
{% if token_fail %}
|
||||
{% url 'account_reset_password' as passwd_reset_url %}
|
||||
<p>{% blocktrans %}The password reset link was invalid, possibly because it has already been used. Please request a <a href="{{ passwd_reset_url }}">new password reset</a>.{% endblocktrans %}</p>
|
||||
{% else %}
|
||||
{% if form %}
|
||||
<form method="POST" action="{{ action_url }}">
|
||||
{% csrf_token %}
|
||||
{{ form|crispy }}
|
||||
<input type="submit" name="action" class="btn btn-primary btn-block" value="{% trans 'change password' %}"/>
|
||||
</form>
|
||||
{% else %}
|
||||
<p>{% trans 'Your password is now changed.' %}</p>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
40
InvenTree/templates/account/signup.html
Normal file
40
InvenTree/templates/account/signup.html
Normal file
@ -0,0 +1,40 @@
|
||||
{% extends "account/base.html" %}
|
||||
|
||||
{% load i18n crispy_forms_tags inventree_extras %}
|
||||
|
||||
{% block head_title %}{% trans "Signup" %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% settings_value 'LOGIN_ENABLE_REG' as enable_reg %}
|
||||
{% settings_value 'LOGIN_ENABLE_SSO' as enable_sso %}
|
||||
|
||||
<h1>{% trans "Sign Up" %}</h1>
|
||||
|
||||
<p>{% blocktrans %}Already have an account? Then please <a href="{{ login_url }}">sign in</a>.{% endblocktrans %}</p>
|
||||
|
||||
{% if enable_reg %}
|
||||
<form class="signup" id="signup_form" method="post" action="{% url 'account_signup' %}">
|
||||
{% csrf_token %}
|
||||
{{ form|crispy }}
|
||||
{% if redirect_field_value %}
|
||||
<input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}" />
|
||||
{% endif %}
|
||||
<button type="submit" class="btn btn-primary btn-block">{% trans "Sign Up" %}</button>
|
||||
</form>
|
||||
|
||||
{% if enable_sso %}
|
||||
<br>
|
||||
<h4>{% trans 'Or use a SSO-provider for signup' %}</h4>
|
||||
<div>
|
||||
{% include "socialaccount/snippets/provider_list.html" with process="login" %}
|
||||
</div>
|
||||
{% include "socialaccount/snippets/login_extra.html" %}
|
||||
{% endif %}
|
||||
|
||||
{% else %}
|
||||
<div class='alert alert-block alert-danger'>
|
||||
<p>{% trans "This function is currently disabled. Please contact an administrator." %}</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
@ -177,6 +177,11 @@ function inventreeDocReady() {
|
||||
'ui-autocomplete': 'dropdown-menu search-menu',
|
||||
},
|
||||
});
|
||||
|
||||
// Generate brand-icons
|
||||
$('.brand-icon').each(function(i, obj) {
|
||||
loadBrandIcon($(this), $(this).attr('brand_name'));
|
||||
});
|
||||
}
|
||||
|
||||
function isFileTransfer(transfer) {
|
||||
@ -275,3 +280,13 @@ function inventreeLoad(name, defaultValue) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
function loadBrandIcon(element, name) {
|
||||
// check if icon exists
|
||||
var icon = window.FontAwesome.icon({prefix: 'fab', iconName: name});
|
||||
|
||||
if (icon) {
|
||||
// add icon to button
|
||||
element.addClass('fab fa-' + name);
|
||||
}
|
||||
}
|
||||
|
@ -35,6 +35,18 @@ function bomItemFields() {
|
||||
hidden: true,
|
||||
},
|
||||
sub_part: {
|
||||
secondary: {
|
||||
title: '{% trans "New Part" %}',
|
||||
fields: function() {
|
||||
var fields = partFields();
|
||||
|
||||
// Set to a "component" part
|
||||
fields.component.value = true;
|
||||
|
||||
return fields;
|
||||
},
|
||||
groups: partGroups(),
|
||||
}
|
||||
},
|
||||
quantity: {},
|
||||
reference: {},
|
||||
@ -576,6 +588,7 @@ function loadBomTable(table, options) {
|
||||
constructForm(`/api/bom/${pk}/`, {
|
||||
fields: fields,
|
||||
title: '{% trans "Edit BOM Item" %}',
|
||||
focus: 'sub_part',
|
||||
onSuccess: function() {
|
||||
reloadBomTable(table);
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ function createNewModal(options={}) {
|
||||
});
|
||||
|
||||
var html = `
|
||||
<div class='modal fade modal-fixed-footer modal-primary inventree-modal' role='dialog' id='modal-form-${id}'>
|
||||
<div class='modal fade modal-fixed-footer modal-primary inventree-modal' role='dialog' id='modal-form-${id}' tabindex='-1'>
|
||||
<div class='modal-dialog'>
|
||||
<div class='modal-content'>
|
||||
<div class="modal-header">
|
||||
@ -111,7 +111,7 @@ function createNewModal(options={}) {
|
||||
|
||||
$(modal_name).modal({
|
||||
backdrop: 'static',
|
||||
keyboard: false,
|
||||
keyboard: user_settings.FORMS_CLOSE_USING_ESCAPE,
|
||||
});
|
||||
|
||||
// Set labels based on supplied options
|
||||
@ -681,7 +681,7 @@ function openModal(options) {
|
||||
|
||||
$(modal).modal({
|
||||
backdrop: 'static',
|
||||
keyboard: false,
|
||||
keyboard: user_settings.FORMS_CLOSE_USING_ESCAPE,
|
||||
});
|
||||
|
||||
// Disable the form
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
</div>
|
||||
|
||||
<div class='modal fade modal-fixed-footer modal-primary' role='dialog' id='modal-form'>
|
||||
<div class='modal fade modal-fixed-footer modal-primary' role='dialog' id='modal-form' tabindex='-1'>
|
||||
<div class='modal-dialog'>
|
||||
<div class='modal-content'>
|
||||
<div class="modal-header">
|
||||
|
@ -82,9 +82,9 @@
|
||||
{% if user.is_staff %}
|
||||
<li><a href="/admin/"><span class="fas fa-user"></span> {% trans "Admin" %}</a></li>
|
||||
{% endif %}
|
||||
<li><a href="{% url 'logout' %}"><span class="fas fa-sign-out-alt"></span> {% trans "Logout" %}</a></li>
|
||||
<li><a href="{% url 'account_logout' %}"><span class="fas fa-sign-out-alt"></span> {% trans "Logout" %}</a></li>
|
||||
{% else %}
|
||||
<li><a href="{% url 'login' %}"><span class="fas fa-sign-in-alt"></span> {% trans "Login" %}</a></li>
|
||||
<li><a href="{% url 'account_login' %}"><span class="fas fa-sign-in-alt"></span> {% trans "Login" %}</a></li>
|
||||
{% endif %}
|
||||
<hr>
|
||||
<li><a href="{% url 'settings' %}"><span class="fas fa-cog"></span> {% trans "Settings" %}</a></li>
|
||||
|
@ -1,59 +1,10 @@
|
||||
{% load static %}
|
||||
{% extends "registration/logged_out.html" %}
|
||||
{% load i18n %}
|
||||
{% load crispy_forms_tags %}
|
||||
{% load inventree_extras %}
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
{% block content %}
|
||||
|
||||
<!-- Required meta tags -->
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<p>{% translate "You were logged out successfully." %}</p>
|
||||
|
||||
<!-- CSS -->
|
||||
<link rel="stylesheet" href="{% static 'css/bootstrap_3.3.7_css_bootstrap.min.css' %}">
|
||||
<link rel="stylesheet" href="{% static 'select2/css/select2.css' %}">
|
||||
<link rel="stylesheet" href="{% static 'css/inventree.css' %}">
|
||||
<link rel="stylesheet" href="{% static 'fontawesome/css/brands.css' %}">
|
||||
<link rel="stylesheet" href="{% static 'fontawesome/css/solid.css' %}">
|
||||
<p><a href="{% url 'admin:index' %}">{% translate 'Log in again' %}</a></p>
|
||||
|
||||
<script type='text/javascript' src="{% static 'fontawesome/js/solid.js' %}"></script>
|
||||
<script type='text/javascript' src="{% static 'fontawesome/js/brands.js' %}"></script>
|
||||
<script type='text/javascript' src="{% static 'fontawesome/js/fontawesome.js' %}"></script>
|
||||
|
||||
<style>
|
||||
.login-error {
|
||||
color: #F88;
|
||||
}
|
||||
</style>
|
||||
|
||||
<title>
|
||||
{% inventree_title %}
|
||||
</title>
|
||||
</head>
|
||||
|
||||
<body class='login-screen'>
|
||||
|
||||
<div class='main body-wrapper login-screen'>
|
||||
|
||||
<div class='login-container'>
|
||||
<div class="row">
|
||||
<div class='container-fluid'>
|
||||
<div class='clearfix content-heading login-header'>
|
||||
<img class="pull-left" src="{% static 'img/inventree.png' %}" width="60" height="60"/>
|
||||
<span><h3>{% inventree_title %} </h3></span>
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
<div class='container-fluid'>
|
||||
<p>{% trans "You have been logged out" %}</p>
|
||||
<p><a href='{% url "login" %}'>{% trans "Return to login screen" %}</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
{% endblock %}
|
||||
|
@ -1,105 +0,0 @@
|
||||
{% load static %}
|
||||
{% load i18n %}
|
||||
{% load inventree_extras %}
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
<!-- Required meta tags -->
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<!-- CSS -->
|
||||
<link rel="stylesheet" href="{% static 'css/bootstrap_3.3.7_css_bootstrap.min.css' %}">
|
||||
<link rel="stylesheet" href="{% static 'select2/css/select2.css' %}">
|
||||
<link rel="stylesheet" href="{% static 'css/inventree.css' %}">
|
||||
<link rel="stylesheet" href="{% static 'fontawesome/css/brands.css' %}">
|
||||
<link rel="stylesheet" href="{% static 'fontawesome/css/solid.css' %}">
|
||||
|
||||
<script type='text/javascript' src="{% static 'fontawesome/js/solid.js' %}"></script>
|
||||
<script type='text/javascript' src="{% static 'fontawesome/js/brands.js' %}"></script>
|
||||
<script type='text/javascript' src="{% static 'fontawesome/js/fontawesome.js' %}"></script>
|
||||
|
||||
<style>
|
||||
.login-error {
|
||||
color: #F88;
|
||||
}
|
||||
</style>
|
||||
|
||||
<title>
|
||||
{% inventree_title %}
|
||||
</title>
|
||||
</head>
|
||||
|
||||
<body class='login-screen'>
|
||||
<!--
|
||||
Background Image Attribution: https://unsplash.com/photos/Ixvv3YZkd7w
|
||||
-->
|
||||
|
||||
<div class='main body-wrapper login-screen'>
|
||||
|
||||
<div class='login-container'>
|
||||
<div class="row">
|
||||
<div class='container-fluid'>
|
||||
<div class='clearfix content-heading login-header'>
|
||||
<img class="pull-left" src="{% static 'img/inventree.png' %}" width="60" height="60"/>
|
||||
<span><h3>{% inventree_title %} </h3></span>
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
<div class='container-fluid'>
|
||||
<form method="post" action=''>
|
||||
{% csrf_token %}
|
||||
|
||||
{% load crispy_forms_tags %}
|
||||
|
||||
<div id="div_id_username" class="form-group">
|
||||
<label for="id_username" class="control-label requiredField">{% trans "Username" %}<span class="asteriskField">*</span></label>
|
||||
<div class="controls ">
|
||||
<div class='input-group'>
|
||||
<div class='input-group-addon'>
|
||||
<span class='fas fa-user'></span>
|
||||
</div>
|
||||
<input type="text" name="username" autofocus autocapitalize="none" autocomplete="username" maxlength="150" class="textinput textInput form-control" required id="id_username" placeholder='{% trans "Enter username" %}'>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="div_id_password" class="form-group">
|
||||
<label for="id_password" class="control-label requiredField">{% trans "Password" %}<span class="asteriskField">*</span></label>
|
||||
<div class='controls'>
|
||||
<div class="input-group">
|
||||
<div class='input-group-addon'>
|
||||
<span class='fas fa-key'></span>
|
||||
</div>
|
||||
<input type="password" name="password" autocomplete="current-password" class="textinput textInput form-control" required id="id_password" placeholder='{% trans "Enter password" %}'>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if form.errors %}
|
||||
<div class='login-error'>
|
||||
<strong>{% trans "Username / password combination is incorrect" %}</strong>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<hr>
|
||||
|
||||
<button class='pull-right btn btn-primary login-button' type="submit">{% trans "Login" %}</button>
|
||||
|
||||
</form>
|
||||
|
||||
{% if email_configured %}
|
||||
<hr><br>
|
||||
<p>{% trans "Forgotten your password?" %} - <a href='{% url "password_reset" %}'>{% trans "Click here to reset" %}</a></p>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -1,59 +0,0 @@
|
||||
{% load static %}
|
||||
{% load i18n %}
|
||||
{% load crispy_forms_tags %}
|
||||
{% load inventree_extras %}
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
<!-- Required meta tags -->
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<!-- CSS -->
|
||||
<link rel="stylesheet" href="{% static 'css/bootstrap_3.3.7_css_bootstrap.min.css' %}">
|
||||
<link rel="stylesheet" href="{% static 'select2/css/select2.css' %}">
|
||||
<link rel="stylesheet" href="{% static 'css/inventree.css' %}">
|
||||
<link rel="stylesheet" href="{% static 'fontawesome/css/brands.css' %}">
|
||||
<link rel="stylesheet" href="{% static 'fontawesome/css/solid.css' %}">
|
||||
|
||||
<script type='text/javascript' src="{% static 'fontawesome/js/solid.js' %}"></script>
|
||||
<script type='text/javascript' src="{% static 'fontawesome/js/brands.js' %}"></script>
|
||||
<script type='text/javascript' src="{% static 'fontawesome/js/fontawesome.js' %}"></script>
|
||||
|
||||
<style>
|
||||
.login-error {
|
||||
color: #F88;
|
||||
}
|
||||
</style>
|
||||
|
||||
<title>
|
||||
{% inventree_title %}
|
||||
</title>
|
||||
</head>
|
||||
|
||||
<body class='login-screen'>
|
||||
|
||||
<div class='main body-wrapper login-screen'>
|
||||
|
||||
<div class='login-container'>
|
||||
<div class="row">
|
||||
<div class='container-fluid'>
|
||||
<div class='clearfix content-heading login-header'>
|
||||
<img class="pull-left" src="{% static 'img/inventree.png' %}" width="60" height="60"/>
|
||||
<span><h3>{% inventree_title %} </h3></span>
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
<div class='container-fluid'>
|
||||
<p>{% trans "Password reset complete" %}</p>
|
||||
<p><a href='{% url "login" %}'>{% trans "Return to login screen" %}</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
@ -1,69 +0,0 @@
|
||||
{% load static %}
|
||||
{% load i18n %}
|
||||
{% load crispy_forms_tags %}
|
||||
{% load inventree_extras %}
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
<!-- Required meta tags -->
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<!-- CSS -->
|
||||
<link rel="stylesheet" href="{% static 'css/bootstrap_3.3.7_css_bootstrap.min.css' %}">
|
||||
<link rel="stylesheet" href="{% static 'select2/css/select2.css' %}">
|
||||
<link rel="stylesheet" href="{% static 'css/inventree.css' %}">
|
||||
<link rel="stylesheet" href="{% static 'fontawesome/css/brands.css' %}">
|
||||
<link rel="stylesheet" href="{% static 'fontawesome/css/solid.css' %}">
|
||||
|
||||
<script type='text/javascript' src="{% static 'fontawesome/js/solid.js' %}"></script>
|
||||
<script type='text/javascript' src="{% static 'fontawesome/js/brands.js' %}"></script>
|
||||
<script type='text/javascript' src="{% static 'fontawesome/js/fontawesome.js' %}"></script>
|
||||
|
||||
<style>
|
||||
.login-error {
|
||||
color: #F88;
|
||||
}
|
||||
</style>
|
||||
|
||||
<title>
|
||||
{% inventree_title %}
|
||||
</title>
|
||||
</head>
|
||||
|
||||
<body class='login-screen'>
|
||||
|
||||
<div class='main body-wrapper login-screen'>
|
||||
|
||||
<div class='login-container'>
|
||||
<div class="row">
|
||||
<div class='container-fluid'>
|
||||
<div class='clearfix content-heading login-header'>
|
||||
<img class="pull-left" src="{% static 'img/inventree.png' %}" width="60" height="60"/>
|
||||
<span><h3>{% inventree_title %} </h3></span>
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
<div class='container-fluid'>
|
||||
|
||||
{% if validlink %}
|
||||
<h3>{% trans "Change password" %}</h3>
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<button class="btn btn-primary" type="submit">{% trans "Change password" %}</button>
|
||||
</form>
|
||||
{% else %}
|
||||
<p>
|
||||
{% trans "The password reset link was invalid, possibly because it has already been used. Please request a new password reset." %}
|
||||
</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
@ -1,65 +0,0 @@
|
||||
{% load static %}
|
||||
{% load i18n %}
|
||||
{% load crispy_forms_tags %}
|
||||
{% load inventree_extras %}
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
<!-- Required meta tags -->
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<!-- CSS -->
|
||||
<link rel="stylesheet" href="{% static 'css/bootstrap_3.3.7_css_bootstrap.min.css' %}">
|
||||
<link rel="stylesheet" href="{% static 'select2/css/select2.css' %}">
|
||||
<link rel="stylesheet" href="{% static 'css/inventree.css' %}">
|
||||
<link rel="stylesheet" href="{% static 'fontawesome/css/brands.css' %}">
|
||||
<link rel="stylesheet" href="{% static 'fontawesome/css/solid.css' %}">
|
||||
|
||||
<script type='text/javascript' src="{% static 'fontawesome/js/solid.js' %}"></script>
|
||||
<script type='text/javascript' src="{% static 'fontawesome/js/brands.js' %}"></script>
|
||||
<script type='text/javascript' src="{% static 'fontawesome/js/fontawesome.js' %}"></script>
|
||||
|
||||
<style>
|
||||
.login-error {
|
||||
color: #F88;
|
||||
}
|
||||
</style>
|
||||
|
||||
<title>
|
||||
{% inventree_title %}
|
||||
</title>
|
||||
</head>
|
||||
|
||||
<body class='login-screen'>
|
||||
|
||||
<div class='main body-wrapper login-screen'>
|
||||
|
||||
<div class='login-container'>
|
||||
<div class="row">
|
||||
<div class='container-fluid'>
|
||||
<div class='clearfix content-heading login-header'>
|
||||
<img class="pull-left" src="{% static 'img/inventree.png' %}" width="60" height="60"/>
|
||||
<span><h3>{% inventree_title %} </h3></span>
|
||||
</div>
|
||||
<hr>
|
||||
<div class='container-fluid'>
|
||||
|
||||
<p>
|
||||
{% trans "We've emailed you instructions for setting your password, if an account exists with the email you entered. You should receive them shortly." %}
|
||||
</p>
|
||||
<p>
|
||||
{% trans "If you don't receive an email, please make sure you've entered the address you registered with, and check your spam folder." %}
|
||||
</p>
|
||||
|
||||
<hr>
|
||||
<a href='{% url "login" %}'>{% trans "Return to login screen" %}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
@ -0,0 +1,17 @@
|
||||
{% load socialaccount %}
|
||||
|
||||
{% get_providers as socialaccount_providers %}
|
||||
|
||||
{% for provider in socialaccount_providers %}
|
||||
{% if provider.id == "openid" %}
|
||||
{% for brand in provider.get_brands %}
|
||||
<a title="{{brand.name}}"
|
||||
class="btn btn-primary socialaccount_provider {{provider.id}} {{brand.id}}"
|
||||
href="{% provider_login_url provider.id openid=brand.openid_url process=process %}"
|
||||
><span class='brand-icon' brand_name='{{provider.id}}'></span> {{brand.name}}</a>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
<a title="{{provider.name}}" class="btn btn-primary socialaccount_provider {{provider.id}}"
|
||||
href="{% provider_login_url provider.id process=process scope=scope auth_params=auth_params %}"
|
||||
><span class='brand-icon' brand_name='{{provider.id}}'></span> {{provider.name}}</a>
|
||||
{% endfor %}
|
@ -51,7 +51,7 @@
|
||||
<td><span class='fas fa-tasks'></span></td>
|
||||
<td>{% trans "Background Worker" %}</td>
|
||||
<td>
|
||||
<a href='https://inventree.readthedocs.io/en/latest/admin/tasks'>
|
||||
<a href='{% inventree_docs_url %}/admin/tasks'>
|
||||
<span class='label label-red'>{% trans "Background worker not running" %}</span>
|
||||
</a>
|
||||
</td>
|
||||
@ -62,7 +62,7 @@
|
||||
<td><span class='fas fa-envelope'></span></td>
|
||||
<td>{% trans "Email Settings" %}</td>
|
||||
<td>
|
||||
<a href='https://inventree.readthedocs.io/en/latest/admin/email'>
|
||||
<a href='{% inventree_docs_url %}/admin/email'>
|
||||
<span class='label label-yellow'>{% trans "Email settings not configured" %}</span>
|
||||
</a>
|
||||
</td>
|
||||
|
Reference in New Issue
Block a user