Skip to content

Commit

Permalink
fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
gothack329 committed Mar 11, 2018
1 parent c6da3a9 commit 31ec80d
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 14 deletions.
Binary file modified article/__pycache__/models.cpython-36.pyc
Binary file not shown.
2 changes: 1 addition & 1 deletion article/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Article(models.Model):
section=models.ForeignKey(Section,on_delete=models.CASCADE,default=0)
author_id = models.ForeignKey(Profile,on_delete=models.CASCADE,default=0)
publish_time = models.DateTimeField(auto_now_add=True,editable=False)
cover = models.ImageField(upload_to='static/upload/', blank=True, null=True)
cover = models.ImageField(upload_to='static/upload/')
title = models.CharField(max_length=1024)
detail = HTMLField()
ip = models.GenericIPAddressField(blank=True,null=True)
Expand Down
4 changes: 2 additions & 2 deletions article/templates/article/detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@


{% block banner %}
<div class="banner" style="background:url(/{{art.cover}}) no-repeat;background-position:center;background-size:cover;">
<div class="banner" style="background:silver url(/{{art.cover}}) no-repeat;background-position:center;background-size:cover;">
<div class="container">
<h1>{% if art %}{{art.title}}{% endif %} </h1>
</div>
Expand All @@ -57,7 +57,7 @@ <h1>{% if art %}{{art.title}}{% endif %} </h1>
<span class="fad">发表于:{{art.publish_time|timetonow}}</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span class="fad">标签:{% if arg.tag %}{{art.tag}}{% endif %}</span>
<span class="sep margintop" ></span>
<div class="ad1"> <h3>广告位</h3> </div>
<div class="ad1"> </div>
{{art.detail|safe }}
</div>

Expand Down
2 changes: 1 addition & 1 deletion article/templates/article/publish.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ <h4>{{operation}}文章</h4>
</div>

<div class="card margintop article-content">
<div class="ad1"> <h3>广告位</h3> </div>
<div class="ad1"> </div>
{{art.detail|safe|escape }}
</div>

Expand Down
Binary file modified db.sqlite3
Binary file not shown.
18 changes: 15 additions & 3 deletions static/bootstrap/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ span.floor {
}

.ad1 {
display:none;
height:100px;
background-color:silver;
text-align:center;
Expand All @@ -174,6 +175,7 @@ span.floor {
}

.ad2 {
display:none;
height:250px;
background-color:silver;
text-align:center;
Expand Down Expand Up @@ -246,14 +248,24 @@ footer, footer a{
}

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

height:60px;
}

.foot-wrap .foot-bottom {
padding: 20px;
border-top:1px solid rgba(255,255,255,.2);
}

.foot-wrap .foot-top ul {
list-style: none;
float:left;
padding-left:20px;
width:100%;
}



.foot-wrap .foot-top ul li {
float:left;
padding-right:20px;
}
18 changes: 11 additions & 7 deletions templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ <h4>主题分区</h4>
{% endfor %}
</div>
<div class="card ad2">
<h4>广告位</h4>
</div>

{% endblock %}
Expand All @@ -154,18 +153,23 @@ <h4>广告位</h4>

<footer class="foot-wrap">
<div class="container">
<section class="foot-top">
<strong>
<div class="foot-top">
<ul>
<li>
<a href="" >关于</a>
</strong>
</section>
</li>
<li>
<a href="" >社区守则</a>
</li>
</ul>
</div>

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

Expand Down

0 comments on commit 31ec80d

Please sign in to comment.