diff --git a/stage1/xwh/requirements.txt b/stage1/xwh/requirements.txt new file mode 100644 index 0000000..acedc42 --- /dev/null +++ b/stage1/xwh/requirements.txt @@ -0,0 +1,8 @@ +click===6.6 +Flask==0.11.1 +itsdangerous==0.24 +jinja2==2.8 +MarkupSafe==0.23 +requests==2.11.1 +virtualenv==15.1.0 +Werkzeug==0.11.11 \ No newline at end of file diff --git a/stage1/xwh/static/001.jpeg b/stage1/xwh/static/001.jpeg new file mode 100644 index 0000000..90a7bb8 Binary files /dev/null and b/stage1/xwh/static/001.jpeg differ diff --git a/stage1/xwh/static/css/hello.css b/stage1/xwh/static/css/hello.css new file mode 100644 index 0000000..ba9cdd0 --- /dev/null +++ b/stage1/xwh/static/css/hello.css @@ -0,0 +1 @@ +#mark{color:red} \ No newline at end of file diff --git a/stage1/xwh/static/css/hello_world.css b/stage1/xwh/static/css/hello_world.css new file mode 100644 index 0000000..968f292 --- /dev/null +++ b/stage1/xwh/static/css/hello_world.css @@ -0,0 +1,2 @@ +h1{color:red; + margin-left:20px;} \ No newline at end of file diff --git a/stage1/xwh/static/img/001.jpeg b/stage1/xwh/static/img/001.jpeg new file mode 100644 index 0000000..90a7bb8 Binary files /dev/null and b/stage1/xwh/static/img/001.jpeg differ diff --git a/stage1/xwh/static/js/hello_world.js b/stage1/xwh/static/js/hello_world.js new file mode 100644 index 0000000..01d3b8e --- /dev/null +++ b/stage1/xwh/static/js/hello_world.js @@ -0,0 +1,5 @@ +document.getElementById("target").onclick=function(){display()}; +function display() +{ +alert('afafww'); +} \ No newline at end of file diff --git a/stage1/xwh/task.py b/stage1/xwh/task.py new file mode 100644 index 0000000..c2f43e9 --- /dev/null +++ b/stage1/xwh/task.py @@ -0,0 +1,20 @@ +from flask import Flask,render_template +app=Flask(__name__) + + +@app.route('/step1') +def hello_world1(): + return 'Hello World!' +@app.route('/step2') +def hello_world2(): + return render_template('hello_world2.html') +@app.route('/step3///') +def hello(tag, name): + tag_list = ['xianyu', 'juju', 'dalao', 'datui', 'youtiao', 'mengxin'] + for list in tag_list: + if list == tag: + return render_template('hello.html',tag = list, name = name, tag_list = tag_list) + return render_template('hello.html',tag = 'other', name = name, tag_list = tag_list) + +if __name__=='__main__': + app.run() \ No newline at end of file diff --git a/stage1/xwh/templates/base.html b/stage1/xwh/templates/base.html new file mode 100644 index 0000000..8267dc6 --- /dev/null +++ b/stage1/xwh/templates/base.html @@ -0,0 +1,8 @@ + + + {% block one %} + {% endblock %} + {% block two %} + {% endblock %} + + \ No newline at end of file diff --git a/stage1/xwh/templates/hello.html b/stage1/xwh/templates/hello.html new file mode 100644 index 0000000..6c4205c --- /dev/null +++ b/stage1/xwh/templates/hello.html @@ -0,0 +1,19 @@ +{% extends "base.html" %} + +{% block one %} +

Hello, {{ name }}, You are {{ tag }}!


+{% endblock %} + + +{% block two %} + {% for elm in tag_list %} + {% if elm == tag %} +

{{ elm }}

+ {% else %} +

{{ elm }}

+ {% endif %} + {% endfor %} + {% if tag == 'other' %} +

other

+ {% endif %} +{% endblock %} \ No newline at end of file diff --git a/stage1/xwh/templates/hello_world2.html b/stage1/xwh/templates/hello_world2.html new file mode 100644 index 0000000..6f6357a --- /dev/null +++ b/stage1/xwh/templates/hello_world2.html @@ -0,0 +1,11 @@ + + + + + + +

Hello World!

+ + + + \ No newline at end of file