Diferencia entre revisiones de «Módulo:Ficha»

Sin resumen de edición
Sin resumen de edición
Línea 37: Línea 37:


local function addRow(rowArgs)
local function addRow(rowArgs)
     if rowArgs.header then
     if rowArgs.seccion then
         root
         root
             .tag('tr')
             .tag('tr')
Línea 46: Línea 46:
                     .cssText(args.headerstyle)
                     .cssText(args.headerstyle)
                     .wikitext(rowArgs.header)
                     .wikitext(rowArgs.header)
     elseif rowArgs.data then
     elseif rowArgs.datos then
         local row = root.tag('tr')
         local row = root.tag('tr')
         row.addClass(rowArgs.rowclass)
         row.addClass(rowArgs.rowclass)
         if rowArgs.label then
         if rowArgs.etiqueta then
             row
             row
                 .tag('th')
                 .tag('th')
                     .attr('scope', 'row')
                     .attr('scope', 'row')
                     .css('text-align', 'left')
                     .css('text-align', 'left')
                     .cssText(args.labelstyle)
                     .cssText(args.estiloetiqueta)
                     .wikitext(rowArgs.label)
                     .wikitext(rowArgs.etiqueta)
                     .done()
                     .done()
         end
         end
          
          
         local dataCell = row.tag('td')
         local dataCell = row.tag('td')
         if not rowArgs.label then  
         if not rowArgs.etiqueta then  
             dataCell
             dataCell
                 .attr('colspan', 2)
                 .attr('colspan', 2)
Línea 66: Línea 66:
         end
         end
         dataCell
         dataCell
             .addClass(rowArgs.class)
             .addClass(rowArgs.clase)
             .cssText(rowArgs.datastyle)
             .cssText(rowArgs.estilodatos)
             .wikitext(rowArgs.data)
             .wikitext(rowArgs.datos)
     end
     end
end
end
Línea 116: Línea 116:
         args.subheader1 = args.subtitulo
         args.subheader1 = args.subtitulo
     end
     end
     if args.subheaderrowclass then
     if args.clasesubtitulo then
         args.clasesubtitulo1 = args.clasesubtitulo
         args.clasesubtitulo1 = args.clasesubtitulo
     end
     end
Línea 139: Línea 139:
     local imagenums = getArgNums('imagen')
     local imagenums = getArgNums('imagen')
     for k, num in ipairs(imagenums) do
     for k, num in ipairs(imagenums) do
         local caption = args['pie' .. num]
         local pie = args['pie' .. num]
         local data = HtmlBuilder.create().wikitext(args['imagen' .. num])
         local datos = HtmlBuilder.create().wikitext(args['imagen' .. num])
         if pie then
         if pie then
             data
             datos
                 .tag('br', {selfClosing = true})
                 .tag('br', {selfClosing = true})
                     .done()
                     .done()
Línea 222: Línea 222:
          
          
         if args.titulo then
         if args.titulo then
             root.wikitext("'''" .. args.title .. "'''")
             root.wikitext("'''" .. args.titulo .. "'''")
         end
         end
     end
     end