Modulo:Bozza: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
mostra richieste precedenti |
+ |
||
Riga 18:
new_text = replace(new_text, old_tmp, tmp)
if tmp:
local
new_text = replace(new_text,
tmp = tmp:gsub('%{%b{}%}', '{{')
local key = tmp:find('%| *esito *= *[^%s%|%}]') and 'old' or 'current'
table.insert(stored_submissions.old, request)▼
if type(stored_submissions[key][ts]) == 'table' then
else
end
end
Line 32 ⟶ 35:
return stored_submissions, new_text
end
local function pairsByTimestamp(t)
local a = {}
local i = 0
local function comp(ts1, ts2)
return ts1 > ts2
end
for ts in pairs(t) do
table.insert(a, ts)
end
table.sort(a, comp)
return function ()
i = i + 1
if not a[i] then
return
else
return a[i], t[a[i]]
end
end
end
Line 57 ⟶ 83:
if state ~= 'S' then
if
state = 'R'
elseif
state = 'N'
end
Line 66 ⟶ 92:
local history_table
if
local styles = frame:extensionTag{
history_table = mw.html.create('table')▼
name = 'templatestyles',
args = { src = 'Modulo:Bozza/styles.css' }
:tag('tr')▼
}
:tag('th')▼
:wikitext('Richieste precedenti')▼
:addClass('bozza-history')
:done()▼
:wikitext('Esito revisione')
:done()
for
local success, jFY = pcall(lang.formatDate, lang, 'j F Y', ts)
submission = submission:gsub('%}%}$', '|mostra esito=x}}')▼
history_table▼
if success then
:tag('tr')▼
for _, submission in ipairs(a) do
▲ submission = submission:gsub('%}%}$', '|mostra esito=x}}')
:wikitext(frame:preprocess(submission))▼
▲ history_table
:wikitext(jFY)
:done()
:tag('div')
▲ :wikitext(frame:preprocess(submission))
:done()
end
end
end
history_table = styles .. tostring(history_table)
end
|