-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
147 additions
and
175 deletions.
There are no files selected for viewing
50 changes: 23 additions & 27 deletions
50
django-diary/source_code_final/entries/templates/entries/base.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,26 @@ | ||
{% load static %} | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<title>My Diary</title> | ||
<link rel="stylesheet" href="{% static 'css/diary.css' %}"> | ||
</head> | ||
|
||
<body> | ||
<h1><a href="/">Dear diary …</a></h1> | ||
|
||
{% if messages %} | ||
<ul class="messages"> | ||
{% for message in messages %} | ||
<li class="message"> | ||
{{ message }} | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
{% endif %} | ||
|
||
{% block content %}{% endblock %} | ||
|
||
<hr> | ||
<a href="{% url 'admin:logout' %}">Logout</a> | ||
</body> | ||
|
||
</html> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>My Diary</title> | ||
<link rel="stylesheet" href="{% static 'css/diary.css' %}"> | ||
</head> | ||
<body> | ||
<h1> | ||
<a href="/">Dear diary …</a> | ||
</h1> | ||
{% if messages %} | ||
<ul class="messages"> | ||
{% for message in messages %}<li class="message">{{ message }}</li>{% endfor %} | ||
</ul> | ||
{% endif %} | ||
{% block content %} | ||
{% endblock content %} | ||
<hr> | ||
<form method="post" action="{% url 'admin:logout' %}"> | ||
{% csrf_token %} | ||
<input type="submit" value="Logout" /> | ||
</form> | ||
</body> | ||
</html> |
8 changes: 5 additions & 3 deletions
8
django-diary/source_code_final/entries/templates/entries/entry_confirm_delete.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
{% extends "entries/base.html" %} | ||
{% block content %} | ||
<form method="post">{% csrf_token %} | ||
<form method="post"> | ||
{% csrf_token %} | ||
<p> | ||
Are you sure you want to delete <em>"{{ entry.title }}"</em><br> | ||
Are you sure you want to delete | ||
<em>"{{ entry.title }}"</em> | ||
created on {{ entry.date_created|date:'Y-m-d' }}? | ||
</p> | ||
<input type="submit" value="Confirm"> | ||
</form> | ||
<a href="{% url 'entry-detail' entry.id %}"> | ||
<button>Cancel</button> | ||
</a> | ||
{% endblock %} | ||
{% endblock content %} |
12 changes: 5 additions & 7 deletions
12
django-diary/source_code_final/entries/templates/entries/entry_detail.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,12 @@ | ||
{% extends "entries/base.html" %} | ||
|
||
{% block content %} | ||
<article> | ||
<h2>{{ entry.date_created|date:'Y-m-d H:i' }}</h2> | ||
<h3>{{ entry.title }}</h3> | ||
<p>{{ entry.content }}</p> | ||
</article> | ||
|
||
<p> | ||
<a href="{% url 'entry-update' entry.id %}">✍️ Edit</a> | ||
<a href="{% url 'entry-delete' entry.id %}">⛔ Delete</a> | ||
</p> | ||
{% endblock %} | ||
<p> | ||
<a href="{% url 'entry-update' entry.id %}">✍️ Edit</a> | ||
<a href="{% url 'entry-delete' entry.id %}">⛔ Delete</a> | ||
</p> | ||
{% endblock content %} |
9 changes: 5 additions & 4 deletions
9
django-diary/source_code_final/entries/templates/entries/entry_form.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
{% extends "entries/base.html" %} | ||
{% block content %} | ||
<form method="post">{% csrf_token %} | ||
<form method="post"> | ||
{% csrf_token %} | ||
{{ form.as_p }} | ||
<input type="submit" value="Save"> | ||
</form> | ||
{% if entry %} | ||
<a href="{% url 'entry-detail' entry.id %}"> | ||
<button>Cancel</button> | ||
<button>Cancel</button> | ||
</a> | ||
{% else %} | ||
<a href="{% url 'entry-list' %}"> | ||
<button>Cancel</button> | ||
<button>Cancel</button> | ||
</a> | ||
{% endif %} | ||
{% endblock %} | ||
{% endblock content %} |
31 changes: 15 additions & 16 deletions
31
django-diary/source_code_final/entries/templates/entries/entry_list.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,19 @@ | ||
{% extends "entries/base.html" %} | ||
|
||
{% block content %} | ||
<article> | ||
<h2 class="mark">{% now "Y-m-d H:i" %}</em></h2> | ||
<a href="{% url 'entry-create' %}"><button>Add new entry</button></a> | ||
<h2 class="mark"> | ||
{% now "Y-m-d H:i" %}</em> | ||
</h2> | ||
<a href="{% url 'entry-create' %}"> | ||
<button>Add new entry</button> | ||
</a> | ||
</article> | ||
{% for entry in entry_list %} | ||
<article> | ||
<h2 class="{{ entry.date_created|date:'l' }}">{{ entry.date_created|date:'Y-m-d H:i' }}</h2> | ||
<h3> | ||
<a href="{% url 'entry-detail' entry.id %}">{{ entry.title }}</a> | ||
</h3> | ||
</article> | ||
{% for entry in entry_list %} | ||
<article> | ||
<h2 class="{{ entry.date_created|date:'l' }}"> | ||
{{ entry.date_created|date:'Y-m-d H:i' }} | ||
</h2> | ||
<h3> | ||
<a href="{% url 'entry-detail' entry.id %}"> | ||
{{ entry.title }} | ||
</a> | ||
</h3> | ||
</article> | ||
{% endfor %} | ||
{% endblock %} | ||
{% endfor %} | ||
{% endblock content %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 3 additions & 7 deletions
10
django-diary/source_code_step_3/entries/templates/entries/entry_list.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,8 @@ | ||
{% for entry in entry_list %} | ||
<article> | ||
<h2 class="{{ entry.date_created|date:'l' }}"> | ||
{{ entry.date_created|date:'Y-m-d H:i' }} | ||
</h2> | ||
<h2 class="{{ entry.date_created|date:'l' }}">{{ entry.date_created|date:'Y-m-d H:i' }}</h2> | ||
<h3> | ||
<a href="{% url 'entry-detail' entry.id %}"> | ||
{{ entry.title }} | ||
</a> | ||
<a href="{% url 'entry-detail' entry.id %}">{{ entry.title }}</a> | ||
</h3> | ||
</article> | ||
{% endfor %} | ||
{% endfor %} |
28 changes: 13 additions & 15 deletions
28
django-diary/source_code_step_4/entries/templates/entries/base.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,16 @@ | ||
{% load static %} | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<title>My Diary</title> | ||
<link rel="stylesheet" href="{% static 'css/diary.css' %}"> | ||
</head> | ||
|
||
<body> | ||
<h1><a href="/">Dear diary …</a></h1> | ||
|
||
{% block content %}{% endblock %} | ||
|
||
</body> | ||
|
||
</html> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>My Diary</title> | ||
<link rel="stylesheet" href="{% static 'css/diary.css' %}"> | ||
</head> | ||
<body> | ||
<h1> | ||
<a href="/">Dear diary …</a> | ||
</h1> | ||
{% block content %} | ||
{% endblock content %} | ||
</body> | ||
</html> |
3 changes: 1 addition & 2 deletions
3
django-diary/source_code_step_4/entries/templates/entries/entry_detail.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
{% extends "entries/base.html" %} | ||
|
||
{% block content %} | ||
<article> | ||
<h2>{{ entry.date_created|date:'Y-m-d H:i' }}</h2> | ||
<h3>{{ entry.title }}</h3> | ||
<p>{{ entry.content }}</p> | ||
</article> | ||
{% endblock %} | ||
{% endblock content %} |
11 changes: 3 additions & 8 deletions
11
django-diary/source_code_step_4/entries/templates/entries/entry_list.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,11 @@ | ||
{% extends "entries/base.html" %} | ||
|
||
{% block content %} | ||
{% for entry in entry_list %} | ||
<article> | ||
<h2 class="{{ entry.date_created|date:'l' }}"> | ||
{{ entry.date_created|date:'Y-m-d H:i' }} | ||
</h2> | ||
<h2 class="{{ entry.date_created|date:'l' }}">{{ entry.date_created|date:'Y-m-d H:i' }}</h2> | ||
<h3> | ||
<a href="{% url 'entry-detail' entry.id %}"> | ||
{{ entry.title }} | ||
</a> | ||
<a href="{% url 'entry-detail' entry.id %}">{{ entry.title }}</a> | ||
</h3> | ||
</article> | ||
{% endfor %} | ||
{% endblock %} | ||
{% endblock content %} |
26 changes: 12 additions & 14 deletions
26
django-diary/source_code_step_5/entries/templates/entries/base.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,16 @@ | ||
{% load static %} | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<title>My Diary</title> | ||
<link rel="stylesheet" href="{% static 'css/diary.css' %}"> | ||
</head> | ||
|
||
<body> | ||
<h1><a href="/">Dear diary …</a></h1> | ||
|
||
{% block content %}{% endblock %} | ||
|
||
</body> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<title>My Diary</title> | ||
<link rel="stylesheet" href="{% static 'css/diary.css' %}"> | ||
</head> | ||
<body> | ||
<h1> | ||
<a href="/">Dear diary …</a> | ||
</h1> | ||
{% block content %} | ||
{% endblock content %} | ||
</body> | ||
</html> |
8 changes: 5 additions & 3 deletions
8
django-diary/source_code_step_5/entries/templates/entries/entry_confirm_delete.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
{% extends "entries/base.html" %} | ||
{% block content %} | ||
<form method="post">{% csrf_token %} | ||
<form method="post"> | ||
{% csrf_token %} | ||
<p> | ||
Are you sure you want to delete <em>"{{ entry.title }}"</em><br> | ||
Are you sure you want to delete | ||
<em>"{{ entry.title }}"</em> | ||
created on {{ entry.date_created|date:'Y-m-d' }}? | ||
</p> | ||
<input type="submit" value="Confirm"> | ||
</form> | ||
<a href="{% url 'entry-detail' entry.id %}"> | ||
<button>Cancel</button> | ||
</a> | ||
{% endblock %} | ||
{% endblock content %} |
3 changes: 1 addition & 2 deletions
3
django-diary/source_code_step_5/entries/templates/entries/entry_detail.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
{% extends "entries/base.html" %} | ||
|
||
{% block content %} | ||
<article> | ||
<h2>{{ entry.date_created|date:'Y-m-d H:i' }}</h2> | ||
<h3>{{ entry.title }}</h3> | ||
<p>{{ entry.content }}</p> | ||
</article> | ||
{% endblock %} | ||
{% endblock content %} |
9 changes: 5 additions & 4 deletions
9
django-diary/source_code_step_5/entries/templates/entries/entry_form.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
{% extends "entries/base.html" %} | ||
{% block content %} | ||
<form method="post">{% csrf_token %} | ||
<form method="post"> | ||
{% csrf_token %} | ||
{{ form.as_p }} | ||
<input type="submit" value="Save"> | ||
</form> | ||
{% if entry %} | ||
<a href="{% url 'entry-detail' entry.id %}"> | ||
<button>Cancel</button> | ||
<button>Cancel</button> | ||
</a> | ||
{% else %} | ||
<a href="{% url 'entry-list' %}"> | ||
<button>Cancel</button> | ||
<button>Cancel</button> | ||
</a> | ||
{% endif %} | ||
{% endblock %} | ||
{% endblock content %} |
11 changes: 3 additions & 8 deletions
11
django-diary/source_code_step_5/entries/templates/entries/entry_list.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,11 @@ | ||
{% extends "entries/base.html" %} | ||
|
||
{% block content %} | ||
{% for entry in entry_list %} | ||
<article> | ||
<h2 class="{{ entry.date_created|date:'l' }}"> | ||
{{ entry.date_created|date:'Y-m-d H:i' }} | ||
</h2> | ||
<h2 class="{{ entry.date_created|date:'l' }}">{{ entry.date_created|date:'Y-m-d H:i' }}</h2> | ||
<h3> | ||
<a href="{% url 'entry-detail' entry.id %}"> | ||
{{ entry.title }} | ||
</a> | ||
<a href="{% url 'entry-detail' entry.id %}">{{ entry.title }}</a> | ||
</h3> | ||
</article> | ||
{% endfor %} | ||
{% endblock %} | ||
{% endblock content %} |
41 changes: 17 additions & 24 deletions
41
django-diary/source_code_step_6/entries/templates/entries/base.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,21 @@ | ||
{% load static %} | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<title>My Diary</title> | ||
<link rel="stylesheet" href="{% static 'css/diary.css' %}"> | ||
</head> | ||
|
||
<body> | ||
<h1><a href="/">Dear diary …</a></h1> | ||
|
||
{% if messages %} | ||
<ul class="messages"> | ||
{% for message in messages %} | ||
<li class="message"> | ||
{{ message }} | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
{% endif %} | ||
|
||
{% block content %}{% endblock %} | ||
|
||
</body> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<title>My Diary</title> | ||
<link rel="stylesheet" href="{% static 'css/diary.css' %}"> | ||
</head> | ||
<body> | ||
<h1> | ||
<a href="/">Dear diary …</a> | ||
</h1> | ||
{% if messages %} | ||
<ul class="messages"> | ||
{% for message in messages %}<li class="message">{{ message }}</li>{% endfor %} | ||
</ul> | ||
{% endif %} | ||
{% block content %} | ||
{% endblock content %} | ||
</body> | ||
</html> |
Oops, something went wrong.