Moduł:Dopracować: Różnice pomiędzy wersjami

Usunięta treść Dodana treść
Nie podano opisu zmian
Nie podano opisu zmian
Linia 196:
end,
text = function(frame)
pf = frame:getParent()
local args={}
local pudelko_modul=require("Module:Pudełko");
local nazwa_przestrzeni_nazw=pf.argspudelko_modul["nazwaNazwa przedmiotowej przestrzeni nazw"](frame);
local nazwij_jednostka=pf.args["nazwij jednostką"]
local typ_jednostki=pf.argspudelko_modul["Przedmiotowy typ jednostki"](frame);
local nazwa_jednostki=pf.argspudelko_modul["nazwaNazwa jednostki"](frame);
local pelna_nazwa_jednostki=(nazwa_przestrzeni_nazw~="")and nazwa_przestrzeni_nazw..":"..nazwa_jednostki or nazwa_jednostki;
local title=mw.title.makeTitle('',pelna_nazwa_jednostki);
function prepareTemplates(reason, date, section, comments)
local c = (reason)and (reason["?"] or {}) or {}
local sourceTemplates;
local templates = {};
function ManualAndTemplatesTemplatesFunkcja(test2templates,section)
local sourceTemplates=test2(section) and resources.manualTemplatessectionTemplates or resources.articleTemplates;otherTemplates
templates["{{unit return sourceTemplates;type}}"]="Jednostki"
templates["{{comma}}"]="";
return sourceTemplates
end;
function Templates()
Linia 210 ⟶ 219:
templates["{{unit type}}"]="Jednostki"
templates["{{comma}}"]="";
elseif((nazwa_przestrzeni_nazw==resources.data.defaultuser)and(typ_jednostki=="jednostka użytkownika"))then
sourceTemplates = (section) and resources.sectionTemplates or resources.userTemplates
templates["{{unit type}}"]="Jednostki użytkowników"
templates["{{comma}}"]=",";
elseif((nazwa_przestrzeni_nazw==resources.data.defaulthelp)and(typ_jednostki=="strona pomocy"))then
sourceTemplates = (section) and resources.sectionTemplates or resources.pomocTemplates
templates["{{unit type}}"]="Strony pomocy"
templates["{{comma}}"]=",";
elseif(nazwa_przestrzeni_nazw==resources.data.defaultwikibooks)then
if(((typ_jednostki)and (typ_jednostki=="jednostka brudnopisu projektu"))or(mw.ustring.match(nazwa_jednostki,"^[Bb]rudnopis/.-")))then
sourceTemplates = (section) and resources.sectionTemplates or resources.documentationdraftprojectTemplates;
templates["{{unit type}}"]="Jednostki brudnopisu projektu"
ifelseif(typ_jednostki=="strona projektu")then
else
sourceTemplates = (section) and resources.sectionTemplates or resources.projektTemplates;
templates["{{unit type}}"]="Strony projektu"
else else
sourceTemplates=TemplatesFunkcja(templates,section);
end;
templates["{{comma}}"]=",";
elseif(nazwa_przestrzeni_nazw==resources.data.defaulttemplate)then--
if(((typ_jednostki)and (typ_jednostki=="strona brudnopisu opisu szablonu"))
or((not mw.ustring.match(nazwa_jednostki,"^[Bb]rudnopis/opis$"))and(mw.ustring.match(nazwa_jednostki,"^[Bb]rudnopis/.-"))))then
sourceTemplates = (section) and resources.sectionTemplates or resources.documentationdrafttemplateTemplates
templates["{{unit type}}"]="Strony brudnopisu opisu szablonów"
ifelseif(typ_jednostki=="strona opisu szablonu")then
else
sourceTemplates = (section) and resources.sectionTemplates or resources.documentationtemplateTemplates;
templates["{{unit type}}"]="Strony opisu szablonów"
else else
sourceTemplates=TemplatesFunkcja(templates,section);
end;
templates["{{comma}}"]=",";
elseif(nazwa_przestrzeni_nazw==resources.data.defaultmodule)then--
if(((typ_jednostki)and(typ_jednostki=="strona brudnopisu opisu modułu"))
or((not mw.ustring.match(nazwa_jednostki,"^[Bb]rudnopis/opis$"))and(mw.ustring.match(nazwa_jednostki,"^[Bb]rudnopis/.-"))))then
sourceTemplates = (section) and resources.sectionTemplates or resources.documentationdraftmoduleTemplates;
templates["{{unit type}}"]="Strony brudnopisu opisu modułów"
elseif(typ_jednostki=="strona opisu szablonu")then
else
sourceTemplates = (section) and resources.sectionTemplates or resources.documentationmoduleTemplates
templates["{{unit type}}"]="Strony opisu modułów"
else else
sourceTemplates=TemplatesFunkcja(templates,section);
end;
templates["{{comma}}"]=",";
elseif((nazwa_przestrzeni_nazw==resources.data.defaultcategory)and(typ_jednostki=="strona kategorii"))then
sourceTemplates = (section) and resources.sectionTemplates or resources.categoryTemplates
templates["{{unit type}}"]="Strony kategorii"
templates["{{comma}}"]=",";
elseif(nazwa_przestrzeni_nazw==resources.data.defaultmainspace)then
if(typ_jednostki)then
if(typ_jednostki=="artykuł")then
sourceTemplates=(section) and resources.sectionTemplates or resources.articleTemplates;
templates["{{unit type}}"]="Artykuły"
templates["{{comma}}"]="";
elseelseif(typ_jednostki=="podręcznik")then
sourceTemplates=(section) and resources.sectionTemplates or resources.manualTemplates;
templates["{{unit type}}"]="Podręczniki"
templates["{{comma}}"]="";
end; else
sourceTemplates=TemplatesFunkcja(templates,section);
elseend;
local test2=string.match(title.text,"^[^/]+$");
sourceTemplates=(section) and resources.sectionTemplates or ManualAndTemplates(test2);
if(test2)then
templates["{{unit type}}"]="Podręczniki"
templates["{{comma}}"]="";
else
templates["{{unit type}}"]="Artykuły"
templates["{{comma}}"]="";
end;
end;
elseif(nazwa_przestrzeni_nazw==resources.data.defaultwikijunior)then
if(typ_jednostki)then
if(typ_jednostki=="artykuł dla dzieci")then
sourceTemplates=(section) and resources.sectionTemplates or resources.articleTemplates;
templates["{{unit type}}"]="Artykuły dla dzieci"
templates["{{comma}}"]=",";
elseelseif(typ_jednostki=="podręcznik dla dzieci")then
sourceTemplates=(section) and resources.sectionTemplates or resources.manualTemplates;
templates["{{unit type}}"]="Podręczniki dla dzieci"
templates["{{comma}}"]=",";
else
sourceTemplates=TemplatesFunkcja(templates,section);
end;
else
local test2=string.match(title.text,"^[^/]+$");
sourceTemplates=(section) and resources.sectionTemplates or ManualAndTemplates(test2);
if(test2)then
templates["{{unit type}}"]="Podręczniki dla dzieci"
templates["{{comma}}"]=",";
else
templates["{{unit type}}"]="Artykuły dla dzieci"
templates["{{comma}}"]=",";
end;
end;
else
sourceTemplates=TemplatesFunkcja(templates,section) and resources.sectionTemplates or resources.otherTemplates;
templates["{{unit type}}"]="Jednostki"
templates["{{comma}}"]="";
end;
end;
Linia 345 ⟶ 337:
end
title = mw.title.getCurrentTitle()
pf = frame:getParent()
nazwa_przestrzeni_nazw=pf.args["nazwa przestrzeni nazw"]
nazwij_jednostka=pf.args["nazwij jednostką"]
typ_jednostki=pf.args["typ jednostki"]
nazwa_jednostki=pf.args["nazwa jednostki"]
strona_glowna_projektu=pf.args["strona główna projektu"]
strona_glowna_projektu=(not strona_glowna_projektu) and "Wikibooks:Strona główna" or string.gsub(strona_glowna_projektu,"_"," ");
strona_glowna_wikijuniora=pf.args["strona główna dla dzieci"]
strona_glowna_wikijuniora=(not strona_glowna_wikijuniora)and "Wikijunior:Strona główna" or string.gsub(strona_glowna_wikijuniora,"_"," ");
nazwa_przestrzeni_nazw=(not nazwa_przestrzeni_nazw)and title.nsText or nazwa_przestrzeni_nazw;
nazwa_przestrzeni_nazw=require("Module:Nazwy").NpFun{nazwa=nazwa_przestrzeni_nazw};
nazwa_jednostki=(not nazwa_jednostki)and title.text or nazwa_jednostki
local uchwyt_nazwy_przestrzeni_nazw=mw.site.namespaces[nazwa_przestrzeni_nazw];
if(uchwyt_nazwy_przestrzeni_nazw)then
nazwa_przestrzeni_nazw2=mw.ustring.gsub(uchwyt_nazwy_przestrzeni_nazw.name,"_"," ");
nazwa_przestrzeni_nazw=nazwa_przestrzeni_nazw2;
else
nazwa_przestrzeni_nazw2="";
end;
if(nazwa_jednostki~="")then
prawidlowa_nazwa_jednostki=mw.title.makeTitle('',nazwa_jednostki);
if(prawidlowa_nazwa_jednostki)then
title=(nazwa_przestrzeni_nazw=="")and mw.title.makeTitle('',nazwa_jednostki)
or mw.title.makeTitle('',nazwa_przestrzeni_nazw..":"..nazwa_jednostki)
nstext=(title)and mw.ustring.gsub(title.nsText,"_"," ") or nil;
else
title=nil;
end;
else
title=nil;
end;
sekcja=pf.args[resources.data.sectionParamIndex];