Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Editing Module:BSW/MainPage

From the only original and legitimate Battlestar Wiki: the free-as-in-beer, non-corporate, open-content encyclopedia, analytical reference, and episode guide on all things Battlestar Galactica. Accept neither subpar substitutes nor subpar clones.
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision Your text
Line 64: Line 64:


-- ── welcome() ────────────────────────────────────────────────────
-- ── welcome() ────────────────────────────────────────────────────
-- Welcome band at the top of the main page.
-- Logo, wiki name, one-line description, article count.
function p.welcome( frame )
function p.welcome( frame )
     local articles = mw.site.stats.articles
     local articles = mw.site.stats.articles
     local formatted = tostring( articles ):reverse():gsub( '(%d%d%d)', '%1,' ):reverse():gsub( '^,', '' )
     local formatted = tostring( articles ):reverse():gsub( '(%d%d%d)', '%1,' ):reverse():gsub( '^,', '' )
    local logo = frame:preprocess( '[[File:BSG-WIKI SM.png|40px|link=Main Page|alt=Battlestar Wiki]]' )
    local desc = frame:preprocess(
        "The free, non-corporate encyclopedia on all things " ..
        "''Battlestar Galactica'' \226\128\148 " ..
        formatted .. "\194\160articles and counting."
    )


     local inner =
     local inner =
         '<div class="bsw-welcome-logo">' .. logo .. '</div>' ..
         '<div class="bsw-welcome-logo">' ..
        '<img src="https://en.battlestarwiki.org/resources/BSGWIKILOGO.png" ' ..
        'alt="Battlestar Wiki" width="48" height="48">' ..
        '</div>' ..
         '<div class="bsw-welcome-text">' ..
         '<div class="bsw-welcome-text">' ..
         '<div class="bsw-welcome-title">Battlestar Wiki</div>' ..
         '<div class="bsw-welcome-title">Battlestar Wiki</div>' ..
         '<div class="bsw-welcome-desc">' .. desc .. '</div>' ..
         '<div class="bsw-welcome-desc">' ..
        'The free, non-corporate encyclopedia on all things ' ..
        '<i>Battlestar Galactica</i> \226\128\148 ' ..
        formatted .. '\194\160articles and counting.' ..
        '</div>' ..
         '</div>' ..
         '</div>' ..
         '<div class="bsw-welcome-links">' ..
         '<div class="bsw-welcome-links">' ..
Line 343: Line 344:
-- ── recenttabs() ──────────────────────────────────────────────────
-- ── recenttabs() ──────────────────────────────────────────────────
function p.recenttabs( frame )
function p.recenttabs( frame )
     local tabs = { {'All','all'}, {'EN','en'}, {'DE','de'}, {'FR','fr'}, {'Media','media'} }
     local tabs = { {'All','all'}, {'EN','en'}, {'DE','de'}, {'Media','media'} }
     local html = '<div class="bsw-wiki-tabs">'
     local html = '<div class="bsw-wiki-tabs">'
     for i, t in ipairs(tabs) do
     for i, t in ipairs(tabs) do
Line 385: Line 386:
end
end


-- ── newestarticle() ──────────────────────────────────────────────
-- ── sisterprojects() ──────────────────────────────────────────────
-- Shell card populated by JS from Special:NewPages API.
function p.newestarticle( frame )
    return
        '<div class="bsw-card" id="bsw-newest-card">' ..
        '<div class="bsw-card-hd">Newest article' ..
        frame:preprocess( '[[Special:NewPages|All new pages →]]' ) ..
        '</div>' ..
        '<div class="bsw-card-body">' ..
        '<div id="bsw-newest-inner">' ..
        '<div class="bsw-loading"><div class="bsw-spinner"></div>Loading…</div>' ..
        '</div>' ..
        '</div>' ..
        '</div>'
end
 
 
-- Dedicated card for sister wiki links.
-- Dedicated card for sister wiki links.
-- Uses numbered params: |1_label, |1_url, |2_label, |2_url ...
-- Uses numbered params: |1_label, |1_url, |2_label, |2_url ...

To protect the wiki against automated edit spam, please solve the following captcha:

Cancel Editing help (opens in new window)

  [] · [[]] · [[|]] · {{}} · · “” ‘’ «» ‹› „“ ‚‘ · ~ | ° &nbsp; · ± × ÷ ² ³ ½ · §
     [[Category:]] · [[:File:]] · [[Special:MyLanguage/]] · <code></code> · <nowiki></nowiki> <code><nowiki></nowiki></code> · <syntaxhighlight></syntaxhighlight> · <includeonly></includeonly> · <noinclude></noinclude> · #REDIRECT[[]] · <translate></translate> · <languages/> · {{#translation:}} · <tvar|></> · {{DEFAULTSORT:}} · <categorytree></categorytree> · <div style="clear:both;"></div> <s></s>


Your changes will be visible immediately.
  • For testing, please use the sandbox instead.
  • On talk pages, please sign your comment by typing four tildes (~~~~).

Page included on this page: