Skip to content

Commit 46fc857

Browse files
authored
Add files via upload
1 parent 064cf1e commit 46fc857

File tree

8 files changed

+205
-0
lines changed

8 files changed

+205
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{% extends "blog/base.html" %}
2+
{% block content %}
3+
<h1>About me</h1>
4+
<p>Thanks for visiting my blog! Check all this cool stuff about me!</p>
5+
6+
{% endblock %}
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
<!DOCTYPE html>
2+
{% load staticfiles %}
3+
<html>
4+
<head>
5+
<title>Blog Project</title>
6+
<!-- Latest compiled and minified CSS -->
7+
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
8+
9+
<!-- Optional theme -->
10+
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
11+
12+
{# MEDIUM STYLE EDITOR#}
13+
<script src="//cdn.jsdelivr.net/medium-editor/latest/js/medium-editor.min.js"></script>
14+
<link rel="stylesheet" href="//cdn.jsdelivr.net/medium-editor/latest/css/medium-editor.min.css" type="text/css" media="screen" charset="utf-8">
15+
16+
17+
{# Custom CSS#}
18+
<link rel="stylesheet" href="{% static 'css/blog.css' %}">
19+
20+
{# Fonts#}
21+
<link href="https://fonts.googleapis.com/css?family=Montserrat|Russo+One" rel="stylesheet">
22+
23+
24+
25+
26+
27+
<body class='loader'>
28+
29+
30+
<nav class="navbar navbar-default techfont custom-navbar">
31+
<div class="container">
32+
33+
34+
<ul class="nav navbar-nav">
35+
<li><a class='navbar-brand bigbrand' href="{% url 'post_list' %}">My Tech blog</a></li>
36+
<li><a href="{% url 'about'%}">About</a></li>
37+
<li><a href="https://www.github.com">Github</a></li>
38+
<li><a href="https://www.linkedin.com">LinkedIn</a></li>
39+
40+
</ul>
41+
42+
<ul class="nav navbar-nav navbar-right">
43+
{% if user.is_authenticated %}
44+
<li>
45+
<a href="{% url 'post_new' %}" >New Post</a>
46+
</li>
47+
48+
<li>
49+
<a href="{% url 'post_draft_list' %}">Drafts</a>
50+
</li>
51+
<li>
52+
<a href="{% url 'logout' %}" >Log out</a>
53+
</li>
54+
55+
<li>
56+
<a >Welcome: {{ user.username }}</a>
57+
</li>
58+
{% else %}
59+
<li><a class='nav navbar-right' href="{% url 'login' %}" ><span class="glyphicon glyphicon-user"></span></a></li>
60+
{% endif %}
61+
62+
</ul>
63+
</div>
64+
</nav>
65+
66+
{# The actual blog posts#}
67+
<div class="content container">
68+
<div class="row">
69+
<div class="col-md-8">
70+
<div class="blog_posts">
71+
{% block content %}
72+
{% endblock %}
73+
74+
</div>
75+
76+
</div>
77+
</div>
78+
</div>
79+
80+
{# SCRIPTS#}
81+
82+
<script type="text/javascript" src="{% static 'js/blog.js' %}"></script>
83+
84+
</body>
85+
</html>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{% extends 'blog/base.html' %}
2+
3+
{% block content %}
4+
<h1>New comment</h1>
5+
<form method="POST" class="post-form">
6+
{% csrf_token %}
7+
{{form.as_p}}
8+
<button type="submit" class="save btn btn-default">Post Comment</button>
9+
</form>
10+
11+
<script>var editor = new MediumEditor('.editable');</script>
12+
13+
{% endblock %}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{% extends "blog/base.html" %}
2+
{% block content %}
3+
<form action="" method="post">{% csrf_token %}
4+
<p>Are you sure you want to delete "{{ object }}"?</p>
5+
<input class='btn btn-danger' type="submit" value="Confirm" />
6+
</form>
7+
{% endblock %}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{% extends 'blog/base.html' %}
2+
3+
{% block content %}
4+
5+
6+
<h1 class='posttitle loader'>{{ post.title }}</h1>
7+
8+
{% if post.published_date %}
9+
<div class="date postdate">
10+
{{ post.published_date }}
11+
</div>
12+
13+
{% else %}
14+
<a class="btn btn-default" href="{% url 'post_publish' pk=post.pk %}">Publish</a>
15+
{% endif %}
16+
17+
<p class='postcontent' >{{ post.text|safe|linebreaksbr }}</p>
18+
19+
20+
{% if user.is_authenticated %}
21+
<a class="btn btn-primary" href="{% url 'post_edit' pk=post.pk %}"><span class="glyphicon glyphicon-pencil"></span></a>
22+
<a class="btn btn-primary" href="{% url 'post_remove' pk=post.pk %}"><span class="glyphicon glyphicon-remove"></span></a>
23+
{% endif %}
24+
25+
26+
27+
<hr>
28+
<a class="btn btn-primary btn-comment" href="{% url 'add_comment_to_post' pk=post.pk %}">Add comment</a>
29+
<div class="container">
30+
31+
32+
{% for comment in post.comments.all %}
33+
<br>
34+
{% if user.is_authenticated or comment.approved_comment %}
35+
36+
{{ comment.created_date }}
37+
{% if not comment.approved_comment %}
38+
<a class="btn btn-default" href="{% url 'comment_remove' pk=comment.pk %}"><span class="glyphicon glyphicon-remove"></span></a>
39+
<a class="btn btn-default" href="{% url 'comment_approve' pk=comment.pk %}"><span class="glyphicon glyphicon-ok"></span></a>
40+
{% endif %}
41+
42+
<p>{{ comment.text|safe|linebreaks }}</p>
43+
<p>Posted by: <strong>{{ comment.author }}</strong></p>
44+
45+
{% endif %}
46+
{% empty %}
47+
<p>No comments posted.</p>
48+
{% endfor %}
49+
</div>
50+
51+
{% endblock %}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{% extends 'blog/base.html' %}
2+
3+
{% block content %}
4+
{% for post in posts %}
5+
<div class="post">
6+
<p class="date">created: {{ post.created_date|date:'d-m-Y' }}</p>
7+
<h1><a href="{% url 'post_detail' pk=post.pk %}">{{ post.title }}</a></h1>
8+
<p>{{ post.text|truncatechars:200 }}</p>
9+
</div>
10+
{% endfor %}
11+
{% endblock %}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{% extends 'blog/base.html' %}
2+
3+
{% block content %}
4+
<h1>New post</h1>
5+
6+
<form method="POST" class="post-form">
7+
{% csrf_token %}
8+
{{form.as_p}}
9+
<button type="submit" class="save btn btn-default">Save</button>
10+
</form>
11+
12+
<script>var editor = new MediumEditor('.editable');</script>
13+
14+
{% endblock %}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{% extends 'blog/base.html' %}
2+
3+
{% block content %}
4+
<div class="centerstage">
5+
6+
7+
{% for post in post_list %}
8+
<div class="post">
9+
10+
<h1><a href="{% url 'post_detail' pk=post.pk %}">{{ post.title }}</a></h1>
11+
<div class="date">
12+
<p>Published on: {{ post.published_date|date:"D M Y"}}</p>
13+
</div>
14+
<a href="{% url 'post_detail' pk=post.pk %}">Comments: {{ post.approve_comments.count }}</a>
15+
</div>
16+
{% endfor %}
17+
</div>
18+
{% endblock %}

0 commit comments

Comments
 (0)