Created
June 18, 2012 17:38
-
-
Save ashwoods/2949599 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
{% block content %} | |
I am the parent, and any template extending me and has a block content will replace this sentence. | |
{% endblock %} | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends "base.html" %} | |
{% block content %} | |
<div class="actions"> | |
{% if user.is_staff %} | |
<a href="{% url admin:index %}">admin</a> | |
{% endif %} | |
<a href="{% url logout %}">logout</a> | |
</div> | |
<div class="search"> | |
<form method="get" action="{% url clients.views.search %}"> | |
<input type="text" name="q" /> | |
<input type="submit" value="Search!" /> | |
</form> | |
</div> | |
{% if q %} | |
<h2>Searched for: {{ q|lower }}</h2> | |
<div class="result"> | |
{% if companies.exists %} | |
<h3>Found companies:</h3> | |
<ul> | |
{% for company in companies.isort %} | |
<li> | |
<a href="{{ company.get_absolute_url }}">{{ company }}</a> | |
</li> | |
{% endfor %} | |
</ul> | |
{% else %} | |
<h3>[No companies found]</h3> | |
{% endif %} | |
</div> | |
<div class="result"> | |
{% if people.exists %} | |
<h3>Found people:</h3> | |
<ul> | |
{% for person in people.isort %} | |
<li> | |
<a href="{{ person.get_absolute_url }}">{{ person }}</a> | |
</li> | |
{% endfor %} | |
</ul> | |
{% else %} | |
<h3>[No people found]</h3> | |
{% endif %} | |
</div> | |
{% endif %} | |
{% endblock%} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment