This commit is contained in:
Anna Sudnitsina 2017-11-05 00:12:08 +03:00
parent 479107efa3
commit d3c1c3046b
6 changed files with 169 additions and 37 deletions

View File

@ -1,3 +0,0 @@
h1 a {
color: #FCA205;
}

129
blog/static/css/new.css Normal file
View File

@ -0,0 +1,129 @@
a {
color: #4a809a;
}
body{
background: #ededed;
font-family: 'Open Sans', sans-serif;
}
#content {
margin: 10px 0 0 0;
}
.date {
color: #999999;
font-size: 12px;
letter-spacing: 1px;
//float: left;
}
input#button-search {
background: url('https://touchit.com.ua/static/images/icons/search-25.png') no-repeat center center;
border: none;
cursor: pointer;
//margin-top: 10px;
width: 32px;
height: 32px;
}
h2 {
font-size: 26.25px;
line-height: 31.5px;
margin: 10px 0;
}
#header {
background: #6da3bd;
box-shadow: 0 0 4px rgba(0, 0, 0, 0.14), 0 4px 8px rgba(0, 0, 0, 0.28);
display: block;
font-family: 'Open Sans', sans-serif;
height: 50px;
}
#logo {
color: #FFFFFF;
float: left;
font-family: 'Lato', sans-serif;
font-size: 25px;
height: 50px;
letter-spacing: 1px;
line-height: 50px;
padding: 0 0 0 15px;
text-align: center;
text-decoration: none;
vertical-align: top;
}
.post {
box-shadow: 0 0.005em 0.01em 0 rgba(0, 0, 0, 0.12), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
box-sizing: border-box;
background: #FFFFFF;
color: #1a1a1a;
display: block;
font-family: 'Open Sans'
font-size: 14px;
font-weight: 300;
line-height: 26px;
margin: 0 0 10px 0;
padding: 15px;
width: 100%;
}
.post-header {
font-family: 'Open Sans', sans-serif;
margin: 5px 0 10px 0;
}
.post-header a {
text-decoration: none;
color: #000;
}
.post-header a:hover {
color: #4a809a;
}
#posts {
box-sizing: border-box;
display: block;
float: left;
padding-right: 250px;
width: 100%;
}
#search {
float: right;
font-size: 100%;
display: block;
height: 50px;
}
#search-form {
margin: 10px 10px 0 10px;
//vertical-align: top;
}
.sidemenu {
box-shadow: 0 0.005em 0.01em 0 rgba(0, 0, 0, 0.12), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
box-sizing: border-box;
background: #FFFFFF;
display: block;
float: left;
//margin-left: 10px;
margin-left: -240px;
padding: 15px;
width: 240px;
}
.sidemenu h2 {
font-size: 16px;
color: #666666;
margin: 0 0 10px 0;
}
.sidemenu ul {
padding: 0;
}
.sidemenu li {
list-style: none;
margin: 5px 0 10px;
}
input[name="search"] {
border: 1px solid #CCCCCC;
border-radius: 4px;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset;
color: #333333;
font-size: 14px;
padding: 6px 12px;
width: 200px;
vertical-align: top;
}

View File

@ -1,38 +1,46 @@
{% load staticfiles %}
<html>
<head>
<title>BLOG</title>
<link rel="stylesheet" href="{% static 'css/blog.css' %}">
<meta charset="utf-8"><meta name=viewport content="width=device-width, initial-scale=1">
<style type="text/css">
<head>
<title>BLOG</title>
<link rel="stylesheet" href="{% static 'css/blog.css' %}">
<link rel="stylesheet" href="{% static 'css/new.css' %}">
<meta charset="utf-8"><meta name=viewport content="width=device-width, initial-scale=1">
<!--style type="text/css">
.menu li {width: 85px;}
.sub-menu li a {padding: 10px 9px;}
.menu .shirt {width: 1px;}
.menu .long {min-width: 95px;}
</style>
</style-->
<!--script src="https://code.jquery.com/jquery-1.12.4.js"></script> <script src="https://code.jquery.com/ui/1.12.0/jquery-ui.js"></script-->
<!--Let browser know website is optimized for mobile--> <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
</head>
</head>
<body>
<div class="page-header block" style="position: relative; ">
<h1><a href="/">Django Blog</a></h1>
<ul class="menu">
<li class="shirt"><a href="/pfm">PFM</a>
<li><a href="#1">Notes</a>
<ul class="sub-menu">
<li> <a href="{% url 'post_new' %}">new post</a></li>
<li> <a href="/blog/1"> all notes</a></li>
</ul>
</li>
<li class="shirt"><a href="/admin">/admin</a></li>
</ul>
</div>
<body>
<div id="header" class="page-header block">
<a id="logo" href="/">Django Blog</a>
<div id="search">
<form id="search-form">
<input name="search" type="text"></input>
<input id="button-search" type="submit" value=""></input>
</form>
</div>
</div>
<div id="content">
{% block content %}
{% endblock %}
</body>
<div class="sidemenu">
<h2>Последние</h2>
<ul>
<li><a href="/">ToDo List</a><div class="date">2017-11-04</div></li>
<li><a href="/">Йа сцылко</a><div class="date">2017-11-03</div></li>
<li><a href="/">Йа сцылко №2</a><div class="date">2017-11-03</div></li>
</ul>
</div>
</div>
</body>
<ul class="menu_top paginator">
{% if posts.has_previous %}

View File

@ -2,9 +2,13 @@
{% load pagination_tags %}
{% block content %}
<div id="posts">
{% for post in posts %}
<div class="block post">
<h1><a href="{% url 'post_detail' pk=post.pk %}">{{ post.title }}</a></h1>
<div class="post">
<div class="post-header">
<h2><a href="{% url 'post_detail' pk=post.pk %}">{{ post.title }}</a></h2>
<div class="date">{{ post.published_date}}</div>
</div>
{{ post.text|safe|linebreaksbr|truncatewords:80 }} <!--|linebreaksbr|truncatewords:80 }}</p--><br>
<p style="float: left; color: #1abc9c; font-style: italic;">
{% if post.tags.names %}
@ -14,9 +18,10 @@
{% endfor %}
{% endif %}
</p>
<p align="right" style="float: right"> {{ post.published_date}}</p>
</div>
{% endfor %}
</div>
</div>
{% endblock content %}

View File

@ -1,6 +0,0 @@
{% extends 'blog/base.html' %}
Тут будет что-нибудь написано =)
{% block content %}
{% endblock %}

View File

@ -20,6 +20,5 @@ from django.conf.urls.static import static
from django.views.generic.base import TemplateView
urlpatterns = patterns('',
url(r'^admin/', admin.site.urls),
url(r'^$', TemplateView.as_view(template_name='main.html')),
url(r'^blog/', include('blog.urls')),
url(r'^', include('blog.urls')),
) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)