mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-03 12:19:12 +00:00
feat: handle empty state
This commit is contained in:
@@ -33,13 +33,13 @@
|
|||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
{% if doc.tasks %}
|
|
||||||
<div class="row align-items-center">
|
<div class="row align-items-center">
|
||||||
<div class="col-sm-6 my-account-header"> <h4>Tasks</h4></div>
|
<div class="col-sm-6 my-account-header"> <h4>Tasks</h4></div>
|
||||||
<div class="col-sm-6 text-right">
|
<div class="col-sm-6 text-right">
|
||||||
<a class="btn btn-secondary btn-light btn-sm" href='/tasks/new?project={{ doc.project_name }}'>{{ _("New task") }}</a>
|
<a class="btn btn-secondary btn-light btn-sm" href='/tasks/new?project={{ doc.project_name }}'>{{ _("New task") }}</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{% if doc.tasks %}
|
||||||
<div class="website-list">
|
<div class="website-list">
|
||||||
<div class="result">
|
<div class="result">
|
||||||
<div class="web-list-item transaction-list-item">
|
<div class="web-list-item transaction-list-item">
|
||||||
@@ -55,11 +55,11 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
<p class="font-weight-bold">{{ _("No Tasks") }}</p>
|
{{ empty_state('Task')}}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if doc.timesheets %}
|
|
||||||
<h4 class="my-account-header">Timesheets</h4>
|
<h4 class="my-account-header">Timesheets</h4>
|
||||||
|
{% if doc.timesheets %}
|
||||||
<div class="website-list">
|
<div class="website-list">
|
||||||
<div class="result">
|
<div class="result">
|
||||||
<div class="web-list-item transaction-list-item">
|
<div class="web-list-item transaction-list-item">
|
||||||
@@ -76,7 +76,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
<p class="font-weight-bold mt-5">{{ _("No Timesheets") }}</p>
|
{{ empty_state('Timesheet')}}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if doc.attachments %}
|
{% if doc.attachments %}
|
||||||
@@ -121,7 +121,21 @@
|
|||||||
aria-valuemax="100" style="width:{{ percent_complete|round|int }}%;">
|
aria-valuemax="100" style="width:{{ percent_complete|round|int }}%;">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% else %}
|
|
||||||
<hr>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
|
||||||
|
|
||||||
|
{% macro empty_state(section_name) %}
|
||||||
|
<div class="frappe-list align-items-center">
|
||||||
|
<div class=" text-muted flex justify-center align-center" style="">
|
||||||
|
<div class=" text-muted flex text-center">
|
||||||
|
<div class="msg-box no-border">
|
||||||
|
<div>
|
||||||
|
<img src="/assets/frappe/images/ui-states/list-empty-state.svg" alt="Generic Empty State" class="null-state">
|
||||||
|
</div>
|
||||||
|
<p>You haven't created a {{ section_name }} yet</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endmacro %}
|
||||||
Reference in New Issue
Block a user