diff options
Diffstat (limited to 'app/lib/grappelli/templates')
82 files changed, 2876 insertions, 0 deletions
diff --git a/app/lib/grappelli/templates/admin/404.html b/app/lib/grappelli/templates/admin/404.html new file mode 100644 index 0000000..10aeb75 --- /dev/null +++ b/app/lib/grappelli/templates/admin/404.html @@ -0,0 +1,13 @@ +{% extends "admin/base_site.html" %} + +<!-- LOADING --> +{% load i18n %} + +<!-- TITLE --> +{% block title %}{% trans "Page not found" %}{% endblock %} + +<!-- CONTENT --> +{% block content %} +<h2>{% trans "Page not found" %}</h2> +<p>{% trans "We're sorry, but the requested page could not be found." %}</p> +{% endblock %} diff --git a/app/lib/grappelli/templates/admin/500.html b/app/lib/grappelli/templates/admin/500.html new file mode 100644 index 0000000..e6fb34a --- /dev/null +++ b/app/lib/grappelli/templates/admin/500.html @@ -0,0 +1,16 @@ +{% extends "admin/base_site.html" %} + +<!-- LOADING --> +{% load i18n %} + +<!-- BREADCRUMBS --> +{% block breadcrumbs %}<div id="breadcrumbs"><a href="/">{% trans "Home" %}</a> › {% trans "Server error" %}</div>{% endblock %} + +<!-- TITLE --> +{% block title %}{% trans "Server error (500)" %}{% endblock %} + +<!-- CONTENT --> +{% block content %} +<h1>{% trans "Server Error <em>(500)</em>" %}</h1> +<p>{% trans "There's been an error. It's been reported to the site administrators via e-mail and should be fixed shortly. Thanks for your patience." %}</p> +{% endblock %} diff --git a/app/lib/grappelli/templates/admin/_grappelli/app_index.html b/app/lib/grappelli/templates/admin/_grappelli/app_index.html new file mode 100644 index 0000000..e9cb806 --- /dev/null +++ b/app/lib/grappelli/templates/admin/_grappelli/app_index.html @@ -0,0 +1,40 @@ +{% extends "admin/_grappelli/index.html" %} + +<!-- LOADING --> +{% load i18n grp_tags %} + +<!-- BREADCRUMBS --> +{% if not is_popup %} + {% block breadcrumbs %} + <div id="breadcrumbs"> + <a href="../">{% trans "Home" %}</a> › + {% for app in app_list %} + {% blocktrans with app.name as name %}{{ name }}{% endblocktrans %} + {% endfor %} + </div> + {% endblock %} +{% endif %} + +<!-- CONTENT --> +{% block content %} + <div class="container-grid"> + <div class="column span-12" id="apps_init"> + {% if app_list %} + {% for app in app_list %} + <div class="module" id="app_{{ app.name|lower }}"> + <h2>{% trans app.name %}</h2> + {% for model in app.models %} + <div class="row"> + {% if model.perms.change %}<a href="{{ model.admin_url }}">{{ model.name }}</a>{% else %}<span>{{ model.name }}</span>{% endif %} + <ul class="actions"> + <li class="add-link">{% if model.perms.add %}<a href="{{ model.admin_url }}add/">{% trans 'Add' %}</a>{% else %} {% endif %}</li> + <li class="change-link"> {% if model.perms.change %}<a href="{{ model.admin_url }}">{% trans 'Change' %}</a>{% else %} {% endif %}</li> + </ul> + </div> + {% endfor %} + </div> + {% endfor %} + {% endif %} + </div> + </div> +{% endblock %} diff --git a/app/lib/grappelli/templates/admin/_grappelli/base.html b/app/lib/grappelli/templates/admin/_grappelli/base.html new file mode 100644 index 0000000..16676b9 --- /dev/null +++ b/app/lib/grappelli/templates/admin/_grappelli/base.html @@ -0,0 +1,78 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="{{ LANGUAGE_CODE }}" xml:lang="{{ LANGUAGE_CODE }}" {% if LANGUAGE_BIDI %}dir="rtl"{% endif %}> +<head> + <title>{% block title %}{% endblock %}</title> + {% block blockbots %}<meta name="robots" content="NONE,NOARCHIVE" />{% endblock %} + + <!-- LOADING --> + {% load adminmedia i18n grp_tags %} + + <!-- STYLESHEETS --> + {% block stylesheets %} + <link rel="stylesheet" type="text/css" href="{% admin_media_prefix %}css/base.css" /> + {% if LANGUAGE_BIDI %}<link rel="stylesheet" type="text/css" href="{% block stylesheet_rtl %}{% admin_media_prefix %}css/rtl.css{% endblock %}" />{% endif %} + <link rel="stylesheet" href="{% admin_media_prefix %}jquery/ui/css/custom-theme/jquery-ui-1.8.custom.css" type="text/css" media="screen" title="no title" charset="utf-8"> + <link rel="stylesheet" type="text/css" href="{% admin_media_prefix %}css/jquery-ui-grappelli-extensions.css" /> + {% endblock %} + {% block extrastyle %}{% endblock %} + + <!-- JAVASCRIPTS --> + {% block javascripts %} + <script type="text/javascript"> + // GLOBALS + var ADMIN_URL = "{% url admin:index %}",{# ugly hack to prevent tests from failing #} + MODEL_URL_ARRAY = {% get_content_types %}, + DATE_FORMAT = "{% get_date_format %}", + TIME_FORMAT = "{% get_time_format %}", + DATETIME_FORMAT = "{% get_datetime_format %}"; + </script> + <script type="text/javascript" src="{% admin_media_prefix %}jquery/jquery-1.4.2.min.js"></script> + <script type="text/javascript" src="{% admin_media_prefix %}jquery/ui/js/jquery-ui-1.8.custom.min.js"></script> + <script type="text/javascript" src="{% admin_media_prefix %}js/grappelli.init.js"></script> + <script type="text/javascript" src="{% admin_media_prefix %}js/grappelli.timepicker.js"></script> + <script type="text/javascript" src="{% admin_media_prefix %}js/grappelli.RelatedObjectLookups.js"></script> + <script type="text/javascript" src="{% admin_media_prefix %}js/grappelli.min.js"></script> + {% endblock %} + + {% block extrahead %}{% endblock %} +</head> +<body class="{% if is_popup %}popup {% endif %}{% block bodyclass %}{% endblock %}"> + <div id="container"> + + <!-- HEADER --> + {% if not is_popup %} + {% include "admin/includes_grappelli/header.html" %} + <!-- BREADCRUMBS --> + {% block breadcrumbs %} + <div id="breadcrumbs"><a href="/">{% trans 'Home' %}</a>{% if title %} › {{ title }}{% endif %}</div> + {% endblock %} + {% endif %} + + <!-- MESSAGES --> + {% if messages %} + <ul class="messagelist"> + {% for message in messages %} + <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li> + {% endfor %} + </ul> + {% endif %} + + <!-- CONTENT --> + <div id="content" class="{% block content-class %}{% endblock %}"> + {% block pretitle %}{% endblock %} + {% block content_title %}{% if title %}<h1>{{ title }}</h1>{% endif %}{% endblock %} + {% block object-tools %}{% endblock %} + {% block content %} + {{ content }} + {% block filters %}{% endblock %} + {% endblock %} + <br class="clear" /> + </div> + + <!-- FOOTER --> + {% block footer %}<div id="footer"></div>{% endblock %} + + </div> +</body> +</html> + diff --git a/app/lib/grappelli/templates/admin/_grappelli/base_site.html b/app/lib/grappelli/templates/admin/_grappelli/base_site.html new file mode 100644 index 0000000..1f94985 --- /dev/null +++ b/app/lib/grappelli/templates/admin/_grappelli/base_site.html @@ -0,0 +1,9 @@ +{% extends "admin/_grappelli/base.html" %} + +<!-- LOADING --> +{% load i18n grp_tags %} + +<!-- TITLE/BRANDING/NAV --> +{% block title %}{{ title }} | {% grappelli_admin_title %}{% endblock %} +{% block branding %}<h1 id="site-name">{% grappelli_admin_title %}</h1>{% endblock %} +{% block nav-global %}{% endblock %} diff --git a/app/lib/grappelli/templates/admin/_grappelli/index.html b/app/lib/grappelli/templates/admin/_grappelli/index.html new file mode 100644 index 0000000..8dedd3d --- /dev/null +++ b/app/lib/grappelli/templates/admin/_grappelli/index.html @@ -0,0 +1,61 @@ +{% extends "admin/_grappelli/base_site.html" %} + +<!-- LOADING --> +{% load i18n adminmedia grp_tags %} + +<!-- STYLES & SCRIPTS --> +{% block javascripts %} + {{ block.super }} +{% endblock %} + +<!-- COLTYPE/BODYCLASS --> +{% block bodyclass %}dashboard{% endblock %} +{% block content-class %}content-grid{% endblock %} + +<!-- BREADCRUMBS --> +{% block breadcrumbs %}<div id="breadcrumbs">{% trans "Home" %}</div>{% endblock %} + +<!-- CONTENT --> +{% block content %} +<div class="container-grid"> + <div class="column span-12"> + {% if app_list %} + {% for app in app_list %} + <div class="module" id="app_{{ app.name|lower }}"> + <h2><a href="{{ app.app_url }}" class="section">{% trans app.name %}</a></h2> + {% for model in app.models %} + <div class="row"> + {% if model.perms.change %}<a href="{{ model.admin_url }}">{{ model.name }}</a>{% else %}<span>{{ model.name }}</span>{% endif %} + <ul class="actions"> + <li class="add-link">{% if model.perms.add %}<a href="{{ model.admin_url }}add/">{% trans 'Add' %}</a>{% else %} {% endif %}</li> + <li class="change-link"> {% if model.perms.change %}<a href="{{ model.admin_url }}">{% trans 'Change' %}</a>{% else %} {% endif %}</li> + </ul> + </div> + {% endfor %} + </div> + {% endfor %} + {% else %} + <p>{% trans "You donĀ“t have permission to edit anything." %}</p> + {% endif %} + </div> + <div class="column span-6 last"> + <div class="module actions" id="recent-actions-module"> + <h2>{% trans 'Recent Actions' %}</h2> + <div class="module"> + <h3>{% trans 'My Actions' %}</h3> + {% load log %} + {% get_admin_log 10 as admin_log for_user user %} + {% if not admin_log %} + <p>{% trans 'None available' %}</p> + {% else %} + <ul> + {% for entry in admin_log %} + <li class="{% if entry.is_addition %}add-link{% endif %}{% if entry.is_change %}change-link{% endif %}{% if entry.is_deletion %}delete-link{% endif %}">{% if not entry.is_deletion %}<a href="{{ entry.get_admin_url }}">{% endif %}{{ entry.object_repr }}{% if not entry.is_deletion %}</a>{% endif %}<br /><span class="mini quiet">{% filter capfirst %}{% trans entry.content_type.name %}{% endfilter %}</span></li> + {% endfor %} + </ul> + {% endif %} + </div> + </div> + </div> +</div> +{% endblock %} diff --git a/app/lib/grappelli/templates/admin/_grappelli_admin_tools/app_index.html b/app/lib/grappelli/templates/admin/_grappelli_admin_tools/app_index.html new file mode 100644 index 0000000..bc896be --- /dev/null +++ b/app/lib/grappelli/templates/admin/_grappelli_admin_tools/app_index.html @@ -0,0 +1,20 @@ +{% extends "admin/_grappelli_admin_tools/index.html" %} +{% load i18n admin_tools_dashboard_tags %} + +<!-- BREADCRUMBS --> +{% if not is_popup %} + {% block breadcrumbs %} + <div id="breadcrumbs"><a href="../"> + {% trans "Home" %}</a> › + {% for app in app_list %} + {% trans app.name %} + {% endfor %} + </div> + {% endblock %} +{% endif %} + +{% block content %} + {% admin_tools_render_dashboard 'app_index' %} +{% endblock %} + +{% block sidebar %}{% endblock %} diff --git a/app/lib/grappelli/templates/admin/_grappelli_admin_tools/base.html b/app/lib/grappelli/templates/admin/_grappelli_admin_tools/base.html new file mode 100644 index 0000000..742273a --- /dev/null +++ b/app/lib/grappelli/templates/admin/_grappelli_admin_tools/base.html @@ -0,0 +1,125 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="{{ LANGUAGE_CODE }}" xml:lang="{{ LANGUAGE_CODE }}" {% if LANGUAGE_BIDI %}dir="rtl"{% endif %}> +<head> + <title>{% block title %}{% endblock %}</title> + {% block blockbots %}<meta name="robots" content="NONE,NOARCHIVE" />{% endblock %} + + <!-- LOADING --> + {% load theming_tags adminmedia i18n grp_tags %} + + <!-- STYLESHEETS --> + {% block stylesheets %} + <link rel="stylesheet" type="text/css" href="{% admin_media_prefix %}css/base.css" /> + {% if LANGUAGE_BIDI %}<link rel="stylesheet" type="text/css" href="{% block stylesheet_rtl %}{% admin_media_prefix %}css/rtl.css{% endblock %}" />{% endif %} + <link rel="stylesheet" href="{% admin_media_prefix %}jquery/ui/css/custom-theme/jquery-ui-1.8.custom.css" type="text/css" media="screen" title="no title" charset="utf-8"> + <link rel="stylesheet" type="text/css" href="{% admin_media_prefix %}css/jquery-ui-grappelli-extensions.css" /> + {% endblock %} + + {% block extrastyle %}{% endblock %} + + <!-- JAVASCRIPTS --> + {% block javascripts %} + <script type="text/javascript"> + // GLOBALS + // TODO: klemens: drop ADMIN_URL + var ADMIN_URL = "{% url admin:index %}", + MODEL_URL_ARRAY = {% get_content_types %}, + DATE_FORMAT = "{% get_date_format %}", + TIME_FORMAT = "{% get_time_format %}", + DATETIME_FORMAT = "{% get_datetime_format %}"; + </script> + <script type="text/javascript" src="{% admin_media_prefix %}jquery/jquery-1.4.2.min.js"></script> + <script type="text/javascript" src="{% admin_media_prefix %}jquery/ui/js/jquery-ui-1.8.custom.min.js"></script> + <script type="text/javascript" src="{% admin_media_prefix %}js/grappelli.init.js"></script> + <script type="text/javascript" src="{% admin_media_prefix %}js/grappelli.timepicker.js"></script> + <script type="text/javascript" src="{% admin_media_prefix %}js/grappelli.RelatedObjectLookups.js"></script> + <script type="text/javascript" src="{% admin_media_prefix %}js/grappelli.min.js"></script> + {% endblock %} + + {% block extrahead %}{% endblock %} +</head> +<body class="{% if is_popup %}popup {% endif %}{% block bodyclass %}{% endblock %}"> + <div id="container"> + + <!-- HEADER --> + {% if not is_popup %} + <div id="header"> + <div class="branding">{% block branding %}{% endblock %}</div> + <!-- Title --> + <div class="admin-title">{% if grappelli_admin_title %}{{ grappelli_admin_title }}{% else %}{% get_admin_title %}{% endif %}</div> + {% if user.is_active and user.is_staff %} + <ul id="user-tools"> + <!-- Username --> + <li class="user-options-container collapse closed"> + <a href="javascript://" class="user-options-handler collapse-handler">{% firstof user.first_name user.username %}</a> + <ul class="user-options"> + <!-- Change Password --> + {% url admin:password_change as password_change_url %} + {% if password_change_url %} + <li><a href="{{ password_change_url }}"> + {% else %} + <li><a href="{{ root_path }}password_change/"> + {% endif %} + {% trans 'Change password' %}</a></li> + <!-- Logout --> + {% url admin:logout as logout_url %} + {% if logout_url %} + <li><a href="{{ logout_url }}"> + {% else %} + <li><a href="{{ root_path }}logout/"> + {% endif %} + {% trans 'Log out' %}</a></li> + </ul> + </li> + <!-- Userlinks --> + {% block userlinks %} + <!-- JS tests --> + {% url test-index as testindexurl %} + {% if testindexurl %} + <li><a href="{{ testindexurl }}">{% trans 'Tests' %}</a></li> + {% endif %} + <!-- Documentation --> + {% url django-admindocs-docroot as docsroot %} + {% if docsroot %} + <li><a href="{{ docsroot }}">{% trans 'Documentation' %}</a></li> + {% endif %} + {% endblock %} + </ul> + {% endif %} + {% block nav-global %}{% endblock %} + </div> + + <!-- BREADCRUMBS --> + {% block breadcrumbs %} + <div id="breadcrumbs"><a href="/">{% trans 'Home' %}</a>{% if title %} › {{ title }}{% endif %}</div> + {% endblock %} + {% endif %} + + <!-- MESSAGES --> + {% if messages %} + <ul class="messagelist"> + {% for message in messages %} + <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li> + {% endfor %} + </ul> + {% endif %} + + <!-- CONTENT --> + <div id="content" class="{% block content-class %}{% endblock %}"> + {% block pretitle %}{% endblock %} + {% block content_title %}{% if title %}<h1>{{ title }}</h1>{% endif %}{% endblock %} + {% block object-tools %}{% endblock %} + {% block content %} + {{ content }} + {% block filters %}{% endblock %} + {% endblock %} + <br class="clear" /> + </div> + + <!-- FOOTER --> + {% block footer %}<div id="footer"></div>{% endblock %} + + </div> +</body> +</html> + diff --git a/app/lib/grappelli/templates/admin/_grappelli_admin_tools/base_site.html b/app/lib/grappelli/templates/admin/_grappelli_admin_tools/base_site.html new file mode 100644 index 0000000..0012bb6 --- /dev/null +++ b/app/lib/grappelli/templates/admin/_grappelli_admin_tools/base_site.html @@ -0,0 +1,25 @@ +{% extends "admin/_grappelli_admin_tools/base.html" %} +{% load i18n admin_tools_menu_tags %} + +{% block title %}{{ title }} | {% trans 'Django site admin' %}{% endblock %} + +{% block extrastyle %} + {{ block.super }} + {% if user.is_active and user.is_staff %} + {% if not is_popup %} + {% admin_tools_render_menu_css %} + {% endif %} + {% endif %} +{% endblock %} + +{% block branding %} + <h1 id="site-name">{% trans 'Django administration' %}</h1> +{% endblock %} + +{% block nav-global %} + {% if user.is_active and user.is_staff %} + {% if not is_popup %} + {% admin_tools_render_menu %} + {% endif %} + {% endif %} +{% endblock %} diff --git a/app/lib/grappelli/templates/admin/_grappelli_admin_tools/index.html b/app/lib/grappelli/templates/admin/_grappelli_admin_tools/index.html new file mode 100644 index 0000000..2f3bb13 --- /dev/null +++ b/app/lib/grappelli/templates/admin/_grappelli_admin_tools/index.html @@ -0,0 +1,18 @@ +{% extends "admin/_grappelli_admin_tools/base_site.html" %} +{% load i18n admin_tools_dashboard_tags %} + +{% block extrastyle %} +{{ block.super }} +{% block dashboard_css %}{% admin_tools_render_dashboard_css %}{% endblock %} +{% endblock %} + +<!-- COLTYPE/BODYCLASS --> +{% block bodyclass %}admin-tools dashboard{% endblock %} +{% block content-class %}content-grid{% endblock %} + +{% block breadcrumbs %}<div id="breadcrumbs">{% trans "Home" %}</div>{% endblock %} +{% block content_title %}{% if title %}<h1>{{ title }}</h1>{% endif %}{% endblock %} + +{% block content %} + {% admin_tools_render_dashboard %} +{% endblock %} diff --git a/app/lib/grappelli/templates/admin/actions.html b/app/lib/grappelli/templates/admin/actions.html new file mode 100644 index 0000000..588f503 --- /dev/null +++ b/app/lib/grappelli/templates/admin/actions.html @@ -0,0 +1,19 @@ +{% load i18n %} +<div class="module footer changelist-actions"> + {% for field in action_form %} + {{ field }} + {% endfor %} + {% if actions_selection_counter %} + <ul> + <li class="action-counter"><span class="action-counter">{{ selection_note }}</span></li> + {% if cl.result_count != cl.result_list|length %} + <li class="all"><span class="all">{{ selection_note_all }}</span></li> + <li class="question"><a href="javascript:;" title="{% trans "Click here to select the objects across all pages" %}">{% blocktrans with cl.result_count as total_count %}Select all {{ total_count }} {{ module_name }}{% endblocktrans %}</a></li> + <li class="clear-selection"><a href="javascript://" class="clear">{% trans "Clear selection" %}</a></li> + {% endif %} + </ul> + {% endif %} + <!-- + submit is triggered via onChange event of select field + <button type="submit" class="button" title="{% trans "Run the selected action" %}" name="index" value="{{ action_index|default:0 }}">{% trans "Go" %}</button>--> +</div> diff --git a/app/lib/grappelli/templates/admin/app_index.html b/app/lib/grappelli/templates/admin/app_index.html new file mode 100644 index 0000000..a877e66 --- /dev/null +++ b/app/lib/grappelli/templates/admin/app_index.html @@ -0,0 +1 @@ +{% extends admin_template_app_index %}
\ No newline at end of file diff --git a/app/lib/grappelli/templates/admin/auth/user/add_form.html b/app/lib/grappelli/templates/admin/auth/user/add_form.html new file mode 100644 index 0000000..7431762 --- /dev/null +++ b/app/lib/grappelli/templates/admin/auth/user/add_form.html @@ -0,0 +1,36 @@ +{% extends "admin/change_form.html" %} +{% load i18n %} + +{% comment %} +{% block after_field_sets %} + <p>{% trans "First, enter a username and password. Then, you'll be able to edit more user options." %}</p> + <fieldset class="module aligned"> + <div class="row"> + {# TODO: get required class on label_tag #} + <div class="column span-4"><label for="id_username" class="required">{% trans 'Username' %}:</label></div> + <div class="column span-flexible"> + {{ form.username }} + {{ form.username.errors }} + <p class="help">{{ form.username.help_text }}</p> + </div> + </div> + <div class="row"> + {# TODO: get required class on label_tag #} + <div class="column span-4"><label for="id_password1" class="required">{% trans 'Password' %}:</label></div> + <div class="column span-flexible"> + {{ form.password1 }} + {{ form.password1.errors }} + </div> + </div> + <div class="row"> + {# TODO: get required class on label_tag #} + <div class="column span-4"><label for="id_password2" class="required">{% trans 'Password (again)' %}:</label></div> + <div class="column span-flexible"> + {{ form.password2 }} + {{ form.password2.errors }} + <p class="help">{% trans 'Enter the same password as above, for verification.' %}</p> + </div> + </div> + </fieldset> +{% endblock %} +{% endcomment %} diff --git a/app/lib/grappelli/templates/admin/auth/user/change_password.html b/app/lib/grappelli/templates/admin/auth/user/change_password.html new file mode 100644 index 0000000..0a82cf7 --- /dev/null +++ b/app/lib/grappelli/templates/admin/auth/user/change_password.html @@ -0,0 +1,68 @@ +{% extends "admin/base_site.html" %} +{% load i18n admin_modify adminmedia %} {# grp_csrf #} +{% block userlinks %} +{% url django-admindocs-docroot as docsroot %} + {% if docsroot %} + <li> + <a href="{{ docsroot }}">{% trans 'Documentation' %}</a> + </li> + {% endif %} + <li> + <a href="{{ root_path }}password_change/">{% trans 'Change password' %}</a> + </li> + <li> + <a href="{{ root_path }}logout/">{% trans 'Log out' %}</a> + </li> +{% endblock %} +{% block breadcrumbs %} + {% if not is_popup %} + <div id="breadcrumbs"> + <a href="../../../../">{% trans "Home" %}</a> › + <a href="../../">{{ opts.verbose_name_plural|capfirst }}</a> › + <a href="../">{{ original|truncatewords:"18" }}</a> › + {% trans 'Change password' %} + </div> + {% endif %} +{% endblock %} +{% block title %}{% trans 'Password change' %}{% endblock %} +{% block content-class %}content-grid{% endblock %} + +{% block content %} +{# TODO: French translations alre all mixed up with change "MY" password form ... #} +{#<h1>{% trans 'Password change' %}</h1>#} +<div class="container-grid"> + <div class="column span-12"> + <p>{% blocktrans with original.username as username %}Enter a new password for the user <strong>{{ username }}</strong>.{% endblocktrans %}</p> + {% if form.errors %} + <p class="errornote"> + {% blocktrans count form.errors.items|length as counter %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %} + </p> + {% endif %} + <form action="{{ form_url }}" method="post" id="{{ opts.module_name }}_form">{% csrf_token %}{% block form_top %}{% endblock %} + {% if is_popup %}<input type="hidden" name="_popup" value="1" />{% endif %} + <fieldset class="module"> + <div class="row"> + <div class="column span-4"><label for="id_new_password1" class="required">{% trans 'New password:' %}</label></div> + <div class="column span-flexible"> + {{ form.password1 }} + {{ form.password1.errors }} + </div> + </div> + <div class="row"> + <div class="column span-4"><label for="id_new_password2" class="required">{% trans 'Password (again)' %}</label></div> + <div class="column span-flexible"> + {{ form.password2 }} + {{ form.password2.errors }} + <p class="help">{% trans 'Enter the same password as above, for verification.' %}</p> + </div> + </div> + </fieldset> + <div class="module submit-row"> + <ul class="submit-row"> + <li><input type="submit" value="{% trans 'Change password' %}" class="default" /></li> + </ul> + </div> + </form> + </div> +</div> +{% endblock %} diff --git a/app/lib/grappelli/templates/admin/base.html b/app/lib/grappelli/templates/admin/base.html new file mode 100644 index 0000000..1ba7a0d --- /dev/null +++ b/app/lib/grappelli/templates/admin/base.html @@ -0,0 +1 @@ +{% extends admin_template_base %}
\ No newline at end of file diff --git a/app/lib/grappelli/templates/admin/base_site.html b/app/lib/grappelli/templates/admin/base_site.html new file mode 100644 index 0000000..1c99d4d --- /dev/null +++ b/app/lib/grappelli/templates/admin/base_site.html @@ -0,0 +1 @@ +{% extends admin_template_base_site %}
\ No newline at end of file diff --git a/app/lib/grappelli/templates/admin/change_form.html b/app/lib/grappelli/templates/admin/change_form.html new file mode 100644 index 0000000..620b166 --- /dev/null +++ b/app/lib/grappelli/templates/admin/change_form.html @@ -0,0 +1,100 @@ +{% extends "admin/base_site.html" %} + +<!-- LOADING --> +{% load i18n admin_modify adminmedia grp_tags %} + +<!-- JAVASCRIPTS --> +{% block javascripts %} + {{ block.super }} + {% url admin:jsi18n as jsi18nurl %} + <script type="text/javascript" src="{{ jsi18nurl|default:"../../../jsi18n/" }}"></script> + {{ media }} +{% endblock %} + +<!-- COLTYPE/BODYCLASS --> +{% block bodyclass %}{{ opts.app_label }}-{{ opts.object_name.lower }} change-form{% endblock %} +{% block content-class %}content-flexible{% endblock %} + +<!-- BREADCRUMBS --> +{% block breadcrumbs %} + {% if not is_popup %} + <div id="breadcrumbs"> + <a href="../../../">{% trans "Home" %}</a> › + <a href="../../">{% trans app_label|capfirst|escape %}</a> › + {% if has_change_permission %}<a href="../">{{ opts.verbose_name_plural|capfirst }}</a>{% else %}{{ opts.verbose_name_plural|capfirst }}{% endif %} › + {% if add %}{% trans "Add" %} {{ opts.verbose_name }}{% else %}{{ original|truncatewords:"18" }}{% endif %} + </div> + {% endif %} +{% endblock %} + +<!-- OBJECT TOOLS --> +{% block object-tools %} + {% if change %} + {% if not is_popup %} + <ul class="tools"> + <li><a href="history/">{% trans "History" %}</a></li> + {% if has_absolute_url %}<li><a href="../../../r/{{ content_type_id }}/{{ object_id }}/" class="focus" target="_blank">{% trans "View on site" %}</a></li>{% endif%} + </ul> + {% endif %} + {% endif %} +{% endblock %} + +<!-- CONTENT --> +{% block content %} + <div class="container-flexible"> + <div class="form-container"> + <form {% if has_file_field %}enctype="multipart/form-data" {% endif %}action="{{ form_url }}" method="post" id="{{ opts.module_name }}_form">{% csrf_token %}{% block form_top %}{% endblock %} + <div> + <!-- Popup Hidden Field --> + {% if is_popup %}<input type="hidden" name="_popup" value="1" />{% endif %} + + <!-- Submit-Row --> + {% if save_on_top %}{% submit_row %}{% endif %} + + <!-- Errors --> + {% if errors %} + <p class="errornote">{% blocktrans count errors|length as counter %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %}</p> + <ul class="errorlist">{% for error in adminform.form.non_field_errors %}<li>{{ error }}</li>{% endfor %}</ul> + {% endif %} + + <!-- Fieldsets --> + {% for fieldset in adminform %} + {% include "admin/includes/fieldset.html" %} + {% endfor %} + + {% block after_field_sets %}{% endblock %} + + <!-- Inlines --> + {% for inline_admin_formset in inline_admin_formsets %} + {% include inline_admin_formset.opts.template %} + {% endfor %} + + {% block after_related_objects %}{% endblock %} + + <!-- Submit-Row --> + {% submit_row %} + + {% if adminform and add %} + {% block extrahead %} + <script type="text/javascript"> + (function($){ + $(function(){ + try { + {# Focus on first FormField #} + $("#{{ adminform.first_field.auto_id }}, #{{ adminform.first_field.auto_id }}_0") + .eq(0).focus(); + } catch(e) {} + }); + }(django.jQuery)); + </script> + {% endblock %} + {% endif %} + + <!-- JS for prepopulated fields --> + {% prepopulated_fields_js %} + + </div> + </form> + </div> + </div> +{% endblock %} diff --git a/app/lib/grappelli/templates/admin/change_list.html b/app/lib/grappelli/templates/admin/change_list.html new file mode 100644 index 0000000..e407964 --- /dev/null +++ b/app/lib/grappelli/templates/admin/change_list.html @@ -0,0 +1,153 @@ +{% extends "admin/base_site.html" %} + +<!-- LOADING --> +{% load adminmedia admin_list i18n grp_tags %} + +<!-- JAVASCRIPTS --> +{% block javascripts %} + {{ block.super }} + {% if cl.formset %} + {% url admin:jsi18n as jsi18nurl %} + <script type="text/javascript" src="{{ jsi18nurl|default:'../../jsi18n/' }}"></script> + {% endif %} + {{ media }} + <script type="text/javascript" src="{% admin_media_prefix %}js/grappelli.change_list.js"></script> + <script type="text/javascript" charset="utf-8"> + {% if is_popup %} + var IS_POPUP = true; + {% else %} + var IS_POPUP = false; + {% endif %} + (function($) { + $(document).ready(function() { + {% if is_popup %} + // UGLY HACK: REMOVE ACTIONS and LIST_EDITABLES FOR POPUPS + // shouldn't be there in the first place, see + // http://code.djangoproject.com/ticket/11700 + $('div#actions').hide(); + $('input.action-select').parent().hide(); + $('input#action-toggle').parent().hide(); + $('div.changelist-results input').attr('disabled', 'disabled'); + $('div.changelist-results select').attr('disabled', 'disabled'); + $('div.changelist-results textarea').attr('disabled', 'disabled').addClass("mceNoEditor"); + $('div#submit').hide(); + $('.related-lookup, .add-another').attr("onClick", "return false;"); + // "really" disable datepicker in grappelli.js + //$('.vDateField').addClass('disabled'); + {% endif %} + + {% if cl.search_fields %} + {% get_search_fields_verbose cl.opts as search_fields_verbose %} + $('body').change_list({'initialSearchVal': '{% if not cl.query and not search_fields_verbose %}{% trans 'Search' %}{% endif %}{% if search_fields_verbose and not cl.query %}{{ search_fields_verbose }}{% endif %}{% if cl.query %}{{ cl.query }}{% endif %}'}); + {% else %} + $('body').change_list(); + {% endif %} + }); + })(django.jQuery); + </script> +{% endblock %} + +<!-- COLTYPE/BODYCLASS-- > +{% block bodyclass %}change-list{% endblock %} +{% block content-class %}content-flexible{% endblock %} + +<!-- BREADCRUMBS -- > +{% block breadcrumbs %} + {% if not is_popup %} + <div id="breadcrumbs"> + <a href="../../">{% trans "Home" %}</a> › + <a href="../">{% trans app_label|capfirst|escape %}</a> › + {{ cl.opts.verbose_name_plural|capfirst }} + </div> + {% endif %} +{% endblock %} + +<!-- CONTENT-TITLE --> +{% block content_title %} + <h1> + {{ cl.opts.verbose_name_plural|capfirst }} + </h1> +{% endblock %} + +<!-- OBJECT-TOOLS --> +{% block object-tools %} + {% if has_add_permission %} + <ul class="tools"> + <li> + <a href="add/{% if is_popup %}?_popup=1{% endif %}" class="add-handler focus"> + {% blocktrans with cl.opts.verbose_name as name %}Add {{ name }}{% endblocktrans %} + </a> + </li> + </ul> + {% endif %} +{% endblock %} + +<!-- CONTENT --> +{% block content %} + {% if cl.search_fields or cl.has_filters or cl.date_hierarchy %} + <div class="module changelist-filters"> + <!-- PAGINATION TOP --> + {% pagination cl %} + {% if cl.has_filters or cl.search_fields %} + <!-- FILTERS --> + {% if cl.has_filters %} + <div id="filters" class="module filter span-6"> + <div class="pulldown-container"> + <a href="javascript://" class="button toggle-filters">{% trans 'Filter' %}</a> + <div class="filter-pulldown"> + {% for spec in cl.filter_specs %}{% admin_list_filter cl spec %}{% endfor %} + </div> + </div> + </div> + {% endif %} + <!-- SEARCH --> + {% if cl.search_fields %} + <div id="search" class="module search span-6"> + {% block search %}{% search_form cl %}{% endblock %} + </div> + {% endif %} + {% endif %} + <br clear="all" /> + </div> + <!-- DATE HIERARCHY --> + {% if cl.date_hierarchy %} + {% date_hierarchy cl %} + {% endif %} + {% endif %} + <form action="" method="post"{% if cl.formset.is_multipart %} enctype="multipart/form-data"{% endif %}>{% csrf_token %} + <div id="changelist" class="container-full{% if cl.list_editable %} editable{% endif %}" style=""> + <!-- POPUP --> + {% if is_popup %}<input type="hidden" name="_popup" value="1" />{% endif %} + <!-- ERRORS --> + {% if cl.formset.errors %} + <p class="errornote"> + {% blocktrans count cl.formset.errors|length as counter %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %} + </p> + {{ cl.formset.non_form_errors }} + {% endif %} + <!-- MANAGEMENT FORM --> + {% if cl.formset %} + {{ cl.formset.management_form }} + {% endif %} + <!-- CHANGELIST-RESULTS --> + {% block result_list %} + {% result_list cl %} + {% endblock %} + <!-- PAGINATION BOTTOM --> + {% pagination cl %} + </div><br clear="all" /> + <!-- CHANGELIST-ACTIONS --> + {% if action_form and cl.full_result_count and cl.result_count %} + {% admin_actions %} + {% endif %} + <!-- SUBMIT ROW --> + {% if cl.formset and cl.full_result_count and cl.result_count %} + <div id="submit" class="module footer"> + <ul class="submit-row"> + <li class="left delete-link-container"><a href="javascript://" class="cancel-link">Cancel</a></li> + <li class="submit-button-container"><input type="submit" class="default" name="_save" value="Save"/></li> + </ul> + </div> + {% endif %} + </form> +{% endblock %} diff --git a/app/lib/grappelli/templates/admin/change_list_results.html b/app/lib/grappelli/templates/admin/change_list_results.html new file mode 100644 index 0000000..062b52e --- /dev/null +++ b/app/lib/grappelli/templates/admin/change_list_results.html @@ -0,0 +1,29 @@ +{% if results %} + + {% if result_hidden_fields %} + <div class="hiddenfields"> {# DIV for HTML validation #} + {% for item in result_hidden_fields %}{{ item }}{% endfor %} + </div> + {% endif %} + + <div class="module changelist-results"> + <table cellspacing="0"> + <thead> + <tr> + {% for header in result_headers %} + <th class="{{ header.class_attrib|cut:'class='|cut:'"' }}{% if header.sortable %} sortable{% endif %}"> + {% if header.sortable %}<a href="{{ header.url }}">{% endif %} + {{ header.text|capfirst }} + {% if header.sortable %}</a>{% endif %} + </th> + {% endfor %} + </tr> + </thead> + <tbody> + {% for result in results %} + <tr class="{% cycle 'row1' 'row2' %}">{% for item in result %}{{ item }}{% endfor %}</tr> + {% endfor %} + </tbody> + </table> + </div> +{% endif %} diff --git a/app/lib/grappelli/templates/admin/csv_export_selected_confirmation.html b/app/lib/grappelli/templates/admin/csv_export_selected_confirmation.html new file mode 100644 index 0000000..873bd87 --- /dev/null +++ b/app/lib/grappelli/templates/admin/csv_export_selected_confirmation.html @@ -0,0 +1,60 @@ +{% extends "admin/base_site.html" %} + +<!-- LOADING --> +{% load i18n %} + +<!-- BREADCRUMBS --> +{% block breadcrumbs %} + <div id="breadcrumbs"> + <a href="../../">{% trans "Home" %}</a> › + <a href="../">{{ app_label|capfirst }}</a> › + <a href="./">{{ opts.verbose_name_plural|capfirst }}</a> › + {% trans 'Export selection as CSV' %} + </div> +{% endblock %} + +<!-- CONTENT --> +{% block content %} + <script type="text/javascript" charset="utf-8"> + (function($) { + $(document).ready(function() { + $("input").attr("autocomplete", "off"); + $('#select_all').click(function(){ + $("._fields").attr('checked', $(this).attr('checked')); + }); + }); + })(django.jQuery); + </script> + <div class="container-grid csv-export-confirmation"> + <form action="" method="post">{% csrf_token %} + <fieldset class="module"> + <h2>{% blocktrans %}Export following fields:{% endblocktrans %}</h2> + <div class="row"> + <ul class="checkboxlist"> + <li><label for="select_all"><input type="checkbox" name="select_all" value="" id="select_all" /> {% blocktrans %}Select all{% endblocktrans %}</label></li> + </ul> + </div> + <div class="row"> + <ul class="checkboxlist"> + {% for item in fields %} + <li> + <label for="id_{{ item.0 }}"><input type="checkbox" class="_fields" name="_fields" value="{{ item.0 }}" id="id_{{ item.0 }}"{% if item.0 in list_display %} checked="checked" {% endif %} /> {{ item.1 }}</label> + </li> + {% endfor %} + </ul> + </div> + </fieldset> + <div class="module footer"> + {% for obj in queryset %} + <input type="hidden" name="{{ action_checkbox_name }}" value="{{ obj.pk }}" /> + {% endfor %} + <input type="hidden" name="action" value="csv_export_selected" /> + <input type="hidden" name="post" value="yes" /> + <ul class="submit-row" {% if is_popup %}style="overflow: auto;"{% endif %}> + <li class="left cancel-button-container"><a href="../" class="cancel-link">{% trans "Back" %}</a></li> + <li class="submit-button-container"><input type="submit" value="{% trans "Export" %}" class="default" /></li> + </ul> + </div> + </form> + </div> +{% endblock %}
\ No newline at end of file diff --git a/app/lib/grappelli/templates/admin/date_hierarchy.html b/app/lib/grappelli/templates/admin/date_hierarchy.html new file mode 100644 index 0000000..25e3c6b --- /dev/null +++ b/app/lib/grappelli/templates/admin/date_hierarchy.html @@ -0,0 +1,13 @@ +{% load i18n %} +{% if show and choices %} + <div id="date-hierarchy" class="module date-hierarchy"> + <div class="row"> + <ul> + {% if back %}<li><a href="{{ back.link }}" class="date-hierarchy-back">{{ back.title }}</a></li>{% endif %} + {% for choice in choices %} + <li>{% if choice.link %}<a href="{{ choice.link }}">{{ choice.title }}</a>{% else %}<span>{{ choice.title }}</span>{% endif %}</li> + {% endfor %} + </ul><br clear="all" /> + </div> + </div> +{% endif %} diff --git a/app/lib/grappelli/templates/admin/delete_confirmation.html b/app/lib/grappelli/templates/admin/delete_confirmation.html new file mode 100644 index 0000000..f0cf7ad --- /dev/null +++ b/app/lib/grappelli/templates/admin/delete_confirmation.html @@ -0,0 +1,48 @@ +{% extends "admin/base_site.html" %} + +<!-- LOADING --> +{% load i18n %} + +<!-- BREADCRUMBS --> +{% block breadcrumbs %} + <div id="breadcrumbs"> + <a href="../../../../">{% trans "Home" %}</a> › + <a href="../../../">{{ app_label|capfirst }}</a> › + <a href="../../">{{ opts.verbose_name_plural|capfirst }}</a> › + <a href="../">{{ object|truncatewords:"18" }}</a> › + {% trans 'Delete' %} + </div> +{% endblock %} + +<!-- CONTENT --> +{% block content %} + <div class="container-grid delete-confirmation"> + {% if perms_lacking %} + <div class="module"> + <h2>{% blocktrans with object as escaped_object %}Deleting the {{ object_name }} '{{ escaped_object }}' would result in deleting related objects, but your account doesn't have permission to delete the following types of objects:{% endblocktrans %}</h2> + <div class="row"> + <ul class="rte"> + {% for obj in perms_lacking %} + <li>{{ obj }}</li> + {% endfor %} + </ul> + </div> + </div> + {% else %} + <div class="module"> + <h2>{% blocktrans with object as escaped_object %}Are you sure you want to delete the {{ object_name }} "{{ escaped_object }}"? All of the following related items will be deleted:{% endblocktrans %}</h2> + <div class="row"> + <ul class="rte">{{ deleted_objects|unordered_list }}</ul> + </div> + </div> + <form action="" method="post">{% csrf_token %} + <div class="module footer"> + <ul class="submit-row" {% if is_popup %}style="overflow: auto;"{% endif %}> + <li class="left cancel-button-container"><a href="../" class="cancel-link">{% trans "Cancel" %}</a></li> + <li class="submit-button-container"><input type="submit" value="{% trans "Yes, I'm sure" %}" class="default" /></li> + </ul><input type="hidden" name="post" value="yes" /> + </div> + </form> + {% endif %} + </div> +{% endblock %} diff --git a/app/lib/grappelli/templates/admin/delete_selected_confirmation.html b/app/lib/grappelli/templates/admin/delete_selected_confirmation.html new file mode 100644 index 0000000..4e34d9f --- /dev/null +++ b/app/lib/grappelli/templates/admin/delete_selected_confirmation.html @@ -0,0 +1,54 @@ +{% extends "admin/base_site.html" %} + +<!-- LOADING --> +{% load i18n %} + +<!-- BREADCRUMBS --> +{% block breadcrumbs %} + <div id="breadcrumbs"> + <a href="../../">{% trans "Home" %}</a> › + <a href="../">{{ app_label|capfirst }}</a> › + <a href="./">{{ opts.verbose_name_plural|capfirst }}</a> › + {% trans 'Delete multiple objects' %} + </div> +{% endblock %} + +<!-- CONTENT --> +{% block content %} + <div class="container-grid delete-confirmation"> + {% if perms_lacking %} + <div class="module"> + <h2>{% blocktrans %}Deleting the {{ object_name }} would result in deleting related objects, but your account doesn't have permission to delete the following types of objects:{% endblocktrans %}</h2> + <div class="row"> + <ul class="rte"> + {% for obj in perms_lacking %} + <li>{{ obj }}</li> + {% endfor %} + </ul> + </div> + </div> + {% else %} + <div class="module"> + <h2>{% blocktrans %}Are you sure you want to delete the selected {{ object_name }} objects? All of the following objects and their related items will be deleted:{% endblocktrans %}</h2> + {% for deleteable_object in deletable_objects %} + <div class="row"> + <ul class="rte">{{ deleteable_object|unordered_list }}</ul> + </div> + {% endfor %} + </div> + <form action="" method="post">{% csrf_token %} + <div class="module footer"> + {% for obj in queryset %} + <input type="hidden" name="{{ action_checkbox_name }}" value="{{ obj.pk }}" /> + {% endfor %} + <input type="hidden" name="action" value="delete_selected" /> + <input type="hidden" name="post" value="yes" /> + <ul class="submit-row" {% if is_popup %}style="overflow: auto;"{% endif %}> + <li class="left cancel-button-container"><a href="." class="cancel-link">{% trans "Cancel" %}</a></li> + <li class="submit-button-container"><input type="submit" value="{% trans "Yes, I'm sure" %}" class="default" /></li> + </ul><input type="hidden" name="post" value="yes" /> + </div> + </form> + {% endif %} + </div> +{% endblock %}
\ No newline at end of file diff --git a/app/lib/grappelli/templates/admin/edit_inline/stacked.html b/app/lib/grappelli/templates/admin/edit_inline/stacked.html new file mode 100644 index 0000000..7112ba2 --- /dev/null +++ b/app/lib/grappelli/templates/admin/edit_inline/stacked.html @@ -0,0 +1,147 @@ +{% load i18n adminmedia %} + +<!-- group --> +<div class="group stacked {% if inline_admin_formset.opts.classes %} {{ inline_admin_formset.opts.classes|join:" " }}{% endif %}" + id="{{ inline_admin_formset.formset.prefix }}-group"> + <h2>{{ inline_admin_formset.opts.verbose_name_plural|title }}</h2> + <ul class="tools"> + <li class="open-handler-container"><a href="javascript://" class="icon open-handler" title="{% trans 'Open All Items' %}"></a></li> + <li class="close-handler-container"><a href="javascript://" class="icon close-handler" title="{% trans 'Close All Items' %}"></a></li> + <li class="add-handler-container"><a href="javascript://" class="icon add-handler" title="{% trans 'Add Item' %}"> </a></li> + </ul> + {{ inline_admin_formset.formset.management_form }} + {{ inline_admin_formset.formset.non_form_errors }} + <!-- container --> + <div class="items"> + {% for inline_admin_form in inline_admin_formset %} + <!-- element --> + <div class="module collapse closed{% if inline_admin_form.original or inline_admin_form.show_url %} has_original{% endif %}{% if forloop.last %} empty-form{% endif %}" + id="{{ inline_admin_formset.formset.prefix }}{% if forloop.last %}-empty{% else %}{{ forloop.counter0 }}{% endif %}"> + <h3>{{ inline_admin_formset.opts.verbose_name|title }} #{{ forloop.counter }} {% if inline_admin_form.original %}{{ inline_admin_form.original }}{% endif %}</h3> + <ul class="tools"> + {% if inline_admin_form.show_url %}<li class="viewsite-link-container"><a href="../../../r/{{ inline_admin_form.original.content_type_id }}/{{ inline_admin_form.original.id }}/" class="icon viewsite-link" title="{% trans 'View on Site' %}" target="_blank"></a></li>{% endif %} + {% if inline_admin_formset.opts.sortable_field_name %} + <li class="drag-handler-container"><a href="javascript://" class="icon drag-handler" title="{% trans 'Move Item' %}"></a></li> + {% endif %} + {% if inline_admin_formset.formset.can_delete %} + {% if inline_admin_form.original %} + <li class="delete-handler-container">{{ inline_admin_form.deletion_field.field }}<a href="javascript://" class="icon delete-handler" title="{% trans 'Delete Item' %}"></a></li> + {% else %} + <li class="remove-handler-container">{{ inline_admin_form.deletion_field.field }}<a href="javascript://" class="icon remove-handler" title="{% trans 'Delete Item' %}"></a></li> + {% endif %} + {% endif %} + </ul> + {% if inline_admin_form.form.non_field_errors %} + <ul class="errorlist"> + <li>{{ inline_admin_form.form.non_field_errors }}</li> + </ul> + {% endif %} + {% for fieldset in inline_admin_form %} + {% include "admin/includes/fieldset_inline.html" %} + {% endfor %} + {{ inline_admin_form.pk_field.field }} + {{ inline_admin_form.fk_field.field }} + </div> + {% endfor %} + {{ inline_admin_formset.extra_forms }} + </div> + <div class="module add-item"> + <a href="javascript://" class="add-handler">{% blocktrans with inline_admin_formset.opts.verbose_name|title as verbose_name %}Add another {{ verbose_name }}{% endblocktrans %}</a> + <ul class="tools"> + <li class="add-handler-container"><a href="javascript://" class="icon add-handler" title="{% trans 'Add Item' %}"> </a></li> + </ul><br clear="all" /> + </div> +</div> + +<script type="text/javascript"> +(function($) { + $(document).ready(function() { + + // call for inline() widget + $("#{{ inline_admin_formset.formset.prefix }}-group").inline({ + prefix: "{{ inline_admin_formset.formset.prefix }}", + deleteCssClass: "delete-handler", + emptyCssClass: "empty-form", + onRemoved: stacked_onRemoved, + onAdded: stacked_onAdded, + }); + +{% if inline_admin_formset.opts.sortable_field_name %} + /** + * sortable inlines + * uses onAdded() and onRemoved() of inline() call above + */ + + $("#{{ inline_admin_formset.formset.prefix }}-group").find("div.row.{{ inline_admin_formset.opts.sortable_field_name }}").hide(); + + {% if errors %} + // sort inline + var container = $("#{{ inline_admin_formset.formset.prefix }}-group > div.items"), + dynamic_forms = container.find("div.dynamic-form"), + updated = false, + curr_form, + real_pos; + + // loop thru all inline forms + for (var i = 0; i < dynamic_forms.length; i++) { + curr_form = $(dynamic_forms[i]); + // the real position according to the sort_field(_name) + real_pos = curr_form.find("div.{{ inline_admin_formset.opts.sortable_field_name }}").find("input").val(); + // if there is none it's an empty inline (=> we are at the end) + // TODO: klemens: maybe buggy. try continue? + if (!real_pos) continue; + + real_pos = parseInt(real_pos, 10); + + // check if real position is not equal to the CURRENT position in the dom + if (real_pos != container.find("div.dynamic-form").index(curr_form)) { + // move to correct postition + curr_form.insertBefore(container.find("div.dynamic-form")[real_pos]); + // to update the inline lables + updated = true; + } + } + if (updated) { + stacked_updateInlineLabel($(dynamic_forms[0])); + } + + {% endif %} + + // activate sortable feature for this inline + $("#{{ inline_admin_formset.formset.prefix }}-group > div.items").sortable({ + // drag&drop the inlines with the drag-handler only + handle: "a.drag-handler", + // very scary magic after drap&drop operations + // pretty similar to inline() widget's removeHandler() + // but removeHandler() can remove the current form and just reorder the rest + // if we would do the same after drag&drop we would loose some form values + // because while looping inputs would have the same names and maybe overwrite each other. + placeholder: 'ui-sortable-placeholder module', + forcePlaceholderSize: true, + items: "div.dynamic-form", + axis: "y", + containment: 'parent', + tolerance: 'pointer', + update: function(evt, ui) { + stacked_updateInlineLabel(ui.item); + } + }); + + // sets the new positions onSubmit (0 - n) + $("#{{ opts.module_name }}_form").bind("submit", function() { + var forms = $("#{{ inline_admin_formset.formset.prefix }}-group").find("div.dynamic-form"), + form, + idx = 0; + for (var i = 0; i < forms.length; i++) { + form = $(forms[i]); + if (is_form_filled(form)) { + form.find("div.{{ inline_admin_formset.opts.sortable_field_name }}").find("input").val(idx); + idx++; + } + } + }); + +{% endif %} + }); +})(django.jQuery); +</script> diff --git a/app/lib/grappelli/templates/admin/edit_inline/tabular.html b/app/lib/grappelli/templates/admin/edit_inline/tabular.html new file mode 100644 index 0000000..4d4ef94 --- /dev/null +++ b/app/lib/grappelli/templates/admin/edit_inline/tabular.html @@ -0,0 +1,211 @@ +{% load i18n adminmedia %} + +<!-- group --> +<div class="group tabular{% if inline_admin_formset.opts.classes %} {{ inline_admin_formset.opts.classes|join:" " }}{% endif %}" + id="{{ inline_admin_formset.formset.prefix }}-group" > + <h2>{{ inline_admin_formset.opts.verbose_name_plural|capfirst }}</h2> + <ul class="tools"> + <li class="add-handler-container"><a href="javascript://" class="icon add-handler" title="{% trans 'Add Another' %}"> </a></li> + </ul> + {{ inline_admin_formset.formset.management_form }} + {{ inline_admin_formset.formset.non_form_errors }} + <!-- container --> + <div class="module table"> + <div class="module thead"> + <div class="tr"> + {% for field in inline_admin_formset.fields %} + {% if not field.widget.is_hidden %} + <div class="th {{ field.label|lower }}{% if field.required %} required{% endif %}">{{ field.label|capfirst }}</div> + {% endif %} + {% endfor %} + {% if inline_admin_formset.formset.can_delete %}<div class="th"> </div>{% endif %} + </div> + </div> + {% for inline_admin_form in inline_admin_formset %} + <!-- element --> + <div class="module tbody{% if inline_admin_form.original or inline_admin_form.show_url %} has_original{% endif %}{% if forloop.last %} empty-form{% endif %}" + id="{{ inline_admin_formset.formset.prefix }}{% if not forloop.last %}{{ forloop.counter0 }}{% else %}-empty{% endif %}"> + {% if inline_admin_form.form.non_field_errors %} + <ul class="errorlist"><li>{{ inline_admin_form.form.non_field_errors }}</li></ul> + {% endif %} + <h3 style="display: none;"><b>{{ inline_admin_formset.opts.verbose_name|title }} #{{ forloop.counter }}</b> {% if inline_admin_form.original %} {{ inline_admin_form.original }}{% endif %}</h3> + {% spaceless %} + {% for fieldset in inline_admin_form %} + {% for line in fieldset %} + {% for field in line %} + {% if field.is_hidden %} {{ field.field }} {% endif %} + {% endfor %} + {% endfor %} + {% endfor %} + {% endspaceless %} + <div class="tr"> + {% for fieldset in inline_admin_form %} + {% for line in fieldset %} + {% for field in line %} + <div class="td {{ field.field.name }} {% if field.field.errors %} error{% endif %}"> + {% if field.is_readonly %} + <p>{{ field.contents }}</p> + {% else %} + {{ field.field }} + {{ field.field.errors.as_ul }} + {% endif %} + </div> + {% endfor %} + {% endfor %} + {% endfor %} + <div class="td tools"> + {% spaceless %} + <ul class="tools"> + {% if inline_admin_form.show_url %}<li class="viewsite-link-container"><a href="../../../r/{{ inline_admin_form.original_content_type_id }}/{{ inline_admin_form.original.id }}/" class="icon viewsite-link" title="{% trans 'View on Site' %}"> </a></li>{% endif %} + {% if inline_admin_formset.opts.sortable_field_name %} + <li class="drag-handler-container"><a href="javascript://" class="icon drag-handler" title="{% trans 'Move Item' %}"></a></li> + {% endif %} + {% if inline_admin_formset.formset.can_delete %}<li class="delete-handler-container">{{ inline_admin_form.deletion_field.field }}<a href="javascript://" class="icon {% if inline_admin_form.original %}delete-handler{% else %}remove-handler{% endif %}" title="{% trans 'Remove' %}"> </a>{% endif %} + </ul> + {% endspaceless %} + </div> + {{ inline_admin_form.fk_field.field }} + {% if inline_admin_form.has_auto_field %}{{ inline_admin_form.pk_field.field }}{% endif %} + </div> + </div> + {% endfor %} + </div> + <div class="module add-item"> + <a href="javascript://" class="add-handler">{% blocktrans with inline_admin_formset.opts.verbose_name|title as verbose_name %}Add another {{ verbose_name }}{% endblocktrans %}</a> + <ul class="tools"> + <li class="add-handler-container"><a href="javascript://" class="icon add-handler" title="{% trans 'Add Item' %}"> </a></li> + </ul><br clear="all" /> + </div> +</div> + +<script type="text/javascript"> +(function($) { + $(document).ready(function($) { + + $("#{{ inline_admin_formset.formset.prefix }}-group").inline({ + prefix: "{{ inline_admin_formset.formset.prefix }}", + deleteCssClass: "delete-handler", + emptyCssClass: "empty-form", + onAdded: tabular_onAdded + }); + +{% if inline_admin_formset.opts.sortable_field_name %} + /** + * sortable inlines + * uses onAdded() and onRemoved() of inline() call above + * uses sortable_updateFormIndex() and is_form_filled() from change_from.html + */ + + // hide sortable_field(_name) from form + // hide div.td.{{ field.name }} + var position_nodes = $("#{{ inline_admin_formset.formset.prefix }}-group").find("div.td.{{ inline_admin_formset.opts.sortable_field_name }}"); + position_nodes.hide(); + + // hide its header (div.th) too (hard) + // "div.th.{{ inline_admin_formset.opts.sortable_field_name }}" is not correct because + // its div.th.<field.label> (and not name, see line#18). + + // so let's get the "position/idx" the first position div + var tabular_row = position_nodes.first().parent().children("div.td"); + // get the "position" (== i) in the "table" + for (var i = 0; i < tabular_row.length; i++) { + if ($(tabular_row[i]).hasClass("{{ inline_admin_formset.opts.sortable_field_name }}")) break; + } + // we have the same order in the header of the "table" + // so delete the div at the "position" (== i) + var position_header = $("#{{ inline_admin_formset.formset.prefix }}-group").find("div.th")[i]; + // and hide + $(position_header).hide() + + {% if errors %} + // sort inline + var container = $("#{{ inline_admin_formset.formset.prefix }}-group > div.table"), + dynamic_forms = container.find("div.dynamic-form"), + updated = false, + curr_form, + real_pos; + + // loop thru all inline forms + for (var i = 0; i < dynamic_forms.length; i++) { + curr_form = $(dynamic_forms[i]); + // the real position according to the sort_field(_name) + real_pos = curr_form.find("div.{{ inline_admin_formset.opts.sortable_field_name }}").find("input").val(); + // if there is none it's an empty inline (=> we are at the end) + // TODO: klemens: maybe buggy. try continue? + if (!real_pos) continue; + + real_pos = parseInt(real_pos, 10); + + // check if real position is not equal to the CURRENT position in the dom + if (real_pos != container.find("div.dynamic-form").index(curr_form)) { + // move to correct postition + curr_form.insertBefore(container.find("div.dynamic-form")[real_pos]); + // to update the inline lables + updated = true; + } + } + + {% endif %} + + $("#{{ inline_admin_formset.formset.prefix }}-group > div.table").sortable({ + // drag&drop the inlines with the drag-handler only + handle: "a.drag-handler", + // very scary magic after drap&drop operations + // pretty similar to inline() widget's removeHandler() + // but removeHandler() can remove the current form and just reorder the rest + // if we would do the same after drag&drop we would loose some form values + // because while looping inputs would have the same names and maybe overwrite each other. + placeholder: 'ui-sortable-placeholder', + forcePlaceholderSize: true, + items: "div.dynamic-form", + axis: "y", + start: function(evt, ui) { + ui.item.hide() + ui.placeholder.height(ui.placeholder.height()-4); + //sadly we have to do this every time we start dragging + var template = "<div class='tr'>", + // minus 1 because we don't need the "sortable_field_name row" + len = ui.item.find("div.tr").children("div.td").length - 1; + + for (var i = 0; i < len; i++) { + template += "<div class='td'></div>" + } + + template += "</div>" + ui.placeholder.addClass("tbody module").append(template); + }, + update: function(evt, ui) { + ui.item.show(); + }, + appendTo: 'body', + forceHelperSize: true, + containment: '#{{ inline_admin_formset.formset.prefix }}-group > div.table', + tolerance: 'pointer', + helper: function(evt, elem) { + var helper = $("<div class='module table' />"); + helper.html(elem.clone()); + return helper; + }, + }); + + // sets the new positions onSubmit (0 - n) + $("#{{ opts.module_name }}_form").bind("submit", function(){ + var forms = $("#{{ inline_admin_formset.formset.prefix }}-group").find("div.dynamic-form"), + form, + idx = 0; + for (var i = 0; i < forms.length; i++) { + form = $(forms[i]); + + if (is_form_filled(form)) { + form.find("div.{{ inline_admin_formset.opts.sortable_field_name }}").find("input").val(idx); + idx++; + } + } + }); + +{% endif %} + + }); +})(django.jQuery); +</script> + diff --git a/app/lib/grappelli/templates/admin/filter.html b/app/lib/grappelli/templates/admin/filter.html new file mode 100644 index 0000000..07756b6 --- /dev/null +++ b/app/lib/grappelli/templates/admin/filter.html @@ -0,0 +1,7 @@ +{% load i18n %} +<div class="filter"> + <label>{% blocktrans with title as filter_title %}{{ filter_title }}{% endblocktrans %}</label> + <select class="filter_choice"> + {% for choice in choices %}<option value="{{ choice.query_string|iriencode }}"{% if choice.selected %} selected='selected'{% endif %}>{{ choice.display|safe }}</option>{% endfor %} + </select> +</div>
\ No newline at end of file diff --git a/app/lib/grappelli/templates/admin/includes/fieldset.html b/app/lib/grappelli/templates/admin/includes/fieldset.html new file mode 100644 index 0000000..561a7e3 --- /dev/null +++ b/app/lib/grappelli/templates/admin/includes/fieldset.html @@ -0,0 +1,37 @@ +{% spaceless %} + <fieldset class="module {{ fieldset.classes }}"> + {% if fieldset.name %}<h2>{{ fieldset.name }}</h2>{% endif %} + {% if fieldset.description %}<div class="description">{{ fieldset.description|safe }}</div>{% endif %} + {% for line in fieldset %} + <div class="row cells-{{ line.fields|length }}{% if not line.fields|length_is:"1" %} cells{% endif %}{% if line.errors %} errors{% endif %} {% for field in line %}{{ field.field.name }} {% endfor %} "> + {% for field in line %} + <div{% if not line.fields|length_is:"1" %} class="cell"{% endif %}> + {% if field.is_checkbox %} + <div class="column span-4"> </div> + <div class="column span-flexible"> + {{ field.field }}{{ field.label_tag }} + {{ line.errors }} + {% if field.field.field.help_text %} + <p class="help">{{ field.field.field.help_text|safe }}</p> + {% endif %} + </div> + {% else %} + <div class="column span-4">{{ field.label_tag }}</div> + <div class="column span-flexible"> + {% if field.is_readonly %} + <p class="readonly">{{ field.contents }}</p> + {% else %} + {{ field.field }} + {% endif %} + {{ line.errors }} + {% if field.field.field.help_text %} + <p class="help">{{ field.field.field.help_text|safe }}</p> + {% endif %} + </div> + {% endif %} + </div> + {% endfor %} + </div> + {% endfor %} + </fieldset> +{% endspaceless %}
\ No newline at end of file diff --git a/app/lib/grappelli/templates/admin/includes/fieldset_inline.html b/app/lib/grappelli/templates/admin/includes/fieldset_inline.html new file mode 100644 index 0000000..137dce9 --- /dev/null +++ b/app/lib/grappelli/templates/admin/includes/fieldset_inline.html @@ -0,0 +1,37 @@ +{% spaceless %} +<fieldset class="module {{ fieldset.classes }}"> + {% if fieldset.name %}<h4>{{ fieldset.name }}</h4>{% endif %} + {% if fieldset.description %}<div class="description">{{ fieldset.description|safe }}</div>{% endif %} + {% for line in fieldset %} + <div class="row cells-{{ line.fields|length }}{% if not line.fields|length_is:"1" %} cells{% endif %}{% if line.errors %} errors{% endif %} {% for field in line %}{{ field.field.name }} {% endfor %} "> + {% for field in line %} + <div{% if not line.fields|length_is:"1" %} class="cell"{% endif %}> + {% if field.is_checkbox %} + <div class="column span-4"> </div> + <div class="column span-flexible"> + {{ field.field }}{{ field.label_tag }} + {{ line.errors }} + {% if field.field.field.help_text %} + <p class="help">{{ field.field.field.help_text|safe }}</p> + {% endif %} + </div> + {% else %} + <div class="column span-4">{{ field.label_tag }}</div> + <div class="column span-flexible"> + {% if field.is_readonly %} + <p class="readonly">{{ field.contents }}</p> + {% else %} + {{ field.field }} + {% endif %} + {{ line.errors }} + {% if field.field.field.help_text %} + <p class="help">{{ field.field.field.help_text|safe }}</p> + {% endif %} + </div> + {% endif %} + </div> + {% endfor %} + </div> + {% endfor %} +</fieldset> +{% endspaceless %}
\ No newline at end of file diff --git a/app/lib/grappelli/templates/admin/includes_grappelli/header.html b/app/lib/grappelli/templates/admin/includes_grappelli/header.html new file mode 100644 index 0000000..77a0ad9 --- /dev/null +++ b/app/lib/grappelli/templates/admin/includes_grappelli/header.html @@ -0,0 +1,46 @@ +{% load i18n grp_tags %} + +<div id="header"> + <div class="branding"> </div> + <!-- Title --> + <div class="admin-title">{% if grappelli_admin_title %}{{ grappelli_admin_title }}{% else %}{% get_admin_title %}{% endif %}</div> + {% if user.is_authenticated and user.is_staff %} + <ul id="user-tools"> + <!-- Username --> + <li class="user-options-container collapse closed"> + <a href="javascript://" class="user-options-handler collapse-handler">{% firstof user.first_name user.username %}</a> + <ul class="user-options"> + <!-- Change Password --> + {% url admin:password_change as password_change_url %} + {% if password_change_url %} + <li><a href="{{ password_change_url }}"> + {% else %} + <li><a href="{{ root_path }}password_change/"> + {% endif %} + {% trans 'Change password' %}</a></li> + <!-- Logout --> + {% url admin:logout as logout_url %} + {% if logout_url %} + <li><a href="{{ logout_url }}"> + {% else %} + <li><a href="{{ root_path }}logout/"> + {% endif %} + {% trans 'Log out' %}</a></li> + </ul> + </li> + <!-- Userlinks --> + {% block userlinks %} + <!-- JS tests --> + {% url test-index as testindexurl %} + {% if testindexurl %} + <li><a href="{{ testindexurl }}">{% trans 'Tests' %}</a></li> + {% endif %} + <!-- Documentation --> + {% url django-admindocs-docroot as docsroot %} + {% if docsroot %} + <li><a href="{{ docsroot }}">{% trans 'Documentation' %}</a></li> + {% endif %} + {% endblock %} + </ul> + {% endif %} +</div> diff --git a/app/lib/grappelli/templates/admin/index.html b/app/lib/grappelli/templates/admin/index.html new file mode 100644 index 0000000..fbec3bc --- /dev/null +++ b/app/lib/grappelli/templates/admin/index.html @@ -0,0 +1 @@ +{% extends admin_template_index %}
\ No newline at end of file diff --git a/app/lib/grappelli/templates/admin/init.js b/app/lib/grappelli/templates/admin/init.js new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/app/lib/grappelli/templates/admin/init.js diff --git a/app/lib/grappelli/templates/admin/invalid_setup.html b/app/lib/grappelli/templates/admin/invalid_setup.html new file mode 100644 index 0000000..f3e097e --- /dev/null +++ b/app/lib/grappelli/templates/admin/invalid_setup.html @@ -0,0 +1,12 @@ +{% extends "admin/base_site.html" %} + +<!-- LOADING --> +{% load i18n %} + +<!-- BREADCRUMBS --> +{% block breadcrumbs %}<div id="breadcrumbs"><a href="../../">{% trans 'Home' %}</a> › {{ title }}</div>{% endblock %} + +<!-- CONTENT --> +{% block content %} + <p>{% trans "Something's wrong with your database installation. Make sure the appropriate database tables have been created, and make sure the database is readable by the appropriate user." %}</p> +{% endblock %} diff --git a/app/lib/grappelli/templates/admin/login.html b/app/lib/grappelli/templates/admin/login.html new file mode 100644 index 0000000..6f12b71 --- /dev/null +++ b/app/lib/grappelli/templates/admin/login.html @@ -0,0 +1,47 @@ +{% extends "admin/base_site.html" %} + +<!-- LOADING --> +{% load i18n %} {# grp_csrf #} + +<!-- BODYCLASS --> +{% block bodyclass %}login{% endblock %} +{% block content-class %}content-flexible{% endblock %} +{% block content_title %}{% endblock %} + +<!-- EXTRAHEAD--> +{% block extrahead %} + <script type="text/javascript"> + (function($) { + $(window).load(function(){ $('#id_username').focus(); }); + })(django.jQuery); + </script> +{% endblock %} + +<!-- BREADCRUMBS --> +{% block breadcrumbs %}{% endblock %} + +<!-- CONTENT --> +{% block content %} + <div class="container-flexible login"> + <div class="column span-10 centered"> + {% if error_message %}<p class="errornote login-errors">{{ error_message }}</p>{% endif %} + <form action="{{ app_path }}" method="post" id="login-form">{% csrf_token %} + <fieldset class="module"> + <div class="row"> + <div class="column span-4"><label for="id_username" class="required">{% trans 'Username:' %}</label></div> + <div class="column span-6 last"><input type="text" name="username" id="id_username" /></div> + </div> + <div class="row"> + <div class="column span-4"><label for="id_password" class="required">{% trans 'Password:' %}</label></div> + <div class="column span-6 last"><input type="password" name="password" id="id_password" /><input type="hidden" name="this_is_the_login_form" value="1" /></div> + </div> + </fieldset> + <div class="module submit-row"> + <ul class="submit-row"> + <li class="submit-button-container"><input type="submit" class="default" value="{% trans 'Log in' %}" /></li> + </ul> + </div> + </form> + </div> + </div> +{% endblock %} diff --git a/app/lib/grappelli/templates/admin/object_history.html b/app/lib/grappelli/templates/admin/object_history.html new file mode 100644 index 0000000..1058fc9 --- /dev/null +++ b/app/lib/grappelli/templates/admin/object_history.html @@ -0,0 +1,51 @@ +{% extends "admin/base_site.html" %} + +<!-- LOADING --> +{% load i18n %} + +<!-- BREADCRUMBS --> +{% block breadcrumbs %} + <div id="breadcrumbs"> + <a href="../../../../">{% trans 'Home' %}</a> › + <a href="../../../">{{ app_label|capfirst }}</a> › + <a href="../../">{{ module_name }}</a> › + <a href="../">{{ object|truncatewords:"18" }}</a> › + {% trans 'History' %} + </div> +{% endblock %} + +<!-- CONTENT --> +{% block content %} + <div class="container-grid object-history"> + <div class="module"> + {% if action_list %} + <table id="change-history"> + <thead> + <tr> + <th scope="col">{% trans 'Date/time' %}</th> + <th scope="col">{% trans 'User' %}</th> + <th scope="col">{% trans 'Action' %}</th> + </tr> + </thead> + <tbody> + {% for action in action_list %} + <tr> + <th scope="row">{{ action.action_time|date:_("DATETIME_FORMAT") }}</th> + <td>{{ action.user.username }}{% if action.user.get_full_name %} ({{ action.user.get_full_name }}){% endif %}</td> + <td> + {% ifequal forloop.counter 1 %} + {% trans "Created object" %} + {% else %} + {{ action.change_message }} + {% endifequal %} + </td> + </tr> + {% endfor %} + </tbody> + </table> + {% else %} + <p>{% trans "This object doesn't have a change history. It probably wasn't added via this admin site." %}</p> + {% endif %} + </div> + </div> +{% endblock %} diff --git a/app/lib/grappelli/templates/admin/pagination.html b/app/lib/grappelli/templates/admin/pagination.html new file mode 100644 index 0000000..ecd0859 --- /dev/null +++ b/app/lib/grappelli/templates/admin/pagination.html @@ -0,0 +1,30 @@ +{% load admin_list i18n %} + +{% spaceless %} + <div class="module pagination"> + <ul class="pagination"> + {% if cl.result_count != cl.full_result_count %} + <li class="results"><span> + {% blocktrans count cl.result_count as counter %}1 result{% plural %}{{ counter }} results{% endblocktrans %} + </span></li> + {% endif %} + <li class="results"> + {% if cl.result_count != cl.full_result_count or cl.show_all %} + <a href="?{% if cl.is_popup %}pop=1{% endif %}" class="total">{% blocktrans with cl.full_result_count as full_result_count %}{{ full_result_count }} total{% endblocktrans %}</a> + {% else %} + <span>{% blocktrans with cl.full_result_count as full_result_count %}{{ full_result_count }} total{% endblocktrans %}</span> + {% endif %} + </li> + {% if pagination_required %} + {% for i in page_range %} + {% ifequal i "." %} + <li class="separator"><span>...</span></li> + {% else %} + <li>{% paginator_number cl i %}</li> + {% endifequal %} + {% endfor %} + {% endif %} + {% if show_all_url %}<li class="showall"><a href="{{ show_all_url }}">{% trans 'Show all' %}</a></li>{% endif %} + </ul><br clear="all" /> + </div> +{% endspaceless %}
\ No newline at end of file diff --git a/app/lib/grappelli/templates/admin/prepopulated_fields_js.html b/app/lib/grappelli/templates/admin/prepopulated_fields_js.html new file mode 100644 index 0000000..7ab79e9 --- /dev/null +++ b/app/lib/grappelli/templates/admin/prepopulated_fields_js.html @@ -0,0 +1,17 @@ +<script type="text/javascript"> + (function( $ ) { + {% for field in prepopulated_fields %} + $("#{{ field.field.auto_id }}").bind('change.grappelli', function() { + $(this).data('changed', true); + }); + {% for dependency in field.dependencies %} + $("#{{ dependency.auto_id }}").bind('keyup.grappelli', function() { + var e = $("#{{ field.field.auto_id }}"); + if (!e.data('changed')) { + e.val(URLify({% for innerdep in field.dependencies %}$("#{{ innerdep.auto_id }}").val(){% if not forloop.last %} + ' ' + {% endif %}{% endfor %}, {{ field.field.field.max_length|default_if_none:"50" }})); + } + }); + {% endfor %} + {% endfor %} + })(django.jQuery); +</script> diff --git a/app/lib/grappelli/templates/admin/search_form.html b/app/lib/grappelli/templates/admin/search_form.html new file mode 100644 index 0000000..48c4184 --- /dev/null +++ b/app/lib/grappelli/templates/admin/search_form.html @@ -0,0 +1,20 @@ +{% load adminmedia i18n grp_tags %} +{% if cl.search_fields %} + {% comment %}{% get_search_fields_verbose cl.opts as search_fields_verbose %}{% endcomment %} + <!-- Search Form --> + <form id="changelist-search" action="" method="get"> + <input type="text" name="{{ search_var }}" id="searchbar" value="{{ cl.query }}" /> + <button type="submit" value="" class="search"> </button> + {% for pair in cl.params.items %} + {% ifnotequal pair.0 search_var %}<input type="hidden" name="{{ pair.0 }}" value="{{ pair.1 }}"/>{% endifnotequal %} + {% endfor %} + {% comment %} + {% if search_fields_verbose and not cl.query %} + <div id="searchbar_tooltip" class="tooltip search-fields" style="display: none;"> + <div class="tooltip-pointer"> </div> + <div class="tooltip-content"><strong>{% trans 'Search' %}:</strong> {{ search_fields_verbose }}</div> + </div> + {% endif %} + {% endcomment %} + </form> +{% endif %}
\ No newline at end of file diff --git a/app/lib/grappelli/templates/admin/submit_line.html b/app/lib/grappelli/templates/admin/submit_line.html new file mode 100644 index 0000000..4f06ac5 --- /dev/null +++ b/app/lib/grappelli/templates/admin/submit_line.html @@ -0,0 +1,12 @@ +{% load i18n %} +<div class="module footer"> + <ul class="submit-row"> + {% if show_delete_link %}<li class="left delete-link-container"><a href="delete/" class="delete-link">Delete</a></li>{% endif %} + {% comment %}<li class="left cancel-link-container"><a href="#" class="cancel-link">Cancel</a></li>{% endcomment %} + {% if show_save %}<li class="submit-button-container"><input type="submit" value="{% trans 'Save' %}" class="default" name="_save" {{ onclick_attrib }}/></li>{% endif %} + {% if show_save_as_new %}<li class="submit-button-container"><input type="submit" value="{% trans 'Save as new' %}" name="_saveasnew" {{ onclick_attrib }}/></li>{% endif %} + {% if show_save_and_add_another %}<li class="submit-button-container"><input type="submit" value="{% trans 'Save and add another' %}" name="_addanother" {{ onclick_attrib }} /></li>{% endif %} + {% if show_save_and_continue %}<li class="submit-button-container"><input type="submit" value="{% trans 'Save and continue editing' %}" name="_continue" {{ onclick_attrib }}/></li>{% endif %} + {% comment %}<li><input type="reset" value="Reset" /></li>{% endcomment %} + </ul><br clear="all" /> +</div> diff --git a/app/lib/grappelli/templates/admin/template_validator.html b/app/lib/grappelli/templates/admin/template_validator.html new file mode 100644 index 0000000..219c442 --- /dev/null +++ b/app/lib/grappelli/templates/admin/template_validator.html @@ -0,0 +1,34 @@ +{% extends "admin/base_site.html" %} + +{# load grp_csrf #} + +{% block content %} + <div id="content-main"> + <form action="" method="post">{% csrf_token %} + {% if form.error_dict %} + <p class="errornote">Your template had {{ form.error_dict.items|length }} error{{ form.error_dict.items|pluralize }}:</p> + {% endif %} + <fieldset class="module aligned"> + <div class="row{% if form.site.errors %} error{% endif %} required"> + <div class="column span-4"><h4><label for="id_site" class="required">Site:</label></h4></div> + <div class="column span-flexible"> + {{ form.site }} + {% if form.site.errors %}{{ form.site.html_error_list }}{% endif %} + </div> + </div> + <div class="row{% if form.template.errors %} error{% endif %} required"> + <div class="column span-4"><h4><label for="id_template" class="required">Template:</label></h4></div> + <div class="column span-flexible"> + {{ form.template }} + {% if form.template.errors %}{{ form.template.html_error_list }}{% endif %} + </div> + </div> + </fieldset> + <div class="submit-row"> + <ul class="submit-row"> + <li class="submit-button-container"><input type="submit" value="Check for errors" class="default" /></li> + </ul> + </div> + </form> + </div> +{% endblock %} diff --git a/app/lib/grappelli/templates/admin_doc/bookmarklets.html b/app/lib/grappelli/templates/admin_doc/bookmarklets.html new file mode 100644 index 0000000..7eba0be --- /dev/null +++ b/app/lib/grappelli/templates/admin_doc/bookmarklets.html @@ -0,0 +1,37 @@ +{% extends "admin/base_site.html" %} +{% load adminmedia %} +{% load i18n %} +{% block bodyclass %}documentation{% endblock %} +{% block content-class %}content-grid{% endblock %} +{% block breadcrumbs %}{% load i18n %}<div id="breadcrumbs"><a href="../../">{% trans "Home" %}</a> › <a href="../">{% trans "Documentation" %}</a> › {% trans "Bookmarklets" %}</div>{% endblock %} +{% block title %}{% trans "Documentation bookmarklets" %}{% endblock %} + +{% block content %} + <h1>{% trans "Bookmarklets" %}</h1> + <div class="container-grid rte"> + {% blocktrans %} + <p>To install bookmarklets, drag the link to your bookmarks + toolbar, or right-click the link and add it to your bookmarks. Now you can + select the bookmarklet from any page in the site. Note that some of these + bookmarklets require you to be viewing the site from a computer designated + as "internal" (talk to your system administrator if you aren't sure if + your computer is "internal").</p> + {% endblocktrans %} + <div class="module"> + <h2><a href="javascript:(function(){if(typeof ActiveXObject!='undefined'){x=new ActiveXObject('Microsoft.XMLHTTP')}else if(typeof XMLHttpRequest!='undefined'){x=new XMLHttpRequest()}else{return;}x.open('HEAD',location.href,false);x.send(null);try{view=x.getResponseHeader('x-view');}catch(e){alert('No view found for this page');return;}if(view=='undefined'){alert('No view found for this page');}document.location='{{ admin_url }}doc/views/'+view+'/';})()">{% trans "Documentation for this page" %}</a></h2> + <p>{% trans "Jumps you from any page to the documentation for the view that generates that page." %}</p> + </div> + <div class="module"> + <h2><a href="javascript:(function(){if(typeof ActiveXObject!='undefined'){x=new ActiveXObject('Microsoft.XMLHTTP')}else if(typeof XMLHttpRequest!='undefined'){x=new XMLHttpRequest()}else{return;}x.open('GET',location.href,false);x.send(null);try{type=x.getResponseHeader('x-object-type');id=x.getResponseHeader('x-object-id');}catch(e){type='(none)';id='(none)';}d=document;b=d.body;e=d.createElement('div');e.id='xxxhhh';s=e.style;s.position='absolute';s.left='10px';s.top='10px';s.font='10px monospace';s.border='1px black solid';s.padding='4px';s.backgroundColor='#eee';e.appendChild(d.createTextNode('Type: '+type));e.appendChild(d.createElement('br'));e.appendChild(d.createTextNode('ID: '+id));e.appendChild(d.createElement('br'));l=d.createElement('a');l.href='#';l.onclick=function(){b.removeChild(e);};l.appendChild(d.createTextNode('[close]'));l.style.textDecoration='none';e.appendChild(l);b.appendChild(e);})();">{% trans "Show object ID" %}</a></h2> + <p>{% trans "Shows the content-type and unique ID for pages that represent a single object." %}</p> + </div> + <div class="module"> + <h2><a href="javascript:(function(){if(typeof ActiveXObject!='undefined'){var x=new ActiveXObject('Microsoft.XMLHTTP')}else if(typeof XMLHttpRequest!='undefined'){var x=new XMLHttpRequest()}else{return;}x.open('GET',location.href,false);x.send(null);try{var type=x.getResponseHeader('x-object-type');var id=x.getResponseHeader('x-object-id');}catch(e){return;}document.location='{{ admin_url }}'+type.split('.').join('/')+'/'+id+'/';})()">{% trans "Edit this object (current window)" %}</a></h2> + <p>{% trans "Jumps to the admin page for pages that represent a single object." %}</p> + </div> + <div class="module"> + <h2><a href="javascript:(function(){if(typeof ActiveXObject!='undefined'){var x=new ActiveXObject('Microsoft.XMLHTTP')}else if(typeof XMLHttpRequest!='undefined'){var x=new XMLHttpRequest()}else{return;}x.open('GET',location.href,false);x.send(null);try{var type=x.getResponseHeader('x-object-type');var id=x.getResponseHeader('x-object-id');}catch(e){return;}window.open('{{ admin_url }}'+type.split('.').join('/')+'/'+id+'/');})()">{% trans "Edit this object (new window)" %}</a></h2> + <p>{% trans "As above, but opens the admin page in a new window." %}</p> + </div> + </div> +{% endblock %} diff --git a/app/lib/grappelli/templates/admin_doc/index.html b/app/lib/grappelli/templates/admin_doc/index.html new file mode 100644 index 0000000..0260106 --- /dev/null +++ b/app/lib/grappelli/templates/admin_doc/index.html @@ -0,0 +1,34 @@ +{% extends "admin/base_site.html" %} +{% load adminmedia %} +{% load i18n %} +{% block bodyclass %}documentation{% endblock %} +{% block content-class %}content-grid{% endblock %} +{% block breadcrumbs %}<div id="breadcrumbs"><a href="{{ root_path }}">Home</a> › Documentation</div>{% endblock %} +{% block title %}Documentation{% endblock %} + +{% block content %} + <h1>Documentation</h1> + <div class="container-grid rte"> + <div class="module"> + <h2><a href="tags/">Tags</a></h2> + <p>List of all the template tags and their functions.</p> + </div> + <div class="module"> + <h2><a href="filters/">Filters</a></h2> + <p>Filters are actions which can be applied to variables in a template to alter the output.</p> + </div> + <div class="module"> + <h2><a href="models/">Models</a></h2> + <p>Models are descriptions of all the objects in the system and their associated fields. Each model has a list of fields which can be accessed as template variables.</p> + </div> + <div class="module"> + <h2><a href="views/">Views</a></h2> + <p>Each page on the public site is generated by a view. The view defines which template is used to generate the page and which objects are available to that template.</p> + </div> + <div class="module"> + <h2><a href="bookmarklets/">Bookmarklets</a></h2> + <p>Tools for your browser to quickly access admin functionality.</p> + </div> + </div> +{% endblock %} + diff --git a/app/lib/grappelli/templates/admin_doc/missing_docutils.html b/app/lib/grappelli/templates/admin_doc/missing_docutils.html new file mode 100644 index 0000000..47488a2 --- /dev/null +++ b/app/lib/grappelli/templates/admin_doc/missing_docutils.html @@ -0,0 +1,14 @@ +{% extends "admin/base_site.html" %} +{% load adminmedia %} +{% load i18n %} +{% block bodyclass %}documentation{% endblock %} +{% block breadcrumbs %}<div id="breadcrumbs"><a href="../">Home</a> › Documentation</div>{% endblock %} +{% block title %}Please install docutils{% endblock %} + +{% block content %} + <h1>Documentation</h1> + <div id="content-main"> + <h3>The admin documentation system requires Python's <a href="http://docutils.sf.net/">docutils</a> library.</h3> + <p>Please ask your administrators to install <a href="http://docutils.sf.net/">docutils</a>.</p> + </div> +{% endblock %} diff --git a/app/lib/grappelli/templates/admin_doc/model_detail.html b/app/lib/grappelli/templates/admin_doc/model_detail.html new file mode 100644 index 0000000..85593f0 --- /dev/null +++ b/app/lib/grappelli/templates/admin_doc/model_detail.html @@ -0,0 +1,51 @@ +{% extends "admin/base_site.html" %} +{% load adminmedia %} +{% load i18n %} +{% block javascripts %} + {{ block.super }} + <script type="text/javascript"> + (function($) { + $(document).ready(function(){ + $('.rte .module').each(function(){ + var childWidth = $('.rte .module').children("table").outerWidth(); + $('.rte .module').css("width", childWidth); + }); + }); + })(django.jQuery); + </script> +{% endblock %} +{% block bodyclass %}documentation{% endblock %} +{% block content-class %}content-grid{% endblock %} +{% block breadcrumbs %}<div id="breadcrumbs"><a href="../../../">Home</a> › <a href="../../">Documentation</a> › <a href="../">Models</a> › {{ name }}</div>{% endblock %} + +{% block title %}Model: {{ name }}{% endblock %} + +{% block content %} + <h1>{{ summary }}</h1> + <div class="container-grid rte"> + {% if description %} + <p>{% filter linebreaksbr %}{% trans description %}{% endfilter %}</p> + {% endif %} + <div class="module model"> + <table class="model" style="width: auto"> + <thead> + <tr> + <th>Field</th> + <th>Type</th> + <th>Description</th> + </tr> + </thead> + <tbody> + {% for field in fields|dictsort:"name" %} + <tr> + <td class="nowrap focus">{{ field.name }}</td> + <td class="nowrap">{{ field.data_type }}</td> + <td>{{ field.verbose }}{% if field.help_text %} - {{ field.help_text|safe }}{% endif %}</td> + </tr> + {% endfor %} + </tbody> + </table> + </div> + <a href="../" class="back">‹ Back to Models Documentation</a> + </div> +{% endblock %} diff --git a/app/lib/grappelli/templates/admin_doc/model_index.html b/app/lib/grappelli/templates/admin_doc/model_index.html new file mode 100644 index 0000000..84a93f3 --- /dev/null +++ b/app/lib/grappelli/templates/admin_doc/model_index.html @@ -0,0 +1,45 @@ +{% extends "admin/base_site.html" %} +{% load adminmedia %} +{% load i18n %} +{% block javascripts %} + {{ block.super }} + <script type="text/javascript" src="{% admin_media_prefix %}js/documentation.js"></script> +{% endblock %} + +{% block bodyclass %}documentation model-index{% endblock %} +{% block content-class %}content-grid{% endblock %} +{% block breadcrumbs %}<div id="breadcrumbs"><a href="../../">Home</a> › <a href="../">Documentation</a> › Models</div>{% endblock %} + +{% block title %}Models{% endblock %} + +{% block content %} + <h1>Model documentation</h1> + {% regroup models by app_label as grouped_models %} + <div class="container-grid"> + <div class="column span-6"> + <div class="module table-of-contents"> + <h2>Model groups</h2> + <ul> + {% regroup models by app_label as grouped_models %} + {% for group in grouped_models %} + <li><a href="#app-{{ group.grouper }}">{{ group.grouper|capfirst }}</a></li> + {% endfor %} + </ul> + </div> + </div> + <div class="column span-18 last rte"> + {% for group in grouped_models %} + <div class="module"> + <h2 id="app-{{ group.grouper }}">{{ group.grouper|capfirst }}</h2> + <table> + {% for model in group.list %} + <tr> + <th><a href="{{ model.app_label }}.{{ model.object_name.lower }}/">{{ model.object_name }}</a></th> + </tr> + {% endfor %} + </table> + </div> + {% endfor %} + </div> + </div> +{% endblock %}
\ No newline at end of file diff --git a/app/lib/grappelli/templates/admin_doc/template_detail.html b/app/lib/grappelli/templates/admin_doc/template_detail.html new file mode 100644 index 0000000..52935dd --- /dev/null +++ b/app/lib/grappelli/templates/admin_doc/template_detail.html @@ -0,0 +1,21 @@ +{% extends "admin/base_site.html" %} +{% load adminmedia %} +{% load i18n %} +{% block bodyclass %}documentation{% endblock %} +{% block breadcrumbs %}<div id="breadcrumbs"><a href="../../../">Home</a> › <a href="../../">Documentation</a> › Templates › {{ name }}</div>{% endblock %} + +{% block title %}Template: {{ name }}{% endblock %} + +{% block content %} + <h1>Template: "{{ name }}"</h1> + {% regroup templates|dictsort:"site_id" by site as templates_by_site %} + {% for group in templates_by_site %} + <h2>Search path for template "{{ name }}" on {{ group.grouper }}:</h2> + <ol> + {% for template in group.list|dictsort:"order" %} + <li><code>{{ template.file }}</code>{% if not template.exists %} <em>(does not exist)</em>{% endif %}</li> + {% endfor %} + </ol> + {% endfor %} + <p class="small"><a href="../../">‹ Back to Documentation</a></p> +{% endblock %} diff --git a/app/lib/grappelli/templates/admin_doc/template_filter_index.html b/app/lib/grappelli/templates/admin_doc/template_filter_index.html new file mode 100644 index 0000000..434679b --- /dev/null +++ b/app/lib/grappelli/templates/admin_doc/template_filter_index.html @@ -0,0 +1,47 @@ +{% extends "admin/base_site.html" %} +{% load adminmedia %} +{% load i18n %} +{% block javascripts %} + {{ block.super }} + <script type="text/javascript" src="{% admin_media_prefix %}js/documentation.js"></script> +{% endblock %} +{% block bodyclass %}documentation{% endblock %} +{% block content-class %}content-grid{% endblock %} +{% block breadcrumbs %}<div id="breadcrumbs"><a href="../../">Home</a> › <a href="../">Documentation</a> › filters</div>{% endblock %} +{% block title %}Template filters{% endblock %} + +{% block content %} + <h1>Template filter documentation</h1> + <div class="container-grid"> + <div class="column span-6"> + {% regroup filters|dictsort:"library" by library as filter_libraries %} + {% for library in filter_libraries %} + <div class="module table-of-contents"> + <h2>{% firstof library.grouper "Built-in filters" %}</h2> + <ul> + {% for filter in library.list|dictsort:"name" %} + <li><a href="#{{ filter.name }}">{{ filter.name }}</a></li> + {% endfor %} + </ul> + </div> + {% endfor %} + </div> + <div class="column span-18 last rte"> + {% regroup filters|dictsort:"library" by library as filter_libraries %} + {% for library in filter_libraries %} + <div class="group collapsible open"> + <h2 class="collapsible-handler">{% firstof library.grouper "Built-in filters" %}</h2> + {% if library.grouper %}<p>To use these filters, put <code>{% templatetag openblock %} load {{ library.grouper }} {% templatetag closeblock %}</code> in your template before using the filter.</p>{% endif %} + {% for filter in library.list|dictsort:"name" %} + <div class="module"> + <h3 id="{{ filter.name }}">{{ filter.name }}</h3> + <p>{{ filter.title }}</p> + <p>{{ filter.body }}</p> + </div> + {% endfor %} + </div> + {% endfor %} + </div> + </div> +{% endblock %} + diff --git a/app/lib/grappelli/templates/admin_doc/template_tag_index.html b/app/lib/grappelli/templates/admin_doc/template_tag_index.html new file mode 100644 index 0000000..703b2b2 --- /dev/null +++ b/app/lib/grappelli/templates/admin_doc/template_tag_index.html @@ -0,0 +1,48 @@ +{% extends "admin/base_site.html" %} +{% load adminmedia %} +{% load i18n %} +{% block javascripts %} + {{ block.super }} + <script type="text/javascript" src="{% admin_media_prefix %}js/documentation.js"></script> +{% endblock %} +{% block bodyclass %}documentation{% endblock %} +{% block content-class %}content-grid{% endblock %} +{% block breadcrumbs %}<div id="breadcrumbs"><a href="../../">Home</a> › <a href="../">Documentation</a> › Tags</div>{% endblock %} +{% block title %}Template tags{% endblock %} + +{% block content %} + <h1>Template tag documentation</h1> + <div class="container-grid"> + <div class="column span-6"> + {% regroup tags|dictsort:"library" by library as tag_libraries %} + {% for library in tag_libraries %} + <div class="module table-of-contents"> + <h2>{% firstof library.grouper "Built-in tags" %}</h2> + <ul> + {% for tag in library.list|dictsort:"name" %} + <li><a href="#{{ tag.name }}">{{ tag.name }}</a></li> + {% endfor %} + </ul> + </div> + {% endfor %} + </div> + <div class="column span-18 last rte"> + {% regroup tags|dictsort:"library" by library as tag_libraries %} + {% for library in tag_libraries %} + <div class="group collapsible open"> + <h2 class="collapsible-handler">{% firstof library.grouper "Built-in tags" %}</h2> + {% if library.grouper %}<p class="small quiet">To use these tags, put <code>{% templatetag openblock %} load {{ library.grouper }} {% templatetag closeblock %}</code> in your template before using the tag.</p>{% endif %} + {% for tag in library.list|dictsort:"name" %} + <div class="module"> + <h3 id="{{ tag.name }}">{{ tag.name }}</h3> + <h4>{{ tag.title }}</h4> + <p>{{ tag.body }}</p> + </div> + {% endfor %} + </div> + {% endfor %} + </div> + </div> +{% endblock %} + + diff --git a/app/lib/grappelli/templates/admin_doc/view_detail.html b/app/lib/grappelli/templates/admin_doc/view_detail.html new file mode 100644 index 0000000..900d3ed --- /dev/null +++ b/app/lib/grappelli/templates/admin_doc/view_detail.html @@ -0,0 +1,30 @@ +{% extends "admin/base_site.html" %} +{% load adminmedia %} +{% load i18n %} +{% block bodyclass %}documentation{% endblock %} +{% block content-class %}content-grid{% endblock %} +{% block breadcrumbs %}<div id="breadcrumbs"><a href="../../../">Home</a> › <a href="../../">Documentation</a> › <a href="../">Views</a> › {{ name }}</div>{% endblock %} +{% block title %}View: {{ name }}{% endblock %} + +{% block content %} + <h1>{{ name }}</h1> + <div class="container-grid rte"> + <div class="module"> + <h2>{{ summary }}</h2> + <p>{{ body }}</p> + {% if meta.Context %} + <div class="module"> + <h3>Context:</h3> + <p>{{ meta.Context }}</p> + </div> + {% endif %} + {% if meta.Templates %} + <div class="module"> + <h3>Templates:</h3> + <p>{{ meta.Templates }}</p> + </div> + {% endif %} + </div> + <a href="../" class="back">‹ Back to Views Documentation</a> + </div> +{% endblock %} diff --git a/app/lib/grappelli/templates/admin_doc/view_index.html b/app/lib/grappelli/templates/admin_doc/view_index.html new file mode 100644 index 0000000..b3c941c --- /dev/null +++ b/app/lib/grappelli/templates/admin_doc/view_index.html @@ -0,0 +1,46 @@ +{% extends "admin/base_site.html" %} +{% load adminmedia %} +{% load i18n %} +{% block javascripts %} + {{ block.super }} + <script type="text/javascript" src="{% admin_media_prefix %}js/documentation.js"></script> +{% endblock %} +{% block bodyclass %}documentation{% endblock %} +{% block content-class %}content-grid{% endblock %} +{% block breadcrumbs %}<div id="breadcrumbs"><a href="../../">Home</a> › <a href="../">Documentation</a> › Views</div>{% endblock %} +{% block title %}Views{% endblock %} + +{% block content %} + <h1>View documentation</h1> + {% regroup views|dictsort:"site_id" by site as views_by_site %} + <div class="container-grid"> + <div class="column span-6"> + <div class="module table-of-contents"> + <h2>Jump to site</h2> + <ul> + {% for site_views in views_by_site %} + <li><a href="#site{{ site_views.grouper.id }}">{{ site_views.grouper.name }}</a></li> + {% endfor %} + </ul> + </div> + </div> + <div class="column span-18 last rte"> + {% for site_views in views_by_site %} + <div class="group"> + <h2 id="site{{ site_views.grouper.id }}">Views by URL on {{ site_views.grouper.name }}</h2> + {% for view in site_views.list|dictsort:"url" %} + {% ifchanged %} + <div class="module"> + <h3><a href="{{ view.module }}.{{ view.name }}/">{{ view.url }}</a></h3> + <p class="small quiet">View function: {{ view.module }}.{{ view.name }}</p> + <p>{{ view.title }}</p> + </div> + {% endifchanged %} + {% endfor %} + </div> + {% endfor %} + </div> + </div> +{% endblock %} + + diff --git a/app/lib/grappelli/templates/admin_tools/dashboard/css.html b/app/lib/grappelli/templates/admin_tools/dashboard/css.html new file mode 100644 index 0000000..0c69fd1 --- /dev/null +++ b/app/lib/grappelli/templates/admin_tools/dashboard/css.html @@ -0,0 +1,2 @@ +{% for css in css_files %} +<link rel="stylesheet" href="{{ media_url }}/{{ css }}" type="text/css" media="screen, projection"/>{% endfor %} diff --git a/app/lib/grappelli/templates/admin_tools/dashboard/dashboard.html b/app/lib/grappelli/templates/admin_tools/dashboard/dashboard.html new file mode 100644 index 0000000..76aaa1e --- /dev/null +++ b/app/lib/grappelli/templates/admin_tools/dashboard/dashboard.html @@ -0,0 +1,79 @@ +{% load i18n admin_tools_dashboard_tags %} + +<script type="text/javascript" src="{{ media_url }}/admin_tools/js/utils.js"></script> + +<script type="text/javascript" charset="utf-8"> + // Load js files syncronously and conditionally + + var js_files = [ + { + src : '{{ media_url }}/admin_tools/js/jquery/jquery.min.js', + test: function() { return typeof(jQuery) == 'undefined'; } + }, + { + src : '{{ media_url }}/admin_tools/js/jquery/jquery-ui.min.js', + test: function() { return typeof(jQuery.ui) == 'undefined'; } + }, + { + src : '{{ media_url }}/admin_tools/js/json.min.js', + test: function() { return typeof(JSON.stringify) == 'undefined'; } + }, + { + src : '{{ media_url }}/admin_tools/js/jquery/jquery.cookie.min.js', + test: function() { return typeof(jQuery.cookie) == 'undefined'; } + }, + { + src : '{{ media_url }}/admin_tools/js/jquery/jquery.dashboard.js', + test: function() { return true; } + }, + { + src : '{{ media_url }}/admin_tools/js/dashboard.js', + test: function() { return true; } + }{% for js in dashboard.Media.js %}, + { + src : '{{ media_url }}/{{ js }}', + test: function() { return true; } + }{% endfor %} + ]; + + loadScripts(js_files, function(){ + jQuery(function($) { + init_dashboard( + '{{ dashboard.get_id }}', + {{ dashboard.columns }}, + {% autoescape off %}{{ dashboard_preferences }}{% endautoescape %}, + '{% url admin-tools-dashboard-set-preferences %}' + ); + }); + }); +</script> + +{% if dashboard.Media.js %} + {% for js in dashboard.Media.js %} + <script type="text/javascript" src="{{ media_url }}/{{ js }}"></script> + {% endfor %} +{% endif %} + +<div class="container-grid"> + <div class="column span-12"> + {% for module in dashboard.children %} + {% if "column_1" in module.css_classes %} + {% admin_tools_render_dashboard_module module forloop.counter %} + {% endif %} + {% endfor %} + </div> + <div class="column span-6"> + {% for module in dashboard.children %} + {% if "column_2" in module.css_classes %} + {% admin_tools_render_dashboard_module module forloop.counter %} + {% endif %} + {% endfor %} + </div> + <div class="column span-6 last"> + {% for module in dashboard.children %} + {% if "column_3" in module.css_classes %} + {% admin_tools_render_dashboard_module module forloop.counter %} + {% endif %} + {% endfor %} + </div> +</div> diff --git a/app/lib/grappelli/templates/admin_tools/dashboard/dashboard.txt b/app/lib/grappelli/templates/admin_tools/dashboard/dashboard.txt new file mode 100644 index 0000000..4417070 --- /dev/null +++ b/app/lib/grappelli/templates/admin_tools/dashboard/dashboard.txt @@ -0,0 +1,141 @@ +from django.utils.translation import ugettext_lazy as _ +from django.core.urlresolvers import reverse +from admin_tools.dashboard import modules, Dashboard, AppIndexDashboard + +# to activate your index dashboard add the following to your settings.py: +# +# ADMIN_TOOLS_INDEX_DASHBOARD = '{{ project }}.{{ file }}.CustomIndexDashboard' + +class CustomIndexDashboard(Dashboard): + """ + Custom index dashboard for {{ project }}. + """ + def __init__(self, **kwargs): + Dashboard.__init__(self, **kwargs) + + # append a link list module for "quick links" + #self.children.append(modules.LinkList( + # title=_('Quick links'), + # layout='inline', + # draggable=False, + # deletable=False, + # collapsible=False, + # children=[ + # { + # 'title': _('Return to site'), + # 'url': '/', + # }, + # { + # 'title': _('Change password'), + # 'url': reverse('admin:password_change'), + # }, + # { + # 'title': _('Log out'), + # 'url': reverse('admin:logout') + # }, + # ] + #)) + + self.children.append(modules.LinkList( + column=1, + title=_('Media Management'), + children=[ + { + 'title': _('Django FileBrowser'), + 'url': '/admin/filebrowser/browse/', + 'external': False, + }, + ] + )) + + # append an app list module for "Administration" + self.children.append(modules.AppList( + title=_('Administration'), + include_list=('django.contrib',), + css_classes=['collapse', 'open'], + )) + + # append an app list module for "Applications" + self.children.append(modules.AppList( + title=_('Applications'), + exclude_list=('django.contrib',), + css_classes=['collapse', 'open'], + )) + + # append a recent actions module + self.children.append(modules.RecentActions( + column=2, + title=_('Recent Actions'), + limit=5 + )) + + # append a feed module + self.children.append(modules.Feed( + column=2, + title=_('Latest Django News'), + feed_url='http://www.djangoproject.com/rss/weblog/', + limit=5 + )) + + # append another link list module for "support". + self.children.append(modules.LinkList( + column=2, + title=_('Support'), + children=[ + { + 'title': _('Django documentation'), + 'url': 'http://docs.djangoproject.com/', + 'external': True, + }, + { + 'title': _('Django "django-users" mailing list'), + 'url': 'http://groups.google.com/group/django-users', + 'external': True, + }, + { + 'title': _('Django irc channel'), + 'url': 'irc://irc.freenode.net/django', + 'external': True, + }, + ] + )) + + def init_with_context(self, context): + """ + Use this method if you need to access the request context. + """ + pass + + +# to activate your app index dashboard add the following to your settings.py: +# +# ADMIN_TOOLS_APP_INDEX_DASHBOARD = '{{ project }}.{{ file }}.CustomAppIndexDashboard' + +class CustomAppIndexDashboard(AppIndexDashboard): + """ + Custom app index dashboard for {{ project }}. + """ + def __init__(self, *args, **kwargs): + AppIndexDashboard.__init__(self, *args, **kwargs) + + # we disable title because its redundant with the model list module + self.title = '' + + # append a model list module + self.children.append(modules.ModelList( + title=_(self.app_title), + models=self.models, + )) + + # append a recent actions module + self.children.append(modules.RecentActions( + column=2, + title=_('Recent Actions'), + include_list=self.get_app_content_types(), + )) + + def init_with_context(self, context): + """ + Use this method if you need to access the request context. + """ + pass diff --git a/app/lib/grappelli/templates/admin_tools/dashboard/dashboard_app_index.txt b/app/lib/grappelli/templates/admin_tools/dashboard/dashboard_app_index.txt new file mode 100644 index 0000000..0574dfc --- /dev/null +++ b/app/lib/grappelli/templates/admin_tools/dashboard/dashboard_app_index.txt @@ -0,0 +1,29 @@ +from django.utils.translation import ugettext_lazy as _ +from django.core.urlresolvers import reverse +from admin_tools.dashboard import modules, AppIndexDashboard + +# create your custom modules here if you want, for example: +# +# class CustomDashboardModule(modules.DashboardModule): +# pass +# +{% if warning %} +# WARNING: you've changed the default file name 'dashboard.py' to '{{ file }}.py', +# so, you will need to tell django-admin-tools about this, just add this line +# to your settings.py file: +# ADMIN_TOOLS_APP_INDEX_DASHBOARD_MODULE = '{{ file }}' +{% endif %} +# Your {{ app }} dashboard class +class {{ app|capfirst }}Dashboard(AppIndexDashboard): + """ + Document your custom app index dashboard. + """ + def __init__(self, app_title, models, *args, **kwargs): + super(CustomAppIndexDashboard, self).__init__(*args, **kwargs) + + # append your modules here, example: + # self.append(modules.RecentActionsDashboardModule( + # title=_('Recent Actions'), + # limit=5, + # include_list=models, + # )) diff --git a/app/lib/grappelli/templates/admin_tools/dashboard/dummy.html b/app/lib/grappelli/templates/admin_tools/dashboard/dummy.html new file mode 100644 index 0000000..f04fcf5 --- /dev/null +++ b/app/lib/grappelli/templates/admin_tools/dashboard/dummy.html @@ -0,0 +1 @@ +{% extends template %} diff --git a/app/lib/grappelli/templates/admin_tools/dashboard/module.html b/app/lib/grappelli/templates/admin_tools/dashboard/module.html new file mode 100644 index 0000000..85f55f8 --- /dev/null +++ b/app/lib/grappelli/templates/admin_tools/dashboard/module.html @@ -0,0 +1,7 @@ +{% if not module.is_empty %} + {% block module_content %} + {% for child in module.children %} + {{ child }} + {% endfor %} + {% endblock %} +{% endif %} diff --git a/app/lib/grappelli/templates/admin_tools/dashboard/modules/app_list.html b/app/lib/grappelli/templates/admin_tools/dashboard/modules/app_list.html new file mode 100644 index 0000000..8cbd4a7 --- /dev/null +++ b/app/lib/grappelli/templates/admin_tools/dashboard/modules/app_list.html @@ -0,0 +1,58 @@ +{% extends "admin_tools/dashboard/module.html" %} +{% load i18n %} +{% block module_content %} + <div class="module {% for item in module.css_classes %}{{ item }} {% endfor %}"{% if index %} id="module_{{ index }}{% if subindex %}_{{ subindex }}{% endif %}"{% endif %}> + + {% if module.title %} + {% if subindex %} + <h3>{{ module.title }}</h3> + {% else %} + <h2>{{ module.title }}</h2> + {% endif %} + {% endif %} + +{% spaceless %} + {% if module.pre_content %} + <p>{{ module.pre_content }}</p> + {% endif %} + {% for child in module.children %} + + <div class="module"> + {% if subindex %} + <h4><a href="{{ child.url }}">{{ child.title }}</a></h4> + {% else %} + <h3><a href="{{ child.url }}">{{ child.title }}</a></h3> + {% endif %} + + {% for model in child.models %} + <div class="row"> + {% if model.change_url %} + <a href="{{ model.change_url }}">{{ model.title }}</a> + {% else %} + {{ model.title }} + {% endif %} + {% if model.add_url or model.change_url %} + <ul class="actions"> + {% if model.add_url %} + <li class="add-link"> + <a href="{{ model.add_url }}">{% trans "Add" %}</a> + </li> + {% endif %} + {% if model.change_url %} + <li class="change-link"> + <a href="{{ model.change_url }}">{% trans "Change" %}</a> + </li> + {% endif %} + </ul> + {% endif %} + </div> + {% endfor %} + + </div> + {% endfor %} + {% if module.post_content %} + <p>{{ module.post_content }}</p> + {% endif %} +{% endspaceless %} +</div> +{% endblock %} diff --git a/app/lib/grappelli/templates/admin_tools/dashboard/modules/column.html b/app/lib/grappelli/templates/admin_tools/dashboard/modules/column.html new file mode 100644 index 0000000..8df8268 --- /dev/null +++ b/app/lib/grappelli/templates/admin_tools/dashboard/modules/column.html @@ -0,0 +1,9 @@ +{% extends "dashboard/module.html" %} +{% load i18n admin_tools_dashboard_tags %} +{% block module_content %} + <div class="column {{ module.className }}"> + {% for child in module.children %} + {% admin_tools_render_dashboard_module child forloop.counter %} + {% endfor %} + </div> +{% endblock %}
\ No newline at end of file diff --git a/app/lib/grappelli/templates/admin_tools/dashboard/modules/feed.html b/app/lib/grappelli/templates/admin_tools/dashboard/modules/feed.html new file mode 100644 index 0000000..3deec4e --- /dev/null +++ b/app/lib/grappelli/templates/admin_tools/dashboard/modules/feed.html @@ -0,0 +1,21 @@ +{% extends "admin_tools/dashboard/module.html" %} +{% block module_content %} +{% if subindex %} + <div class="module feed {% for item in module.css_classes %}{{ item }} {% endfor %}"> + <h3>{{ module.title }}</h2> +{% else %} + <div class="module feed {% for item in module.css_classes %}{{ item }} {% endfor %}"> + <h2>{{ module.title }}</h2> +{% endif %} + <ul> + {% spaceless %} + {% for child in module.children %} + <li> + {% if child.date %}<span class="date mini quiet">{{ child.date|date }} </span>{% endif %} + {% if child.warning %}<span class="warning">{{ child.title }}</span>{% else %}<a class="external" href="{{ child.url }}">{{ child.title }}</a>{% endif %} + </li> + {% endfor %} + {% endspaceless %} + </ul> +</div> +{% endblock %} diff --git a/app/lib/grappelli/templates/admin_tools/dashboard/modules/group.html b/app/lib/grappelli/templates/admin_tools/dashboard/modules/group.html new file mode 100644 index 0000000..144c82f --- /dev/null +++ b/app/lib/grappelli/templates/admin_tools/dashboard/modules/group.html @@ -0,0 +1,33 @@ +{% extends "admin_tools/dashboard/module.html" %} +{% load admin_tools_dashboard_tags %} +{% block module_content %} +<div class="group group-{{ module.display }} {% for item in module.css_classes %}{{ item }} {% endfor %}"> + {% spaceless %} + {% if module.title %} + <h2>{{ module.title }}</h2> + {% endif %} + {% ifequal module.display "tabs" %} + <div class="group-{{ module.display }}-container"> + <ul> + {% for sub_module in module.children %} + {% if not sub_module.is_empty %}<li class="group-tabs-link"><a href="#module_{{ index }}_{{ forloop.counter }}">{{ sub_module.title }}</a></li>{% endif %} + {% endfor %} + </ul> + {% for sub_module in module.children %} + {% admin_tools_render_dashboard_module sub_module index forloop.counter %} + {% endfor %} + </div> + {% endifequal %} + {% ifequal module.display "accordion" %} + {% for sub_module in module.children %} + {% if not sub_module.is_empty %}<span class="group-accordion-header"><a href="#">{{ sub_module.title }}</a></span>{% endif %} + {% admin_tools_render_dashboard_module sub_module index forloop.counter %} + {% endfor %} + {% else %} + + {% endifequal %} + + + {% endspaceless %} +</div> +{% endblock %} diff --git a/app/lib/grappelli/templates/admin_tools/dashboard/modules/link_list.html b/app/lib/grappelli/templates/admin_tools/dashboard/modules/link_list.html new file mode 100644 index 0000000..97b357e --- /dev/null +++ b/app/lib/grappelli/templates/admin_tools/dashboard/modules/link_list.html @@ -0,0 +1,21 @@ +{% extends "admin_tools/dashboard/module.html" %} +{% block module_content %} + <div class="module link-list {% for item in module.css_classes %}{{ item }} {% endfor %}"> +{% if module.title %} + {% if subindex %} + <h3>{{ module.title }}</h3> + {% else %} + <h2>{{ module.title }}</h2> + {% endif %} +{% endif %} + <ul> + {% spaceless %} + {% for child in module.children %} + <li> + <a class="{% if child.external %}external{% else %}internal{% endif %}" href="{{ child.url }}" {% if child.description %} title="{{ child.description }}"{% endif %}>{{ child.title }}</a> + </li> + {% endfor %} + {% endspaceless %} + </ul> + </div> +{% endblock %} diff --git a/app/lib/grappelli/templates/admin_tools/dashboard/modules/model_list.html b/app/lib/grappelli/templates/admin_tools/dashboard/modules/model_list.html new file mode 100644 index 0000000..7431f8f --- /dev/null +++ b/app/lib/grappelli/templates/admin_tools/dashboard/modules/model_list.html @@ -0,0 +1,26 @@ +{% extends "admin_tools/dashboard/module.html" %} +{% load i18n %} +{% block module_content %} + <div class="module {% for item in module.css_classes %}{{ item }} {% endfor %}"> + {% if module.title %} + {% if subindex %} + <h3>{{ module.title }}</h3> + {% else %} + <h2>{{ module.title }}</h2> + {% endif %} + {% endif %} + + {% for child in module.children %} + <div class="row"> + {% if child.change_url %}<a href="{{ child.change_url }}">{{ child.title }}</a>{% else %}{{ child.title }}{% endif %} + + {% if child.add_url or child.change_url %} + <ul class="actions"> + {% if child.add_url %}<li class="add-link"><a href="{{ child.add_url }}">{% trans "Add" %}</a></li>{% endif %} + {% if child.change_url %}<li class="change-link"><a href="{{ child.change_url }}">{% trans "Change" %}</a></li>{% endif %} + </ul> + {% endif %} + </div> + {% endfor %} + </div> +{% endblock %} diff --git a/app/lib/grappelli/templates/admin_tools/dashboard/modules/module_group.html b/app/lib/grappelli/templates/admin_tools/dashboard/modules/module_group.html new file mode 100644 index 0000000..8e0f256 --- /dev/null +++ b/app/lib/grappelli/templates/admin_tools/dashboard/modules/module_group.html @@ -0,0 +1,10 @@ +{% extends "dashboard/module.html" %} +{% load i18n admin_tools_dashboard_tags %} +{% block module_content %} + <div class="group collapsible open"> + <h2 class="collapsible-handler">{{ module.title }}</h2> + {% for sub_module in module.children %} + {% admin_tools_render_dashboard_module sub_module forloop.counter %} + {% endfor %} + </div> +{% endblock %} diff --git a/app/lib/grappelli/templates/admin_tools/dashboard/modules/recent_actions.html b/app/lib/grappelli/templates/admin_tools/dashboard/modules/recent_actions.html new file mode 100644 index 0000000..0b7bb9e --- /dev/null +++ b/app/lib/grappelli/templates/admin_tools/dashboard/modules/recent_actions.html @@ -0,0 +1,26 @@ +{% extends "admin_tools/dashboard/module.html" %} +{% load i18n %} +{% block module_content %} +{% if subindex %} + <div class="module actions {% for item in module.css_classes %}{{ item }} {% endfor %}"> + <h3>{% trans 'Recent Actions' %}</h2> + <div class="module"> + <h4>{% trans 'My Actions' %}</h3> +{% else %} + <div class="module actions {% for item in module.css_classes %}{{ item }} {% endfor %}"> + <h2>{% trans 'Recent Actions' %}</h2> + <div class="module"> + <h3>{% trans 'My Actions' %}</h3> +{% endif %} + {% if module.children %} + <ul> + {% for entry in module.children %} + <li class="{% if entry.is_addition %}add-link{% endif %}{% if entry.is_change %}change-link{% endif %}{% if entry.is_deletion %}delete-link{% endif %}">{% if not entry.is_deletion %}<a href="{{ entry.get_admin_url }}">{% endif %}{{ entry.object_repr }}{% if not entry.is_deletion %}</a>{% endif %}<br /><span class="mini quiet">{% filter capfirst %}{% trans entry.content_type.name %}{% endfilter %}</span></li> + {% endfor %} + </ul> + {% else %} + <p>{% trans 'None Available' %}</p> + {% endif %} + </div> +</div> +{% endblock %} diff --git a/app/lib/grappelli/templates/admin_tools/dashboard/preferences_form.html b/app/lib/grappelli/templates/admin_tools/dashboard/preferences_form.html new file mode 100644 index 0000000..7da463a --- /dev/null +++ b/app/lib/grappelli/templates/admin_tools/dashboard/preferences_form.html @@ -0,0 +1,10 @@ +{% extends "admin/base_site.html" %} + +{% block content %} + +<form action="." method="POST"> + {{ form.as_p }} + <p><input type="submit" value="Save" /></p> +</form> + +{% endblock %} diff --git a/app/lib/grappelli/templates/admin_tools/menu/add_bookmark_form.html b/app/lib/grappelli/templates/admin_tools/menu/add_bookmark_form.html new file mode 100644 index 0000000..e0fcf2a --- /dev/null +++ b/app/lib/grappelli/templates/admin_tools/menu/add_bookmark_form.html @@ -0,0 +1,9 @@ +{% url admin-tools-menu-add-bookmark as form_url %} +{% if form_url %} + <form id="bookmark-form" action="{{ form_url }}" method="POST"> + <input type="hidden" name="next" value="{% firstof url request.get_full_path|urlencode %}" /> + <input type="hidden" name="url" value="{% firstof url request.get_full_path|urlencode %}" /> + <input type="hidden" name="title" value="{{ title }}" /> + <button id="bookmark-button" type="submit"></button> + </form> +{% endif %} diff --git a/app/lib/grappelli/templates/admin_tools/menu/css.html b/app/lib/grappelli/templates/admin_tools/menu/css.html new file mode 100644 index 0000000..71aefdb --- /dev/null +++ b/app/lib/grappelli/templates/admin_tools/menu/css.html @@ -0,0 +1 @@ +<!-- admin_tools/menu/css.html -->
\ No newline at end of file diff --git a/app/lib/grappelli/templates/admin_tools/menu/delete_confirm.html b/app/lib/grappelli/templates/admin_tools/menu/delete_confirm.html new file mode 100644 index 0000000..e32a678 --- /dev/null +++ b/app/lib/grappelli/templates/admin_tools/menu/delete_confirm.html @@ -0,0 +1,13 @@ +{% extends "admin/base_site.html" %} + +{% block content %} + +<p>Are you sure you want to delete this bookmark?</p> + +<p>{{ bookmark.name }} - {{ bookmark.url }}</p> + +<form action="." method="POST"> + <p><input type="submit" value="Delete" /></p> +</form> + +{% endblock %} diff --git a/app/lib/grappelli/templates/admin_tools/menu/dummy.html b/app/lib/grappelli/templates/admin_tools/menu/dummy.html new file mode 100644 index 0000000..f04fcf5 --- /dev/null +++ b/app/lib/grappelli/templates/admin_tools/menu/dummy.html @@ -0,0 +1 @@ +{% extends template %} diff --git a/app/lib/grappelli/templates/admin_tools/menu/form.html b/app/lib/grappelli/templates/admin_tools/menu/form.html new file mode 100644 index 0000000..7da463a --- /dev/null +++ b/app/lib/grappelli/templates/admin_tools/menu/form.html @@ -0,0 +1,10 @@ +{% extends "admin/base_site.html" %} + +{% block content %} + +<form action="." method="POST"> + {{ form.as_p }} + <p><input type="submit" value="Save" /></p> +</form> + +{% endblock %} diff --git a/app/lib/grappelli/templates/admin_tools/menu/item.html b/app/lib/grappelli/templates/admin_tools/menu/item.html new file mode 100644 index 0000000..9bf8bbd --- /dev/null +++ b/app/lib/grappelli/templates/admin_tools/menu/item.html @@ -0,0 +1,15 @@ +{% load admin_tools_menu_tags %} +{% spaceless %} +{% if not item.is_empty %} + <li class="menu-item{% if item.children %} parent{% if index %} collapse closed{% else %} item-collapse item-closed{% endif %}{% endif %}{% if not item.enabled %} disabled{% endif %}{% if selected %} selected{% endif %}{% if forloop.last %} last{% endif %}{% if item.css_classes %} {{ item.css_classes|join:' ' }}{% endif %}"> + <a href="{% if item.url and item.enabled %}{{ item.url }}{% else %}#{% endif %}" class="{% if item.children %}parent{% if index %} collapse-handler{% else %} item-collapse-handler-container{% endif %}{% endif %}" {% if item.description %} title="{{ item.description }}"{% endif %}{% if item.accesskey %} accesskey="{{ item.accesskey }}"{% endif %}>{{ item.title }}</a>{% if item.children %}{% if not index %}<a href="javascript://" class="icon item-collapse-handler"></a>{% endif %}{% endif %} + {% if item.children %} + <ul> + {% for child_item in item.children %} + {% admin_tools_render_menu_item child_item %} + {% endfor %} + </ul> + {% endif %} + </li> +{% endif %} +{% endspaceless %} diff --git a/app/lib/grappelli/templates/admin_tools/menu/menu.html b/app/lib/grappelli/templates/admin_tools/menu/menu.html new file mode 100644 index 0000000..f43dc23 --- /dev/null +++ b/app/lib/grappelli/templates/admin_tools/menu/menu.html @@ -0,0 +1,64 @@ +{% load i18n admin_tools_menu_tags %} +{% if menu.children %} + <script type="text/javascript" src="{{ media_url }}/admin_tools/js/utils.js"></script> + <script type="text/javascript" charset="utf-8"> + // Load js files syncronously and conditionally + var js_files = [ + { + src : '{{ media_url }}/admin_tools/js/jquery/jquery.min.js', + test: function() { return typeof(jQuery) == 'undefined'; } + }, + { + src : '{{ media_url }}/admin_tools/js/json.min.js', + test: function() { return typeof(JSON.stringify) == 'undefined'; } + }, + { + src : '{{ media_url }}/admin_tools/js/menu.js', + test: function() { return true; } + }{% for js in menu.Media.js %}, + { + src : '{{ media_url }}/{{ js }}', + test: function() { return true; } + }{% endfor %} + ]; + loadScripts(js_files, function(){ + jQuery(function($) { + {% if has_bookmark_item %} + process_bookmarks( + "{{ request.get_full_path }}", + "{{ title }}", + "{% trans 'Please enter a name for the bookmark' %}" + ); + {% endif %} + }); + }); + </script> + {% comment %} + {% for item in menu.children %} + <ul class="navigation-menu"> + {% admin_tools_render_menu_item item forloop.counter %} + {% ifequal item.css_classes|join:' ' "bookmark" %} + <li class="actions"> + {% if bookmark %} + {% include "admin_tools/menu/remove_bookmark_form.html" %} + {% else %} + {% include "admin_tools/menu/add_bookmark_form.html" %} + {% endif %} + </li> + {% endifequal %} + </ul> + {% endfor %} + {% endcomment %} + {% for item in menu.children %} + <ul class="navigation-menu"> + {% admin_tools_render_menu_item item forloop.counter %} + </ul> + {% ifequal item.css_classes|join:' ' "bookmark" %} + {% if bookmark %} + {% include "admin_tools/menu/remove_bookmark_form.html" %} + {% else %} + {% include "admin_tools/menu/add_bookmark_form.html" %} + {% endif %} + {% endifequal %} + {% endfor %} +{% endif %} diff --git a/app/lib/grappelli/templates/admin_tools/menu/menu.txt b/app/lib/grappelli/templates/admin_tools/menu/menu.txt new file mode 100644 index 0000000..72d20da --- /dev/null +++ b/app/lib/grappelli/templates/admin_tools/menu/menu.txt @@ -0,0 +1,32 @@ +from django.core.urlresolvers import reverse +from django.utils.translation import ugettext_lazy as _ +from admin_tools.menu import items, Menu + +# to activate your custom menu add the following to your settings.py: +# +# ADMIN_TOOLS_MENU = '{{ project }}.{{ file }}.CustomMenu' + +class CustomMenu(Menu): + """ + Custom Menu for {{ project }} admin site. + """ + def __init__(self, **kwargs): + Menu.__init__(self, **kwargs) + self.children.append(items.MenuItem( + title=_('Dashboard'), + url=reverse('admin:index') + )) + self.children.append(items.AppList( + title=_('Applications'), + models=('add.your.app.models.here',) + )) + self.children.append(items.AppList( + title=_('Administration'), + models=('django.contrib',) + )) + + def init_with_context(self, context): + """ + Use this method if you need to access the request context. + """ + pass diff --git a/app/lib/grappelli/templates/admin_tools/menu/remove_bookmark_form.html b/app/lib/grappelli/templates/admin_tools/menu/remove_bookmark_form.html new file mode 100644 index 0000000..7d9567f --- /dev/null +++ b/app/lib/grappelli/templates/admin_tools/menu/remove_bookmark_form.html @@ -0,0 +1,7 @@ +{% url admin-tools-menu-remove-bookmark bookmark.id as form_url %} +{% if form_url %} +<form id="bookmark-form" action="{{ form_url }}" method="POST"> + <input type="hidden" name="next" value="{% firstof url request.get_full_path|urlencode %}" /> + <button id="bookmark-button" class="bookmarked" type="submit"></button> +</form> +{% endif %} diff --git a/app/lib/grappelli/templates/grappelli/index.html b/app/lib/grappelli/templates/grappelli/index.html new file mode 100644 index 0000000..c0a4469 --- /dev/null +++ b/app/lib/grappelli/templates/grappelli/index.html @@ -0,0 +1,3 @@ +{% extends 'admin/base_site.html' %} + +hallo
\ No newline at end of file diff --git a/app/lib/grappelli/templates/registration/logged_out.html b/app/lib/grappelli/templates/registration/logged_out.html new file mode 100644 index 0000000..31e9db4 --- /dev/null +++ b/app/lib/grappelli/templates/registration/logged_out.html @@ -0,0 +1,18 @@ +{% extends "admin/base_site.html" %} +{% load i18n %} +{% block content-class %}content-flexible{% endblock %} + +{% block breadcrumbs %}{% comment %}<div id="breadcrumbs"><a href="../">{% trans 'Home' %}</a></div>{% endcomment %}{% endblock %} +{% block content_title %} {% endblock %} + +{% block content %} + <div class="container-flexible logout"> + <div class="column span-10 centered"> + <h1>{{ title }}. <a href="../"><strong>{% trans 'Log in again' %}</strong></a></h1> + {% comment %}<div class="module"> + <h2>{{ title }}, </h2> + <div class="row"><a href="../"><strong>{% trans 'Log in again' %}</strong></a></div> + </div>{% endcomment %} + </div> + </div> +{% endblock %} diff --git a/app/lib/grappelli/templates/registration/password_change_done.html b/app/lib/grappelli/templates/registration/password_change_done.html new file mode 100644 index 0000000..bfd01ab --- /dev/null +++ b/app/lib/grappelli/templates/registration/password_change_done.html @@ -0,0 +1,24 @@ +{% extends "admin/base_site.html" %} +{% load i18n %} +{% block userlinks %} + {% url django-admindocs-docroot as docsroot %} + {% if docsroot %} + <li> + <a href="{{ docsroot }}">{% trans 'Documentation' %}</a> + </li> + {% endif %} + <li> + <a href="{{ root_path }}password_change/">{% trans 'Change password' %}</a> + </li> + <li> + <a href="{{ root_path }}logout/">{% trans 'Log out' %}</a> + </li> +{% endblock %} + +{% block breadcrumbs %}<div id="breadcrumbs"><a href="../../">{% trans 'Home' %}</a> › {% trans 'Password change' %}</div>{% endblock %} + +{% block title %}{% trans 'Password change successful' %}{% endblock %} +{% block content %} + <h1>{% trans 'Password change successful' %}</h1> + <p>{% trans 'Your password was changed.' %}</p> +{% endblock %} diff --git a/app/lib/grappelli/templates/registration/password_change_form.html b/app/lib/grappelli/templates/registration/password_change_form.html new file mode 100644 index 0000000..e4d175f --- /dev/null +++ b/app/lib/grappelli/templates/registration/password_change_form.html @@ -0,0 +1,60 @@ +{% extends "admin/base_site.html" %} +{% load i18n %} {# grp_csrf #} +{% block userlinks %} +{% url django-admindocs-docroot as docsroot %}{% if docsroot %} +<li> + <a href="{{ docsroot }}">{% trans 'Documentation' %}</a> +</li> +{% endif %} +<li> + <a href="{{ root_path }}password_change/">{% trans 'Change password' %}</a> +</li> +<li> + <a href="{{ root_path }}logout/">{% trans 'Log out' %}</a> +</li> +{% endblock %} +{% block breadcrumbs %}<div id="breadcrumbs"><a href="../">{% trans 'Home' %}</a> › {% trans 'Password change' %}</div>{% endblock %} +{% block title %}{% trans 'Password change' %}{% endblock %} +{% block content-class %}content-grid{% endblock %} + +{% block content %} + +<h1>{% trans 'Password change' %}</h1> + +<div class="container-grid"> + <div class="column span-12"> + <p>{% trans "Please enter your old password, for securitys sake, and then enter your new password twice so we can verify you typed it in correctly." %}</p> + <form action="" method="post">{% csrf_token %} + <fieldset class="module"> + <div class="row"> + <div class="column span-4"><label for="id_old_password" class="required">{% trans 'Old password:' %}</label></div> + <div class="column span-flexible"> + {{ form.old_password }} + {{ form.old_password.errors }} + </div> + </div> + <div class="row"> + <div class="column span-4"><label for="id_new_password1" class="required">{% trans 'New password:' %}</label></div> + <div class="column span-flexible"> + {{ form.new_password1 }} + {{ form.new_password1.errors }} + </div> + </div> + <div class="row"> + <div class="column span-4"><label for="id_new_password2" class="required">{% trans 'Confirm password:' %}</label></div> + <div class="column span-flexible"> + {{ form.new_password2 }} + {{ form.new_password2.errors }} + </div> + </div> + </fieldset> + <div class="module submit-row"> + <ul class="submit-row"> + <li class="submit-button-container"><input type="submit" value="{% trans 'Change my password' %}" class="default" /></li> + </ul> + </div> + </form> + </div> +</div> + +{% endblock %} diff --git a/app/lib/grappelli/templates/registration/password_reset_complete.html b/app/lib/grappelli/templates/registration/password_reset_complete.html new file mode 100644 index 0000000..5b14a54 --- /dev/null +++ b/app/lib/grappelli/templates/registration/password_reset_complete.html @@ -0,0 +1,12 @@ +{% extends "admin/base_site.html" %} +{% load i18n %} + +{% block breadcrumbs %}<div id="breadcrumbs"><a href="../../">{% trans 'Home' %}</a> › {% trans 'Password reset' %}</div>{% endblock %} + +{% block title %}{% trans 'Password reset complete' %}{% endblock %} + +{% block content %} + <h1>{% trans 'Password reset complete' %}</h1> + <p>{% trans "Your password has been set. You may go ahead and log in now." %}</p> + <p><a href="{{ login_url }}">{% trans 'Log in' %}</a></p> +{% endblock %}
\ No newline at end of file diff --git a/app/lib/grappelli/templates/registration/password_reset_confirm.html b/app/lib/grappelli/templates/registration/password_reset_confirm.html new file mode 100644 index 0000000..6aad70f --- /dev/null +++ b/app/lib/grappelli/templates/registration/password_reset_confirm.html @@ -0,0 +1,23 @@ +{% extends "admin/base_site.html" %} +{% load i18n %} {# grp_csrf #} + +{% block breadcrumbs %}<div id="breadcrumbs"><a href="../">{% trans 'Home' %}</a> › {% trans 'Password reset confirmation' %}</div>{% endblock %} + +{% block title %}{% trans 'Password reset' %}{% endblock %} + +{% block content %} + {% if validlink %} + <h1>{% trans 'Enter new password' %}</h1> + <p>{% trans "Please enter your new password twice so we can verify you typed it in correctly." %}</p> + <form action="" method="post">{% csrf_token %} + {{ form.new_password1.errors }} + <p class="aligned wide"><label for="id_new_password1">{% trans 'New password:' %}</label>{{ form.new_password1 }}</p> + {{ form.new_password2.errors }} + <p class="aligned wide"><label for="id_new_password2">{% trans 'Confirm password:' %}</label>{{ form.new_password2 }}</p> + <p><input type="submit" value="{% trans 'Change my password' %}" /></p> + </form> + {% else %} + <h1>{% trans 'Password reset unsuccessful' %}</h1> + <p>{% trans "The password reset link was invalid, possibly because it has already been used. Please request a new password reset." %} + {% endif %} +{% endblock %} diff --git a/app/lib/grappelli/templates/registration/password_reset_done.html b/app/lib/grappelli/templates/registration/password_reset_done.html new file mode 100644 index 0000000..a009281 --- /dev/null +++ b/app/lib/grappelli/templates/registration/password_reset_done.html @@ -0,0 +1,11 @@ +{% extends "admin/base_site.html" %} +{% load i18n %} + +{% block breadcrumbs %}<div id="breadcrumbs"><a href="../">{% trans 'Home' %}</a> › {% trans 'Password reset' %}</div>{% endblock %} + +{% block title %}{% trans 'Password reset successful' %}{% endblock %} + +{% block content %} + <h1>{% trans 'Password reset successful' %}</h1> + <p>{% trans "We've e-mailed a new password to the e-mail address you submitted. You should be receiving it shortly." %}</p> +{% endblock %} diff --git a/app/lib/grappelli/templates/registration/password_reset_email.html b/app/lib/grappelli/templates/registration/password_reset_email.html new file mode 100644 index 0000000..4e4bd6d --- /dev/null +++ b/app/lib/grappelli/templates/registration/password_reset_email.html @@ -0,0 +1,15 @@ +{% load i18n %}{% autoescape off %} +{% trans "You're receiving this e-mail because you requested a password reset" %} +{% blocktrans %}for your user account at {{ site_name }}{% endblocktrans %}. + +{% trans "Please go to the following page and choose a new password:" %} +{% block reset_link %} +{{ protocol }}://{{ domain }}{% url django.contrib.auth.views.password_reset_confirm uidb36=uid, token=token %} +{% endblock %} +{% trans "Your username, in case you've forgotten:" %} {{ user.username }} + +{% trans "Thanks for using our site!" %} + +{% blocktrans %}The {{ site_name }} team{% endblocktrans %} + +{% endautoescape %} diff --git a/app/lib/grappelli/templates/registration/password_reset_form.html b/app/lib/grappelli/templates/registration/password_reset_form.html new file mode 100644 index 0000000..7933280 --- /dev/null +++ b/app/lib/grappelli/templates/registration/password_reset_form.html @@ -0,0 +1,15 @@ +{% extends "admin/base_site.html" %} +{% load i18n %} {# grp_csrf #} + +{% block breadcrumbs %}<div id="breadcrumbs"><a href="../">{% trans 'Home' %}</a> › {% trans 'Password reset' %}</div>{% endblock %} + +{% block title %}{% trans "Password reset" %}{% endblock %} + +{% block content %} + <h1>{% trans "Password reset" %}</h1> + <p>{% trans "Forgotten your password? Enter your e-mail address below, and we'll reset your password and e-mail the new one to you." %}</p> + <form action="" method="post">{% csrf_token %} + {% if form.email.errors %}{{ form.email.errors }}{% endif %} + <p><label for="id_email">{% trans 'E-mail address:' %}</label> {{ form.email }} <input type="submit" value="{% trans 'Reset my password' %}" /></p> + </form> +{% endblock %} |