This commit is contained in:
Anna Sudnitsina 2017-11-08 12:43:13 +03:00
parent dfe6c2ad56
commit 64eaab9d6b
6 changed files with 88 additions and 92 deletions

View File

@ -23,6 +23,14 @@ a {
letter-spacing: 1px;
margin-right: 10px;
}
.delete {
right: 80px;
}
.edit {
position: absolute;
right: 10px;
bottom: 10px;
}
input#button-search {
background: url('https://touchit.com.ua/static/images/icons/search-25.png') no-repeat center center;
border: none;

View File

@ -5,10 +5,9 @@
<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">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.3.0/css/font-awesome.min.css">
<!--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>
<body>
<div id="header">
@ -21,43 +20,39 @@
</div>
</div>
<div id="content">
{% block content %}
{% endblock %}
<div class="sidemenu">
Hop hey</div>
<div class="sidemenu">
<div class="block">
<h2>Меню</h2>
<ul>
<li><li><a href="{% url 'post_new' %}">new post</a></li>
<li><a href="/blog/1">all notes</a></li>
</ul>
{% block content %}
{% endblock %}
<div class="sidemenu">
<div class="block">
<h2>Меню</h2>
<ul>
<li><li><a href="{% url 'post_new' %}">new post</a></li>
<li><a href="/blog/1">all notes</a></li>
</ul>
</div>
<div class="block">
<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>
</div>
<div class="block">
<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>
</div>
<ul class="menu_top paginator">
{% if posts.has_previous %}
<li> <a href="?page=1"><<</a> </li>
<li> <a href="?page={{ posts.previous_page_number }}">{{ posts.previous_page_number }}</a> </li>
{% endif %}
<li> <a style="color: #000000" href="">{{ posts.number }}<a></li>
{% if posts.has_next %}
<li> <a href="?page={{ posts.next_page_number }}"> {{ posts.next_page_number }}</a> </li>
<li> <a href="?page={{ posts.next_page_number|add:1 }}">{{ posts.next_page_number|add:1 }}</a></li>
<li><a href="?page={{ posts.paginator.num_pages }}"> >> </a></li> {% endif %}
</body>
{% comment %}
<!--li> {% for i in posts.paginator.page_range %} </li-->
{% endcomment %}
</ul>
<ul class="menu_top paginator">
{% if posts.has_previous %}
<li> <a href="?page=1"><<</a> </li>
<li> <a href="?page={{ posts.previous_page_number }}">{{ posts.previous_page_number }}</a> </li>
{% endif %}
<li> <a style="color: #000000" href="">{{ posts.number }}<a></li>
{% if posts.has_next %}
<li> <a href="?page={{ posts.next_page_number }}"> {{ posts.next_page_number }}</a> </li>
<li> <a href="?page={{ posts.next_page_number|add:1 }}">{{ posts.next_page_number|add:1 }}</a></li>
<li><a href="?page={{ posts.paginator.num_pages }}"> >> </a></li> {% endif %}
</body>
{% comment %}
<!--li> {% for i in posts.paginator.page_range %} </li-->
{% endcomment %}
</ul>
</html>

View File

@ -4,22 +4,21 @@
<div class="block" style="position: relative; ">
<h1>{{ post.title }}</h1>
<h3> Теги:
{% if tags %}
{% for tag in tags %}
<a href="{% url 'search_by_tag' tag=tag%}">{{ tag }}</a>
{% endfor %}
{% endif %}
{% if tags %}
{% for tag in tags %}
<a href="{% url 'search_by_tag' tag=tag%}">{{ tag }}</a>
{% endfor %}
{% endif %}
</h3>
<p>{{ post.text|safe|linebreaksbr }}</p>
<span>
{% if post.published_date %}
{{ post.published_date }}
{% endif %}
{% if post.published_date %}
{{ post.published_date }}
{% endif %}
</span>
<span class="edit" style="position: absolute; right: 10px; bottom: 10px;"><a href="{% url 'post_edit' pk=post.pk %}">edit post</a></span>
<span class="edit" style="position: absolute; right: 80px; bottom: 10px;"><a href='#deletionDialog';">delete</a></span>
<span class="edit"><a href="{% url 'post_edit' pk=post.pk %}">edit post</a></span>
<span class="edit delete"><a href='#deletionDialog';">delete</a></span>
<div id="deletionDialog" class="dialog">
<div>
<p align="right"><a href=""><img src="http://py.difrex.ru/media/images/x.PNG"></a></p>

View File

@ -1,11 +1,11 @@
{% extends 'blog/base.html' %}
{% extends 'blog/base.html' %}
{% block content %}
{% block content %}
<div class="block">
<form method="POST" class="post-form">{% csrf_token %}
{{ form.as_p }}
<button type="submit" class="save btn btn-default">Save</button>
</form>
</div>
<form method="POST" class="post-form">{% csrf_token %}
{{ form.as_p }}
<button type="submit" class="save btn btn-default">Save</button>
</form>
</div>
{% endblock %}

View File

@ -1,25 +1,24 @@
{% extends 'blog/base.html' %}
{% load pagination_tags %}
{% block content %}
{% block content %}
<div id="posts">
{% for post in posts %}
{% for post in posts %}
<div class="post">
<div class="post-header">
<h2><a href="{% url 'post_detail' pk=post.pk %}">{{ post.title }}</a></h2>
<div class="date"><i class="fa fa-calendar"></i> {{ post.published_date}}</div>
{% if post.tags.names %}
<div class="tag">
<i class="fa fa-tags"></i>
{% for tag in post.tags.names %}
<a href="{% url 'search_by_tag' tag=tag%}">{{ tag }}</a>
{% if post.tags.names %}
<div class="tag">
<i class="fa fa-tags"></i>
{% for tag in post.tags.names %}
<a href="{% url 'search_by_tag' tag=tag%}">{{ tag }}</a>
{% endfor %}
</div>
{% endif %}
</div>
{{ post.text|safe|linebreaksbr|truncatewords:80 }} <!--|linebreaksbr|truncatewords:80 }}</p--><br>
</div>
{% endfor %}
</div>
</div>
{% endif %}
</div>
{{ post.text|safe|linebreaksbr|truncatewords:80 }} <!--|linebreaksbr|truncatewords:80 }}</p--><br>
</div>
{% endfor %}
</div>
{% endblock content %}

View File

@ -1,24 +1,19 @@
{% extends 'blog/base.html' %}
{% load pagination_tags %}
{% block content %}
{% for post in tagged_posts %}
<div class="block post">
<h1><a href="{% url 'post_detail' pk=post.pk %}">{{ post.title }}</a></h1>
{{ post.text|safe|linebreaksbr|truncatewords:80 }} <!--|linebreaksbr|truncatewords:80 }}</p-->
<br>
<p style="float: left; color: #1abc9c; font-style: italic;"> Tags:
{% for tag in post.tags.names %}
<a href="{% url 'search_by_tag' tag=tag%}" style="color: #1abc9c; ">{{ tag }}</a>
{% endfor %}
</p>
<p align="right">
{{ post.published_date}}
</p>
</div>
<div class="block post">
<h1><a href="{% url 'post_detail' pk=post.pk %}">{{ post.title }}</a></h1>
{{ post.text|safe|linebreaksbr|truncatewords:80 }} <!--|linebreaksbr|truncatewords:80 }}</p--><br>
<p style="float: left; color: #1abc9c; font-style: italic;"> Tags:
{% for tag in post.tags.names %}
<a href="{% url 'search_by_tag' tag=tag%}" style="color: #1abc9c; ">{{ tag }}</a>
{% endfor %}
</p>
<p align="right">
{{ post.published_date}}
</p>
</div>
{% endfor %}
{% endblock content %}