<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="initial-scale=1, width=device-width">
    {| block head_title |}
    {[ if ctx.com.title ~= '' then ]}
    <title>{{ ctx.com.title }} - {{ ctx.com.site.title }}</title>
    {[ else ]}
    <title>{{ ctx.com.site.title }}</title>
    {[ end ]}
    {| end block head_title |}
    {| block head |}{| end block head |}
    <link rel="stylesheet" href="/statics/style.css">
    {| block style |}{| end block style |}
</head>
<body>
    <div style="max-width: 900px; margin: auto;">
        {| block top_bar |}
        <div class="top-bar">
            <div class="top-bar-left">
                <h2><a href="/">{{ ctx.com.site.title }}</a></h2>
                &emsp;<form action="/vod/search/" method="GET">
                    <input name="kw" id="search-input" placeholder="搜索片名" onfocus="this.select()">
                    &nbsp;<input type="submit" value="搜索">
                </form>
            </div>
            <div class="top-bar-right">
                {[ if ctx.com.user.is_admin then ]}
                <div><a href="{= ctx.com.urls.admin =}">管理</a></div>
                {[ end ]}
                {[ if ctx.com.user.signed_in then ]}
                <div><a href="{= ctx.com.urls.my =}">设置</a></div>
                <div><a href="{= ctx.com.urls.sign_out =}">登出</a></div>
                {[ else ]}
                <div>
                    <a href="{= ctx.com.urls.sign_in =}">登录</a>/<a
                        href="{= ctx.com.urls.sign_up =}">注册</a>
                </div>
                {[ end ]}
            </div>
        </div>
        {| end block top_bar |}
        <div>{| block content |}{| end block content |}</div>
        <div>{| block footer |}{| end block footer |}</div>
    </div>
    {| block script |}{| end block script |}
</body>
</html>
