Star Wars Empire
(Νέα σελίδα με '-- <nowiki> local p = {} function p.main(frame) local title = mw.title.getCurrentTitle() local html = mw.html.create('div'):addClass('canontab') local args...')
 
Χωρίς σύνοψη επεξεργασίας
 
(Μία ενδιάμεση αναθεώρηση από τον ίδιο χρήστη δεν εμφανίζεται)
Γραμμή 18: Γραμμή 18:
 
eraicons:tag('div')
 
eraicons:tag('div')
 
:addClass('eraicons')
 
:addClass('eraicons')
:wikitext('[[File:Premium-Eras-legends.png|This article details a subject that falls under the Legends brand.|link=Legends]]')
+
:wikitext('[[File:Premium-Eras-legends.png|Αυτό το άρθρο περιέχει θέμα που υπάγεται στο είδος Θρύλοι.|link=Legends]]')
 
:done()
 
:done()
 
local page
 
local page
Γραμμή 34: Γραμμή 34:
 
html:tag('div')
 
html:tag('div')
 
:addClass('canontab__tab')
 
:addClass('canontab__tab')
:wikitext('[[File:Tab-canon-black.png|Click here for Wookieepedia\'s article on the Canon version of this subject.|link=' .. page.text .. ']]')
+
:wikitext('[[File:Tab-canon-black.png|Μπείτε εδώ για το άρθρο του Star Wars Empire για τη εκδοχή Κάνον του θέματος.|link=' .. page.text .. ']]')
 
:done()
 
:done()
 
:tag('div')
 
:tag('div')
 
:addClass('canontab__tab')
 
:addClass('canontab__tab')
 
:addClass('canontab__current')
 
:addClass('canontab__current')
:wikitext('[[File:Tab-legends-white.png|This article covers the Legends version of this subject.|link=' .. title.text .. ']]')
+
:wikitext('[[File:Tab-legends-white.png|Αυτό το άρθρο καλύπτει την εκδοχή των Θρύλων του θέματος.|link=' .. title.text .. ']]')
 
:done()
 
:done()
 
elseif type ~= 'legends' then
 
elseif type ~= 'legends' then
Γραμμή 46: Γραμμή 46:
 
eraicons:tag('div')
 
eraicons:tag('div')
 
:addClass('eraicons')
 
:addClass('eraicons')
:wikitext('[[File:Premium-Eras-canon.png|This article details a subject that is considered canon.|link=Canon]]')
+
:wikitext('[[File:Premium-Eras-canon.png|Αυτό το άρθρο περιέχει θέμα που θεωρείται κάνον.|link=Canon]]')
 
:done()
 
:done()
local page = mw.title.new(args['legends'] or (title.text .. '/Легенди'))
+
local page = mw.title.new(args['legends'] or (title.text .. '/Legends'))
 
if not page.exists then
 
if not page.exists then
 
-- Legends tab doesn't exist, return
 
-- Legends tab doesn't exist, return
Γραμμή 56: Γραμμή 56:
 
:addClass('canontab__tab')
 
:addClass('canontab__tab')
 
:addClass('canontab__current')
 
:addClass('canontab__current')
:wikitext('[[File:Tab-canon-white.png|This article covers the Canon version of this subject.|link=' .. title.text .. ']]')
+
:wikitext('[[File:Tab-canon-white.png|Αυτό το άρθρο καλύπτει την εκδοχή Κάνον του θέματος|link=' .. title.text .. ']]')
 
:done()
 
:done()
 
:tag('div')
 
:tag('div')
 
:addClass('canontab__tab')
 
:addClass('canontab__tab')
:wikitext('[[File:Tab-legends-black.png|Click here for Wookieepedia\'s article on the Legends version of this subject.|link=' .. page.text .. ']]')
+
:wikitext('[[File:Tab-legends-black.png|Μπείτε εδώ για το άρθρο του Star Wars Empire σχετικά με την έκδοση Θρύλοι αυτού του θέματος.|link=' .. page.text .. ']]')
 
:done()
 
:done()
 
end
 
end

Τελευταία αναθεώρηση της 21:49, 17 Φεβρουαρίου 2019

Documentation for this module may be created at Module:Canon/τεκμηρίωση

-- <nowiki>
local p = {}

function p.main(frame)
    local title = mw.title.getCurrentTitle()
    local html = mw.html.create('div'):addClass('canontab')
    local args = frame:getParent().args
    local type = args[1]
    local ret = ''
    local eraicons = mw.html.create('div'):addClass('eraicons__wrapper')
    -- TODO: DRY
    if (title.subpageText ~= title.text and title.subpageText == 'Legends') or type == 'legends' then
        -- Legends
        if title.subpageText == 'Legends' then
            ret = ret .. frame:preprocess('{{DISPLAYTITLE:' .. title.baseText .. '}}')
        end
        ret = ret .. '[[Κατηγορία:Άρθρα_θρύλοι|' .. title.baseText .. ']]'
        eraicons:tag('div')
                    :addClass('eraicons')
                    :wikitext('[[File:Premium-Eras-legends.png|Αυτό το άρθρο περιέχει θέμα που υπάγεται στο είδος Θρύλοι.|link=Legends]]')
                :done()
        local page
        if args['canon'] then
            page = mw.title.new(args['canon'])
        elseif title.subpageText ~= title.text then
            page = mw.title.new(title.baseText)
        else
            return ret .. tostring(eraicons:done())
        end
        if not page.exists then
            -- Canon tab doesn't exist, return
            return ret .. tostring(eraicons:done())
        end
        html:tag('div')
                :addClass('canontab__tab')
                :wikitext('[[File:Tab-canon-black.png|Μπείτε εδώ για το άρθρο του Star Wars Empire για τη εκδοχή Κάνον του θέματος.|link=' .. page.text .. ']]')
            :done()
            :tag('div')
                :addClass('canontab__tab')
                :addClass('canontab__current')
                :wikitext('[[File:Tab-legends-white.png|Αυτό το άρθρο καλύπτει την εκδοχή των Θρύλων του θέματος.|link=' .. title.text .. ']]')
            :done()
    elseif type ~= 'legends' then
        -- Canon
        ret = ret .. '[[Κατηγορία:Άρθρα_κάνον|' .. title.baseText .. ']]'
        eraicons:tag('div')
                    :addClass('eraicons')
                    :wikitext('[[File:Premium-Eras-canon.png|Αυτό το άρθρο περιέχει θέμα που θεωρείται κάνον.|link=Canon]]')
                :done()
        local page = mw.title.new(args['legends'] or (title.text .. '/Legends'))
        if not page.exists then
            -- Legends tab doesn't exist, return
            return ret .. tostring(eraicons:done())
        end
        html:tag('div')
                :addClass('canontab__tab')
                :addClass('canontab__current')
                :wikitext('[[File:Tab-canon-white.png|Αυτό το άρθρο καλύπτει την εκδοχή Κάνον του θέματος|link=' .. title.text .. ']]')
            :done()
            :tag('div')
                :addClass('canontab__tab')
                :wikitext('[[File:Tab-legends-black.png|Μπείτε εδώ για το άρθρο του Star Wars Empire σχετικά με την έκδοση Θρύλοι αυτού του θέματος.|link=' .. page.text .. ']]')
            :done()
    end
    return ret .. tostring(html:done()) .. tostring(eraicons:done())
end

return p