2017年5月-6月,本小组做山东大学软件工程专业项目实训。我们做的项目是“基于信号处理的在线云评测+社区系统”,我和另一位组员@zhan010g负责其中一部分。
本周我们写了HTML用户注册界面,我们写的代码如下。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta name="description" content="">
<meta name="author" content="">
<title>Signin Template for Bootstrap</title>
<!-- Bootstrap core CSS -->
<link href="../../../../static/dist/css/bootstrap.min.css" rel="stylesheet">
<script type="text/javascript">
function control_editor(){
var show = document.getElementById("editor").style.display;
if(show=="none"){
document.getElementById("editor").style.display="";
document.getElementById("show_editor").innerHTML = "hide_editor";
} else{
document.getElementById("editor").style.display="none";
document.getElementById("show_editor").innerHTML = "show_editor";
}
}
</script>
</head>
<body>
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">judgeOL</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">judgeOL</a>
<a class="navbar-brand" href="#">Problems</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
<a href="{% url 'judgeOL:login' %}">
<button class="btn btn-primary btn-lg" >Sign in</button>
</a>
<a href="{% url 'judgeOL:register' %}">
<button class="btn btn-default btn-lg">Sign up</button>
</a>
</ul>
</div>
</div>
</nav>
<br><br><br><br>
<div class="container">
<div class="row">
<div class="col-md-8 col-md-offset-2">
{% if discussion %}
<h1>{{ discussion.name }}</h1>
<blockquote>
<h2>
<span class="label label-warning">
<i class="glyphicon glyphicon-user"></i> {{ discussion.user.name }}
</span>
<button type="button" disabled="disabled" class="btn btn-default pull-right">
<span><i class="glyphicon glyphicon-eye-open"></i> {{ discussion.view_count }} </span>
</button>
<button type="button" class="btn btn-info pull-right">
<span><i class="glyphicon glyphicon-star"></i> {{ discussion.vote_count }} </span>
</button>
</h2>
<br>
<p class="well">{{ discussion.pub_text }}</p>
<p class="well"><code>{{ discussion.pub_code }}</code></p>
<span class="label label-success">{{ discussion.pub_date}}</span>
</blockquote >
{% endif %}
<hr>
<div>
<button type="button" id="show_editor" οnclick="control_editor()" class="btn btn-primary">show editor</button>
</div>
<div id="editor" style="display:none;" class="container-fluid">
<hr/>
<form action="{% url 'judgeOL:new_response' problem_id=problem_id discussion_id=discussion.id%}" method="post">
{% csrf_token %}
<div>
<h2>TEXT:</h2>
<textarea rows="8" name="text" class="form-control col-md-12">text:123124123123</textarea>
</div>
<div>
<h2>CODE:</h2>
<textarea rows="8" name="code" class="form-control col-md-12">code:123124123123</textarea>
</div>
<button type="submit" id="response" class="btn btn-primary pull-right">response</button>
</form>
</div>
<hr>
<blockquote>
<h3>
<span class="label label-success">
<i class="glyphicon glyphicon-user"></i> Rain
</span>
<button type="button" class="btn btn-info pull-right">
<span><i class="glyphicon glyphicon-star"></i> 100 </span>
</button>
</h3>
<p class="well">text</p>
<p class="well"><code>code</code></p>
<span class="label label-success">time</span>
</blockquote >
{% if response_list %}
{% for response in response_list %}
<blockquote>
<h3>
<span class="label label-success">
<i class="glyphicon glyphicon-user"></i> {{ response.user.name }}
</span>
<button type="button" class="btn btn-info pull-right">
<span><i class="glyphicon glyphicon-star"></i> {{ response.vote_count }} </span>
</button>
</h3>
<p class="well">{{ response.pub_text }}</p>
<p class="well"><code>{{ response.pub_code }}</code></p>
<span class="label label-success">{{ response.pub_data }}</span>
</blockquote >
{% endfor %}
{% endif %}
<hr/>
<ul class="pagination">
<li class="active"><a href="#">1</a></li>
<li><a href="#">2</a></li>
<li><a href="#">3</a></li>
<li><a href="#">4</a></li>
<li><a href="#">5</a></li>
</ul>
</div>
</div>
</div>
</body>
</html>