Jump to content
സഹായം

ಪ್ರವೇಶಿಸಿರಿ (ಸಹಾಯ)
உள்ளேற (உதவி)

"ഘടകം:GradeLinks" എന്ന താളിന്റെ പതിപ്പുകൾ തമ്മിലുള്ള വ്യത്യാസം

17 ബൈറ്റുകൾ നീക്കംചെയ്തിരിക്കുന്നു ,  5 ജനുവരി
തിരുത്തലിനു സംഗ്രഹമില്ല
('local p = {} function p.render(frame) local args = frame:getParent().args local mainUrl = args.MainUrl or "" local itemName = args.ItemName or "" local grades = { { key = "G1", suffix = "A ഗ്രേഡ്", file = "MedelA.svg", label = "A ഗ്രേഡ്" }, { key = "G2", suffix = "B ഗ്രേഡ്", file = "MedelB.svg", label = "B ഗ്രേഡ്" }, { key = "G3",...' താൾ സൃഷ്ടിച്ചിരിക്കുന്നു)
 
No edit summary
വരി 6: വരി 6:
     local itemName = args.ItemName or ""
     local itemName = args.ItemName or ""
     local grades = {
     local grades = {
         { key = "G1", suffix = "A ഗ്രേഡ്", file = "MedelA.svg", label = "A ഗ്രേഡ്" },
         { suffix = "A ഗ്രേഡ്", file = "MedelA.svg", label = "A ഗ്രേഡ്" },
         { key = "G2", suffix = "B ഗ്രേഡ്", file = "MedelB.svg", label = "B ഗ്രേഡ്" },
         { suffix = "B ഗ്രേഡ്", file = "MedelB.svg", label = "B ഗ്രേഡ്" },
         { key = "G3", suffix = "C ഗ്രേഡ്", file = "MedelC.svg", label = "C ഗ്രേഡ്" },
         { suffix = "C ഗ്രേഡ്", file = "MedelC.svg", label = "C ഗ്രേഡ്" },
         { key = "G4", suffix = "മറ്റുള്ളവ", file = "MedelO.svg", label = "മറ്റുള്ളവ" },
         { suffix = "മറ്റുള്ളവ", file = "MedelO.svg", label = "മറ്റുള്ളവ" },
     }
     }


     local output = {}
     local output = {}


    -- Dynamically check for each grade's existence
     for _, grade in ipairs(grades) do
     for _, grade in ipairs(grades) do
         if args[grade.key] then
         local page = mainUrl .. "/" .. itemName .. "/" .. grade.suffix
            local page = mainUrl .. "/" .. itemName .. "/" .. grade.suffix
        if mw.title.new(page).exists then
            if mw.title.new(page).exists then
            table.insert(output, string.format(
                table.insert(output, string.format(
                '<div style="text-align: center; padding: 0.75em; font-weight: normal; line-height: 1.15; font-size: 1.05em; margin-bottom: 0.2em; min-width: 120px; max-width: 250px; flex: 1 1 0px; margin-right: 1px;">' ..
                    '<div style="text-align: center; padding: 0.75em; font-weight: normal; line-height: 1.15; font-size: 1.05em; margin-bottom: 0.2em; min-width: 120px; max-width: 250px; flex: 1 1 0px; margin-right: 1px;">' ..
                '<span aria-hidden="true" role="presentation">[[File:%s|45px|link=%s|frameless|center]]</span>' ..
                    '<span aria-hidden="true" role="presentation">[[File:%s|45px|link=%s|frameless|center]]</span>' ..
                '[[%s|<b>%s</b>]]</div>',
                    '[[%s|<b>%s</b>]]</div>',
                grade.file, page, page, grade.label
                    grade.file, page, page, grade.label
            ))
                ))
            end
         end
         end
     end
     end


    -- Render the output only if at least one grade exists
     if #output > 0 then
     if #output > 0 then
         return string.format(
         return string.format(
"https://schoolwiki.in/പ്രത്യേകം:മൊബൈൽവ്യത്യാസം/2623870" എന്ന താളിൽനിന്ന് ശേഖരിച്ചത്