+{% extends "default.html" %}
+{% block title %}{{ page.book.title }}: {{ page.title }}{% endblock %}
+{% block body %}
+
+
+
{{ page.title }}
{{ page.body }}
{% if page_items %}
-
Вы видите
-
+
Вы видите
+
{% endif %}
{% if dropped_items %}
-
Брошено вами ранее
-
- {% for dropped_item in dropped_items %}
- -
- {{ dropped_item.item.name }}
-
- [Подобрать]
-
-
- {% endfor %}
-
+
Брошено вами ранее
+
+ {% for dropped_item in dropped_items %}
+ -
+ {{ dropped_item.item.name }}
+
+ [Подобрать]
+
+
+ {% endfor %}
+
{% endif %}
Куда податься?
{% for link, passable in links %}
- -
- {% if passable %}
-
- {{ link.name }}
-
- {% else %}
- {{ link.name }}
- {% endif %}
-
+ -
+ {% if passable %}
+
+ {{ link.name }}
+
+ {% else %}
+ {{ link.name }}
+ {% endif %}
+
{% endfor %}
{% if progress.items.all %}
-
Инвентарь
-
- {% for item in progress.items.all %}
- -
- {{ item.name }}
-
- [Выбросить]
-
-
- {% endfor %}
-
+
Инвентарь
+
+ {% for item in progress.items.all %}
+ -
+ {{ item.name }}
+
+ [Выбросить]
+
+
+ {% endfor %}
+
{% endif %}
Сохранения
-
-
-
+
+{% endblock %}
diff --git a/djaif/book/templates/saves.html b/djaif/book/templates/saves.html
index 278cb25..0e0fd50 100644
--- a/djaif/book/templates/saves.html
+++ b/djaif/book/templates/saves.html
@@ -1,28 +1,18 @@
-
-
-
-
-
{{ book.title }}: Сохранения
-
-
-
- {{ book.title }}
-
-
- {{ page.title }}
-
-
[Продолжить игру]
-
-
[Новое сохранение]
+{% extends "default.html" %}
+{% block title %}{{ book.title }}: Сохранения{% endblock %}
+{% block body %}
+
+{% endblock %}
diff --git a/djaif/book/views.py b/djaif/book/views.py
index 0090e7a..595faef 100644
--- a/djaif/book/views.py
+++ b/djaif/book/views.py
@@ -33,7 +33,7 @@ def inner(request, book_id, **kwargs):
def view_books(request):
return render(
request,
- 'book_index.html',
+ 'books.html',
context={'books': models.Book.objects.all()},
)
@@ -85,7 +85,6 @@ def view_book(request, book_id):
'page': progress.book_page,
'progress': progress,
'links': links,
- 'notesets': notesets,
'page_items': progress.book_page.items.exclude(
id__in=progress.items.only('id'),
).exclude(
@@ -96,6 +95,7 @@ def view_book(request, book_id):
'dropped_items': progress.droppeditem_set.filter(
book_page=progress.book_page,
).all(),
+ 'notesets': notesets,
},
)
@@ -164,7 +164,6 @@ def view_saves(request, progress, book_id):
request,
'saves.html',
context={
- 'book': progress.book,
'page': progress.book_page,
'saves': saves,
},
@@ -195,10 +194,7 @@ def view_book_map(request, book_id):
@on_progress
def add_note(request, progress, book_id):
- if 'pin' in request.POST:
- page = progress.book_page
- else:
- page = None
+ page = progress.book_page if 'pin' in request.POST else None
models.Note.objects.create(
progress=progress,
text=request.POST['text'],
diff --git a/static/page.css b/static/page.css
deleted file mode 100644
index c91453b..0000000
--- a/static/page.css
+++ /dev/null
@@ -1,57 +0,0 @@
-body {
- padding: 0;
- margin: 0;
- height: 100vh;
- display: flex;
- flex-direction: column;
-}
-
-.main {
- flex: 1 1;
- display: flex;
-}
-
-.content {
- flex: 1 1;
- padding: 1em;
- font-size: 150%;
-}
-
-.new-note {
- display: flex;
- flex-direction: column;
-}
-
-.sidebar {
- padding: 0.2em;
- background-color: lightgray;
- font-size: 120%;
-}
-
-.noteset {
- padding: 0;
- margin: 0;
-}
-
-.noteset > li {
- list-style: none;
- border-bottom: 1pt black solid;
-}
-
-.noteset > li > pre {
- margin: 0;
- padding: 0.5em;
- font-family: Serif;
-}
-
-.noteset-other {
- background-color: white;
-}
-
-.noteset-page {
- background-color: greenyellow;
-}
-
-.noteset-pinned {
- background-color: yellow;
-}
diff --git a/static/styles.css b/static/styles.css
new file mode 100644
index 0000000..2c2d9ba
--- /dev/null
+++ b/static/styles.css
@@ -0,0 +1,79 @@
+body {
+ padding: 0;
+ margin: 0;
+}
+
+/* Page */
+
+.page {
+ height: 100vh;
+ display: flex;
+ flex-direction: column;
+}
+
+.page h1 {
+ margin-top: 0;
+}
+
+.page-split {
+ flex: 1 1;
+ display: flex;
+ flex-direction: row;
+}
+
+.page-content {
+ flex: 1 1;
+ padding: 1em;
+}
+
+.page-sidebar {
+ padding: 0.2em;
+ background-color: lightgray;
+}
+
+.page-sidebar > h3 {
+ margin-top: 0;
+ margin-bottom: 0.5em;
+}
+
+.page-sidebar > .new-note {
+ display: flex;
+ flex-direction: column;
+ margin-bottom: 0.5em;
+ font-size: smaller;
+}
+
+.page-sidebar > .noteset {
+ padding: 0;
+ margin: 0;
+}
+
+.page-sidebar > .noteset > li {
+ list-style: none;
+ border-bottom: 1pt black solid;
+}
+
+.page-sidebar > .noteset > li > pre {
+ margin: 0;
+ padding: 0.5em;
+ font-family: Serif;
+}
+
+.page-sidebar > .noteset-other {
+ background-color: white;
+}
+
+.page-sidebar > .noteset-page {
+ background-color: greenyellow;
+}
+
+.page-sidebar > .noteset-pinned {
+ background-color: yellow;
+}
+
+/* Single form */
+
+.single-column {
+ margin: 1em auto;
+ max-width: 800px;
+}