Module:Infobox: Difference between revisions

m
Missing a case to substitute for the creators list
(per talk page)
 
m (Missing a case to substitute for the creators list)
 
(14 intermediate revisions by 3 users not shown)
Line 54: Line 54:
s = mw.ustring.gsub(s, '([\r\n][%*#;:][^\r\n]*)$', '%1\n')
s = mw.ustring.gsub(s, '([\r\n][%*#;:][^\r\n]*)$', '%1\n')
s = mw.ustring.gsub(s, '^([%*#;:][^\r\n]*)$', '%1\n')
s = mw.ustring.gsub(s, '^([%*#;:][^\r\n]*)$', '%1\n')
s = mw.ustring.gsub(s, '^([%*#;:])', '\n%1')
s = mw.ustring.gsub(s, '^(%{%|)', '\n%1')
return s
return s
else
else
Line 129: Line 131:
                 :css('text-align', 'center')  
                 :css('text-align', 'center')  
         end
         end
       
        if rowArgs.label == "Created by" or rowArgs.label == "Last Updated by" then
        creatorsList = {}
        rowArgs.data = string.gsub(rowArgs.data, ", and ", ", ")
        rowArgs.data = string.gsub(rowArgs.data, " and ", ", ")
        rowArgs.data = string.gsub(rowArgs.data, "%[%[User:", "")
        rowArgs.data = string.gsub(rowArgs.data, "%]%]", "")
        for creator in mw.text.gsplit(rowArgs.data, ",") do
        name = mw.text.trim(creator, "%s%p")
    alias = mw.text.split(name,"|")
    if #alias == 2 then
        table.insert(creatorsList, "[[User:" .. alias[1] .. "|" .. alias[2] .. "]]")
    else
        table.insert(creatorsList, "[[User:" .. name .. "|" .. name .. "]]")
    end
        end
        rowArgs.data = mw.text.listToText(creatorsList)
        end
         dataCell
         dataCell
             :attr('id', rowArgs.dataid)
             :attr('id', rowArgs.dataid)
Line 134: Line 154:
             :cssText(rowArgs.datastyle)
             :cssText(rowArgs.datastyle)
             :cssText(rowArgs.rowcellstyle)
             :cssText(rowArgs.rowcellstyle)
            :newline()
             :wikitext(fixChildBoxes(rowArgs.data, 'td'))
             :wikitext(fixChildBoxes(rowArgs.data, 'td'))
     end
     end
Line 174: Line 193:
                 :css('text-align', 'center')
                 :css('text-align', 'center')
                 :cssText(args.belowstyle)
                 :cssText(args.belowstyle)
                :newline()
                 :wikitext(fixChildBoxes(args.below,'td'))
                 :wikitext(fixChildBoxes(args.below,'td'))
end
end
Bureaucrats, Check users, emailconfirmed, Interface administrators, staff, Administrators, translation-admin, Widget editors
1,637

edits