[UPDT] BASE: Updated horilla database initialize by adding authentication

This commit is contained in:
Horilla
2024-07-03 13:05:21 +05:30
parent 94edb74548
commit 176d400287
5 changed files with 197 additions and 103 deletions

View File

@@ -48,7 +48,6 @@
.select2-selection.select2-selection--multiple {
height: 46px !important;
}
</style>
<div id="main">
<div class="oh-alert-container">
@@ -61,7 +60,7 @@
<main class="oh-auth">
<div
class="oh-onboarding-card"
style="max-height: 790px;max-width: 975px;"
style="max-height: 790px; max-width: 975px"
id="ohAuthCard"
>
<div class="oh-onboarding-card__header">
@@ -71,18 +70,22 @@
class="oh-onboarding-card__step oh-onboarding-card__step--active"
>
<div class="oh-onboarding-card__count">1</div>
<span class="oh-onboarding-card__text">Sign Up</span>
<span class="oh-onboarding-card__text">Authentication</span>
</li>
<li class="oh-onboarding-card__step">
<div class="oh-onboarding-card__count">2</div>
<span class="oh-onboarding-card__text">Company</span>
<span class="oh-onboarding-card__text">Sign Up</span>
</li>
<li class="oh-onboarding-card__step">
<div class="oh-onboarding-card__count">3</div>
<span class="oh-onboarding-card__text">Company</span>
</li>
<li class="oh-onboarding-card__step">
<div class="oh-onboarding-card__count">4</div>
<span class="oh-onboarding-card__text">Department</span>
</li>
<li class="oh-onboarding-card__step oh-onboarding-card__step">
<div class="oh-onboarding-card__count">4</div>
<div class="oh-onboarding-card__count">5</div>
<span class="oh-onboarding-card__text">Job Position</span>
</li>
</ul>
@@ -90,66 +93,19 @@
<h1
class="oh-onboarding-card__title oh-onboarding-card__title--h2 text-center my-3"
>
{% trans "Sign Up" %}
{% trans "Database Authentication" %}
</h1>
<p class="text-muted text-center">
{% trans "Please sign up to access the Horilla HRMS." %}
{% trans "Authenticate with your password to initialize the Horilla HRMS database." %}
</p>
<form
hx-post="{% url 'initialize-database-user' %}"
hx-post="{% url 'initialize-database' %}"
hx-target="#ohAuthCard"
class="oh-form-group"
>
{% csrf_token %}
<div class="row">
<div class="col-12 col-sm-12 col-md-6 col-lg-6">
<div class="oh-input-group">
<label class="oh-label" for="firstname"
>{% trans "First Name" %}</label
>
<input
type="text"
id="firstname"
name="firstname"
class="oh-input w-100"
placeholder="e.g. Adam"
required
/>
</div>
</div>
<div class="col-12 col-sm-12 col-md-6 col-lg-6">
<div class="oh-input-group">
<label class="oh-label" for="lastname"
>{% trans "Last Name" %}</label
>
<input
type="text"
id="lastname"
name="lastname"
class="oh-input w-100"
placeholder="e.g. Luis"
required
/>
</div>
</div>
</div>
<div class="row">
<div class="col-12 col-sm-12 col-md-6 col-lg-6">
<div class="oh-input-group">
<label class="oh-label" for="username"
>{% trans "Username" %}</label
>
<input
type="text"
id="username"
name="username"
class="oh-input w-100"
placeholder="e.g. jane.doe@acme.com"
required
/>
</div>
</div>
<div class="col-12 col-sm-12 col-md-6 col-lg-6">
<div class="col-12 col-sm-12 col-md-12 col-lg-12">
<div class="oh-input-group">
<label class="oh-label" for="password"
>{% trans "Password" %}</label
@@ -160,7 +116,7 @@
id="password"
name="password"
class="oh-input oh-input--password w-100"
placeholder="Use alphanumeric characters"
placeholder="Database authentication passowrd"
required
/>
<button
@@ -182,46 +138,16 @@
</div>
</div>
</div>
<div class="row">
<div class="col-12 col-sm-12 col-md-6 col-lg-6">
<div class="oh-input-group">
<label class="oh-label" for="email"
>{% trans "Email" %}</label
>
<input
type="text"
id="email"
name="email"
class="oh-input w-100"
placeholder="e.g. jane.doe@acme.com"
required
/>
</div>
</div>
<div class="col-12 col-sm-12 col-md-6 col-lg-6">
<div class="oh-input-group">
<label class="oh-label" for="phone"
>{% trans "Phone" %}</label
>
<input
type="text"
id="phone"
name="phone"
class="oh-input w-100"
placeholder="e.g. 9865324512"
required
/>
</div>
</div>
</div>
<button
type="submit"
class="oh-btn oh-onboarding-card__button mt-4 oh-btn--secondary oh-btn--shadow w-100 mb-4"
role="button"
<div class="oh-modal__dialog-footer p-0 mt-3">
<button
type="submit"
class="oh-btn oh-btn--secondary-outline m-2"
role="button"
>
<ion-icon class="me-2" name="lock-closed-outline"></ion-icon>
{% trans "Secure Sign-up" %}
</button>
{% trans "Authenticate" %}
<ion-icon class="ms-2" name="arrow-forward-outline"></ion-icon>
</button>
</div>
</form>
</div>
<img src={% if white_label_company.icon %} "{{white_label_company.icon.url}}" {% else %} "{% static 'images/ui/auth-logo.png' %}" {% endif %} alt="Horilla" />
@@ -230,6 +156,7 @@
<script src="{% static '/build/js/web.frontend.min.js' %}"></script>
<script src="https://code.jquery.com/jquery-3.6.4.min.js"></script>
<script src="{% static 'htmx/htmx.min.js' %}"></script>
<script src="{% static 'build/js/hxSelect2.js' %}"></script>
<script src="{% static '/index/index.js' %}"></script>
<script
type="module"
@@ -239,7 +166,6 @@
nomodule
src="https://unpkg.com/ionicons@5.5.2/dist/ionicons/ionicons.js"
></script>
<script src="{% static 'build/js/hxSelect2.js' %}"></script>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@10"></script>
<script>
$(document).on("htmx:beforeRequest", function (event, data) {