Refactor company base page

This commit is contained in:
Oliver 2021-10-27 22:44:40 +11:00
parent 8fdaab233c
commit 9536231cb0
2 changed files with 60 additions and 54 deletions

View File

@ -1,18 +1,16 @@
{% extends "two_column.html" %}
{% extends "page_base.html" %}
{% load static %}
{% load i18n %}
{% load inventree_extras %}
{% block page_title %}
{% inventree_title %} | {% trans "Company" %} - {{ company.name }}
{% endblock %}
{% block thumbnail %}
{% settings_value "INVENTREE_DOWNLOAD_FROM_URL" as allow_download %}
{% block details_left %}
<div class='row g-0'>
<div class='col-md-4'>
<div class='dropzone part-thumb-container' id='company-thumb'>
<img class="part-thumb" id='company-image'
{% if company.image %}
@ -22,18 +20,16 @@
{% endif %}/>
<div class='btn-row part-thumb-overlay'>
<div class='btn-group'>
<button type='button' class='btn btn-default btn-glyph' title='{% trans "Upload new image" %}' id='company-image-upload'><span class='fas fa-file-upload'></span></button>
<button type='button' class='btn btn-outline-secondary btn-glyph' title='{% trans "Upload new image" %}' id='company-image-upload'><span class='fas fa-file-upload'></span></button>
{% settings_value "INVENTREE_DOWNLOAD_FROM_URL" as allow_download %}
{% if allow_download %}
<button type='button' class='btn btn-default btn-glyph' title="{% trans 'Download image from URL' %}" id='company-image-url'><span class='fas fa-cloud-download-alt'></span></button>
<button type='button' class='btn btn-outline-secondary btn-glyph' title="{% trans 'Download image from URL' %}" id='company-image-url'><span class='fas fa-cloud-download-alt'></span></button>
{% endif %}
</div>
</div>
</div>
{% endblock %}
{% block page_data %}
<h3>{% trans "Company" %}</h3>
<hr>
</div>
<div class='col-md-8'>
<h4>
{{ company.name }}
{% if user.is_staff and perms.company.change_company %}
@ -41,28 +37,30 @@
{% endif %}
</h4>
<p>{{ company.description }}</p>
<div class='btn-group action-buttons'>
<div class='btn-group' role='group'>
{% if company.is_supplier and roles.purchase_order.add %}
<button type='button' class='btn btn-default' id='company-order-2' title='{% trans "Create Purchase Order" %}'>
<button type='button' class='btn btn-outline-secondary' id='company-order-2' title='{% trans "Create Purchase Order" %}'>
<span class='fas fa-shopping-cart'/>
</button>
{% endif %}
{% if perms.company.change_company %}
<button type='button' class='btn btn-default' id='company-edit' title='{% trans "Edit company information" %}'>
<button type='button' class='btn btn-outline-secondary' id='company-edit' title='{% trans "Edit company information" %}'>
<span class='fas fa-edit icon-green'/>
</button>
{% endif %}
{% if perms.company.delete_company %}
<button type='button' class='btn btn-default' id='company-delete' title='{% trans "Delete Company" %}'>
<button type='button' class='btn btn-outline-secondary' id='company-delete' title='{% trans "Delete Company" %}'>
<span class='fas fa-trash-alt icon-red'/>
</button>
{% endif %}
</div>
</div>
</div>
{% endblock %}
{% block page_details %}
<h4>{% trans "Company Details" %}</h4>
<table class="table">
{% block details_right %}
<table class="table table-striped table-condensed">
<col width='25'>
{% if company.website %}
<tr>

View File

@ -29,10 +29,14 @@
</button>
<ul class="dropdown-menu">
{% if roles.purchase_order.add %}
<li><a href='#' id='multi-supplier-part-order' title='{% trans "Order parts" %}'>{% trans "Order Parts" %}</a></li>
<li><a class='dropdown-item' href='#' id='multi-supplier-part-order' title='{% trans "Order parts" %}'>
<span class='fas fa-shopping-cart'></span> {% trans "Order Parts" %}
</a></li>
{% endif %}
{% if roles.purchase_order.delete %}
<li><a href='#' id='multi-supplier-part-delete' title='{% trans "Delete parts" %}'>{% trans "Delete Parts" %}</a></li>
<li><a class='dropdown-item' href='#' id='multi-supplier-part-delete' title='{% trans "Delete parts" %}'>
<span class='fas fa-trash-alt icon-red'></span> {% trans "Delete Parts" %}
</a></li>
{% endif %}
</ul>
</div>
@ -69,10 +73,14 @@
</button>
<ul class="dropdown-menu">
{% if roles.purchase_order.add %}
<li><a href='#' id='multi-manufacturer-part-order' title='{% trans "Order parts" %}'>{% trans "Order Parts" %}</a></li>
<li><a class='dropdown-item' href='#' id='multi-manufacturer-part-order' title='{% trans "Order parts" %}'>
<span class='fas fa-shopping-cart'></span> {% trans "Order Parts" %}
</a></li>
{% endif %}
{% if roles.purchase_order.delete %}
<li><a href='#' id='multi-manufacturer-part-delete' title='{% trans "Delete parts" %}'>{% trans "Delete Parts" %}</a></li>
<li><a class='dropdown-item' href='#' id='multi-manufacturer-part-delete' title='{% trans "Delete parts" %}'>
<span class='fas fa-trash-alt icon-red'></span> {% trans "Delete Parts" %}
</a></li>
{% endif %}
</ul>
</div>
@ -166,7 +174,7 @@
</div>
<div class='col-sm-6'>
<div class='btn-group float-right'>
<button type='button' id='edit-notes' title='{% trans "Edit Notes" %}' class='btn btn-small btn-default'>
<button type='button' id='edit-notes' title='{% trans "Edit Notes" %}' class='btn btn-small btn-outline-secondary'>
<span class='fas fa-edit'>
</span>
</button>