Преглед изворни кода

N°1094.2 Portal: Showing "icon" attribute on ServiceFamily and Service levels in "mosaic" mode of "services" BrowseBrick.

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@5038 a333f486-631f-4898-b8df-5754b55c2be0
glajarige пре 7 година
родитељ
комит
d7e96856d9

+ 1 - 1
datamodels/2.x/itop-portal-base/portal/src/views/bricks/browse/mode_mosaic.html.twig

@@ -187,7 +187,7 @@
                 // - Adding stub div
 				var textElem = $('<div></div>').addClass('mosaic-item-text');
                 // - Adding image
-                if( (item.image !== undefined) && (item.image !== '') )
+                if( (item.image !== undefined) && (item.image !== '') && (item.image !== null) )
                 {
                     iItemFlags += 4;
                     aElem.append( $('<div></div>').addClass('mosaic-item-image').append( $('<img />').attr('src', item.image) ) );

+ 13 - 4
datamodels/2.x/itop-portal-base/portal/web/css/portal.scss

@@ -677,10 +677,19 @@ table .group-actions .item-action-wrapper .panel-body > p:last-child{
 	font-size: 1em;
 }
 
-/****************/
-/* - Mosaic mode  */
-/* Note: Some of the CSS is factorised in the "Tree mode" part */
-/****************/
+/****************************************************************/
+/* - Mosaic mode                                                */
+/*                                                              */
+/* Note: Some of the CSS is factorised in the "Tree mode" part  */
+/*                                                              */
+/* Note: .mosaic-item-layout-x classes are for different        */
+/*   presentation modes. Like in binary, add the values to know */
+/*   which class to use.                                        */
+/*   - 1 is for name                                            */
+/*   - 2 is for description                                     */
+/*   - 4 is for image                                           */
+/*   eg. .mosaic-item-layout-5 when just name and image         */
+/****************************************************************/
 #brick_content_mosaic{
   	position: relative;
 	padding: 10px 10px 1px 10px;

+ 4 - 2
datamodels/2.x/itop-tickets/datamodel.itop-tickets.xml

@@ -1067,6 +1067,7 @@
 					<levels>
 						<level id="1">
 							<class>ServiceFamily</class>
+							<image_att>icon</image_att>
 							<levels>
 								<!-- Level IDs must be numeric -->
 								<level id="1">
@@ -1080,10 +1081,10 @@
 									<tooltip_att>description</tooltip_att>
 									<!-- Attribute code of the above class [from the OQL] used to display a small text beside the object's name -->
 									<!-- Note: This is not used in "list" mode -->
-									<description_att/>
+									<description_att>description</description_att>
 									<!-- Attribute code of the above class [from the OQL] used to display a image beside the object's name -->
 									<!-- Note: This is used in "mosaic" mode only for now -->
-									<!--<image_att/>-->
+									<image_att>icon</image_att>
 									<!-- Title of the level, will be display in lists and others browse modes -->
 									<title>Class:Service</title>
 									<!-- Optional tag to add attributes to the table by their code, can be specified for each level -->
@@ -1100,6 +1101,7 @@
 											<parent_att>service_id</parent_att>
 											<name_att/>
 											<tooltip_att>description</tooltip_att>
+											<description_att>description</description_att>
 											<title>Class:ServiceSubcategory</title>
 											<actions>
 												<action id="create_from_this" xsi:type="create_from_this">