Skip to content

Commit

Permalink
update base template
Browse files Browse the repository at this point in the history
  • Loading branch information
gothack329 committed Feb 25, 2018
1 parent 8330601 commit f9da029
Show file tree
Hide file tree
Showing 18 changed files with 513 additions and 9 deletions.
Binary file modified article/__pycache__/views.cpython-36.pyc
Binary file not shown.
2 changes: 1 addition & 1 deletion article/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Create your views here.

def homepage(request):
return HttpResponse('<p>Test</p>')
return render(request,'base.html')


def detail(request, article_id):
Expand Down
Binary file modified edconline/__pycache__/settings.cpython-36.pyc
Binary file not shown.
2 changes: 1 addition & 1 deletion edconline/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'DIRS': [os.path.join(BASE_DIR, 'templates')],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
Expand Down
Binary file added static/bootstrap/css/.style.css.swp
Binary file not shown.
5 changes: 5 additions & 0 deletions static/bootstrap/css/bootstrap-theme.min.css

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions static/bootstrap/css/bootstrap.min.css

Large diffs are not rendered by default.

76 changes: 76 additions & 0 deletions static/bootstrap/css/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@


html,body {
background-color:#f6f8fa;
height: 100%;
}

.navbar-collapse {
background-color: rgba(38,41,46,0.9);
box-shadow:0 0 2px 0 #25292e;
}

.navbar-nav {
float: none;
text-align:center;
}

ul.nav.navbar-nav li {
float:none;
display: inline-block;
margin: 0em;
}

ul.nav.navbar-nav li .logo {
font-size:40px;
color:#f6f8fa;
}

ul.nav.navbar-nav li a:hover {
text-decoration:none;
}

.container-fluid {
padding-top:50px;
position:relative;
min-height:100%;
/*设置padding-bottom值大于等于footer的height值,以保证main的内容能够全部显示出来而不被footer遮盖;*/
padding-bottom: 150px;
box-sizing: border-box;
}

.sidebar , .content {
margin-top:10px;
}

.card {
width:100%;
margin:10px;
padding:10px;
border: 1px solid #e2e2e2;
box-shadow: 1px 1px 1px 1px #e2e2e2;
background-color:white;
}


footer {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 150px;
background-color: #25292e;
}
footer, footer a{
color:white;
}

.foot-wrap .foot-top {
padding:20px;
}


.foot-wrap .foot-bottom {
padding: 20px;
border-top:1px solid rgba(255,255,255,.2);
}
Binary file not shown.
288 changes: 288 additions & 0 deletions static/bootstrap/fonts/glyphicons-halflings-regular.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
7 changes: 7 additions & 0 deletions static/bootstrap/js/bootstrap.min.js

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions static/bootstrap/js/jquery.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions static/bootstrap/js/scripts.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// Empty JS for your own code to be here
Binary file added templates/.base.html.swp
Binary file not shown.
131 changes: 124 additions & 7 deletions templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,128 @@
{% load staticfiles %}

<html>
<head>
<title>{% if title %}{{title}} - {% endif %}物志</title>
{% block header %}
{% endblock %}
</head>
<body>
</body>
<head>
<title>{% if title %}{{title}} - {% endif %}物志</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="EDC online">
<meta name="author" content="物志">
<link href="/static/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href='http://cdn.webfont.youziku.com/webfonts/nomal/114602/46453/5a919786f629d911e0099415.css' rel='stylesheet' type='text/css' />
{% block header %}
<link href="/static/bootstrap/css/style.css" rel="stylesheet">
{% endblock %}
</head>
<body>

<nav class="navbar-collapse collapse navbar-fixed-top">
<div class="container">
<ul class="nav navbar-nav">
<li class="css106de12c1c1bfaa ">
<a class="logo" href='/'>物志</a>
</li>
<li class="navbar-right">
{% if user.login %}
头像
{% else%}
<a href="#">登录</a>
{% endif %}
</li>

</ul>
</div>
</nav>

<div class="container-fluid">
<div class="container">
<div class="row ">
<div class="content col-md-8">

<div class="card">
<p>这里是正文栏</p>
<p>这里是正文栏</p>
<p>这里是正文栏</p>
<p>这里是正文栏</p>
<p>这里是正文栏</p>
</div>

<div class="card">
<p>这里是正文栏</p>
<p>这里是正文栏</p>
<p>这里是正文栏</p>
<p>这里是正文栏</p>
<p>这里是正文栏</p>
</div>

<div class="card">
<p>这里是正文栏</p>
<p>这里是正文栏</p>
<p>这里是正文栏</p>
<p>这里是正文栏</p>
<p>这里是正文栏</p>
</div>

<div class="card">
<p>这里是正文栏</p>
<p>这里是正文栏</p>
<p>这里是正文栏</p>
<p>这里是正文栏</p>
<p>这里是正文栏</p>
</div>

<div class="card">
<p>这里是正文栏</p>
<p>这里是正文栏</p>
<p>这里是正文栏</p>
<p>这里是正文栏</p>
<p>这里是正文栏</p>
</div>

</div>

<div class="sidebar col-md-4">
{% block sidebar %}
{% endblock %}
<div class="card">
<p>这里是右侧边栏</p>
<p>这里是右侧边栏</p>
<p>这里是右侧边栏</p>
</div>
<div class="card">
<p>这里是右侧边栏</p>
<p>这里是右侧边栏</p>
<p>这里是右侧边栏</p>
</div>

</div>
</div>
</div>

<footer class="foot-wrap">
<!--采用container,使得页尾内容居中 -->
<div class="container">
<section class="foot-top">
<strong>
<a href="" >关于</a>
<a href="" >关于</a>
<a href="" >关于</a>
<a href="" >关于</a>
<strong>
</section>

<section class="foot-bottom">
<span class="css106de12c1c1bfaa" style="font-size:30px;font-color:#d73a49">
<a class="logo" href='/'>物志</a>
</span>
Copyright ©2018
</section>
</div>

</footer>

<script src="/static/bootstrap/js/jquery.min.js"></script>
<script src="/static/bootstrap/js/bootstrap.min.js"></script>
<script src="/static/bootstrap/js/scripts.js"></script>
</body>
</html>

0 comments on commit f9da029

Please sign in to comment.