You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
require "phlex"
|
|
|
|
|
|
|
|
module RankKing
|
|
|
|
module Views
|
|
|
|
|
|
|
|
class Layout < Phlex::HTML
|
|
|
|
def initialize(title: nil)
|
|
|
|
@title = title
|
|
|
|
end
|
|
|
|
|
|
|
|
def template(&block)
|
|
|
|
doctype
|
|
|
|
html(lang: "en") do
|
|
|
|
head do
|
|
|
|
meta(charset: "utf-8")
|
|
|
|
meta(name: "viewport", content: "width=device-width, initial-scale=1")
|
|
|
|
title { ["Rank King", @title].compact.join(" - ") }
|
|
|
|
end
|
|
|
|
|
|
|
|
body do
|
|
|
|
header do
|
|
|
|
h1 { "Rank King" }
|
|
|
|
end
|
|
|
|
|
|
|
|
nav
|
|
|
|
|
|
|
|
main(&block)
|
|
|
|
|
|
|
|
footer
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
class NewPool < Phlex::HTML
|
|
|
|
def initialize(csrf_token:)
|
|
|
|
@csrf_token = csrf_token
|
|
|
|
end
|
|
|
|
|
|
|
|
def template
|
|
|
|
form do
|
|
|
|
input(type: "hidden", name: "_csrf", value: @csrf_token)
|
|
|
|
label(for: "name")
|
|
|
|
input(type: "text", name: "name", id: "name", required: true)
|
|
|
|
input(type: "submit", value: "Create")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|