mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-04 07:24:34 +02:00
Made EDA form for parts prettier
This commit is contained in:
parent
168b4f6c15
commit
b5c7a789a2
7 changed files with 1592 additions and 1436 deletions
|
@ -31,20 +31,59 @@ use Symfony\Component\Form\Extension\Core\Type\TextType;
|
|||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
use function Symfony\Component\Translation\t;
|
||||
|
||||
class EDAPartInfoType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
->add('reference_prefix', TextType::class)
|
||||
->add('value', TextType::class)
|
||||
->add('invisible', TriStateCheckboxType::class)
|
||||
->add('exclude_from_bom', TriStateCheckboxType::class)
|
||||
->add('exclude_from_board', TriStateCheckboxType::class)
|
||||
->add('exclude_from_sim', TriStateCheckboxType::class)
|
||||
->add('kicad_symbol', TextType::class)
|
||||
->add('kicad_footprint', TextType::class)
|
||||
;
|
||||
->add('reference_prefix', TextType::class, [
|
||||
'label' => 'eda_info.reference_prefix',
|
||||
'attr' => [
|
||||
'placeholder' => t('eda_info.reference_prefix.placeholder'),
|
||||
]
|
||||
]
|
||||
)
|
||||
->add('value', TextType::class, [
|
||||
'label' => 'eda_info.value',
|
||||
'attr' => [
|
||||
'placeholder' => t('eda_info.value.placeholder'),
|
||||
]
|
||||
])
|
||||
->add('invisible', TriStateCheckboxType::class, [
|
||||
'label' => 'eda_info.invisible',
|
||||
])
|
||||
->add('exclude_from_bom', TriStateCheckboxType::class, [
|
||||
'label' => 'eda_info.exclude_from_bom',
|
||||
'label_attr' => [
|
||||
'class' => 'checkbox-inline'
|
||||
]
|
||||
])
|
||||
->add('exclude_from_board', TriStateCheckboxType::class, [
|
||||
'label' => 'eda_info.exclude_from_board',
|
||||
'label_attr' => [
|
||||
'class' => 'checkbox-inline'
|
||||
]
|
||||
])
|
||||
->add('exclude_from_sim', TriStateCheckboxType::class, [
|
||||
'label' => 'eda_info.exclude_from_sim',
|
||||
'label_attr' => [
|
||||
'class' => 'checkbox-inline'
|
||||
]
|
||||
])
|
||||
->add('kicad_symbol', TextType::class, [
|
||||
'label' => 'eda_info.kicad_symbol',
|
||||
'attr' => [
|
||||
'placeholder' => t('eda_info.kicad_symbol.placeholder'),
|
||||
]
|
||||
])
|
||||
->add('kicad_footprint', TextType::class, [
|
||||
'label' => 'eda_info.kicad_footprint',
|
||||
'attr' => [
|
||||
'placeholder' => t('eda_info.kicad_footprint.placeholder'),
|
||||
]
|
||||
]);
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
|
|
|
@ -130,7 +130,7 @@ class KiCADHelper
|
|||
"symbolIdStr" => $part->getEdaInfo()->getKicadSymbol() ?? $part->getCategory()?->getEdaInfo()->getKicadSymbol() ?? "",
|
||||
"exclude_from_bom" => $this->boolToKicadBool($part->getEdaInfo()->getExcludeFromBom() ?? $part->getCategory()?->getEdaInfo()->getExcludeFromBom() ?? false),
|
||||
"exclude_from_board" => $this->boolToKicadBool($part->getEdaInfo()->getExcludeFromBoard() ?? $part->getCategory()?->getEdaInfo()->getExcludeFromBoard() ?? false),
|
||||
"exclude_from_sim" => $this->boolToKicadBool($part->getEdaInfo()->getExcludeFromSim() ?? $part->getCategory()?->getEdaInfo()->getExcludeFromSim() ?? false),
|
||||
"exclude_from_sim" => $this->boolToKicadBool($part->getEdaInfo()->getExcludeFromSim() ?? $part->getCategory()?->getEdaInfo()->getExcludeFromSim() ?? true),
|
||||
"fields" => []
|
||||
];
|
||||
|
||||
|
|
24
templates/parts/edit/_eda.html.twig
Normal file
24
templates/parts/edit/_eda.html.twig
Normal file
|
@ -0,0 +1,24 @@
|
|||
{{ form_row(form.eda_info.reference_prefix) }}
|
||||
{{ form_row(form.eda_info.value) }}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-9 offset-sm-3">
|
||||
{{ form_row(form.eda_info.invisible) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-9 offset-sm-3">
|
||||
{{ form_widget(form.eda_info.exclude_from_bom) }}
|
||||
{{ form_widget(form.eda_info.exclude_from_board) }}
|
||||
{{ form_widget(form.eda_info.exclude_from_sim) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-9 offset-sm-3">
|
||||
<h6>{% trans %}eda_info.kicad_section.title{% endtrans %}:</h6>
|
||||
</div>
|
||||
</div>
|
||||
{{ form_row(form.eda_info.kicad_symbol) }}
|
||||
{{ form_row(form.eda_info.kicad_footprint) }}
|
|
@ -64,6 +64,12 @@
|
|||
{% trans %}part.edit.tab.associations{% endtrans %}
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-bs-toggle="tab" role="tab" href="#eda">
|
||||
<i class="fas fa-compass-drafting fa-fw"></i>
|
||||
{% trans %}part.edit.tab.eda{% endtrans %}
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-bs-toggle="tab" role="tab" href="#comment">
|
||||
<i class="fas fa-sticky-note fa-fw"></i>
|
||||
|
@ -99,6 +105,9 @@
|
|||
<div class="tab-pane fade p-2" id="associations" role="tabpanel">
|
||||
{% include "parts/edit/_associated_parts.html.twig" %}
|
||||
</div>
|
||||
<div class="tab-pane fade p-2" id="eda" role="tabpanel">
|
||||
{% include "parts/edit/_eda.html.twig" %}
|
||||
</div>
|
||||
<div class="tab-pane fade p-2" id="comment" role="tabpanel">
|
||||
{{ form_widget(form.comment)}}
|
||||
</div>
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -2,13 +2,13 @@
|
|||
<xliff xmlns="urn:oasis:names:tc:xliff:document:2.0" version="2.0" srcLang="en" trgLang="en">
|
||||
<file id="security.en">
|
||||
<unit id="aazoCks" name="user.login_error.user_disabled">
|
||||
<segment state="translated">
|
||||
<segment>
|
||||
<source>user.login_error.user_disabled</source>
|
||||
<target>Your account is disabled! Contact an administrator if you think this is wrong.</target>
|
||||
</segment>
|
||||
</unit>
|
||||
<unit id="Dpb9AmY" name="saml.error.cannot_login_local_user_per_saml">
|
||||
<segment state="translated">
|
||||
<segment>
|
||||
<source>saml.error.cannot_login_local_user_per_saml</source>
|
||||
<target>You cannot login as local user via SSO! Use your local user password instead.</target>
|
||||
</segment>
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
<note priority="1">Part-DB1\src\Entity\UserSystem\Group.php:0</note>
|
||||
<note priority="1">Part-DB1\src\Entity\UserSystem\User.php:0</note>
|
||||
</notes>
|
||||
<segment state="translated">
|
||||
<segment>
|
||||
<source>part.master_attachment.must_be_picture</source>
|
||||
<target>The preview attachment must be a valid picture!</target>
|
||||
</segment>
|
||||
|
@ -82,7 +82,7 @@
|
|||
<note priority="1">src\Entity\StructuralDBElement.php:0</note>
|
||||
<note priority="1">src\Entity\Supplier.php:0</note>
|
||||
</notes>
|
||||
<segment state="translated">
|
||||
<segment>
|
||||
<source>structural.entity.unique_name</source>
|
||||
<target>An element with this name already exists on this level!</target>
|
||||
</segment>
|
||||
|
@ -102,7 +102,7 @@
|
|||
<note category="file-source" priority="1">Part-DB1\src\Entity\Parameters\StorelocationParameter.php:0</note>
|
||||
<note category="file-source" priority="1">Part-DB1\src\Entity\Parameters\SupplierParameter.php:0</note>
|
||||
</notes>
|
||||
<segment state="translated">
|
||||
<segment>
|
||||
<source>parameters.validator.min_lesser_typical</source>
|
||||
<target>Value must be lesser or equal the the typical value ({{ compared_value }}).</target>
|
||||
</segment>
|
||||
|
@ -122,7 +122,7 @@
|
|||
<note category="file-source" priority="1">Part-DB1\src\Entity\Parameters\StorelocationParameter.php:0</note>
|
||||
<note category="file-source" priority="1">Part-DB1\src\Entity\Parameters\SupplierParameter.php:0</note>
|
||||
</notes>
|
||||
<segment state="translated">
|
||||
<segment>
|
||||
<source>parameters.validator.min_lesser_max</source>
|
||||
<target>Value must be lesser than the maximum value ({{ compared_value }}).</target>
|
||||
</segment>
|
||||
|
@ -142,7 +142,7 @@
|
|||
<note category="file-source" priority="1">Part-DB1\src\Entity\Parameters\StorelocationParameter.php:0</note>
|
||||
<note category="file-source" priority="1">Part-DB1\src\Entity\Parameters\SupplierParameter.php:0</note>
|
||||
</notes>
|
||||
<segment state="translated">
|
||||
<segment>
|
||||
<source>parameters.validator.max_greater_typical</source>
|
||||
<target>Value must be greater or equal than the typical value ({{ compared_value }}).</target>
|
||||
</segment>
|
||||
|
@ -152,7 +152,7 @@
|
|||
<note category="file-source" priority="1">Part-DB1\src\Entity\UserSystem\User.php:0</note>
|
||||
<note priority="1">Part-DB1\src\Entity\UserSystem\User.php:0</note>
|
||||
</notes>
|
||||
<segment state="translated">
|
||||
<segment>
|
||||
<source>validator.user.username_already_used</source>
|
||||
<target>A user with this name is already exisiting</target>
|
||||
</segment>
|
||||
|
@ -162,7 +162,7 @@
|
|||
<note category="file-source" priority="1">Part-DB1\src\Entity\UserSystem\User.php:0</note>
|
||||
<note priority="1">Part-DB1\src\Entity\UserSystem\User.php:0</note>
|
||||
</notes>
|
||||
<segment state="translated">
|
||||
<segment>
|
||||
<source>user.invalid_username</source>
|
||||
<target>The username must contain only letters, numbers, underscores, dots, pluses or minuses!</target>
|
||||
</segment>
|
||||
|
@ -171,7 +171,7 @@
|
|||
<notes>
|
||||
<note category="state" priority="1">obsolete</note>
|
||||
</notes>
|
||||
<segment state="translated">
|
||||
<segment>
|
||||
<source>validator.noneofitschild.self</source>
|
||||
<target>An element can not be its own parent!</target>
|
||||
</segment>
|
||||
|
@ -180,163 +180,163 @@
|
|||
<notes>
|
||||
<note category="state" priority="1">obsolete</note>
|
||||
</notes>
|
||||
<segment state="translated">
|
||||
<segment>
|
||||
<source>validator.noneofitschild.children</source>
|
||||
<target>You can not assign children element as parent (This would cause loops)!</target>
|
||||
</segment>
|
||||
</unit>
|
||||
<unit id="ayNr6QK" name="validator.select_valid_category">
|
||||
<segment state="translated">
|
||||
<segment>
|
||||
<source>validator.select_valid_category</source>
|
||||
<target>Please select a valid category!</target>
|
||||
</segment>
|
||||
</unit>
|
||||
<unit id="6vIlN5q" name="validator.part_lot.only_existing">
|
||||
<segment state="translated">
|
||||
<segment>
|
||||
<source>validator.part_lot.only_existing</source>
|
||||
<target>Can not add new parts to this location as it is marked as "Only Existing"</target>
|
||||
</segment>
|
||||
</unit>
|
||||
<unit id="3xoKOIS" name="validator.part_lot.location_full.no_increase">
|
||||
<segment state="translated">
|
||||
<segment>
|
||||
<source>validator.part_lot.location_full.no_increase</source>
|
||||
<target>Location is full. Amount can not be increased (new value must be smaller than {{ old_amount }}).</target>
|
||||
</segment>
|
||||
</unit>
|
||||
<unit id="R6Ov4Yt" name="validator.part_lot.location_full">
|
||||
<segment state="translated">
|
||||
<segment>
|
||||
<source>validator.part_lot.location_full</source>
|
||||
<target>Location is full. Can not add new parts to it.</target>
|
||||
</segment>
|
||||
</unit>
|
||||
<unit id="BNQk2e7" name="validator.part_lot.single_part">
|
||||
<segment state="translated">
|
||||
<segment>
|
||||
<source>validator.part_lot.single_part</source>
|
||||
<target>This location can only contain a single part and it is already full!</target>
|
||||
</segment>
|
||||
</unit>
|
||||
<unit id="4gPskOG" name="validator.attachment.must_not_be_null">
|
||||
<segment state="translated">
|
||||
<segment>
|
||||
<source>validator.attachment.must_not_be_null</source>
|
||||
<target>You must select an attachment type!</target>
|
||||
</segment>
|
||||
</unit>
|
||||
<unit id="cDDVrWT" name="validator.orderdetail.supplier_must_not_be_null">
|
||||
<segment state="translated">
|
||||
<segment>
|
||||
<source>validator.orderdetail.supplier_must_not_be_null</source>
|
||||
<target>You must select an supplier!</target>
|
||||
</segment>
|
||||
</unit>
|
||||
<unit id="k5DDdB4" name="validator.measurement_unit.use_si_prefix_needs_unit">
|
||||
<segment state="translated">
|
||||
<segment>
|
||||
<source>validator.measurement_unit.use_si_prefix_needs_unit</source>
|
||||
<target>To enable SI prefixes, you have to set a unit symbol!</target>
|
||||
</segment>
|
||||
</unit>
|
||||
<unit id="DuzIOCr" name="part.ipn.must_be_unique">
|
||||
<segment state="translated">
|
||||
<segment>
|
||||
<source>part.ipn.must_be_unique</source>
|
||||
<target>The internal part number must be unique. {{ value }} is already in use!</target>
|
||||
</segment>
|
||||
</unit>
|
||||
<unit id="Z4Kuuo2" name="validator.project.bom_entry.name_or_part_needed">
|
||||
<segment state="translated">
|
||||
<segment>
|
||||
<source>validator.project.bom_entry.name_or_part_needed</source>
|
||||
<target>You have to choose a part for a part BOM entry or set a name for a non-part BOM entry.</target>
|
||||
</segment>
|
||||
</unit>
|
||||
<unit id="WF_v4ih" name="project.bom_entry.name_already_in_bom">
|
||||
<segment state="translated">
|
||||
<segment>
|
||||
<source>project.bom_entry.name_already_in_bom</source>
|
||||
<target>There is already an BOM entry with this name!</target>
|
||||
</segment>
|
||||
</unit>
|
||||
<unit id="5v4p85H" name="project.bom_entry.part_already_in_bom">
|
||||
<segment state="translated">
|
||||
<segment>
|
||||
<source>project.bom_entry.part_already_in_bom</source>
|
||||
<target>This part already exists in the BOM!</target>
|
||||
</segment>
|
||||
</unit>
|
||||
<unit id="3lM32Tw" name="project.bom_entry.mountnames_quantity_mismatch">
|
||||
<segment state="translated">
|
||||
<segment>
|
||||
<source>project.bom_entry.mountnames_quantity_mismatch</source>
|
||||
<target>The number of mountnames has to match the BOMs quantity!</target>
|
||||
</segment>
|
||||
</unit>
|
||||
<unit id="x47D5WT" name="project.bom_entry.can_not_add_own_builds_part">
|
||||
<segment state="translated">
|
||||
<segment>
|
||||
<source>project.bom_entry.can_not_add_own_builds_part</source>
|
||||
<target>You can not add a project's own builds part to the BOM.</target>
|
||||
</segment>
|
||||
</unit>
|
||||
<unit id="2x2XDI_" name="project.bom_has_to_include_all_subelement_parts">
|
||||
<segment state="translated">
|
||||
<segment>
|
||||
<source>project.bom_has_to_include_all_subelement_parts</source>
|
||||
<target>The project BOM has to include all subprojects builds parts. Part %part_name% of project %project_name% missing!</target>
|
||||
</segment>
|
||||
</unit>
|
||||
<unit id="U9b1EzD" name="project.bom_entry.price_not_allowed_on_parts">
|
||||
<segment state="translated">
|
||||
<segment>
|
||||
<source>project.bom_entry.price_not_allowed_on_parts</source>
|
||||
<target>Prices are not allowed on BOM entries associated with a part. Define the price on the part instead.</target>
|
||||
</segment>
|
||||
</unit>
|
||||
<unit id="ID056SR" name="validator.project_build.lot_bigger_than_needed">
|
||||
<segment state="translated">
|
||||
<segment>
|
||||
<source>validator.project_build.lot_bigger_than_needed</source>
|
||||
<target>You have selected more quantity to withdraw than needed! Remove unnecessary quantity.</target>
|
||||
</segment>
|
||||
</unit>
|
||||
<unit id="6hV5UqD" name="validator.project_build.lot_smaller_than_needed">
|
||||
<segment state="translated">
|
||||
<segment>
|
||||
<source>validator.project_build.lot_smaller_than_needed</source>
|
||||
<target>You have selected less quantity to withdraw than needed for the build! Add additional quantity.</target>
|
||||
</segment>
|
||||
</unit>
|
||||
<unit id="G9ZKt.4" name="part.name.must_match_category_regex">
|
||||
<segment state="translated">
|
||||
<segment>
|
||||
<source>part.name.must_match_category_regex</source>
|
||||
<target>The part name does not match the regular expression stated by the category: %regex%</target>
|
||||
</segment>
|
||||
</unit>
|
||||
<unit id="m8kMFhf" name="validator.attachment.name_not_blank">
|
||||
<segment state="translated">
|
||||
<segment>
|
||||
<source>validator.attachment.name_not_blank</source>
|
||||
<target>Set a value here, or upload a file to automatically use its filename as name for the attachment.</target>
|
||||
</segment>
|
||||
</unit>
|
||||
<unit id="nwGaNBW" name="validator.part_lot.owner_must_match_storage_location_owner">
|
||||
<segment state="translated">
|
||||
<segment>
|
||||
<source>validator.part_lot.owner_must_match_storage_location_owner</source>
|
||||
<target>The owner of this lot must match the owner of the selected storage location (%owner_name%)!</target>
|
||||
</segment>
|
||||
</unit>
|
||||
<unit id="HXSz3nQ" name="validator.part_lot.owner_must_not_be_anonymous">
|
||||
<segment state="translated">
|
||||
<segment>
|
||||
<source>validator.part_lot.owner_must_not_be_anonymous</source>
|
||||
<target>A lot owner must not be the anonymous user!</target>
|
||||
</segment>
|
||||
</unit>
|
||||
<unit id="N8aA0Uh" name="validator.part_association.must_set_an_value_if_type_is_other">
|
||||
<segment state="translated">
|
||||
<segment>
|
||||
<source>validator.part_association.must_set_an_value_if_type_is_other</source>
|
||||
<target>If you set the type to "other", then you have to set a descriptive value for it!</target>
|
||||
</segment>
|
||||
</unit>
|
||||
<unit id="9VYNZ4v" name="validator.part_association.part_cannot_be_associated_with_itself">
|
||||
<segment state="translated">
|
||||
<segment>
|
||||
<source>validator.part_association.part_cannot_be_associated_with_itself</source>
|
||||
<target>A part can not be associated with itself!</target>
|
||||
</segment>
|
||||
</unit>
|
||||
<unit id="csc1PNn" name="validator.part_association.already_exists">
|
||||
<segment state="translated">
|
||||
<segment>
|
||||
<source>validator.part_association.already_exists</source>
|
||||
<target>The association with this part already exists!</target>
|
||||
</segment>
|
||||
</unit>
|
||||
<unit id="sfW4NYE" name="validator.part_lot.vendor_barcode_must_be_unique">
|
||||
<segment state="translated">
|
||||
<segment>
|
||||
<source>validator.part_lot.vendor_barcode_must_be_unique</source>
|
||||
<target>This vendor barcode value was already used in another lot. The barcode must be unique!</target>
|
||||
</segment>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue