summaryrefslogtreecommitdiff
path: root/procurement/templates
diff options
context:
space:
mode:
Diffstat (limited to 'procurement/templates')
-rw-r--r--procurement/templates/procurement/documentation.html7
-rw-r--r--procurement/templates/procurement/includes/supplier_details.html51
-rw-r--r--procurement/templates/procurement/view_suppliers.html35
3 files changed, 91 insertions, 2 deletions
diff --git a/procurement/templates/procurement/documentation.html b/procurement/templates/procurement/documentation.html
index 4775890..f482a1d 100644
--- a/procurement/templates/procurement/documentation.html
+++ b/procurement/templates/procurement/documentation.html
@@ -55,7 +55,9 @@
<p>
Components and their approved Suppliers can be located under
<a href="{% url 'component-search' %}">source components</a>. From this page you may search for a
- component, and then click the Find Suppliers button to display its Suppliers
+ component, and then click the Find Suppliers button to display its Suppliers.
+ You can also view details for any authorized Supplier in the system directly under
+ <a href="{% url 'supplier-search' %}">view suppliers</a>.
</p>
<h2><a name="api"></a>API</h2>
@@ -63,6 +65,7 @@
A simple REST api is integrated into the system, using the <a href="https://www.django-rest-framework.org/">Django Rest Framework</a>.
It provides a means of querying <a href="{% url 'api-component-list' %}">all components</a> or, by providing an id
in the url, <a href="{% url 'api-component-retrieve' pk=1 %}">a specific component</a>.
+ You may also use the API to query <a href="{% url 'api-supplier-list' %}">all authorized suppliers</a>, <a href="{% url 'api-supplier-retrieve' pk=1 %}">a specific supplier</a> by providing an id, or <a href="{% url 'api-supplier-components' pk=1 %}">the components a specific supplier provides</a>.
</p>
</div>
<!-- /.panel-body -->
@@ -73,4 +76,4 @@
-{% endblock %} \ No newline at end of file
+{% endblock %}
diff --git a/procurement/templates/procurement/includes/supplier_details.html b/procurement/templates/procurement/includes/supplier_details.html
new file mode 100644
index 0000000..0e46c67
--- /dev/null
+++ b/procurement/templates/procurement/includes/supplier_details.html
@@ -0,0 +1,51 @@
+<!-- Supplier Details -->
+<div class="panel panel-default">
+ <div class="panel-heading">
+ Supplier information for {{ supplier.name }}
+ </div>
+ <!-- /.panel-heading -->
+ <div class="panel-body">
+ <div class="table-responsive">
+ <table class="table">
+ <thead>
+ <tr>
+ <th>Representative</th>
+ <th>Email</th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for representative in supplier.representatives.all %}
+ <tr>
+ <td>{{ representative.name }}</td>
+ <td>{{ representative.email }}</td>
+ </tr>
+ {% empty %}
+ <tr>
+ <td colspan="2">{{ supplier_name }} has no representatives</td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ </div>
+ <!-- /.table-responsive -->
+ </div>
+ <!-- /.panel-body -->
+</div>
+<!-- / Supplier Details Panel -->
+<!-- Components Supplied by Panel -->
+<div class="panel panel-default">
+ <div class="panel-heading">
+ Components Supplied by {{ supplier.name }}
+ </div>
+ <div class="panel-body">
+ <form id="find-suppliers" method="post" action="{% url 'component-search' %}">
+ <div class="form-group">
+ {% csrf_token %}
+ {{ component_form }}
+ </div>
+ <div class="form-group">
+ <input type="submit" value="View Other Suppliers" id="find-suppliers-button" class="btn btn-secondary">
+ </div>
+ </form>
+ </div>
+</div>
diff --git a/procurement/templates/procurement/view_suppliers.html b/procurement/templates/procurement/view_suppliers.html
new file mode 100644
index 0000000..918ce62
--- /dev/null
+++ b/procurement/templates/procurement/view_suppliers.html
@@ -0,0 +1,35 @@
+{% extends "base.html" %}
+{% load static %}
+
+{% block additional_css %}
+ <link href="{% static 'procurement/css/suppliers.css' %}" rel="stylesheet" type="text/css">
+ <link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.6-rc.0/css/select2.min.css" rel="stylesheet" />
+{% endblock %}
+
+{% block main_content_area %}
+ <div class="col-lg-8">
+ <div class="panel panel-default">
+ <div class="panel-body">
+ <form id="supplier-info" method="post">
+ <div class="form-group">
+ {% csrf_token %}
+ {{ form }}
+ </div>
+ <div class="form-group">
+ <input type="submit" value="View Supplier Information" id="view-supplier-button" class="btn btn-primary">
+ </div>
+ </form>
+ </div>
+ <!-- /.panel-body -->
+ </div>
+ <!-- /.panel -->
+ {% if supplier != None %}
+ {% include 'procurement/includes/supplier_details.html' %}
+ {% endif %}
+ </div>
+{% endblock %}
+
+{% block additional_js %}
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.6-rc.0/js/select2.min.js"></script>
+ <script src="{% static 'procurement/js/component_search.js' %}"></script>
+{% endblock %}