src/templates/base.html

Summary

Maintainability
Test Coverage
<!doctype html>
<% import config %>
<html>
<head>
    % if page_title:
    <title>${page_title|h}</title>
    % else:
    <title>${config.TITLE|h}</title>
    % endif
    <meta charset="utf-8">
    <script src="${ static('js/main.js') }"></script>
    <link rel="stylesheet" href="${ static('css/style.css') }">
    <%block name="head"/>
</head>

<body>
    <div>
        % if req.current_user:
            <a href="${ url_for('signout') }">注销</a>
        % else:
            <a href="${ url_for('signup') }">注册</a>
            <a href="${ url_for('signin') }">登录</a>
        % endif
    </div>
    % for msg in get_messages():
        % if msg.tag == 'success':
            <div class="ui-green">
                ${msg.txt}
            </div>
        % elif msg.tag == 'error':
            <div class="ui-red">
                ${msg.txt}
            </div>
        % endif
    % endfor

    ${self.body()}
    <%block name="script"/>
</body>
</html>