Модуль:Сущность: различия между версиями

Нет описания правки
Нет описания правки
Строка 69: Строка 69:
local function buildCardCall(merged, entityId)
local function buildCardCall(merged, entityId)
     local parts = {}
     local parts = {}
    -- id сущности
    if entityId and entityId ~= "" then
        parts[#parts + 1] = "id=" .. mw.text.encode(entityId)
    end


     -- типы (cardTag)
     -- типы (cardTag)
Строка 111: Строка 106:
             parts[#parts + 1] = mw.text.encode(compositeKey) .. "=" .. content
             parts[#parts + 1] = mw.text.encode(compositeKey) .. "=" .. content
         end
         end
    end
    -- id сущности
    if entityId and entityId ~= "" and #parts > 0 then
        table.insert(parts, 1, "id=" .. mw.text.encode(entityId))
     end
     end


Строка 167: Строка 167:
                         table.insert(cur, compositeKey)
                         table.insert(cur, compositeKey)
                         merged.labelLists[section] = cur
                         merged.labelLists[section] = cur
 
                    end
                        if e.cardTag and e.cardTag ~= "" then
                end
                            if not merged.tagSet[e.cardTag] then
                if e.cardTag and e.cardTag ~= "" then
                                merged.tagSet[e.cardTag] = true
                    if not merged.tagSet[e.cardTag] then
                                table.insert(merged.tags, e.cardTag)
                        merged.tagSet[e.cardTag] = true
                            end
                        table.insert(merged.tags, e.cardTag)
                        end
                     end
                     end
                 end
                 end