Add a base layout.
This commit is contained in:
parent
75a386539e
commit
e7b1144301
|
@ -50,7 +50,7 @@ get "/game/:id" do |env|
|
|||
black = false
|
||||
end
|
||||
|
||||
black.try { |black| render "src/Go/views/game.ecr"} || render_404
|
||||
black.try { |black| render "src/Go/views/game.ecr", "src/Go/views/base.ecr"} || render_404
|
||||
else
|
||||
render_404
|
||||
end
|
||||
|
|
12
src/Go/views/base.ecr
Normal file
12
src/Go/views/base.ecr
Normal file
|
@ -0,0 +1,12 @@
|
|||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="/css/main.css">
|
||||
<link href="https://fonts.googleapis.com/css?family=Indie+Flower|Raleway" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<div class="content-wrapper">
|
||||
<h1>Go</h1>
|
||||
<%= content %>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -1,26 +1,6 @@
|
|||
<html>
|
||||
<head>
|
||||
<style>
|
||||
.board-cell {
|
||||
display: inline-block;
|
||||
background-color: #eaeaea;
|
||||
padding: 20px;
|
||||
}
|
||||
.black-cell {
|
||||
background-color: black;
|
||||
}
|
||||
.white-cell {
|
||||
background-color: white;
|
||||
}
|
||||
.board {
|
||||
max-width: 360px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="elm-root"></div>
|
||||
<script src="/js/Go.js"></script>
|
||||
<script>
|
||||
<div id="elm-root"></div>
|
||||
<script src="/js/Go.js"></script>
|
||||
<script>
|
||||
var node = document.getElementById('elm-root')
|
||||
var app = Elm.Main.embed(node, {
|
||||
'black' : <%= black %>,
|
||||
|
@ -28,6 +8,4 @@
|
|||
'id' : "<%= id %>",
|
||||
'size' : <%= size %>
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue
Block a user