mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-31 05:05:42 +00:00 
			
		
		
		
	Refactor "manufacturer_part" view
This commit is contained in:
		| @@ -20,10 +20,10 @@ | ||||
|             {% endif %}/> | ||||
|             <div class='btn-row part-thumb-overlay'> | ||||
|                 <div class='btn-group'> | ||||
|                     <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> | ||||
|                     <button type='button' class='btn btn-outline-secondary' 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-outline-secondary 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' title="{% trans 'Download image from URL' %}" id='company-image-url'><span class='fas fa-cloud-download-alt'></span></button> | ||||
|                     {% endif %} | ||||
|                 </div> | ||||
|             </div> | ||||
|   | ||||
| @@ -1,4 +1,4 @@ | ||||
| {% extends "two_column.html" %} | ||||
| {% extends "page_base.html" %} | ||||
| {% load static %} | ||||
| {% load i18n %} | ||||
|  | ||||
| @@ -10,6 +10,14 @@ InvenTree | {% trans "Manufacturer Part" %} | ||||
| {% include "company/manufacturer_part_navbar.html" %} | ||||
| {% endblock %} | ||||
|  | ||||
| {% block breadcrumbs %} | ||||
| <li class='breadcrumb-item'><a href='{% url "manufacturer-index" %}'>{% trans "Manufacturers" %}</a></li> | ||||
| {% if part.manufacturer %} | ||||
| <li class='breadcrumb-item'><a href='{% url "company-detail" part.manufacturer.id %}'>{{ part.manufacturer.name }}</a></li> | ||||
| {% endif %} | ||||
| <li class="breadcrumb-item active" aria-current="page"><a href='{% url "manufacturer-part-detail" part.id %}'>{{ part.MPN }}</a></li> | ||||
| {% endblock %} | ||||
|  | ||||
| {% block thumbnail %} | ||||
| <img class='part-thumb' | ||||
| {% if part.part.image %} | ||||
| @@ -19,46 +27,40 @@ src="{% static 'img/blank_image.png' %}" | ||||
| {% endif %}/> | ||||
| {% endblock %} | ||||
|  | ||||
| {% block page_data %} | ||||
| <h3>{% trans "Manufacturer Part" %}</h3> | ||||
| <hr> | ||||
| {% block details %} | ||||
| <h4> | ||||
|     {{ part.part.full_name }} | ||||
|     {% trans "Manufacturer Part" %}: {{ part.part.full_name }} | ||||
|     {% if user.is_staff and perms.company.change_company %} | ||||
|     <a href="{% url 'admin:company_supplierpart_change' part.pk %}"> | ||||
|         <span title='{% trans "Admin view" %}' class='fas fa-user-shield'></span> | ||||
|     </a> | ||||
|     {% endif %} | ||||
| </h4> | ||||
| <p>{{ part.manufacturer.name }} - {{ part.MPN }}</p> | ||||
|  | ||||
| {% if roles.purchase_order.change %} | ||||
| <div class='btn-row'> | ||||
|     <div class='btn-group action-buttons' role='group'> | ||||
|         {% comment "for later" %} | ||||
|         {% if roles.purchase_order.add %} | ||||
|         <button type='button' class='btn btn-default btn-glyph' id='order-part' title='{% trans "Order part" %}'> | ||||
|             <span class='fas fa-shopping-cart'></span> | ||||
|         </button> | ||||
|         {% endif %} | ||||
|         {% endcomment %} | ||||
|         <button type='button' class='btn btn-default btn-glyph' id='edit-part' title='{% trans "Edit manufacturer part" %}'> | ||||
|             <span class='fas fa-edit icon-green'/> | ||||
|         </button> | ||||
|         {% if roles.purchase_order.delete %} | ||||
|         <button type='button' class='btn btn-default btn-glyph' id='delete-part' title='{% trans "Delete manufacturer part" %}'> | ||||
|             <span class='fas fa-trash-alt icon-red'/> | ||||
|         </button> | ||||
|         {% endif %} | ||||
|     </div> | ||||
| <div class='btn-group' role='group'> | ||||
|     {% comment "for later" %} | ||||
|     {% if roles.purchase_order.add %} | ||||
|     <button type='button' class='btn btn-outline-secondary' id='order-part' title='{% trans "Order part" %}'> | ||||
|         <span class='fas fa-shopping-cart'></span> | ||||
|     </button> | ||||
|     {% endif %} | ||||
|     {% endcomment %} | ||||
|     <button type='button' class='btn btn-outline-secondary' id='edit-part' title='{% trans "Edit manufacturer part" %}'> | ||||
|         <span class='fas fa-edit icon-green'/> | ||||
|     </button> | ||||
|     {% if roles.purchase_order.delete %} | ||||
|     <button type='button' class='btn btn-outline-secondary' id='delete-part' title='{% trans "Delete manufacturer part" %}'> | ||||
|         <span class='fas fa-trash-alt icon-red'/> | ||||
|     </button> | ||||
|     {% endif %} | ||||
| </div> | ||||
| {% endif %} | ||||
|  | ||||
| {% endblock %} | ||||
|  | ||||
| {% block page_details %} | ||||
| {% block details_right %} | ||||
|  | ||||
| <h4>{% trans "Manufacturer Part Details" %}</h4> | ||||
| <table class="table table-striped table-condensed"> | ||||
|     <col width='25'> | ||||
|         <tr> | ||||
|   | ||||
| @@ -37,15 +37,15 @@ src="{% static 'img/blank_image.png' %}" | ||||
| <div class='btn-row'> | ||||
|     <div class='btn-group action-buttons' role='group'> | ||||
|         {% if roles.purchase_order.add %} | ||||
|         <button type='button' class='btn btn-default btn-glyph' id='order-part' title='{% trans "Order part" %}'> | ||||
|         <button type='button' class='btn btn-default' id='order-part' title='{% trans "Order part" %}'> | ||||
|             <span class='fas fa-shopping-cart'></span> | ||||
|         </button> | ||||
|         {% endif %} | ||||
|         <button type='button' class='btn btn-default btn-glyph' id='edit-part' title='{% trans "Edit supplier part" %}'> | ||||
|         <button type='button' class='btn btn-default' id='edit-part' title='{% trans "Edit supplier part" %}'> | ||||
|             <span class='fas fa-edit icon-green'/> | ||||
|         </button> | ||||
|         {% if roles.purchase_order.delete %} | ||||
|         <button type='button' class='btn btn-default btn-glyph' id='delete-part' title='{% trans "Delete supplier part" %}'> | ||||
|         <button type='button' class='btn btn-default' id='delete-part' title='{% trans "Delete supplier part" %}'> | ||||
|             <span class='fas fa-trash-alt icon-red'/> | ||||
|         </button> | ||||
|         {% endif %} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user