基于django的实验室网站管理平台设计与实现(五)

十三、首页模块
1.修改视图函数(./homeApp/views.py)
from django.shortcuts import render
from django.shortcuts import HttpResponse

Create your views here.

def home(request):
return render(request,‘home.html’)

2.在homeApp中新增模板文件夹,新增home.html文件

3.配置首页模板(home.html)
{% extends “base.html” %}
{% load static%}
{% block title %}
首页
{% endblock %}
{% block content %}

15
15
15
<div class="row row-3 col-md-12">
	<div class="col-md-8">
		<!-- 实验室 -->
		<span class="part1">
			<a href="{% url 'aboutApp:labinfo' %}">实验室概况</a>
		</span>
		<span class="part1 en">	&nbsp;&nbsp;/ About Us
		</span>
		<div class="line1">
			<div class="line2 theme"></div>
		</div>
		<div style="margin-top:20px;">
			<img class="img-responsive" src="{% static 'images/sys.png' %}">
			<p class="text1">
			  南开大学滨海学院于2004年经教育部批准设立,学院建院以来十分重视实验室建设,从建院至今,已投入九千多万元建设实验室。
			  在建设中,根据教学科研和学科建设需要,坚持“统筹规划、分步实施、资源共享、急用先建”的原则,使得学院各个实验室都能充分发挥效益。 
			</p>
		</div>  
	</div>
	
	<div class="col-md-4">
	  <!-- 通知公告 -->
	  <span class="part1">
		<a href="#"><img src="{% static 'images/notice.jpeg' %}"style="width:30px;height:30px">通知公告</a>
	  </span>
	  <span class="part1 en">
		&nbsp;&nbsp;/ Notice
	  </span>
	  <a class="btn btn-default btn-xs more-btn" href="{% url 'newsApp:news' '03' %}">
		+&nbsp;更多
	  </a>
	  <div class="line1">
		<div class="line2 theme"></div>
	  </div>
	  <div>
		
		<ul class="list-unstyled list-new">
		  {% for note in noteList %}
		  <li>
			<a href="{% url 'newsApp:newDetail' note.id %}">
			  {{note.XWBT|truncatechars:"25"}}
			</a>
			<span>【{{note.CJSJ|date:"Y-m-d"}}】</span>
		  </li>
		  {% endfor %}
		</ul>
	  </div>
	</div>


</div>
<div class="row row-3 col-md-12">

	<div class="col-md-6">
	  <!-- 规章制度 -->
	  <span class="part1">
		<a href="#"><img src="{% static 'images/gzzd.jpeg' %}"style="width:30px;height:30px">规章制度</a>
	  </span>
	  <span class="part1 en">
		&nbsp;&nbsp;/ Regulations 
	  </span>
	  <a class="btn btn-default btn-xs more-btn" href="{% url 'rulesApp:rules' '01' %}">
		+&nbsp;更多
	  </a>
	  <div class="line1">
		<div class="line2 theme"></div>
	  </div>
	  <div>
		
		<ul class="list-unstyled list-new">
		  {% for gzzd in gzzdList %}
		  <li>
			<a href="{% url 'rulesApp:ruleDetail' gzzd.id %}">
			  {{gzzd.GZZDBT|truncatechars:"25"}}
			</a>
			<span>【{{gzzd.CJSJ|date:"Y-m-d"}}】</span>

		  </li>
		  {% endfor %}
		</ul>
	  </div>
	</div>
	
	<div class="col-md-6">
		<!-- 新闻动态 -->
		<span class="part1">
		<a href="#"><img src="{% static 'images/news.jpeg' %}" style="width:30px;height:30px">新闻动态</a>
		</span>
		<span class="part1 en">
		&nbsp;&nbsp;/ News
		</span>
		<a class="btn btn-default btn-xs more-btn" href="{% url 'newsApp:news' '02' %}">
		+&nbsp;更多
		</a>
		<div class="line1">
			<div class="line2 theme"></div>
		</div>

		<div class="col-md-10">
			
			<ul class="list-unstyled list-new">
			  {% for mynew in newList %}
			  <li>
				<a href="{% url 'newsApp:newDetail' mynew.id %}">
				  {{mynew.XWBT|truncatechars:"15"}}</a>
				<span>【{{mynew.CJSJ|date:"Y-m-d"}}】</span>
			  </li>
			  {% endfor %}
			</ul>
		</div>    
	</div>		
</div>		

<div class="row row-3 col-md-12">

	<div class="col-md-6">
	  <!-- 规章制度 -->
	  <span class="part1">
		<a href="#"><img src="{% static 'images/gzzd.jpeg' %}"style="width:30px;height:30px">安全管理制度</a>
	  </span>
	  <span class="part1 en">
		&nbsp;&nbsp;/ Regulations
	  </span>
	  <a class="btn btn-default btn-xs more-btn" href="{% url 'rulesApp:rules' '01' %}">
		+&nbsp;更多
	  </a>
	  <div class="line1">
		<div class="line2 theme"></div>
	  </div>
	  <div>
		
		<ul class="list-unstyled list-new">
		  {% for aqzd in aqglzdList %}
		  <li>
			<a href="{% url 'rulesApp:ruleDetail' aqzd.id %}">
			  {{aqzd.GZZDBT|truncatechars:"25"}}
			</a>
			<span>【{{aqzd.CJSJ|date:"Y-m-d"}}】</span>
		  </li>
		  {% endfor %}
		</ul>
	  </div>
	</div>		

	
	<div class="col-md-6">
	  <!-- 实验室信息 -->
	  <span class="part1">
		<a href="#"><img src="{% static 'images/lab.png' %}" style="width:30px;height:30px">实验室信息</a>
	  </span>
	  <span class="part1 en">
		&nbsp;&nbsp;/ Labs
	  </span>
	  <a class="btn btn-default btn-xs more-btn" href="{% url 'aboutApp:labs' '01' %}">
		+&nbsp;更多
	  </a>
	  <div class="line1">
		<div class="line2 theme"></div>
	  </div>
	  <div>
		
		<ul class="list-unstyled list-new">
		  {% for labxx in labtList %}
		  <li>
			<a href="{% url 'aboutApp:labDetail' labxx.id %}">
			  {{labxx.LABMC|truncatechars:"25"}}
			</a>
			<span>【{{labxx.CJSJ|date:"Y-m-d"}}】</span>
		  </li>
		  {% endfor %}
		</ul>
	  </div>
	</div>
</div>

<div class="row row-3">
	<!-- 友情链接 -->
	<div class="col-md-12">	
		<span class="part1">
			<a href="#">友情链接</a>
		</span>
	</div>
	<div class="line1">
		<div class="line2 theme"></div>
	</div>
	<div class="col-md-2">		
		<a href="http://binhai.nankai.edu.cn/">南开大学滨海学院</a>
	</div>
	<div class="col-md-2">		
		<a href="http://binhai.nankai.edu.cn/">滨海学院教务网</a>
	</div>
	<div class="col-md-2">		
		<a href="http://binhai.nankai.edu.cn/">滨海学院实验室</a>
	</div>
	<div class="col-md-2">		
		<a href="http://binhai.nankai.edu.cn/">滨海学院图书馆</a>
	</div>
	<div class="col-md-2">		
		<a href="http://binhai.nankai.edu.cn/">就业指导中心</a>
	</div>
	<div class="col-md-2">		
		<a href="http://binhai.nankai.edu.cn/">滨海学院新闻网</a>
	</div>
</div>

{% endblock %}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值