mirror of
https://gitlab.com/Deukhoofd/BattleSim.git
synced 2025-10-28 10:10:04 +00:00
Lots of stuff
This commit is contained in:
15
client/templates/replays/index.jade
Normal file
15
client/templates/replays/index.jade
Normal file
@@ -0,0 +1,15 @@
|
||||
extends ../layout
|
||||
|
||||
block content
|
||||
.m4.mt-header.pt1
|
||||
h2 Your replays
|
||||
#all-replays.row-fluid
|
||||
|
||||
block footer
|
||||
script(src=asset_path('js/data.js'))
|
||||
script(src=asset_path('js/vendor.js'))
|
||||
script(src=asset_path('js/templates.js'))
|
||||
script(src=asset_path('js/replays.js'))
|
||||
script.
|
||||
var replays = new Replays(!{JSON.stringify(replays)});
|
||||
new ReplayView({el: '#all-replays', collection: replays}).render();
|
||||
39
client/templates/replays/show.jade
Normal file
39
client/templates/replays/show.jade
Normal file
@@ -0,0 +1,39 @@
|
||||
extends ../layout
|
||||
|
||||
block content
|
||||
.fill.flex-center.flex-column
|
||||
unless replay
|
||||
p No replay found.
|
||||
else
|
||||
h1.mt-header.mb1
|
||||
= replay.getFormat()
|
||||
= ": " + replay.getName()
|
||||
#replay.relative(style = 'width: 100%; height: 100%;')
|
||||
|
||||
block footer
|
||||
if replay
|
||||
script(src=asset_path('js/data.js', {fingerprint: replay.version('js/data.js')}))
|
||||
script(src=asset_path('js/vendor.js', {fingerprint: replay.version('js/vendor.js')}))
|
||||
script(src=asset_path('js/templates.js', {fingerprint: replay.version('js/templates.js')}))
|
||||
script(src=asset_path('js/replays.js', {fingerprint: replay.version('js/replays.js')}))
|
||||
script.
|
||||
var replay = !{JSON.stringify(replay.toJSON())};
|
||||
var battle = new Battle({
|
||||
id: replay.id,
|
||||
format: replay.format,
|
||||
numActive: replay.numActive,
|
||||
playerIds: replay.players
|
||||
});
|
||||
var $battleWindow = $(window.JST['battle_window']({
|
||||
battle: battle,
|
||||
window: window
|
||||
}));
|
||||
|
||||
$('#replay').html($battleWindow);
|
||||
|
||||
battle.view = new BattleView({
|
||||
el: $battleWindow,
|
||||
model: battle
|
||||
});
|
||||
|
||||
battle.update(replay.contents);
|
||||
Reference in New Issue
Block a user