Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions stage1/Zhangruihan/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
click==6.6
itsdangerous==0.24
Jinja2==2.8
MarkupSafe==0.23
requests==2.11.1
virtualenv==15.1.0
Werkzeug==0.11.11
Binary file added stage1/Zhangruihan/static/hust.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions stage1/Zhangruihan/static/plus.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
p {font-size:300%;color:red;}
5 changes: 5 additions & 0 deletions stage1/Zhangruihan/static/step2.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
document.getElementById("target").onclick=function(){click()};
function click()
{
alert("hello dalao");
}
19 changes: 19 additions & 0 deletions stage1/Zhangruihan/task.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from flask import Flask,render_template
app = Flask(__name__)

@app.route('/step1')
def step1():
return 'Hello, World!'

@app.route('/step2')
def step2():
return render_template('hello_world.html')

@app.route('/step3/<title>/<name>')
def step3(title,name):
list=['萌新','油条','大腿','dalao','juju','咸鱼']
for tag in list:
if tag==title:
return render_template('step3.html',title=tag,name=name,list=list)
return render_template('step3.html',title='other',name=name,list=list)

8 changes: 8 additions & 0 deletions stage1/Zhangruihan/templates/base.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<html>
<body>
{% block step3_hello %}
{% endblock %}
{% block step3_other %}
{% endblock %}
</body>
</html>
12 changes: 12 additions & 0 deletions stage1/Zhangruihan/templates/hello_world.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<html>
<head>
<link rel="stylesheet" type="text/css" href="{{url_for('static',filename='plus.css')}}" />
</head>

<body>
<p>hello world</p>
<img src="../static/hust.jpg" />
<button id="target" onclick="click()">Click me!</button>
<script src="{{url_for('static',filename='step2.js')}}"></script>
</body>
</html>
20 changes: 20 additions & 0 deletions stage1/Zhangruihan/templates/step3.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{% extends "base.html" %}

{% block step3_hello %}
<p>Hello, {{name}}! You are {{title}}.</p>
{% endblock %}

{% block step3_other %}
{% for rank in list %}
{% if rank==title %}
<h2><font color='blue'>{{rank}}</font></h2>
{% else %}
<h2>{{rank}}</h2>
{% endif %}
{% endfor %}
{% if title=='other' %}
<h2><font color='red'>other</font></h2>
{% else %}
<h2>other</h2>
{% endif %}
{% endblock %}