| Latest revision |
Your text |
| Line 372: |
Line 372: |
| '<div class="bsw-card-hd">Sister projects</div>' .. | | '<div class="bsw-card-hd">Sister projects</div>' .. |
| '<div class="bsw-card-body">' .. body .. '</div>' .. | | '<div class="bsw-card-body">' .. body .. '</div>' .. |
| '</div>'
| |
| end
| |
|
| |
| -- ── votd() ────────────────────────────────────────────────────────
| |
| function p.votd( frame )
| |
| -- Build today's date string using os.date (server local time)
| |
| -- MW magic words aren't accessible via callParserFunction
| |
| local today = os.date( '%Y-%m-%d' )
| |
|
| |
| local override_page = 'BattlestarWiki:VotD/' .. today
| |
| local override_title = mw.title.new( override_page )
| |
| local override_token = ''
| |
| if override_title and override_title.exists then
| |
| local content = override_title:getContent()
| |
| if content then
| |
| override_token = mw.text.trim( content )
| |
| end
| |
| end
| |
|
| |
| -- Header bar
| |
| local hd =
| |
| '<div class="bsw-votd-hd">' ..
| |
| '<span class="bsw-votd-hd-inner">' ..
| |
| '<span class="bsw-votd-hd-dot"></span>' ..
| |
| '\226\136\158 Video of the Day' ..
| |
| '</span>' ..
| |
| frame:preprocess( '[https://battlestarpegasus.com battlestarpegasus.com \226\134\151]' ) ..
| |
| '</div>'
| |
|
| |
| -- Inner grid: player + info panel, both populated by JS
| |
| local inner =
| |
| '<div class="bsw-votd-inner">' ..
| |
| '<div class="bsw-votd-player">' ..
| |
| '<div class="bsw-loading"><div class="bsw-spinner"></div>' ..
| |
| 'Loading today\226\128\153s video\226\128\166</div>' ..
| |
| '</div>' ..
| |
| '<div class="bsw-votd-info" id="bsw-votd-info" style="display:none"></div>' ..
| |
| '</div>'
| |
|
| |
| return
| |
| '<div class="bsw-votd-band" id="bsw-votd-container"' ..
| |
| ' data-date="' .. today .. '"' ..
| |
| ' data-override="' .. override_token .. '">' ..
| |
| hd .. inner ..
| |
| '</div>' | | '</div>' |
| end | | end |
|
| |
|
| return p | | return p |