diff --git a/shimatta_kenkyusho/parts/views.py b/shimatta_kenkyusho/parts/views.py index b8cd448..2eff882 100644 --- a/shimatta_kenkyusho/parts/views.py +++ b/shimatta_kenkyusho/parts/views.py @@ -623,8 +623,8 @@ class ComponentDetailView(LoginRequiredMixin, BaseTemplateMixin, DetailView): context['comp_form'] = ComponentForm(instance=self.object) context['new_distri_num_form'] = DistributorNumberCreateForm() context['new_param_form'] = ComponentParameterCreateForm() - context['distri_nums'] = DistributorNum.objects.filter(component=self.object) - context['parameters'] = ComponentParameter.objects.filter(component=self.object) + context['distri_nums'] = DistributorNum.objects.filter(component=self.object).order_by('distributor__name') + context['parameters'] = ComponentParameter.objects.filter(component=self.object).order_by('parameter_type__parameter_name') return context diff --git a/shimatta_kenkyusho/templates/parts/components-detail.html b/shimatta_kenkyusho/templates/parts/components-detail.html index e865118..a8d2163 100644 --- a/shimatta_kenkyusho/templates/parts/components-detail.html +++ b/shimatta_kenkyusho/templates/parts/components-detail.html @@ -93,10 +93,26 @@ {% endif %} +
+ + + + + + + {% for stock in stocks %} + + + + + {% endfor %} + +
StorageAmount
{{stock.storage.get_full_path}}{{stock.amount}}
+

Parameters

- +
@@ -105,23 +121,38 @@ {% for param in parameters %} - - + + {% endfor %}
Parameter Value
{{param.parameter_type.parameter_name}}{{param.resolved_value_as_string}} +
+ {{param.parameter_type.parameter_name}} +
+
+ {{param.resolved_value_as_string}} +
{% csrf_token %}
-
+
+
+ {% for param in parameters %} + {% if param.parameter_type.parameter_description %} +
+ {{param.parameter_type.parameter_description}} +
+ {% endif %} + {% endfor %} +

Distributor Part Numbers

- +
@@ -144,22 +175,6 @@
Distributor Part Number
-
-
- - - - - - - {% for stock in stocks %} - - - - - {% endfor %} - -
StorageAmount
{{stock.storage.get_full_path}}{{stock.amount}}