diff options
author | Mike Crute <mcrute@gmail.com> | 2012-12-04 16:06:00 -0500 |
---|---|---|
committer | Mike Crute <mcrute@gmail.com> | 2012-12-11 15:27:46 -0500 |
commit | ab626f31a0645d87560d242a20dd60e01b3d3b46 (patch) | |
tree | fbeac460e4b4182d0ee4178e5add369bbca76944 | |
parent | fc5ad68e62bd2b82450cdbdd3c83f8c1e94feed2 (diff) | |
download | django-precompiler-ab626f31a0645d87560d242a20dd60e01b3d3b46.tar.bz2 django-precompiler-ab626f31a0645d87560d242a20dd60e01b3d3b46.tar.xz django-precompiler-ab626f31a0645d87560d242a20dd60e01b3d3b46.zip |
Brief diversion into template inheritance
-rw-r--r-- | templates/base.html | 13 | ||||
-rw-r--r-- | templates/contact/form.html | 29 | ||||
-rw-r--r-- | templates/contact/thanks.html | 23 | ||||
-rw-r--r-- | templates/index.html | 27 |
4 files changed, 45 insertions, 47 deletions
diff --git a/templates/base.html b/templates/base.html new file mode 100644 index 0000000..136c66d --- /dev/null +++ b/templates/base.html | |||
@@ -0,0 +1,13 @@ | |||
1 | <!DOCTYPE html> | ||
2 | <html> | ||
3 | <head> | ||
4 | <meta charset="utf-8"> | ||
5 | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | ||
6 | <title>{% block title %}CodeMash{% endblock %}</title> | ||
7 | <meta name="viewport" content="width=device-width"> | ||
8 | </head> | ||
9 | <body> | ||
10 | {% block content %} | ||
11 | {% endblock %} | ||
12 | </body> | ||
13 | </html> | ||
diff --git a/templates/contact/form.html b/templates/contact/form.html index 7ada5e0..27b68f0 100644 --- a/templates/contact/form.html +++ b/templates/contact/form.html | |||
@@ -1,17 +1,12 @@ | |||
1 | <!DOCTYPE html> | 1 | {% extends "base.html" %} |
2 | <html> | 2 | |
3 | <head> | 3 | {% block title %}Contact Us{% endblock %} |
4 | <meta charset="utf-8"> | 4 | |
5 | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | 5 | {% block content %} |
6 | <title>Contact Us</title> | 6 | <h1>Contact Us</h1> |
7 | <meta name="viewport" content="width=device-width"> | 7 | <form action="{% url 'contact:thanks' %}" method="post"> |
8 | </head> | 8 | {% csrf_token %} |
9 | <body> | 9 | {{ form.as_p }} |
10 | <h1>Contact Us</h1> | 10 | <button type="submit">Contact Us</button> |
11 | <form action="{% url 'contact:thanks' %}" method="post"> | 11 | </form> |
12 | {% csrf_token %} | 12 | {% endblock %} |
13 | {{ form.as_p }} | ||
14 | <button type="submit">Contact Us</button> | ||
15 | </form> | ||
16 | </body> | ||
17 | </html> | ||
diff --git a/templates/contact/thanks.html b/templates/contact/thanks.html index 67e8336..8e131f0 100644 --- a/templates/contact/thanks.html +++ b/templates/contact/thanks.html | |||
@@ -1,14 +1,9 @@ | |||
1 | <!DOCTYPE html> | 1 | {% extends "base.html" %} |
2 | <html> | 2 | |
3 | <head> | 3 | {% block title %}Thank You{% endblock %} |
4 | <meta charset="utf-8"> | 4 | |
5 | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | 5 | {% block content %} |
6 | <title>Thank You</title> | 6 | <h1>Thanks for contacting us</h1> |
7 | <meta name="viewport" content="width=device-width"> | 7 | <p>We have sent the following message to the organizers. Thanks.</p> |
8 | </head> | 8 | <p>{{ form.message.value }}</p> |
9 | <body> | 9 | {% endblock %} |
10 | <h1>Thanks for contacting us</h1> | ||
11 | <p>We have sent the following message to the organizers. Thanks.</p> | ||
12 | <p>{{ form.message.value }}</p> | ||
13 | </body> | ||
14 | </html> | ||
diff --git a/templates/index.html b/templates/index.html index 0ea840f..ff76c3e 100644 --- a/templates/index.html +++ b/templates/index.html | |||
@@ -1,16 +1,11 @@ | |||
1 | <!DOCTYPE html> | 1 | {% extends "base.html" %} |
2 | <html> | 2 | |
3 | <head> | 3 | {% block title %}Hello Codemash{% endblock %} |
4 | <meta charset="utf-8"> | 4 | |
5 | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | 5 | {% block content %} |
6 | <title>Hello Codemash</title> | 6 | <h1>Hello Codemash</h1> |
7 | <meta name="viewport" content="width=device-width"> | 7 | <ul> |
8 | </head> | 8 | <li><a href="{% url 'contact:form' %}">Contact Us</a></li> |
9 | <body> | 9 | </ul> |
10 | <h1>Hello Codemash</h1> | 10 | <p>You've just created your first Django page. Pretty cool, eh?</p> |
11 | <ul> | 11 | {% endblock %} |
12 | <li><a href="{% url 'contact:form' %}">Contact Us</a></li> | ||
13 | </ul> | ||
14 | <p>You've just created your first Django page. Pretty cool, eh?</p> | ||
15 | </body> | ||
16 | </html> | ||