Module:CharTree: Difference between revisions

From Elwiki
No edit summary
No edit summary
Line 11: Line 11:
     for job_iter=1,3,1 do
     for job_iter=1,3,1 do
         for path_iter=1,4,1 do
         for path_iter=1,4,1 do
             char = args[path_iter .. 'x' .. job_iter];
             char = args[path_iter .. 'x' .. job_iter] or 'Unreleased';
            file_name = 'Icon - ' .. char:gsub(':', '');
            link = '|link=' .. char
             nopath = 'no' .. path_iter .. 'path';
             nopath = 'no' .. path_iter .. 'path';
             nopathnojob = 'no' .. path_iter .. 'path' .. job_iter .. 'job';
             nopathnojob = 'no' .. path_iter .. 'path' .. job_iter .. 'job';
            entry = char_tree:tag('div'):addClass('char-banner-tree-image')
            if char ~= 'Unreleased' then
                file_name = 'Icon - ' .. char:gsub(':', '');
                link = '|link=' .. char
            end
           
             if (args[nopath] ~= nil or args[nopathnojob] ~= nil) then
             if (args[nopath] ~= nil or args[nopathnojob] ~= nil) then
                 file_name = 'Dunno';
                 file_name = 'Dunno';
                 link = '|link=' .. char;
                 link = '|link=' .. char;
             end
             end
             entry = char_tree:tag('div'):addClass('char-banner-tree-image')
 
            :attr('data-class-name', char):wikitext('[[File:' .. file_name .. '.png' .. link .. ']]');
             entry:attr('data-class-name', char):wikitext('[[File:' .. file_name .. '.png' .. link .. ']]');
 
             if (args[nopath] ~= nil) then
             if (args[nopath] ~= nil) then
                 entry:addClass('disable-image-link');
                 entry:addClass('disable-image-link');
             end
             end
             if (args[nopathnojob] ~= nil) then
             if (args[nopathnojob] ~= nil) then
                 entry:attr('data-unreleased', 'true'):attr('data-class-name', 'Unreleased');
                 entry:attr('data-unreleased', 'true');
             end
             end
         end
         end