码迷,mamicode.com
首页 > 其他好文 > 详细

加载静态文件,父模板的继承和扩展

时间:2017-11-05 20:07:30      阅读:173      评论:0      收藏:0      [点我收藏+]

标签:name   模板   用户   container   write   styles   加载   span   idt   

<!DOCTYPE html>
<html lang="en">
<head>
 <meta charset="UTF-8">
 <title>{% block denglutitle %}{% endblock %}
         {% block zhucetitle %}{% endblock %}
     夜间模式</title>

<link rel="stylesheet" type="text/css" href="../static/css/test.css">
     <script>
        function mySwitch() {
            var oBody=document.getElementById("myBody");
            var oOnoff=document.getElementById("myOnOff");
            if (oOnoff.src.match("bulbon")){
                oOnoff.src="http://www.runoob.com/images/pic_bulboff.gif";
                oBody.style.background="black";
                oBody.style.color="white";

            }else {
                oOnoff.src="http://www.runoob.com/images/pic_bulbon.gif";
                oBody.style.background="white";
                oBody.style.color="black";

            }

        }
    </script>
{% block dengluhead %}{% endblock %}
{% block zhucehead %}{% endblock %}
</head>
<script>
    document.write(Date())
</script>
<nav>
 <a href="{{ url_for(‘test‘) }}">首页</a>
 <input type="text" ></input>
 <button type="submit">搜索</button>
 <a href="{{ url_for(‘denglu‘) }}">登录</a>
 <a href="{{ url_for(‘zhuce‘) }}">注册</a>
</nav>
<p align="right"><img id="myOnOff" onclick="mySwitch()" src="http://www.runoob.com/images/pic_bulbon.gif" width="40px"></p>



<body id="myBody">



{% block denglubody %}{% endblock %}
{% block zhucebody %}{% endblock %}
</body>



</html>
{% extends ‘test.html‘%}
{% block zhucetitle %}注册界面{% endblock %}
{% block zhucehead %}

    <meta charset="UTF-8">
    <title>注册界面</title>
    <script src="../static/js/wang.js"></script>
    <link rel="stylesheet" type="text/css" href="../static/css/zhuce.css">
{% endblock %}
{% block zhucebody %}

<div class="div" id="container">
    <div id="header" >
        <h2 class="h">注册</h2>
    </div>
    <div id="content">
            <p class="p">账号:
                <input id="uname" type="text" placeholder="请输入用户名">
            </p>
            <p class="p">密码:
                <input id="upass" type="password" >
            </p>
            <p class="p">再次输入密码:
                <input id="upass2" type="password" >
            </p>
            <div id="error_box"><br>
            </div>
    </div>
    <div>
        <button  onclick="fnLogin()">注册</button>
    </div>
    </div>
    <div>
        <i>版权信息@</i>
    </div>


{% endblock %}
{% extends ‘test.html‘%}
{% block denglutitle %}欢迎你,请先登陆!{% endblock %}



{% block dengluhead %}


    <script  src="../static/js/wang1.js"></script>
    <link rel="stylesheet"  type="text/css"  href="../static/css/zhuce.css">
{% endblock %}
{% block denglubody %}

<div class="div" id="container">
    <div id="header" >
        <h2 class="h">登陆</h2>
    </div>
    <div id="content">
            <p class="p">账号:
                <input id="uname" type="text" placeholder="请输入用户名">
            </p>
            <p class="p">密码:
                <input id="upass" type="password" >
            </p>
            <div id="error_box"><br>
            </div>
            <button  onclick="register()">登陆</button>
            &nbsp&nbsp&nbsp
            <input type="button" name="regist" value="注册">
    </div>
    <div>
        <i>版权信息@</i>
    </div>
</div>
{% endblock %}

 

加载静态文件,父模板的继承和扩展

标签:name   模板   用户   container   write   styles   加载   span   idt   

原文地址:http://www.cnblogs.com/wangze019/p/7788276.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!