• Welcome to the Kancolle Wiki!
  • If you have any questions regarding site content, account registration, etc., please visit the KanColle Wiki Discord

Changes

Jump to navigation Jump to search
Add highlighting and category for incomplete quotes
Line 14: Line 14:  
     remodel_row_style = [[style="border-left: 15px solid #aaa;"]],
 
     remodel_row_style = [[style="border-left: 15px solid #aaa;"]],
 
     spoiler = [[<span style="background-color:#3a3a3a">${text}</span>]],
 
     spoiler = [[<span style="background-color:#3a3a3a">${text}</span>]],
 +
    incomplete_style = "background:#fee;",
 +
    incomplete_category = "[[Category:Ship pages with incomplete quotes]]",
 
     row = [=[|- ${style}
 
     row = [=[|- ${style}
 
| nowrap="nowrap" |${audio_button} ${line}
 
| nowrap="nowrap" |${audio_button} ${line}
| colspan="${ja_colspan}" | <span lang="ja" style="font-family: sans-serif;">${ja}</span>
+
| colspan="${ja_colspan}" style="${ja_style}" |<span lang="ja" style="font-family: sans-serif;">${ja}</span>
${en_cell}| ${note}]=],
+
${en_cell}|${note}]=],
 
     note = [[|-
 
     note = [[|-
 
| colspan="5" | ⇧ ${note}]],
 
| colspan="5" | ⇧ ${note}]],
Line 63: Line 65:  
     return text and line.spoiler and format{templates.spoiler, text = text} or text or ""
 
     return text and line.spoiler and format{templates.spoiler, text = text} or text or ""
 
end
 
end
 +
 +
-- Global variable, potentially altered by insertRow, checked by Quotes.ShipQuotes.
 +
local complete = true
    
function insertRow(result, remodel, args, line)
 
function insertRow(result, remodel, args, line)
Line 71: Line 76:  
     if not remodel and not line.extra or jaEn or ja or en or note then
 
     if not remodel and not line.extra or jaEn or ja or en or note then
 
         local line_name = remodel or line.name
 
         local line_name = remodel or line.name
 +
        local ja_style = not jaEn and (not ja or ja == "" or ja == "?") and templates.incomplete_style
 +
        local en_style = not jaEn and (not en or en == "" or en == "?") and templates.incomplete_style
 +
        local jaEn_style = jaEn and (jaEn == "" or jaEn == "?") and templates.incomplete_style
 +
        if ja_style or en_style or jaEn_style then
 +
            complete = false
 +
        end
 
         table.insert(result, format{
 
         table.insert(result, format{
 
             templates.row,
 
             templates.row,
Line 86: Line 97:  
             ja = format_text(jaEn or ja, line),
 
             ja = format_text(jaEn or ja, line),
 
             ja_colspan = jaEn and "2" or "1",
 
             ja_colspan = jaEn and "2" or "1",
             en_cell = jaEn and "" or "|" .. format_text(en, line) .. "\n",
+
            ja_style = ja_style or jaEn_style or "",
 +
             en_cell = jaEn and "" or '| style="' .. (en_style or "") .. '"|' .. format_text(en, line) .. "\n",
 
             note = format_text(note, line),
 
             note = format_text(note, line),
 
         })
 
         })
Line 109: Line 121:  
     end
 
     end
 
     table.insert(result, templates.footer)
 
     table.insert(result, templates.footer)
 +
    if not complete then
 +
        table.insert(result, templates.incomplete_category)
 +
    end
 
     return table.concat(result, "\n")
 
     return table.concat(result, "\n")
 
end
 
end
 +
 +
-- Quotes.t = Quotes.ShipQuotes(nil, {ship = "Ayanami"})
    
return Quotes
 
return Quotes
cssedit, gkautomate
7,064

edits

Navigation menu