diff --git a/polls/templates/base.html b/polls/templates/base.html new file mode 100644 index 0000000..d41fa24 --- /dev/null +++ b/polls/templates/base.html @@ -0,0 +1,96 @@ + + + + + + + + {% block title %}Test site{% endblock %} + + + + +
+ {% block content %}{% endblock %} +
+ + diff --git a/polls/templates/polls/detail.html b/polls/templates/polls/detail.html index 68a65fc..f263c81 100644 --- a/polls/templates/polls/detail.html +++ b/polls/templates/polls/detail.html @@ -1,86 +1,25 @@ - - - - - - - - Testapp - - - -
-

{{ question.question_text }}

+{% block title %}{{ question.question_text }}{% endblock %} + +{% block content %} +
+

{{ question.question_text }}

+
+ +
+ {% csrf_token %} +
+ {% if error_message %}

{{ error_message }}

{% endif %} +
+ {% for choice in question.choice_set.all %} + +
+ {% endfor %} +
+

- - - {% csrf_token %} -
- {% if error_message %}

{{ error_message }}

{% endif %} -
- {% for choice in question.choice_set.all %} - -
- {% endfor %} -
-
-
- -
-
- - \ No newline at end of file + + +
+{% endblock %} diff --git a/polls/templates/polls/index.html b/polls/templates/polls/index.html index 30ffbc6..1ea0364 100644 --- a/polls/templates/polls/index.html +++ b/polls/templates/polls/index.html @@ -1,45 +1,31 @@ +{% extends "base.html" %} - - - - - - - - Testapp - - - -
-

Polls

-
-
- {% if latest_question_list %} -
- {% for question in latest_question_list %} - - -
-
-
{{ question.question_text }}
- -
- {{ question.pub_date }} -
-
- {% endfor %} +{% block title %}Polls{% endblock %} + +{% block content %} +

Polls

+
+
+ {% if latest_question_list %} + -
- - \ No newline at end of file + + {% endfor %} +
+ {% else %} +

+ No polls are available.
+ You can create polls in the admin panel +

+ {% endif %} +
+{% endblock %} diff --git a/polls/templates/polls/results.html b/polls/templates/polls/results.html index 9e9eab1..9c6d70a 100644 --- a/polls/templates/polls/results.html +++ b/polls/templates/polls/results.html @@ -1,92 +1,28 @@ - - - - - - - - Testapp - - - -
-

{{ question.question_text }}

-
-

Results

-
-
- {% for choice_text, choice_votes, choice_percent in choices %} -
-
-
-
{{ choice_text }}
- +{% block title %}{{ question.question_text }} Results{% endblock %} + +{% block content %} +

{{ question.question_text }}

+
+

Results

+
+
+ {% for choice_text, choice_votes, choice_percent in choices %} +
+
+
+
{{ choice_text }}
+
- {% endfor %} - + {{ choice_votes }} vote{{ choice_votes|pluralize }}
-
- - \ No newline at end of file +
+ {% endfor %} + +
+{% endblock %}