{% load l10n %}{% if rules and not disallow_all %}{% for rule in rules %}{% ifchanged rule.robot %}{% if not forloop.first %}
{% endif %}User-agent: {{ rule.robot }}{% endifchanged %}
{% for url in rule.allowed.all %}Allow: {{ url.pattern|safe }}
{% endfor %}{% for url in rule.disallowed.all %}Disallow: {{ url.pattern|safe }}
{% endfor %}{% if rule.crawl_delay %}Crawl-delay: {% localize off %}{{ rule.crawl_delay|floatformat:'0' }}{% endlocalize %}
{% endif %}{% endfor %}{% elif disallow_all %}User-agent: *
Disallow: /
{% else %}User-agent: *
Disallow: /admin
{% endif %}
{% if host and not disallow_all %}Host: {{ host }}{% endif %}
{% if not disallow_all %}{% for sitemap_url in sitemap_urls %}Sitemap: {{ sitemap_url }}
{% endfor %}{% endif %}
