Changes

no edit summary
Line 10: Line 10:     
     map_rows = [=[|-
 
     map_rows = [=[|-
! colspan="2" style="text-align:center;width:40%;" | [[${link}|World ${id}: ${name}]]<br />${name_en}
+
! colspan="2" style="text-align:center;width:40%;" | <div style="position:absolute;left:5px;">&#91;[[Module:${module_link}|Edit]]&#93;</div>[[${link}|World ${id}: ${name}]]<br />${name_en}
| rowspan="4" style="text-align:center;width:60%;" | <div style="position:absolute;right:5px;">&#91;[[Module:${module_link}|Edit]]&#93;</div>${banner}
+
| rowspan="4" style="text-align:center;width:60%;" | ${banner}
 
|-
 
|-
 
! Difficulty
 
! Difficulty
Line 68: Line 68:  
end
 
end
   −
function formatDifficulty(stars)
+
function formatDifficulty(api_stars, banner_stars)
     local result = stars > 10 and [[<span style="font-size:150%">'''☆'''</span>]] .. string.rep("☆", stars - 10) or string.rep("☆", stars) or "?"
+
    if not api_stars and not banner_stars then
     return string.format("%s (%d)", result, stars)
+
        return "?"
 +
    end
 +
    local stars = banner_stars or api_stars
 +
    api_stars = api_stars or "?"
 +
     local stars_string
 +
        = stars > 10
 +
        and [[<span style="font-size:150%">'''☆'''</span>]] .. string.rep("☆", stars - 10)
 +
        or string.rep("☆", stars)
 +
    if banner_stars then
 +
        return string.format('%s (<span class="explain" title="API value: %d">%d</span>)', stars_string, api_stars, stars)
 +
     else
 +
        return string.format("%s (%d)", stars_string, stars)
 +
    end
 
end
 
end
   Line 96: Line 108:  
             name = map_data.name or "?",
 
             name = map_data.name or "?",
 
             name_en = map_data.name_en or "?",
 
             name_en = map_data.name_en or "?",
             difficulty = formatDifficulty(map_data.stars),
+
             difficulty = formatDifficulty(map_data.stars, map_data.banner_stars),
 
             ship_exp = formatShipExp(map_data.ship_exp),
 
             ship_exp = formatShipExp(map_data.ship_exp),
 
             items_string = formatItems(map_data.items),
 
             items_string = formatItems(map_data.items),
cssedit, gkautomate
7,060

edits