انتقل إلى المحتوى

وحدة:بطاقة/قالب/طعام

من ويكيبيديا، الموسوعة الحرة

-- Credits:
-- Developer : وهراني @arwiki (وحدة:بطاقة/قالب/طعام)
-- Version: 20240413

local generic = require( 'وحدة:بطاقة/أدوات' )

return  {
    maincolor = '#FFCC66',
	wikimod = 'Wikidata.Ca',
    parts = {
		generic.title({icon='mets'}),
		generic.native_name({property = 'P1476 OR P1705'}),
		generic.mainimage(),
       {type = 'table', title = 'معلومات عامة', rows = {
            {type = 'row' , label = 'اسم آخر',
            	value = {'أسماء_أخرى','alternate_name','اسم آخر'}, 
            	wikidata = {property = 'P2561' 
					, qualifier='P276'
					, formatting = 'table', rowformat='* $0$R0 $1'
					, rowsubformat1='<br/><small>($1)</small>'}
            },
            {type = 'row' , label = 'المنشأ', 
                value = {'منشأ','المكان الأصلي','country','دولة'},
                wikidata = {property = 'P495 OR P1071'}
            },
            {type = 'row' , label = 'ينتج من', 
                value = {'ينتج من'}, 
                wikidata = {property = 'P1582'}
            },
            {type = 'row' , label = 'المنطقة' , 
                value = {'منطقة','region'}, 
                wikidata = {property = 'P131'}
            },
            {type = 'row' , label = 'بلد المطبخ' , 
                    value = {'بلد_المطبخ','national_cuisine'}, 
                    wikidata = {property = 'P2012 OR P361'}
            },
            {type = 'row' , label = 'المبتكر' , 
                    value = {'مبتكر','creator','المبتكر'}, 
                    wikidata = {property = 'P61 OR P170'}
            },
            {type = 'row' , label = 'تاريخ الابتكار' , 
                    value = {'السنة','year','الابتكار'}, 
                    wikidata = {property = 'P571 OR P575 OR P580'}
            },
            {type = 'row' , label = 'شهادة المنتج' , 
                    value = {'شهادة','certification'}, 
                    wikidata = {property = 'P1389'}
            },
            {type = 'row' , label = 'مدة الطبخ' , 
                    value = {'مدة1','time1','مدة الطبخ'}
            },
            {type = 'row' , label = 'طريقة الطبخ'  
                    , value = {'طريقة','method'}
                    , wikidata= { property = 'P2079', conjunction='<br />',
                    	formatting='table', rowformat='$0$R0 $1', qualifier='P642'}
            },
            {type = 'row' , label = 'الترتيب' , 
            	value = {'الترتيب','course'}, 
            	wikidata= {property = 'P279', formatting='table', rowformat='$0$R0',
                    	whitelist0='Q11942732/Q622440/Q6545590/Q772630/Q182940/Q8486'
                    }
            },
            {type = 'row' , label = 'النوع', 
                    value = {'نوع','type'},  
                    wikidata= {property = 'P279', listrank='bestrank', formatting='table', rowformat='$0$R0',
                    	blacklist0='Q11942732/Q622440/Q6545590/Q772630/Q182940/Q8486'
                    }
            },
            {type = 'row' , label = 'حرارة التقديم' , 
                    value = {'يقدم','served','حرارة التقديم'}, 
                    wikidata = {property = 'P7767'}
            },
            {type = 'row' , label = 'المكونات الرئيسية',  
            	value = {'المكونات','main_ingredient','مكونات'},
                wikidata = { conjunction='<br />',
                	property = 'P527 OR P186' , formatting='table'
                     , qualifier='P518' , qualifier2='P1114'
                     , qualifier3='P1107' , qualifier4='P5102'
                     , rowformat = '* $0$R0 $2$3$4' , rowsubformat2='($2)'
                     , rowsubformat3='<small><br />(بنسبة : $3)</small>'
                     , rowsubformat4='<small><br />($4)</small>'
                     , colformat2='unitcode' , blacklist1 ='Q81727'}
            },
            {type = 'row' , label = 'المكونات الثانوية' , 
                    value = {'المكونات الثانوية','minor_ingredient'}
            },
            {type = 'row' , label = 'تنويعات أخرى' , 
                    value = {'تنويعات','variations'}
            },
            {type = 'row' , label = 'طبق مماثل' , 
                    value = {'طبق_مماثل','similar_dish','طبق مماثل'}, 
            },
            {type = 'row' , label = 'الشكل' , 
                value = {'شكل','shape'}, 
                wikidata = {property = 'P1419'}
            },
            {type = 'row' , label = 'اللون' , 
                value = {'لون','color'}, 
                wikidata = {property = 'P462'}
            },
            {type = 'row' , label = 'معلومات أخرى' , 
                    value = {'أخرى','other'}
            },
            {type = 'row' , label = 'التقديم مع' , 
                    value = {'يقدم مع','التقديم مع'}
            },
            {type = 'row' , label = 'التقديم في' , 
            	value = {'يقدم في','التقديم في'}, 
            	wikidata = { 
                	property='P186' ,qualifier='P518' , qualifier2='P186/P18',
                	formatting='table', rowformat = '$0$R0 $2', 
                	rowsubformat2 = '[[file:$2|50x50px|left]]', 
                	whitelist1 = 'Q81727' 
            	}
            },
            {type = 'row' , label = 'التصنيف' , 
                value = {'التصنيف'}, 
                wikidata = {property = 'P136'}
            },
		}},
		{type='table', title = '[[تغذية|القيمة الغذائية]]', rows = {
            {type = 'row' , label = '[[مؤشر جلايسيمي]]' , 
            value =  function ( localdata )
            	local glycemic_index = localdata['glycemic_index'] or localdata['مؤشر_جلايسيمي']
            	if type(glycemic_index) ~= 'string' and type(glycemic_index) ~= 'number' 
            	   then return nil end
            	 if type(glycemic_index) == 'string' then 
            	 	glycemic_index= tonumber(glycemic_index) 
            	 end
            	 if type(glycemic_index) == 'nil' then return nil end
            	 if(glycemic_index < 56) then 
            	 		return  glycemic_index..'&nbsp;<span style="background-color:#CCFFCC">(Low GI)</span>'
            		elseif(glycemic_index < 56) then 
            			return  glycemic_index..'&nbsp;<span style="background-color:#FFFF99">(Medium GI)</span>'
            	 	else return glycemic_index..'&nbsp;<span style="background-color:#FFCC99">(High GI)</span>'
            	 end
            end
            },
            {type = 'row' , label = 'كمية التقديم' , 
                    value = {'كمية_التقديم','serving_size','كمية التقديم'}
            },
            {type = 'row' , label = 'درجة الحموضة (pH)' , 
                    value = {'درجة_الحموضة','pH'} , 
                    wikidata = {property='P9440'}
            },
            {type = 'row' , label = 'نسبة الكحول' , 
                    value = {'نسبة_كحول','abv','نسبة الكحول'} , 
                    wikidata = {property='P2665'}
            },
            {type = 'row' , label = '[[السعرات الحرارية]]' , 
                    value = {'سعرات','calories'}
            },
            {type = 'row' , label = '[[بروتين|البروتينات]]' , 
                    value = {'بروتين','protein'}
            },
            {type = 'row' , label = '[[دهون|الدهون]]' , 
                    value = {'دهون','fat'}
            },
            {type = 'row' , label = '[[سكريات|الكاربوهيدرات]]' , 
                    value = {'سكريات','كاربوهيدرات','carbohydrate'}
            },
        }},
	   {type = 'table' , title ='التصنيفات' ,rows = {
	        {type = 'row' 
                , label = 'تراث لا مادي'
                , value = {'تراث لا مادي' ,'immaterial heritage'}
                , wikidata = {
                	property='P3259', 
                	qualifier ='P17',
                	formatting='table', 
                	rowformat='$0$R0 $1', rowsubformat1="($1) ",
                	showDate='true'}
	        }
	   }},
    }  -- for parts
} -- for return