N°7644 - Add Brand logo and Model picture (#646)

* Add Brand logo and Model picture

* Add dictionary items for new attributes

* Add Model picture to summary card
This commit is contained in:
Thomas Casteleyn
2024-07-10 10:29:11 +02:00
committed by GitHub
parent ff0f1d8ce9
commit 7b91e9e164
2 changed files with 43 additions and 3 deletions

View File

@@ -4491,6 +4491,9 @@
<attribute id="name"/>
</attributes>
</naming>
<fields_semantic>
<image_attribute>logo</image_attribute>
</fields_semantic>
<style>
<icon/>
</style>
@@ -4509,6 +4512,13 @@
</uniqueness_rules>
</properties>
<fields>
<field id="logo" xsi:type="AttributeImage">
<display_max_width>96</display_max_width>
<display_max_height>96</display_max_height>
<storage_max_width>128</storage_max_width>
<storage_max_height>128</storage_max_height>
<is_null_allowed>true</is_null_allowed>
</field>
<field id="physicaldevices_list" xsi:type="AttributeLinkedSet">
<linked_class>PhysicalDevice</linked_class>
<ext_key_to_me>brand_id</ext_key_to_me>
@@ -4525,9 +4535,12 @@
<item id="name">
<rank>10</rank>
</item>
<item id="physicaldevices_list">
<item id="logo">
<rank>20</rank>
</item>
<item id="physicaldevices_list">
<rank>30</rank>
</item>
</items>
</details>
<search>
@@ -4544,6 +4557,13 @@
</item>
</items>
</list>
<summary>
<items>
<item id="name">
<rank>10</rank>
</item>
</items>
</summary>
</presentation>
</class>
<class id="Model" _delta="define">
@@ -4564,6 +4584,9 @@
<attribute id="type"/>
</complementary_attributes>
</naming>
<fields_semantic>
<image_attribute>picture</image_attribute>
</fields_semantic>
<style>
<icon/>
</style>
@@ -4596,6 +4619,13 @@
<extkey_attcode>brand_id</extkey_attcode>
<target_attcode>name</target_attcode>
</field>
<field id="picture" xsi:type="AttributeImage">
<display_max_width>256</display_max_width>
<display_max_height>256</display_max_height>
<storage_max_width>512</storage_max_width>
<storage_max_height>512</storage_max_height>
<is_null_allowed>true</is_null_allowed>
</field>
<field id="type" xsi:type="AttributeEnum">
<sort_type>label</sort_type>
<values>
@@ -4678,12 +4708,15 @@
<item id="brand_id">
<rank>20</rank>
</item>
<item id="type">
<item id="picture">
<rank>30</rank>
</item>
<item id="physicaldevices_list">
<item id="type">
<rank>40</rank>
</item>
<item id="physicaldevices_list">
<rank>50</rank>
</item>
</items>
</details>
<search>
@@ -4717,6 +4750,9 @@
<item id="type">
<rank>20</rank>
</item>
<item id="picture">
<rank>30</rank>
</item>
</items>
</summary>
</presentation>

View File

@@ -1092,6 +1092,8 @@ Dict::Add('EN US', 'English', 'English', array(
Dict::Add('EN US', 'English', 'English', array(
'Class:Brand' => 'Brand',
'Class:Brand+' => '',
'Class:Brand/Attribute:logo' => 'Logo',
'Class:Brand/Attribute:logo+' => '',
'Class:Brand/Attribute:physicaldevices_list' => 'Physical devices',
'Class:Brand/Attribute:physicaldevices_list+' => 'All the physical devices corresponding to this brand',
'Class:Brand/UniquenessRule:name+' => 'The name must be unique',
@@ -1110,6 +1112,8 @@ Dict::Add('EN US', 'English', 'English', array(
'Class:Model/Attribute:brand_id+' => '',
'Class:Model/Attribute:brand_name' => 'Brand name',
'Class:Model/Attribute:brand_name+' => '',
'Class:Model/Attribute:picture' => 'Picture',
'Class:Model/Attribute:picture+' => '',
'Class:Model/Attribute:type' => 'Device type',
'Class:Model/Attribute:type+' => '',
'Class:Model/Attribute:type/Value:PowerSource' => 'Power Source',