diff --git a/functional_tests/tests.py b/functional_tests/tests.py index 5359941..d008385 100644 --- a/functional_tests/tests.py +++ b/functional_tests/tests.py @@ -33,9 +33,9 @@ class NewVisitorTest(LiveServerTestCase): def test_can_start_a_todo_list(self): self.browser.get(self.live_server_url) - self.assertIn('Dashboard', self.browser.title) + self.assertIn('Dashboard | ', self.browser.title) header_text = self.browser.find_element(By.TAG_NAME, 'h1').text - self.assertIn('Dashboard', header_text) + self.assertIn('Dashboard | ', header_text) inputbox = self.browser.find_element(By.ID, 'id-new-item') self.assertEqual(inputbox.get_attribute('placeholder'), 'Enter a to-do item') diff --git a/templates/apps/dashboard/home.html b/templates/apps/dashboard/home.html index a5d0bd4..dec8b4f 100644 --- a/templates/apps/dashboard/home.html +++ b/templates/apps/dashboard/home.html @@ -1,12 +1,6 @@ - - - Dashboard - - -

Dashboard | Start a new to-do list

-
- - {% csrf_token %} -
- - \ No newline at end of file +{% extends "core/base.html" %} + +{% block title_text %}Start a new to-do list{% endblock title_text %} +{% block header_text %}Start a new to-do list{% endblock header_text %} + +{% block form_action %}/apps/dashboard/newlist{% endblock form_action %} diff --git a/templates/apps/dashboard/list.html b/templates/apps/dashboard/list.html index 558f0a6..9fa70f9 100644 --- a/templates/apps/dashboard/list.html +++ b/templates/apps/dashboard/list.html @@ -1,17 +1,15 @@ - - - To-Do lists - - -

Your To-Do List

-
- - {% csrf_token %} -
- - {% for item in list.item_set.all %} - - {% endfor %} -
{{ forloop.counter }}. {{ item.text }}
- - \ No newline at end of file +{% extends "core/base.html" %} + +{% block title_text %}Your to-do list{% endblock title_text %} +{% block header_text %}Your to-do list{% endblock header_text %} + +{% block form_action %}/apps/dashboard/{{ list.id }}/add-item{% endblock form_action %} + +{% block table %} + + {% for item in list.item_set.all %} + + {% endfor %} +
{{ forloop.counter }}. {{ item.text }}
+{% endblock table %} +