Compare commits
4 Commits
feature/21
...
develop
Author | SHA1 | Date | |
---|---|---|---|
46a94c9688 | |||
21ac4a8c06 | |||
207b5c3fb5 | |||
3450f7475a |
@ -1,12 +1,13 @@
|
|||||||
annotated-types==0.7.0
|
annotated-types==0.7.0
|
||||||
asgiref==3.8.1
|
asgiref==3.8.1
|
||||||
astroid==2.6.5
|
astroid==3.3.5
|
||||||
certifi==2024.8.30
|
certifi==2024.8.30
|
||||||
charset-normalizer==3.4.0
|
charset-normalizer==3.4.0
|
||||||
crispy-bootstrap5==2024.10
|
crispy-bootstrap5==2024.10
|
||||||
|
dill==0.3.9
|
||||||
Django==5.1.3
|
Django==5.1.3
|
||||||
django-crispy-forms==2.3
|
django-crispy-forms==2.3
|
||||||
django-filter==2.4.0
|
django-filter==24.3
|
||||||
django-qr-code==4.1.0
|
django-qr-code==4.1.0
|
||||||
django-rest-framework==0.1.0
|
django-rest-framework==0.1.0
|
||||||
django-tex==1.1.10
|
django-tex==1.1.10
|
||||||
@ -21,15 +22,17 @@ mccabe==0.6.1
|
|||||||
packaging==24.2
|
packaging==24.2
|
||||||
Pillow==8.3.1
|
Pillow==8.3.1
|
||||||
pipdeptree==2.23.4
|
pipdeptree==2.23.4
|
||||||
|
platformdirs==4.3.6
|
||||||
psycopg2-binary==2.9.9
|
psycopg2-binary==2.9.9
|
||||||
pydantic==2.9.2
|
pydantic==2.9.2
|
||||||
pydantic_core==2.23.4
|
pydantic_core==2.23.4
|
||||||
pylint==2.9.6
|
pylint==3.3.1
|
||||||
requests==2.32.3
|
requests==2.32.3
|
||||||
segno==1.6.1
|
segno==1.6.1
|
||||||
setuptools==75.3.0
|
setuptools==75.3.0
|
||||||
sqlparse==0.4.1
|
sqlparse==0.4.1
|
||||||
toml==0.10.2
|
toml==0.10.2
|
||||||
|
tomlkit==0.13.2
|
||||||
typing_extensions==4.12.2
|
typing_extensions==4.12.2
|
||||||
tzdata==2024.2
|
tzdata==2024.2
|
||||||
urllib3==2.2.3
|
urllib3==2.2.3
|
||||||
|
@ -9,7 +9,6 @@ admin.site.register(parts_models.Manufacturer)
|
|||||||
admin.site.register(parts_models.Storage)
|
admin.site.register(parts_models.Storage)
|
||||||
admin.site.register(parts_models.Stock)
|
admin.site.register(parts_models.Stock)
|
||||||
admin.site.register(parts_models.ComponentParameter)
|
admin.site.register(parts_models.ComponentParameter)
|
||||||
admin.site.register(parts_models.PackageParameter)
|
|
||||||
admin.site.register(parts_models.ComponentParameterType)
|
admin.site.register(parts_models.ComponentParameterType)
|
||||||
admin.site.register(parts_models.ComponentType)
|
admin.site.register(parts_models.ComponentType)
|
||||||
admin.site.register(parts_models.Distributor)
|
admin.site.register(parts_models.Distributor)
|
||||||
|
@ -252,19 +252,15 @@ class DistributorNumberDeleteForm(forms.Form):
|
|||||||
|
|
||||||
class ComponentParameterDeleteForm(forms.Form):
|
class ComponentParameterDeleteForm(forms.Form):
|
||||||
param_num = forms.UUIDField(required=True)
|
param_num = forms.UUIDField(required=True)
|
||||||
model = parts_models.ComponentParameter
|
|
||||||
|
|
||||||
def clean_param_num(self):
|
def clean_param_num(self):
|
||||||
my_uuid = self.cleaned_data['param_num']
|
my_uuid = self.cleaned_data['param_num']
|
||||||
try:
|
try:
|
||||||
param = self.model.objects.get(id=my_uuid)
|
param = parts_models.ComponentParameter.objects.get(id=my_uuid)
|
||||||
except:
|
except:
|
||||||
raise ValidationError('Parameter Number Invalid')
|
raise ValidationError('Parameter Number Invalid')
|
||||||
return param
|
return param
|
||||||
|
|
||||||
class PackageParameterDeleteForm(ComponentParameterDeleteForm):
|
|
||||||
model = parts_models.PackageParameter
|
|
||||||
|
|
||||||
class AdvancedComponentSearchForm(forms.Form):
|
class AdvancedComponentSearchForm(forms.Form):
|
||||||
name = forms.CharField(max_length=255, label='Component Name', required=False)
|
name = forms.CharField(max_length=255, label='Component Name', required=False)
|
||||||
package = AutocompleteForeingKeyField(required=False, api_search_url='package-list', foreign_model=parts_models.Package)
|
package = AutocompleteForeingKeyField(required=False, api_search_url='package-list', foreign_model=parts_models.Package)
|
||||||
@ -313,7 +309,6 @@ class ComponentParameterSearchForm(forms.Form):
|
|||||||
class ComponentParameterCreateForm(forms.Form):
|
class ComponentParameterCreateForm(forms.Form):
|
||||||
parameter_type = AutocompleteForeingKeyField(required=True, foreign_model=parts_models.ComponentParameterType, api_search_url='componentparametertype-list', image_field_name=None, name_field_name='descriptive_name')
|
parameter_type = AutocompleteForeingKeyField(required=True, foreign_model=parts_models.ComponentParameterType, api_search_url='componentparametertype-list', image_field_name=None, name_field_name='descriptive_name')
|
||||||
value = forms.CharField(required=True, max_length=256)
|
value = forms.CharField(required=True, max_length=256)
|
||||||
model = parts_models.ComponentParameter
|
|
||||||
|
|
||||||
def clean(self):
|
def clean(self):
|
||||||
data = super().clean()
|
data = super().clean()
|
||||||
@ -343,20 +338,7 @@ class ComponentParameterCreateForm(forms.Form):
|
|||||||
else:
|
else:
|
||||||
text_value = ''
|
text_value = ''
|
||||||
value = self.cleaned_data['number_value']
|
value = self.cleaned_data['number_value']
|
||||||
self.model.objects.create(parameter_type=param_type, component=component, value=value, text_value=text_value)
|
parts_models.ComponentParameter.objects.create(parameter_type=param_type, component=component, value=value, text_value=text_value)
|
||||||
|
|
||||||
class PackageParameterCreateForm(ComponentParameterCreateForm):
|
|
||||||
model = parts_models.PackageParameter
|
|
||||||
|
|
||||||
def save(self, package):
|
|
||||||
param_type = self.cleaned_data['parameter_type']
|
|
||||||
if param_type.parameter_type == 'F':
|
|
||||||
text_value = self.cleaned_data['value']
|
|
||||||
value = 0
|
|
||||||
else:
|
|
||||||
text_value = ''
|
|
||||||
value = self.cleaned_data['number_value']
|
|
||||||
self.model.objects.create(parameter_type=param_type, package=package, value=value, text_value=text_value)
|
|
||||||
|
|
||||||
class QrSearchForm(forms.Form):
|
class QrSearchForm(forms.Form):
|
||||||
my_qr_validator = QrCodeValidator()
|
my_qr_validator = QrCodeValidator()
|
||||||
|
@ -1,43 +0,0 @@
|
|||||||
from django.core.management.base import BaseCommand, CommandParser
|
|
||||||
from django.contrib.auth import get_user_model
|
|
||||||
from parts.models import Component, ComponentParameter, ComponentParameterType, PackageParameter, Package
|
|
||||||
|
|
||||||
class Command(BaseCommand):
|
|
||||||
help = "Remove component parameters, that are also set on the package with the same value"
|
|
||||||
|
|
||||||
def add_arguments(self, parser: CommandParser):
|
|
||||||
parser.add_argument('--dry-run',
|
|
||||||
help='Do not perform parameter deletion. Print only',
|
|
||||||
action='store_true')
|
|
||||||
|
|
||||||
def handle(self, *args, **options):
|
|
||||||
# Get all components with set packages. Ignore the ones without packages
|
|
||||||
all_comps = Component.objects.exclude(package__isnull=True)
|
|
||||||
|
|
||||||
for component in all_comps:
|
|
||||||
package_parameters = PackageParameter.objects.filter(package=component.package)
|
|
||||||
component_parameters = ComponentParameter.objects.filter(component=component)
|
|
||||||
package_param_ids = package_parameters.values_list('parameter_type_id', flat=True)
|
|
||||||
component_param_ids = component_parameters.values_list('parameter_type_id', flat=True)
|
|
||||||
|
|
||||||
# Skip trivial cases
|
|
||||||
if len(package_param_ids) == 0 or len(component_param_ids) == 0:
|
|
||||||
continue
|
|
||||||
|
|
||||||
self.stdout.write(f'Comp: {str(component)} Found {len(component_param_ids)} different parameters')
|
|
||||||
self.stdout.write(f'\tPackage: {str(component.package)} Found {len(package_param_ids)} different parameters')
|
|
||||||
|
|
||||||
commontypes = ctypes = ComponentParameterType.objects.filter(id__in=component_param_ids).filter(id__in=package_param_ids)
|
|
||||||
self.stdout.write(f'\tCommon parameter count: {len(commontypes)}')
|
|
||||||
|
|
||||||
# Check if values are the same when rendered as a string. This avoids float comparison problems
|
|
||||||
for common_type in commontypes:
|
|
||||||
s1 = package_parameters.filter(parameter_type=common_type).first().resolved_value_as_string()
|
|
||||||
comp_param = component_parameters.filter(parameter_type=common_type).first()
|
|
||||||
s2 = comp_param.resolved_value_as_string()
|
|
||||||
if s1 == s2:
|
|
||||||
self.stdout.write(f'\tParameter {common_type.parameter_name} is the same value for component and package: {s1}. Removing from component')
|
|
||||||
if not options['dry_run']:
|
|
||||||
comp_param.delete()
|
|
||||||
else:
|
|
||||||
self.stderr.write(f'\tParameter {common_type.parameter_name} is set on component {str(component)} and its package with different values: "{s1}" vs "{s2}"')
|
|
@ -1,49 +0,0 @@
|
|||||||
# Generated by Django 5.1.3 on 2024-11-19 20:26
|
|
||||||
|
|
||||||
import django.db.models.deletion
|
|
||||||
import uuid
|
|
||||||
from django.db import migrations, models
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
|
|
||||||
dependencies = [
|
|
||||||
("parts", "0012_storage_verbose_name"),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.CreateModel(
|
|
||||||
name="PackageParameter",
|
|
||||||
fields=[
|
|
||||||
(
|
|
||||||
"id",
|
|
||||||
models.UUIDField(
|
|
||||||
default=uuid.uuid4,
|
|
||||||
editable=False,
|
|
||||||
primary_key=True,
|
|
||||||
serialize=False,
|
|
||||||
unique=True,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
("value", models.FloatField(default=0)),
|
|
||||||
("text_value", models.TextField(blank=True)),
|
|
||||||
(
|
|
||||||
"package",
|
|
||||||
models.ForeignKey(
|
|
||||||
on_delete=django.db.models.deletion.CASCADE, to="parts.package"
|
|
||||||
),
|
|
||||||
),
|
|
||||||
(
|
|
||||||
"parameter_type",
|
|
||||||
models.ForeignKey(
|
|
||||||
on_delete=django.db.models.deletion.CASCADE,
|
|
||||||
to="parts.componentparametertype",
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
options={
|
|
||||||
"ordering": ["id"],
|
|
||||||
"unique_together": {("package", "parameter_type")},
|
|
||||||
},
|
|
||||||
),
|
|
||||||
]
|
|
@ -238,25 +238,24 @@ class Component(models.Model):
|
|||||||
sum = 0
|
sum = 0
|
||||||
return sum
|
return sum
|
||||||
|
|
||||||
class AbstractParameter(models.Model):
|
|
||||||
class Meta:
|
|
||||||
abstract = True
|
|
||||||
|
|
||||||
|
class ComponentParameter(models.Model):
|
||||||
|
class Meta:
|
||||||
|
unique_together = ('component', 'parameter_type')
|
||||||
|
ordering = ['id']
|
||||||
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False, unique=True)
|
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False, unique=True)
|
||||||
|
component = models.ForeignKey(Component, on_delete=models.CASCADE) # A target component is required!
|
||||||
parameter_type = models.ForeignKey(ComponentParameterType, on_delete=models.CASCADE)
|
parameter_type = models.ForeignKey(ComponentParameterType, on_delete=models.CASCADE)
|
||||||
value = models.FloatField(default=0)
|
value = models.FloatField(default=0)
|
||||||
text_value = models.TextField(null=False, blank=True)
|
text_value = models.TextField(null=False, blank=True)
|
||||||
|
|
||||||
def _get_object_of_param(self):
|
|
||||||
return None
|
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
if self.parameter_type.parameter_type == 'F':
|
if self.parameter_type.parameter_type == 'F':
|
||||||
value = self.text_value
|
value = self.text_value
|
||||||
else:
|
else:
|
||||||
value = str(self.value)
|
value = str(self.value)
|
||||||
|
|
||||||
return str(self._get_object_of_param())+ ': '+ str(self.parameter_type) + ': ' + value
|
return str(self.component)+ ': '+ str(self.parameter_type) + ': ' + value
|
||||||
|
|
||||||
def resolved_value_as_string(self):
|
def resolved_value_as_string(self):
|
||||||
my_type = self.parameter_type.parameter_type
|
my_type = self.parameter_type.parameter_type
|
||||||
@ -271,24 +270,6 @@ class AbstractParameter(models.Model):
|
|||||||
elif my_type == 'F':
|
elif my_type == 'F':
|
||||||
return self.text_value
|
return self.text_value
|
||||||
|
|
||||||
class ComponentParameter(AbstractParameter):
|
|
||||||
class Meta:
|
|
||||||
unique_together = ('component', 'parameter_type')
|
|
||||||
ordering = ['id']
|
|
||||||
component = models.ForeignKey(Component, on_delete=models.CASCADE) # A target component is required!
|
|
||||||
|
|
||||||
def _get_object_of_param(self):
|
|
||||||
return self.component
|
|
||||||
|
|
||||||
class PackageParameter(AbstractParameter):
|
|
||||||
class Meta:
|
|
||||||
unique_together = ('package', 'parameter_type')
|
|
||||||
ordering = ['id']
|
|
||||||
package = models.ForeignKey(Package, on_delete=models.CASCADE)
|
|
||||||
|
|
||||||
def _get_object_of_param(self):
|
|
||||||
return self.package
|
|
||||||
|
|
||||||
class Stock(models.Model):
|
class Stock(models.Model):
|
||||||
class Meta:
|
class Meta:
|
||||||
unique_together = ('component', 'storage')
|
unique_together = ('component', 'storage')
|
||||||
@ -395,6 +376,12 @@ def auto_apply_template_structure(sender, instance, created, **kwargs):
|
|||||||
If there are nested sub-storages these will be added when the sub-storages
|
If there are nested sub-storages these will be added when the sub-storages
|
||||||
are created automatically.
|
are created automatically.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
# Skip recursion if the model is saved 'raw' e.g. when imported
|
||||||
|
if 'raw' in kwargs:
|
||||||
|
if kwargs['raw']:
|
||||||
|
return
|
||||||
|
|
||||||
if created:
|
if created:
|
||||||
if instance.template:
|
if instance.template:
|
||||||
for sub_storage in instance.template.storage_set.all():
|
for sub_storage in instance.template.storage_set.all():
|
||||||
|
@ -8,7 +8,7 @@ from django.db.models import Q
|
|||||||
from django.forms import formset_factory
|
from django.forms import formset_factory
|
||||||
from django.db import IntegrityError
|
from django.db import IntegrityError
|
||||||
from django.db.models import ProtectedError
|
from django.db.models import ProtectedError
|
||||||
from ..models import Stock, Component, ComponentParameter, DistributorNum, PackageParameter
|
from ..models import Stock, Component, ComponentParameter, DistributorNum
|
||||||
from ..forms import *
|
from ..forms import *
|
||||||
from .component_import import import_components_from_csv
|
from .component_import import import_components_from_csv
|
||||||
from .generic_views import BaseTemplateMixin
|
from .generic_views import BaseTemplateMixin
|
||||||
@ -174,8 +174,6 @@ class ComponentDetailView(LoginRequiredMixin, BaseTemplateMixin, DetailView):
|
|||||||
'distributor__name')
|
'distributor__name')
|
||||||
context['parameters'] = ComponentParameter.objects.filter(component=self.object).order_by(
|
context['parameters'] = ComponentParameter.objects.filter(component=self.object).order_by(
|
||||||
'parameter_type__parameter_name')
|
'parameter_type__parameter_name')
|
||||||
context['package_parameters'] = PackageParameter.objects.filter(package=self.object.package).order_by(
|
|
||||||
'parameter_type__parameter_name')
|
|
||||||
|
|
||||||
return context
|
return context
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ from django.core.paginator import Paginator
|
|||||||
from django.db.models import ProtectedError
|
from django.db.models import ProtectedError
|
||||||
from django.db.models import Q
|
from django.db.models import Q
|
||||||
from ..forms import *
|
from ..forms import *
|
||||||
from ..models import Package, PackageParameter
|
from ..models import Package
|
||||||
from .generic_views import BaseTemplateMixin
|
from .generic_views import BaseTemplateMixin
|
||||||
|
|
||||||
class PackageView(LoginRequiredMixin, BaseTemplateMixin, TemplateView):
|
class PackageView(LoginRequiredMixin, BaseTemplateMixin, TemplateView):
|
||||||
@ -82,9 +82,6 @@ class PackageDetailView(LoginRequiredMixin, BaseTemplateMixin, DetailView):
|
|||||||
context = super().get_context_data(**kwargs)
|
context = super().get_context_data(**kwargs)
|
||||||
context['package'] = self.object
|
context['package'] = self.object
|
||||||
context['edit_form'] = PackageForm(instance=self.object)
|
context['edit_form'] = PackageForm(instance=self.object)
|
||||||
context['new_param_form'] = PackageParameterCreateForm()
|
|
||||||
context['parameters'] = PackageParameter.objects.filter(package=self.object).order_by(
|
|
||||||
'parameter_type__parameter_name')
|
|
||||||
|
|
||||||
return context
|
return context
|
||||||
|
|
||||||
@ -120,27 +117,6 @@ class PackageDetailView(LoginRequiredMixin, BaseTemplateMixin, DetailView):
|
|||||||
context['edit_form'] = edit_form
|
context['edit_form'] = edit_form
|
||||||
return self.render_to_response(context)
|
return self.render_to_response(context)
|
||||||
|
|
||||||
def handle_submit_delete_param_post(self, request, **kwargs):
|
|
||||||
form = PackageParameterDeleteForm(data=request.POST)
|
|
||||||
if form.is_valid():
|
|
||||||
form.cleaned_data['param_num'].delete()
|
|
||||||
|
|
||||||
context = self.get_context_data(**kwargs)
|
|
||||||
return self.render_to_response(context)
|
|
||||||
|
|
||||||
def handle_submit_new_param_post(self, request, **kwargs):
|
|
||||||
form = PackageParameterCreateForm(data=request.POST)
|
|
||||||
|
|
||||||
if form.is_valid():
|
|
||||||
try:
|
|
||||||
form.save(self.object)
|
|
||||||
except IntegrityError:
|
|
||||||
form.add_error('__all__', 'This parameter is already set')
|
|
||||||
context = self.get_context_data(**kwargs)
|
|
||||||
if not form.is_valid():
|
|
||||||
context['new_param_form'] = form
|
|
||||||
return self.render_to_response(context)
|
|
||||||
|
|
||||||
def post(self, request, *args, **kwargs):
|
def post(self, request, *args, **kwargs):
|
||||||
self.object = self.get_object()
|
self.object = self.get_object()
|
||||||
|
|
||||||
@ -148,9 +124,5 @@ class PackageDetailView(LoginRequiredMixin, BaseTemplateMixin, DetailView):
|
|||||||
return self.handle_delete_package(request)
|
return self.handle_delete_package(request)
|
||||||
elif 'submit-pkg-edit' in request.POST:
|
elif 'submit-pkg-edit' in request.POST:
|
||||||
return self.edit_package(request)
|
return self.edit_package(request)
|
||||||
elif 'submit-delete-param' in request.POST:
|
|
||||||
return self.handle_submit_delete_param_post(request, **kwargs)
|
|
||||||
elif 'submit-create-new-param' in request.POST:
|
|
||||||
return self.handle_submit_new_param_post(request, **kwargs)
|
|
||||||
|
|
||||||
return super().post(request, *args, **kwargs)
|
return super().post(request, *args, **kwargs)
|
@ -119,19 +119,6 @@
|
|||||||
<th scope="col"></th>
|
<th scope="col"></th>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for param in package_parameters %}
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<h6 {% if param.parameter_type.parameter_description %} class="accordion-header" data-bs-toggle="collapse" data-bs-target="#collapse-pkg-parameter-desc-{{forloop.counter}}"{% endif %}>
|
|
||||||
{{param.parameter_type.parameter_name}}
|
|
||||||
</h6>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
{{param.resolved_value_as_string}}
|
|
||||||
</td>
|
|
||||||
<td><span class="text-info">from Package</span></td>
|
|
||||||
</tr>
|
|
||||||
{% endfor %}
|
|
||||||
{% for param in parameters %}
|
{% for param in parameters %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
@ -161,13 +148,6 @@
|
|||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% for param in package_parameters %}
|
|
||||||
{% if param.parameter_type.parameter_description %}
|
|
||||||
<div class="collapse accordion-collapse" id="collapse-pkg-parameter-desc-{{forloop.counter}}" data-bs-parent="#accordion-param-desc">
|
|
||||||
{{param.parameter_type.parameter_description}}
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
|
@ -26,46 +26,6 @@
|
|||||||
<input type="submit" class="btn btn-primary" value="Save" name="submit-pkg-edit">
|
<input type="submit" class="btn btn-primary" value="Save" name="submit-pkg-edit">
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-3">
|
|
||||||
<h3>Parameters <button class="btn btn-success" data-bs-toggle="modal" data-bs-target="#new-component-parameter-modal"><i class="bi bi-plus-circle"></i></button></h3>
|
|
||||||
<table class="table align-middle mb-3">
|
|
||||||
<thead>
|
|
||||||
<th scope="col">Parameter</th>
|
|
||||||
<th scope="col">Value</th>
|
|
||||||
<th scope="col"></th>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
{% for param in parameters %}
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<h6 {% if param.parameter_type.parameter_description %} class="accordion-header" data-bs-toggle="collapse" data-bs-target="#collapse-parameter-desc-{{forloop.counter}}"{% endif %}>
|
|
||||||
{{param.parameter_type.parameter_name}}
|
|
||||||
</h6>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
{{param.resolved_value_as_string}}
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<form method="post">
|
|
||||||
{% csrf_token %}
|
|
||||||
<input type="hidden" value="{{param.id}}" name="param_num">
|
|
||||||
<button class="btn btn-danger" name="submit-delete-param">X</button>
|
|
||||||
</form>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
{% endfor %}
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
<div class="accordion" id="accordion-param-desc">
|
|
||||||
{% for param in parameters %}
|
|
||||||
{% if param.parameter_type.parameter_description %}
|
|
||||||
<div class="collapse accordion-collapse" id="collapse-parameter-desc-{{forloop.counter}}" data-bs-parent="#accordion-param-desc">
|
|
||||||
{{param.parameter_type.parameter_description}}
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -120,7 +80,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% include 'parts/modals/new-component-parameter-modal.html' with component_name=object.name form=new_param_form %}
|
|
||||||
|
|
||||||
{% endblock content %}
|
{% endblock content %}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user