Commits

Rod Morison committed ce1385c Draft

mezzanine.core templates

Comments (0)

Files changed (15)

templates/base.html

+<!DOCTYPE html>
+{% load pages_tags mezzanine_tags i18n future %}
+<html>
+<head>
+
+<meta http-equiv="Content-type" content="text/html; charset=utf-8">
+<meta name="viewport" content="width=device-width">
+<meta name="keywords" content="{% block meta_keywords %}{% endblock %}">
+<meta name="description" content="{% block meta_description %}{% endblock %}">
+<title>{% block meta_title %}{% endblock %}{% if settings.SITE_TITLE %} | {{ settings.SITE_TITLE }}{% endif %}</title>
+<link rel="shortcut icon" href="{{ STATIC_URL }}img/favicon.ico">
+
+{% ifinstalled mezzanine.blog %}
+<link rel="alternate" type="application/rss+xml" title="RSS" href="{% url "blog_post_feed" "rss" %}">
+<link rel="alternate" type="application/atom+xml" title="Atom" href="{% url "blog_post_feed" "atom" %}">
+{% endifinstalled %}
+
+{% compress css %}
+<link rel="stylesheet" href="{{ STATIC_URL }}css/bootstrap.css">
+<link rel="stylesheet" href="{{ STATIC_URL }}css/bootstrap.responsive.css">
+<link rel="stylesheet" href="{{ STATIC_URL }}css/mezzanine.css">
+{% ifinstalled cartridge.shop %}
+<link rel="stylesheet" href="{{ STATIC_URL }}css/cartridge.css">
+{% endifinstalled %}
+{% block extra_css %}{% endblock %}
+{% endcompress %}
+
+{% compress js %}
+<script src="{{ STATIC_URL }}mezzanine/js/{{ settings.JQUERY_FILENAME }}"></script>
+<script src="{{ STATIC_URL }}js/bootstrap.min.js"></script>
+<script>
+$(function() {
+    $('.middleinput:text, textarea').addClass('xlarge');
+    $('.control-group label').addClass('control-label');
+});
+</script>
+{% block extra_js %}{% endblock %}
+{% endcompress %}
+<!--[if lt IE 9]>
+<script src="{{ STATIC_URL }}js/html5shiv.js"></script>
+<![endif]-->
+
+{% block extra_head %}{% endblock %}
+
+</head>
+<body id="{% block body_id %}body{% endblock %}">
+
+<div class="navbar navbar-inverse">
+<div class="navbar-inner">
+<div class="container">
+    <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
+        <span class="icon-bar"></span>
+        <span class="icon-bar"></span>
+        <span class="icon-bar"></span>
+    </a>
+    {% if settings.SITE_TITLE %}<a class="brand" href="/">{{ settings.SITE_TITLE }}</a>{% endif %}
+    {% if settings.SITE_TAGLINE %}<p class="tagline">{{ settings.SITE_TAGLINE }}</p>{% endif %}
+    <div class="nav-collapse">
+        {% search_form "all" %}
+        {% page_menu "pages/menus/dropdown.html" %}
+    </div>
+</div>
+</div>
+</div>
+
+<div class="container">
+
+{% nevercache %}
+{% for message in messages %}
+<div class="alert alert-{{ message.tags }}" data-alert="alert">
+<a class="close" href="#" onclick="$(this).parent().fadeOut('fast'); return false;">×</a>{{ message }}
+</div>
+{% endfor %}
+{% endnevercache %}
+
+
+<h1>{% block title %}{% endblock %}</h1>
+
+<ul class="breadcrumb">
+{% spaceless %}
+{% block breadcrumb_menu %}{% page_menu "pages/menus/breadcrumb.html" %}{% endblock %}
+{% endspaceless %}
+</ul>
+
+</div>
+
+<div class="container">
+<div class="row">
+
+<div class="span2 left">
+    {% block left_panel %}
+    <div class="panel tree">{% page_menu "pages/menus/tree.html" %}</div>
+    {% endblock %}
+</div>
+
+<div class="span7 middle">
+    {% block main %}{% endblock %}
+</div>
+
+<div class="span3 right">
+    {% nevercache %}
+    {% include "includes/user_panel.html" %}
+    {% endnevercache %}
+    <div class="panel">
+    {% block right_panel %}
+    {% ifinstalled mezzanine.twitter %}
+    {% include "twitter/tweets.html" %}
+    {% endifinstalled %}
+    {% endblock %}
+    </div>
+</div>
+
+</div>
+</div>
+
+<footer>
+<div class="container">
+{% page_menu "pages/menus/footer.html" %}
+<br style="clear:both">
+<p>
+    {% trans "Powered by" %}
+    <a href="http://mezzanine.jupo.org">Mezzanine</a>{% ifinstalled cartridge.shop %},
+    <a href="http://cartridge.jupo.org">Cartridge</a>{% endifinstalled %}
+    {% trans "and" %}
+    <a href="http://www.djangoproject.com">Django</a>
+    <span class="separator">|</span>
+    {% trans "Theme by" %} <a href="http://twitter.github.com/bootstrap/">Bootstrap</a>
+    {% ifinstalled mezzanine.mobile %}
+    <span class="separator">|</span>
+    <a href="{% url "set_device" "mobile" %}?next={{ request.path }}">{% trans "View Mobile Site" %}</a>
+    {% endifinstalled %}
+</p>
+</div>
+</footer>
+
+{% include "includes/footer_scripts.html" %}
+
+</body>
+</html>

templates/email/base.html

+{% block main %}{% endblock %}
+
+<br><a href="http://{{ request.get_host }}">http://{{ request.get_host }}</a>

templates/email/base.txt

+{% block main %}{% endblock %}
+
+http://{{ request.get_host }}

templates/errors/404.html

+{% extends "base.html" %}
+
+{% load i18n %}
+
+{% block title %}
+{% trans "Page not found" %}
+{% endblock %}
+
+{% block main %}
+{% trans "The page you requested does not exist." %}
+{% endblock %}

templates/errors/500.html

+{% extends "base.html" %}
+
+{% load i18n %}
+
+{% block title %}
+{% trans "Error" %}
+{% endblock %}
+
+{% block main %}
+{% trans "Sorry, an error occurred." %}
+{% endblock %}

templates/includes/editable_form.html

+{% load i18n future %}
+
+{# Edit form #}
+<form style="display:none;" class="editable-form" method="post"
+    action="{% url "edit" %}" id="{{ form.uuid }}"
+    {% if form.is_multipart %} enctype="multipart/form-data"{% endif %}>
+    {% csrf_token %}
+    {% for field in form %}
+    <p{% if field.is_hidden %} style="display:none;"{% endif %}>
+        {{ field.label_tag }}<br />{{ field }}{{ field.errors }}
+        {% if field.help_text %}
+        <span class="helptext">{{ field.help_text }}</span>
+        {% endif %}
+    </p>
+    {% endfor %}
+    <input type="submit" value="{% trans "Save" %}" class="btn primary large">
+    <input type="button" value="{% trans "Cancel" %}" class="btn large">
+</form>
+
+{# Original content wrapped in span #}
+<div class="editable-original">{{ original }}</div>
+
+{# Edit link #}
+<a style="visibility:hidden;" class="editable-link" href="#"
+    rel="#{{ form.uuid }}">{% trans "Edit" %}</a>
+
+{# Edit highlight #}
+<div style="visibility:hidden;" class="editable-highlight"></div>
+

templates/includes/editable_loader.html

+{% load i18n future %}
+
+<link rel="stylesheet" href="{{ STATIC_URL }}mezzanine/css/editable.css">
+{{ richtext_media|safe }}
+<script>
+{% url "fb_browse" as fb_browse_url %}
+{% url "static_proxy" as static_proxy_url %}
+window.__filebrowser_url = '{{ fb_browse_url }}';
+window.__toolbar_html = '{{ toolbar|escapejs }}';
+window.__static_proxy = '{{ static_proxy_url }}';
+</script>
+<script src="{{ STATIC_URL }}mezzanine/js/jquery.tools.toolbox.expose.js"></script>
+<script src="{{ STATIC_URL }}mezzanine/js/jquery.tools.overlay.js"></script>
+<script src="{{ STATIC_URL }}mezzanine/js/jquery.form.js"></script>
+<script src="{{ STATIC_URL }}mezzanine/js/jquery.ba-resize.js"></script>
+<script src="{{ STATIC_URL }}mezzanine/js/editable.js"></script>
+

templates/includes/editable_toolbar.html

+{% load i18n future %}
+
+<form id="editable-toolbar" method="POST" action="{% url "admin:logout" %}?{{ REDIRECT_FIELD_NAME }}={{ request.path }}">
+    {% csrf_token %}
+    <a id="editable-toolbar-toggle" href="#">&gt;&gt;</a>
+    {% if editable_obj.get_admin_url  %}
+    <a href="{{ editable_obj.get_admin_url }}">{% trans "Admin" %}</a>
+    {% else %}
+    <a href="{% url "admin:index" %}">{% trans "Admin" %}</a>
+    {% endif %}
+    <a id="editable-toolbar-logout" href="#">{% trans "Log out" %}</a>
+</form>
+
+<img id="editable-loading" src="{{ STATIC_URL }}mezzanine/img/loadingAnimation.gif" />
+

templates/includes/footer_scripts.html

+{% load mezzanine_tags %}
+
+{% editable_loader %}
+
+<script>
+{% if settings.GOOGLE_ANALYTICS_ID and not request.user.is_staff %}
+var _gaq = _gaq || [['_trackPageview']];
+_gaq.unshift(['_setAccount', '{{ settings.GOOGLE_ANALYTICS_ID }}']);
+(function(d, t) {
+    var g = d.createElement(t),
+        s = d.getElementsByTagName(t)[0];
+    g.async = true;
+    g.src = '//www.google-analytics.com/ga.js';
+    s.parentNode.insertBefore(g, s);
+})(document, 'script');
+{% endif %}
+</script>

templates/includes/form_fields.html

+{% load mezzanine_tags %}
+
+{% if form_for_fields.non_field_errors %}
+<div class="control-group error non-field-errors">
+    {% for error in form_for_fields.non_field_errors %}
+    <span class="help-inline">{{ error }}</span>
+    {% endfor %}
+</div>
+{% endif %}
+
+{% nevercache %}
+<input type="hidden" name="referrer" value="{{ request.META.HTTP_REFERER }}">
+{% csrf_token %}
+{% endnevercache %}
+
+{% for field in form_for_fields %}
+{% if field.is_hidden %}
+{{ field }}
+{% else %}
+<div class="control-group input_{{ field.id_for_label }} {{ field.field.type }}
+    {% if field.errors %} error{% endif %}">
+    {{ field.label_tag }}
+    <div class="controls">
+        {{ field }}
+        {% if field.errors %}
+        <span class="help-inline">
+            {% for e in field.errors %}
+            {% if not forloop.first %} / {% endif %}{{ e }}
+            {% endfor %}
+        </span>
+        {% else %}
+        <span class="help-inline">{{ field.help_text }}</span>
+        {% endif %}
+    </div>
+</div>
+{% endif %}
+{% endfor %}

templates/includes/pagination.html

+{% load i18n %}
+
+{% if current_page.has_previous or current_page.has_next %}
+<div class="pagination">
+<ul>
+
+<li class="disabled">
+    <a>{% trans "Page" %} {{ current_page.number }} {% trans "of" %} {{ current_page.paginator.num_pages }}</a>
+</li>
+<li class="prev{% if not current_page.has_previous %} disabled{% endif %}">
+    <a{% if current_page.has_previous %} href="?page={{ current_page.previous_page_number }}{% if querystring %}&{{ querystring }}{% endif %}"{% endif %}>&larr;</a>
+</li>
+{% for page in current_page.visible_page_range %}
+<li{% if page == current_page.number %} class="active"{% endif %}>
+    <a href="?page={{ page }}{% if querystring %}&{{ querystring }}{% endif %}">{{ page }}</a>
+</li>
+{% endfor %}
+<li class="next{% if not current_page.has_next %} disabled{% endif %}">
+    <a{% if current_page.has_next %} href="?page={{ current_page.next_page_number }}{% if querystring %}&{{ querystring }}{% endif %}"{% endif %}>&rarr;</a>
+</li>
+
+</ul>
+</div>
+{% endif %}

templates/includes/search_form.html

+{% load mezzanine_tags i18n future %}
+<form action="{% url "search" %}" class="navbar-search pull-right">
+
+<input class="search-query" placeholder="{% trans "Search" %}" type="text" name="q" value="{{ request.REQUEST.q }}">
+
+{% if search_model_choices %}
+    {% if search_model_choices|length == 1 %}
+    <input type="hidden" name="type" value="{{ search_model_choices.0.1 }}">
+    {% else %}
+    <select name="type">
+        <option value="">{% trans "Everything" %}</option>
+        {% for verbose_name, model in search_model_choices %}
+        <option value="{{ model }}"
+            {% if model == request.REQUEST.type  %}selected{% endif %}>
+            {{ verbose_name }}
+        </option>
+        {% endfor %}
+        <input type="submit" class="btn" value="{% trans "Go" %}">
+    </select>
+    {% endif %}
+{% endif %}
+
+</form>

templates/includes/user_panel.html

+{% load mezzanine_tags %}
+{% ifinstalled mezzanine.accounts %}
+<div class="panel">{% include "accounts/includes/user_panel.html" %}</div>
+{% endifinstalled %}

templates/index.html

+{% extends "base.html" %}
+{% load i18n %}
+
+{% block meta_title %}{% trans "Home" %}{% endblock %}
+{% block title %}{% trans "Home" %}{% endblock %}
+
+{% block breadcrumb_menu %}
+<li class="active">{% trans "Home" %}</li>
+{% endblock %}
+
+{% block main %}
+{% trans "This is the homepage." %}
+{% endblock %}

templates/search_results.html

+{% extends "base.html" %}
+
+{% load i18n future mezzanine_tags %}
+
+{% block meta_title %}{% trans "Search Results" %}{% endblock %}
+{% block title %}{% trans "Search Results" %}{% endblock %}
+
+{% block breadcrumb_menu %}
+<li>
+    <a href="{% url "home" %}">{% trans "Home" %}</a>
+    <span class="divider">/</span>
+</li>
+<li class="active">{% trans "Search Results" %}</li>
+{% endblock %}
+
+{% block main %}
+
+<p>
+{% if results.paginator.count == 0 %}
+{% blocktrans %}
+No results were found in {{ search_type }} matching your query: {{ query }}
+{% endblocktrans %}
+{% else %}
+{% blocktrans with start=results.start_index end=results.end_index total=results.paginator.count %}
+Showing {{ start }} to {{ end }} of {{ total }} results in {{ search_type }} matching your query: {{ query }}
+{% endblocktrans %}
+{% endif %}
+</p>
+
+<div id="search-results">
+    {% for result in results.object_list %}
+    <h5>{{ forloop.counter0|add:results.start_index }})
+        <a href="{{ result.get_absolute_url }}">{{ result }}</a></h5>
+    <p>{{ result.description|truncatewords_html:20|safe }}</p>
+    <a href="{{ result.get_absolute_url }}">{% trans "read more" %}</a>
+    {% endfor %}
+</div>
+
+{% pagination_for results %}
+
+{% endblock %}