Skip to content

Commit

Permalink
2.1@commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Madridspark committed Feb 1, 2017
1 parent f1d49d8 commit 6b76865
Show file tree
Hide file tree
Showing 9 changed files with 136 additions and 68 deletions.
3 changes: 2 additions & 1 deletion branch/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import os
from django.shortcuts import render, redirect
from django.http import HttpResponse
from central.models import StaticInfo

def index(request):
return render(request, 'branch-index.html', {})
return render(request, 'branch-index.html', {'staticInfo' : StaticInfo.objects.all()[0]})
Binary file modified branch/views.pyc
Binary file not shown.
30 changes: 15 additions & 15 deletions static/css/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,21 @@ span
.dis-ilb{display: inline-block;}

.font-base{font-size: 10px;}
.font-11{font-size: 1.1em;}
.font-12{font-size: 1.2em;}
.font-13{font-size: 1.3em;}
.font-14{font-size: 1.4em;}
.font-15{font-size: 1.5em;}
.font-16{font-size: 1.6em;}
.font-17{font-size: 1.7em;}
.font-18{font-size: 1.8em;}
.font-19{font-size: 1.9em;}
.font-20{font-size: 2.0em;}
.font-22{font-size: 2.2em;}
.font-24{font-size: 2.4em;}
.font-28{font-size: 2.4em;}
.font-30{font-size: 3.0em;}
.font-36{font-size: 3.6em;}
.font-11{font-size: 11px;}
.font-12{font-size: 12px;}
.font-13{font-size: 13px;}
.font-14{font-size: 14px;}
.font-15{font-size: 15px;}
.font-16{font-size: 16px;}
.font-17{font-size: 17px;}
.font-18{font-size: 18px;}
.font-19{font-size: 19px;}
.font-20{font-size: 20px;}
.font-22{font-size: 22px;}
.font-24{font-size: 24px;}
.font-28{font-size: 24px;}
.font-30{font-size: 30px;}
.font-36{font-size: 36px;}

.color-f{color: #fff;}
.color-e{color: #eee;}
Expand Down
63 changes: 63 additions & 0 deletions static/css/branch/base.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
header
{
height: 346px;
}

h2
{
height: 300px;
background-color: #eee;
}

nav
{
text-align: center;
border-bottom: 1px solid #ddd;
background-color: #fff;
}

nav li
{
margin: 0 1em;
line-height: 3em;
transition: color 0.5s, width 1s;
}

nav li:hover
{
color: orangered;
}

nav.fixed
{
width: 100%;
position: fixed;
top: 0;
}

footer
{
padding: 20px 0 10px;
background-color: #333;
}

.footer-about
{
position: relative;
text-align: right;
}

.footer-about span
{
position: absolute;
left: 10px;
}

.footer-about li
{
display: inline-block;
margin: 5px 1em;
padding: 0.2em 2em;
border: 1px solid #ccc;
border-radius: 5px;
}
5 changes: 0 additions & 5 deletions static/css/central/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,6 @@ footer
background-color: #333;
}

.foot-friends
{
text-align: center;
}

.foot-about
{
position: relative;
Expand Down
Binary file added static/img/test.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions static/js/branch/base.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
$(function()
{
isToggle = false;
$(window).scroll(function()
{
if(($(window).scrollTop() > 300 && !isToggle) || ($(window).scrollTop() < 300 && isToggle))
{
$("#nav-bar").toggleClass("fixed");
isToggle = !isToggle;
}
});
});
45 changes: 21 additions & 24 deletions templates/branch-base.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,38 @@
<html>
<head>
<meta charset="utf-8">
<title>{% block title %}首页{% endblock %} - {{ branch }} - {{ section }}</title>
<link rel="stylesheet" type="text/css" href="static/css/base.css">
<title>{% block title %}首页{% endblock %} - {{ branch.name }} - {{ staticInfo.theName }}</title>
<link rel="stylesheet" type="text/css" href="/static/css/base.css">
<link rel="stylesheet" type="text/css" href="/static/css/branch/base.css">
{% block css %}
{% endblock %}
</head>
<body>
<header>
<div class="font-base wrap color-6 nav-fixed">
<h2 style="background-image: url(/static/upload/{{ staticInfo.theLogo }});" class="font-16 nav-content fl">
{{ staticInfo.theName }}
</h2>
<nav class="nav-content fr">
<ul class="color-3 font-15 nav-list fl">
<li><a href="#">我的大学</a></li>
<li><a href="#">高校动态</a></li>
<li><a href="#">论坛</a></li>
<li><a href="#">关于本站</a></li>
</ul>
<div class="font-14 nav-aside nav-content fl">
<a href="#">登录</a>
<span>|</span>
<a href="#">注册</a>
</div>
</nav>
</div>
<!--style="background-image: url({{ branch.hero }});"-->
<h2 class="font-36">
{{ staticInfo.theName }}<span class="font-14">[{{ branch.name }}]</span>
</h2>
<nav id="nav-bar" class="wrap color-6">
<ul class="color-3 font-15 nav-list">
<li class="dis-inl"><a href="#">我的大学</a></li>
<li class="dis-inl"><a href="#">高校动态</a></li>
<li class="dis-inl"><a href="#">论坛</a></li>
<li class="dis-inl"><a href="#">关于本站</a></li>
</ul>
</nav>
</header>

{% block content %}
{% endblock %}
<footer>
<ul class="foot-about font-12 color-c">
<span>© 2017 {{ staticInfo.theLink }}</span>
<ul class="footer-about font-12 color-c">
<span>© 2017 <a href="http://{{ staticInfo.theLink }}">{{ staticInfo.theLink }}</a></span>
<li><a href="#">提建议、求助,请联系我们</a></li>
<li><a href="#">加入我们</a></li>
</ul>
</footer>
<script src="static/js/jquery-3.1.1.min.js"></script>
<script src="/static/js/jquery-3.1.1.min.js"></script>
<script src="/static/js/branch/base.js"></script>
{% block js %}
{% endblock %}
</body>
Expand Down
46 changes: 23 additions & 23 deletions templates/central-index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
<head>
<meta charset="utf-8">
<title>{% block title %}首页{% endblock %} - {{ staticInfo.theName }}</title>
<link rel="stylesheet" type="text/css" href="static/css/base.css">
<link rel="stylesheet" type="text/css" href="static/css/central/index.css">
<link rel="stylesheet" type="text/css" href="static/css/img-rolling.css">
<link rel="stylesheet" type="text/css" href="static/fonts/central/iconfont.css">
<link rel="stylesheet" type="text/css" href="/static/css/base.css">
<link rel="stylesheet" type="text/css" href="/static/css/central/index.css">
<link rel="stylesheet" type="text/css" href="/static/css/img-rolling.css">
<link rel="stylesheet" type="text/css" href="/static/fonts/central/iconfont.css">
</head>
<body>
<header>
<div class="font-base wrap color-6 nav-fixed">
<div class="wrap color-6 nav-fixed">
<h2 style="background-image: url(/static/upload/{{ staticInfo.theLogo }});" class="font-16 nav-content fl">
{{ staticInfo.theName }}
</h2>
Expand All @@ -35,7 +35,7 @@ <h2 style="background-image: url(/static/upload/{{ staticInfo.theLogo }});" clas
<div class="rollingl rolling-btn absl"></div>
<ul>
{% for img in heroImages %}
<li><a style="background-image:url(static/upload/{{ img.theImage }});" href="{{ img.theLink }}"></a></li>
<li><a style="background-image:url(/static/upload/{{ img.theImage }});" href="{{ img.theLink }}"></a></li>
{% endfor %}
</ul>
<div class="rollingr rolling-btn absr"></div>
Expand All @@ -44,33 +44,33 @@ <h2 style="background-image: url(/static/upload/{{ staticInfo.theLogo }});" clas
<article class="art wrap">
<div class="art-disp fl font-14 color-5">
<div class="arts-list fl">
<h3 class="font-16">高校动态</h3>
<h3 class="font-22">高校动态</h3>
<a href="#" class="list-more color-a">更多>></a>
<ul>
<li><a href="#">跳转到详情页。。。</a></li>
</ul>
</div>
<div class="arts-list fl">
<h3 class="font-16">高校秘密</h3>
<h3 class="font-22">高校秘密</h3>
<a href="#" class="list-more color-a">更多>></a>
<ul>
<li><a href="#">跳转到详情页。。。</a></li>
</ul>
</div>
<div class="arts-list fl">
<h3 class="font-16">网站简介</h3>
<div class="list-about font-12">
<h3 class="font-22">网站简介</h3>
<div class="list-about font-17">
{{ staticInfo.theIntro|safe }}
</div>
</div>
<div class="arts-list arts-list-last fl">
<h3 class="font-16">管理团队</h3>
<h3 class="font-22">管理团队</h3>
{% for row in staticTeammates %}
<ul class="list-teammates">
{% for teammates in row %}
<li class="fl">
<img width="150" height="150" src="static/upload/{{ teammates.theHeaderImage }}">
<h4 class="font-13 color-0">{{ teammates.thePersonName }}</h4>
<img width="150" height="150" src="/static/upload/{{ teammates.theHeaderImage }}">
<h4 class="font-18 color-0">{{ teammates.thePersonName }}</h4>
<p>{{ teammates.thePersonIntro }}</p>
</li>
{% endfor %}
Expand Down Expand Up @@ -99,18 +99,18 @@ <h4 class="font-13 color-0">{{ teammates.thePersonName }}</h4>
<div class="aside-video">
<h3>本站宣传视频</h3>
<video width="310" controls="controls">
<source src="static/upload/{{ videoFiles.OGG }}" type="video/ogg" />
<source src="static/upload/{{ videoFiles.MP4 }}" type="video/mp4" />
<source src="static/upload/{{ videoFiles.WEBM }}" type="video/webm" />
<object data="static/upload/{{ videoFiles.MP4 }}" width="310">
<embed width="310" src="static/upload/{{ videoFiles.SWF }}" />
<source src="/static/upload/{{ videoFiles.OGG }}" type="video/ogg" />
<source src="/static/upload/{{ videoFiles.MP4 }}" type="video/mp4" />
<source src="/static/upload/{{ videoFiles.WEBM }}" type="video/webm" />
<object data="/static/upload/{{ videoFiles.MP4 }}" width="310">
<embed width="310" src="/static/upload/{{ videoFiles.SWF }}" />
</object>
</video>
</div>
<div class="aside-addition">
<h3>特别关注</h3>
<a href="{{ noticeImage.theLink }}">
<img width="310" src="static/upload/{{ noticeImage.theImage }}">
<img width="310" src="/static/upload/{{ noticeImage.theImage }}">
</a>
</div>
<div class="aside-comm">
Expand Down Expand Up @@ -140,13 +140,13 @@ <h3>联系方式</h3>
</article>
<footer>
<ul class="foot-about font-12 color-c">
<span>© 2017 {{ staticInfo.theLink }}</span>
<span>© 2017 <a href="http://{{ staticInfo.theLink }}">{{ staticInfo.theLink }}</a></span>
<li><a href="#">提建议、求助,请联系我们</a></li>
<li><a href="#">加入我们</a></li>
</ul>
</footer>
<script src="static/js/jquery-3.1.1.min.js"></script>
<script src="static/js/img-rolling.js"></script>
<script src="static/js/central/index.js"></script>
<script src="/static/js/jquery-3.1.1.min.js"></script>
<script src="/static/js/img-rolling.js"></script>
<script src="/static/js/central/index.js"></script>
</body>
</html>

0 comments on commit 6b76865

Please sign in to comment.