Difference between revisions of "Module:OInfobox-Building"

Jump to navigation Jump to search
m
Undo revision 2354 by Olessan (talk) - this version works, but reverting to compare
m
m (Undo revision 2354 by Olessan (talk) - this version works, but reverting to compare)
Tag: Undo
Line 125: Line 125:
     if buildingData then
     if buildingData then
--SECTION-PRODUCTION
--SECTION-PRODUCTION
        local productionData = {}
local productionData = {}
        if buildingData.employees then
if buildingData.employees then
            local employeeData = {}
             for type, value in pairs(buildingData.employees) do
             for type, value in pairs(buildingData.employees) do
                 table.insert(productionData, {label = com.firstUpper({type}), value = value})
                 table.insert(employeeData, {label = com.firstUpper({type}), value = value})
             end
             end
        end


        if buildingData.workers then
             if #employeeData > 0 then
            local workers = buildingData.workers
                 addSection(infobox, employeeData, 'Employees', 2)
             if buildingData.rank then
                 workers = workers .. ' ' .. buildingData.rank
             end
             end
            table.insert(productionData, {label = 'Workers', value = workers.firstUpper})
end
        end
   
        --
         if buildingData.input then
         if buildingData.input then
             local input = ''
             local input = ''
Line 169: Line 166:
          
          
         if #productionData > 0 then
         if #productionData > 0 then
             addSection(infobox, productionData, 'Production', 2) -- Apply 2 columns to the whole section
             addSection(infobox, productionData, 'Production')
         end
         end
         --/
         --/
606

edits

Navigation menu