Skip to content

Commit 57b1845

Browse files
author
slavanorm
committed
add
1 parent d1889e0 commit 57b1845

File tree

10 files changed

+172
-88
lines changed

10 files changed

+172
-88
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
chromedriver.exe
22
db.sqlite3
3+
/static

.idea/workspace.xml

+131-75
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

db.sqlite3

0 Bytes
Binary file not shown.
160 Bytes
Binary file not shown.

functional_tests/tests.py

+2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ def setUp(self):
2626
self.browser = webdriver.Chrome(chrome_options=options)
2727

2828
def tearDown(self):
29+
30+
self.browser.refresh()
2931
self.browser.quit()
3032

3133
def wait_for_row_in_list_table(self, row_text):

lists/static/base.css

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#id_new_item {
2+
margin-top: 2ex;
3+
}

templates/base.html

+32-11
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,39 @@
1-
<html>
1+
{% load static %}
2+
<!DOCTYPE html>
3+
<html lang="en">
24
<head>
5+
<meta charset="utf-8">
6+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
7+
<meta name="viewport" content="width=device-width, initial-scale=1">
38
<title>To-Do lists</title>
9+
<link href="{% static "bootstrap/css/bootstrap.min.css" %}" rel="stylesheet">
10+
<link href="{% static "base.css" %}" rel="stylesheet">
411
</head>
512
<body>
6-
<h1> {% block header_text %}{% endblock %}</h1>
7-
<form method="POST" action= {% block form_action %}{% endblock %}>
8-
<p style="text-align: center;">
9-
<input name="item_text"
10-
id="id_new_item"
11-
placeholder="Enter a to-do item"/>
12-
</p>
13-
{% csrf_token %}
14-
</form>
15-
{% block table %}{% endblock %}
13+
<div class="container">
1614

15+
<div class="row">
16+
<div class="col-md-6 col-md-offset-3 jumbotron">
17+
<div class="text-center">
18+
<h1>{% block header_text %}{% endblock %}</h1>
19+
<form method="POST" action="{% block form_action %}{% endblock %}">
20+
<input name="item_text"
21+
id="id_new_item"
22+
class="form-control input-lg"
23+
placeholder="Enter a to-do item"/>
24+
{% csrf_token %}
25+
</form>
26+
</div>
27+
</div>
28+
</div>
29+
30+
<div class="row">
31+
<div class="col-md-6 col-md-offset-3">
32+
{% block table %}
33+
{% endblock %}
34+
</div>
35+
</div>
36+
37+
</div>
1738
</body>
1839
</html>

templates/list.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
{% block form_action %}/lists/{{ list.id }}/add_item{% endblock %}
66

77
{% block table %}
8-
<table id="id_list_table">
8+
<table id="id_list_table" class="table">
99
{% for item in list.item_set.all %}
1010
<tr><td>{{ forloop.counter }}: {{ item.text }}</td></tr>
1111
{% endfor %}
Binary file not shown.

tyryshkinsite/settings.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
# Application definition
3434

3535
INSTALLED_APPS = [
36-
"django.contrib.admin",
36+
# "django.contrib.admin",
3737
"django.contrib.auth",
3838
"django.contrib.contenttypes",
3939
"django.contrib.sessions",
@@ -121,3 +121,4 @@
121121
# https://docs.djangoproject.com/en/3.0/howto/static-files/
122122

123123
STATIC_URL = "/static/"
124+
STATIC_ROOT = "static/"

0 commit comments

Comments
 (0)