Large diffs are not rendered by default.

Binary file not shown.
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.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

@@ -0,0 +1,13 @@
// This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment.
require('../../js/transition.js')
require('../../js/alert.js')
require('../../js/button.js')
require('../../js/carousel.js')
require('../../js/collapse.js')
require('../../js/dropdown.js')
require('../../js/modal.js')
require('../../js/tooltip.js')
require('../../js/popover.js')
require('../../js/scrollspy.js')
require('../../js/tab.js')
require('../../js/affix.js')

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
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.
@@ -0,0 +1,3 @@
/**
* Created by root on 19.07.17.
*/
@@ -0,0 +1,4 @@
.post-block{
box-shadow: 0 2px 5px 0 rgba(0,0,0,0.16), 0 2px 10px 0 rgba(0,0,0,0.12);
transition: all 0.5s ease 0s;
}
@@ -0,0 +1,32 @@
<!DOCTYPE html>
{% load bootstrap3 %}
<html{% if request.LANGUAGE_CODE %} lang="{{ request.LANGUAGE_CODE }}"{% endif %} xmlns="http://www.w3.org/1999/html">

<head>
<meta charset="utf-8">
<!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge" /><![endif]-->
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1.0, maximum-scale=1.0">
<title>{% block bootstrap3_title %} My RSS {% endblock %}</title>
{% bootstrap_css %}
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
{% if 'javascript_in_head'|bootstrap_setting %}{% bootstrap_javascript jquery=True %}{% endif %}
{% block bootstrap3_extra_head %}{% endblock %}
{% load staticfiles %}
<link href="{% static "rss_news/styles.css" %}" type="text/css" rel="stylesheet">
<link href="{% static "rss_news/fontawesome/css/font-awesome.css" %}" type="text/css" rel="stylesheet">
<link href="{% static "rss_news/bootstrap/css/bootstrap.css" %}" type="text/css" rel="stylesheet">
</head>

<body>
{% block bootstrap3_content %}{% endblock %}
{% if not 'javascript_in_head'|bootstrap_setting %}{% bootstrap_javascript jquery=True %}{% endif %}
{% block bootstrap3_extra_script %}{% endblock %}
</body>
<script src={% static "rss_news/script.js" %}></script>
{% block add_script %}{% endblock %}
</html>
@@ -1,15 +1,110 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Index</title>
</head>
<body>

{% if value == 'Hello Python' %}
<span>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aliquam atque blanditiis consequatur consequuntur cumque deserunt dolor earum eligendi facere id in maiores, minima perferendis placeat quis sapiente sit ullam. Optio?</span>
{% endif %}

<span>{{ number }}</span>
</body>
</html>
{% extends 'bootstrap3.html' %}
{% load bootstrap3 %}
{% block bootstrap3_content %}
<!-- HEADER start -->
<nav class="navbar navbar-default navbar-fixed-top" style="...">
<div class="container">
<div class="navbar-header">
<span>
<a class="navbar-brand"><i class="fa fa-rss"></i> My RSS</a>


</span>
</div>
<div class="navbar-right">
<div class="navbar-text">
<button class="btn btn-default btn-xs" data-toggle="modal" data-target="#loginModal">Login</button>
<button class="btn btn-default btn-xs" data-toggle="modal" data-target="#regModal">Registration</button>
</div>
</div>
</div>
</nav>
<!-- HEADER end -->

<!-- MAIN start -->
<div class="container" style="margin-top: 100px">
<div class="row">
<div class="col-xs-0 col-md-3"></div>
<div class="col-xx-0 col-md-6">
{% for post in posts %}
<div class="post-block">
<div class="container-fluid">
<div class="row">
<div class="col-xs-12">
<h3>{{ post.title }}</h3>
<hr>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div>{{ post.text }}</div>
</div>
</div>
<div class="row">
<div class="col-xs-12 text-right">
<div class="btn-group">
<a href="/post/{{ post.id }}/" class="btn btn-sm btn-default">Read</a>
<button class="btn btn-sm btn-default">Add Favorite</button>
</div>
</div>
<br>
<br>
</div>
</div>
</div>
<br>
{% endfor %}
</div>
<div class="col-xs-0 col-md-3"></div>
</div>
</div>
<!-- MAIN start -->

<!-- LoginModal start -->
<div id="loginModal" class="modal fade" role="dialog">
<div class="modal-dialog">

<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Log IN</h4>
</div>
<div class="modal-body">
<p>Log IN forms</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">LogIN</button>
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>

</div>
</div>
<!-- LoginModal end -->

<!-- RegisterModal start -->
<div id="regModal" class="modal fade" role="dialog">
<div class="modal-dialog">

<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Registration</h4>
</div>
<div class="modal-body">
<p>Registration forms</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Registration</button>
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>

</div>
</div>
<!-- RegisterModal end -->

{% endblock %}

@@ -0,0 +1,40 @@
{% extends 'bootstrap3.html' %}
{% load bootstrap3 %}
{% block bootstrap3_content %}

<!-- HEADER start -->
<nav class="navbar navbar-default navbar-fixed-top" style="...">
<div class="container">
<div class="navbar-header">
<span>
<a class="navbar-brand"><i class="fa fa-book"></i> Post {{ post.title }}</a>
</span>
</div>
<div class="navbar-right">
<div class="navbar-text">
<button class="btn btn-default btn-xs">Login</button>
<button class="btn btn-default btn-xs">Registration</button>
</div>
</div>
</div>
</nav>
<!-- HEADER end -->

<!-- POST start -->
<div class="container" style="margin-top: 100px">
<div class="row">
<div class="col-xs-0 col-md-3"></div>
<div class="col-xx-0 col-md-6">
<div class="container-fluid">
<h3>{{ post.title }}</h3>
<br>
<p>{{ post.text }}</p>
</div>
</div>
<div class="col-xs-0 col-md-3"></div>
</div>
</div>
<!-- POST end -->

{% endblock %}

@@ -2,5 +2,6 @@
from django.contrib import admin
from rss.apps.rss_news import views
urlpatterns = [
url(r'^index$', views.index),
url(r'^$', views.index),
url(r'post/(?P<id>[0-9]+)/$', views.post),
]
@@ -1,17 +1,24 @@
from django.http import HttpResponse
from django.shortcuts import render
import random
from rss.apps.rss_news.models import Post


# Create your views here.

def index(request):
# return HttpResponse('Hi!')
posts = reversed(Post.objects.all())
context = {
'posts': posts,
}
return render(request, 'index.html', context)


number = random.randrange(0, 100)
def post(request, id):
try:
post = Post.objects.get(id=id)
result = post.text
except Post.DoesNotExist:
return HttpResponse('Post dose not exist')

context = {
'value': 'Hello Python',
'number': str(number),
'post': post,
}
return render(request, 'index.html', context)
return render(request, 'post.html', context)
@@ -37,8 +37,8 @@
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'bootstrap3'
'rss.apps.rss_news'
'bootstrap3',
'rss.apps.rss_news',
]

MIDDLEWARE = [
@@ -78,8 +78,12 @@

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'rss',
'USER': 'postgres',
'PASSWORD': 'o9p0[-]=',
'HOST': '127.0.0.1',
'PORT': '5432',
}
}

@@ -18,5 +18,5 @@

urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^rss_news/', include('rss.apps.rss_news.urls'))
url(r'', include('rss.apps.rss_news.urls'))
]