[UPDT] ASSET: Updated asset module empty pages styles

This commit is contained in:
Horilla
2025-05-09 11:42:54 +05:30
parent 68528aed3e
commit d63809657c
3 changed files with 70 additions and 137 deletions

View File

@@ -76,7 +76,7 @@ function getAssetImportTemplate() {
const url = URL.createObjectURL(file); const url = URL.createObjectURL(file);
const link = document.createElement("a"); const link = document.createElement("a");
link.href = url; link.href = url;
link.download = "my_excel_file.xlsx"; link.download = "asset_excel.xlsx";
document.body.appendChild(link); document.body.appendChild(link);
link.click(); link.click();
}, },

View File

@@ -1,22 +1,7 @@
{% extends 'index.html' %} {% block content %} {% load static %} {% extends 'index.html' %} {% block content %} {% load static %}
{% load i18n %} {% load widget_tweaks %} {% load i18n %} {% load widget_tweaks %}
<!-- start of messages --> <section class="oh-wrapper oh-main__topbar">
{% if messages %}
<div class="oh-wrapper">
{% for message in messages %}
<div class="oh-alert-container">
<div class="oh-alert oh-alert--animated {{message.tags}}">
{{ message }}
</div>
</div>
{% endfor %}
</div>
{% endif %}
<!-- end of messages -->
<main :class="sidebarOpen ? 'oh-main__sidebar-visible' : ''">
<section class="oh-wrapper oh-main__topbar" x-data="{searchShow: false}">
<div class="oh-main__titlebar oh-main__titlebar--left"> <div class="oh-main__titlebar oh-main__titlebar--left">
<h1 class="oh-main__titlebar-title fw-bold"> <h1 class="oh-main__titlebar-title fw-bold">
{% trans "Asset Batch Number" %} {% trans "Asset Batch Number" %}
@@ -27,8 +12,9 @@
{% if perms.asset.add_assetlot %} {% if perms.asset.add_assetlot %}
<div class="oh-btn-group ml-2"> <div class="oh-btn-group ml-2">
<div> <div>
<a class="oh-btn oh-btn--secondary oh-btn--shadow" data-toggle="oh-modal-toggle" data-target="#objectCreateModal" <a class="oh-btn oh-btn--secondary oh-btn--shadow" data-toggle="oh-modal-toggle"
hx-get="{% url 'asset-batch-number-creation' %}" hx-target="#objectCreateModalTarget"> data-target="#objectCreateModal" hx-get="{% url 'asset-batch-number-creation' %}"
hx-target="#objectCreateModalTarget">
<ion-icon class="me-2" name="add-outline"></ion-icon>{% trans "Create" %} <ion-icon class="me-2" name="add-outline"></ion-icon>{% trans "Create" %}
</a> </a>
</div> </div>
@@ -37,23 +23,12 @@
</div> </div>
</div> </div>
</section> </section>
</main>
<div class="oh-wrapper-main">
<main :class="sidebarOpen ? 'oh-main__sidebar-visible' : ''">
<div class="oh-wrapper"> <div class="oh-wrapper">
<div class="oh-404"> <div class="oh-empty">
<img <img src="{% static 'images/ui/search.svg' %}" class="oh-404__image" alt="Page not found. 404." />
style="width: 190px; height: 190px" <h1 class="oh-empty__title">{% trans "No Records found." %}</h1>
src="{% static 'images/ui/batch.png' %}" <p class="oh-empty__subtitle">{% trans "No Asset Batches have been created." %}</p>
class="oh-404__image mb-4"
alt="Page not found. 404."
/>
<h5 class="oh-404__subtitle">
{% trans "No Asset Batches have been created." %}
</h5>
</div> </div>
</div> </div>
</main>
</div>
{% endblock %} {% endblock %}

View File

@@ -5,34 +5,6 @@
{% load widget_tweaks %} {% load widget_tweaks %}
{% load assets_custom_filter %} {% load assets_custom_filter %}
<style>
.button-link {
display: inline-block;
padding: 12px 15px;
background-color: #F0EFEF; /* Change this to your desired button color */
color: #312D2D; /* Text color for the button */
text-align: center;
text-decoration: none;
cursor: pointer;
}
</style>
<!-- start of messages -->
{% if messages %}
<div class="oh-wrapper">
{% for message in messages %}
<div class="oh-alert-container">
<div class="oh-alert oh-alert--animated oh-alert--warning">
{{ message }}
</div>
</div>
{% endfor %}
</div>
{% endif %}
<!-- end of messages -->
<main :class="sidebarOpen ? 'oh-main__sidebar-visible' : ''">
<section class="oh-wrapper oh-main__topbar" x-data="{searchShow: false}"> <section class="oh-wrapper oh-main__topbar" x-data="{searchShow: false}">
<div class="oh-main__titlebar oh-main__titlebar--left"> <div class="oh-main__titlebar oh-main__titlebar--left">
<h1 class="oh-main__titlebar-title fw-bold">{{ model.get_verbose_name }}</h1> <h1 class="oh-main__titlebar-title fw-bold">{{ model.get_verbose_name }}</h1>
@@ -41,29 +13,22 @@
<div class="oh-main__titlebar-button-container"> <div class="oh-main__titlebar-button-container">
{% if perms.asset.add_asset %} {% if perms.asset.add_asset %}
<!-- import asset start --> <div class="oh-dropdown ml-2" x-data="{open: false}">
<div class="oh-dropdown" > <button onclick="event.stopPropagation();event.preventDefault()" class="oh-btn oh-btn--dropdown"
<button class="ml-2" id="import-button" style='border:none'> @click="open = !open" @click.outside="open = false">
<a href="#" id="asset-info-import" class="button-link" onclick="return confirm('{% trans "Do you want to download template ?" %}')"><ion-icon name="arrow-down-outline" class="me-1"></ion-icon> {% trans "Import" %}</a> {% trans "Actions" %}
</button> </button>
<div class="oh-dropdown__import oh-dropdown__import--right " style="display: none;" id ="import-dropdown" > <div class="oh-dropdown__menu oh-dropdown__menu--right" x-show="open" style="display: none">
<button class="oh-modal__close close-import" aria-label="Close"> <ul class="oh-dropdown__items">
<ion-icon name="close-outline"></ion-icon> <li class="oh-dropdown__item" id="import-button">
</button> <a href="#" class="oh-dropdown__link asset-info-import" data-toggle="oh-modal-toggle"
<div id="AssetImportResponse"></div> data-target="#objectCreateModal" hx-get="{%url 'asset-import' %}"
<form action="{%url 'asset-import' %}" enctype="multipart/form-data" method="post"> hx-target="#objectCreateModalTarget" class="button-link"
{% csrf_token %} onclick="return confirm('{% trans "Do you want to download template ?" %}')">
<div class="oh-dropdown__import-form"> {% trans "Import" %}
<label class="oh-dropdown__import-label" for="uploadFile"> </a>
<ion-icon name="cloud-upload" class="oh-dropdown__import-form-icon"></ion-icon> </li>
<span class="oh-dropdown__import-form-title">{% trans "Upload a File" %}</span> </ul>
<span class="oh-dropdown__import-form-text">{% trans "Drag and drop files here" %}</span>
</label>
<input type="file" name="asset_import" id="" />
</div>
<button type="submit"
class="oh-btn oh-btn--small oh-btn--secondary w-100 mt-3">{% trans "Upload" %}</button>
</form>
</div> </div>
</div> </div>
{% endif %} {% endif %}
@@ -71,10 +36,8 @@
<div class="oh-btn-group ml-2"> <div class="oh-btn-group ml-2">
{% if perms.asset.add_assetcategory %} {% if perms.asset.add_assetcategory %}
<div> <div>
<a href="#" class="oh-btn oh-btn--secondary oh-btn--shadow" <a href="#" class="oh-btn oh-btn--secondary oh-btn--shadow" data-toggle="oh-modal-toggle"
data-toggle="oh-modal-toggle" data-target="#objectCreateModal" hx-get="{%url 'asset-category-creation' %}"
data-target="#objectCreateModal"
hx-get="{%url 'asset-category-creation' %}"
hx-target="#objectCreateModalTarget"> hx-target="#objectCreateModalTarget">
<ion-icon name="add-outline"></ion-icon> <ion-icon name="add-outline"></ion-icon>
{% trans "Create" %} {% trans "Create" %}
@@ -85,18 +48,13 @@
</div> </div>
</div> </div>
</section> </section>
</main>
<div
class="oh-wrapper-main"
>
<main :class="sidebarOpen ? 'oh-main__sidebar-visible' : ''">
<div class="oh-wrapper"> <div class="oh-wrapper">
<div class="oh-404"> <div class="oh-empty">
<img style=" width: 190px;height: 190px;" src="{% static 'images/ui/asset.png' %}" class="oh-404__image mb-4" alt="Page not found. 404."/> <img src="{% static 'images/ui/search.svg' %}" class="oh-404__image" alt="Page not found. 404." />
<h5 class="oh-404__subtitle">{% trans "There is no Asset category and no Assets has been created." %}</h5> <h1 class="oh-empty__title">{% trans "No Records found." %}</h1>
</div> <p class="oh-empty__subtitle">{% trans "No Asset Categories or Assets have been created." %}</p>
</div>
</main>
</div> </div>
</div> </div>