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

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

return {
  maincolor = '#CEDEFF' -- اللون المستعمل لعنوان البطاقة
  , wikimod = 'Wikidata.Ca'
  , parts = { -- محتويات البطاقة
    building.title(),
    {type = 'subtitle', 
        value = function ( localdata )
                    local val = localdata['الاسم الأصلي'] or localdata['اسم اصلي'] or localdata['native_name']
                    if val and localdata['لغة_الاسم_الأصلي']  then
                        return mw.ustring.format('%s <span class="nickname" lang="%s">%s</span>'
                            , val 
                            , localdata['الاسم_باللغة_الاصلية'] or ''
                            , localdata['لغة_الاسم_الأصلي']
                        )
                    end
                    return val
                end,
                wikidata= {property = 'P1559 OR P1476 OR P1448 OR P1705', list = 'notlang', conjunction = "<br />"
                   ,listrank='bestrank' ,formatting = '$text {{Language icon|NoCat=y|$language}}'}
    },

    {
		type = 'images',
		imageparameters =  {'لوحة_الشارع','traffic_sign'},
	--	defaultimage = {},
	--	maintenancecat =
		captionparameter = {'تعليق لوحة الشارع','تعليق_لوحة_الشارع'},
		property = 'P14 OR P1766',
		defaultupright = upright or '0.6',
		uprightparameter = 'upright_traffic_sign',
		sizeparameter = {'traffic_sign_size','عرض_لوحة_الشارع'},
		numval = 1,
	},

    generic.mainimage(),
    generic.locationmap(),
    generic.geoloc(),

    {type = 'table' , title ='التسمية' ,rows = {

		{type = 'row' 
			, label = 'معنى الاسم'
			, value = {'معنى_التسمية','etymology'}
			--, wikidata = {property='P'}
		},
        {type = 'row' , label = 'الاسم نسبة إلى' , 
                value = {'سبب_تسمية','namesake'} , 
                wikidata = {property = 'P138'}
        },
		{type = 'row' 
			, label = 'أسماء أخرى'
			, value = {'أسماء_أخرى','other_name'}
			--, wikidata = {property='P'}
		},

		{type = 'row' 
			, label = 'أسماء سابقة'
			, value = {'أسماء_سابقة','former_names'}
			--, wikidata = {property='P'}
		},
	}},
 	{type = 'table' , title ='معلومات عامة' ,rows = {

		{type = 'row' 
			, label = 'الموقع'
			, value = {'موقع','الموقع','location'}
			, wikidata = {property = 'P276'}
		},
		{type = 'row' 
			, label = 'العنوان'
			, value = {'عنوان','العنوان','address'}
			, wikidata = {property='P6375', list = 2, conjunction = "<br />"
                    ,formatting = '$text {{Language icon|NoCat=y|$language}}'}
		},
		{type = 'row' 
			, label = 'المدينة'
			, value = {'المدينة','location_town','location_city'}
			--, wikidata = {property='P'}
		},
		{type = 'row' 
			, label = 'التقسيم الإداري'
			, value = {'تقسيم','administrative_territorial'}
			, wikidata = {property = 'P131'}
		},
		building.country(),

		{type = 'row' 
			, label = 'المالك'
			, value = {'مالك'}
			--, wikidata = {property='P'}
		},

		{type = 'row' 
			, label = 'مسؤول الصيانة'
			, value = {'مسؤول_الصيانة','maintained_by'}
			, wikidata = {property='P126'}
		},

        {
            type = 'row',
            label = 'الطول',
            value = {'طول','length'},
            wikidata = {property = 'P2043',formatting='unit'},
        },
        {
            type = 'row',
            label = 'العرض',
            value = {'عرض','width'},
            wikidata = {property = 'P2049',formatting='unit'},
        },
		{type = 'row' 
			, label = 'الرمز البريدي'
			, value = {'رمز_بريدي','الرمز_البريدي'}
			, wikidata = {property='P281'}
		},

		{type = 'row' 
			, label = 'أقرب محطة مترو'
			, value = {'مترو'}
			--, wikidata = {property='P'}
		},
		building.coordinates();

		{type = 'row' 
			, label = 'بداية الشارع'
			, value = {'بداية الشارع','beginning'}
			, wikidata = {property='P1427', conjunction='<br />'}
		},
		{type = 'row' 
			, label = 'التقاطعات<br>الرئيسية'
			, value = {'تقاطع'}
			, wikidata = {property='P47', conjunction='<br />'}
		},
		{type = 'row' 
			, label = 'مرتبط بـ'
			, value = {'مرتبط','connects_with','junction'}
			, wikidata = {property='P2789', conjunction='<br />'}
		},
		{type = 'row' 
			, label = 'نهاية الشارع'
			, value = {'نهاية الشارع','terminus','end'}
			, wikidata = {property='P1444', conjunction='<br />'}
		},

    }},
    {type = 'table' , title ='الإنشاءات' ,rows = {
		{type = 'row' 
			, label = 'التكليف بالإنشاء'
			, value = {'تاريخ_تكليف'}
			--, wikidata = {property='P'}
		},
		building.construction(),
		building.opening(),
        building.demolition()

    }},
    {type = 'table' , title ='موقع الشارع' ,rows = {
		{type = 'row' 
			, label = 'الشمال'
			, value = {'شمال','north'}
			--, wikidata = {property='P'}
		},
		{type = 'row' 
			, label = 'الشرق'
			, value = {'شرق','east'}
			--, wikidata = {property='P'}
		},
		{type = 'row' 
			, label = 'الجنوب'
			, value = {'جنوب','south'}
			--, wikidata = {property='P'}
		},
		{type = 'row' 
			, label = 'الغرب'
			, value = {'غرب','west'}
			--, wikidata = {property='P'}
		},

		{type = 'row' 
			, label = 'معروف بـ'
			, value = {'سبب_الشهرة'}
			--, wikidata = {property='P'}
		},
		{type = 'row' 
			, label = 'الحالة' 
            , value = {'حالة','الوضع_الحالي','status'}
 			, wikidata = {property='P5816'}
		},

    }},
 }
}