diff options
Diffstat (limited to 'lib/grappelli/templates/admin')
39 files changed, 1697 insertions, 0 deletions
diff --git a/lib/grappelli/templates/admin/404.html b/lib/grappelli/templates/admin/404.html new file mode 100644 index 0000000..10aeb75 --- /dev/null +++ b/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/lib/grappelli/templates/admin/500.html b/lib/grappelli/templates/admin/500.html new file mode 100644 index 0000000..e6fb34a --- /dev/null +++ b/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/lib/grappelli/templates/admin/_grappelli/app_index.html b/lib/grappelli/templates/admin/_grappelli/app_index.html new file mode 100644 index 0000000..e9cb806 --- /dev/null +++ b/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/lib/grappelli/templates/admin/_grappelli/base.html b/lib/grappelli/templates/admin/_grappelli/base.html new file mode 100644 index 0000000..16676b9 --- /dev/null +++ b/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/lib/grappelli/templates/admin/_grappelli/base_site.html b/lib/grappelli/templates/admin/_grappelli/base_site.html new file mode 100644 index 0000000..1f94985 --- /dev/null +++ b/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/lib/grappelli/templates/admin/_grappelli/index.html b/lib/grappelli/templates/admin/_grappelli/index.html new file mode 100644 index 0000000..8dedd3d --- /dev/null +++ b/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/lib/grappelli/templates/admin/_grappelli_admin_tools/app_index.html b/lib/grappelli/templates/admin/_grappelli_admin_tools/app_index.html new file mode 100644 index 0000000..bc896be --- /dev/null +++ b/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/lib/grappelli/templates/admin/_grappelli_admin_tools/base.html b/lib/grappelli/templates/admin/_grappelli_admin_tools/base.html new file mode 100644 index 0000000..742273a --- /dev/null +++ b/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/lib/grappelli/templates/admin/_grappelli_admin_tools/base_site.html b/lib/grappelli/templates/admin/_grappelli_admin_tools/base_site.html new file mode 100644 index 0000000..0012bb6 --- /dev/null +++ b/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/lib/grappelli/templates/admin/_grappelli_admin_tools/index.html b/lib/grappelli/templates/admin/_grappelli_admin_tools/index.html new file mode 100644 index 0000000..2f3bb13 --- /dev/null +++ b/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/lib/grappelli/templates/admin/actions.html b/lib/grappelli/templates/admin/actions.html new file mode 100644 index 0000000..588f503 --- /dev/null +++ b/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/lib/grappelli/templates/admin/app_index.html b/lib/grappelli/templates/admin/app_index.html new file mode 100644 index 0000000..a877e66 --- /dev/null +++ b/lib/grappelli/templates/admin/app_index.html @@ -0,0 +1 @@ +{% extends admin_template_app_index %}
\ No newline at end of file diff --git a/lib/grappelli/templates/admin/auth/user/add_form.html b/lib/grappelli/templates/admin/auth/user/add_form.html new file mode 100644 index 0000000..7431762 --- /dev/null +++ b/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/lib/grappelli/templates/admin/auth/user/change_password.html b/lib/grappelli/templates/admin/auth/user/change_password.html new file mode 100644 index 0000000..0a82cf7 --- /dev/null +++ b/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/lib/grappelli/templates/admin/base.html b/lib/grappelli/templates/admin/base.html new file mode 100644 index 0000000..1ba7a0d --- /dev/null +++ b/lib/grappelli/templates/admin/base.html @@ -0,0 +1 @@ +{% extends admin_template_base %}
\ No newline at end of file diff --git a/lib/grappelli/templates/admin/base_site.html b/lib/grappelli/templates/admin/base_site.html new file mode 100644 index 0000000..1c99d4d --- /dev/null +++ b/lib/grappelli/templates/admin/base_site.html @@ -0,0 +1 @@ +{% extends admin_template_base_site %}
\ No newline at end of file diff --git a/lib/grappelli/templates/admin/change_form.html b/lib/grappelli/templates/admin/change_form.html new file mode 100644 index 0000000..620b166 --- /dev/null +++ b/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/lib/grappelli/templates/admin/change_list.html b/lib/grappelli/templates/admin/change_list.html new file mode 100644 index 0000000..e407964 --- /dev/null +++ b/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/lib/grappelli/templates/admin/change_list_results.html b/lib/grappelli/templates/admin/change_list_results.html new file mode 100644 index 0000000..062b52e --- /dev/null +++ b/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/lib/grappelli/templates/admin/csv_export_selected_confirmation.html b/lib/grappelli/templates/admin/csv_export_selected_confirmation.html new file mode 100644 index 0000000..873bd87 --- /dev/null +++ b/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/lib/grappelli/templates/admin/date_hierarchy.html b/lib/grappelli/templates/admin/date_hierarchy.html new file mode 100644 index 0000000..25e3c6b --- /dev/null +++ b/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/lib/grappelli/templates/admin/delete_confirmation.html b/lib/grappelli/templates/admin/delete_confirmation.html new file mode 100644 index 0000000..f0cf7ad --- /dev/null +++ b/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/lib/grappelli/templates/admin/delete_selected_confirmation.html b/lib/grappelli/templates/admin/delete_selected_confirmation.html new file mode 100644 index 0000000..4e34d9f --- /dev/null +++ b/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/lib/grappelli/templates/admin/edit_inline/stacked.html b/lib/grappelli/templates/admin/edit_inline/stacked.html new file mode 100644 index 0000000..7112ba2 --- /dev/null +++ b/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/lib/grappelli/templates/admin/edit_inline/tabular.html b/lib/grappelli/templates/admin/edit_inline/tabular.html new file mode 100644 index 0000000..4d4ef94 --- /dev/null +++ b/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/lib/grappelli/templates/admin/filter.html b/lib/grappelli/templates/admin/filter.html new file mode 100644 index 0000000..07756b6 --- /dev/null +++ b/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/lib/grappelli/templates/admin/includes/fieldset.html b/lib/grappelli/templates/admin/includes/fieldset.html new file mode 100644 index 0000000..561a7e3 --- /dev/null +++ b/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/lib/grappelli/templates/admin/includes/fieldset_inline.html b/lib/grappelli/templates/admin/includes/fieldset_inline.html new file mode 100644 index 0000000..137dce9 --- /dev/null +++ b/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/lib/grappelli/templates/admin/includes_grappelli/header.html b/lib/grappelli/templates/admin/includes_grappelli/header.html new file mode 100644 index 0000000..77a0ad9 --- /dev/null +++ b/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/lib/grappelli/templates/admin/index.html b/lib/grappelli/templates/admin/index.html new file mode 100644 index 0000000..fbec3bc --- /dev/null +++ b/lib/grappelli/templates/admin/index.html @@ -0,0 +1 @@ +{% extends admin_template_index %}
\ No newline at end of file diff --git a/lib/grappelli/templates/admin/init.js b/lib/grappelli/templates/admin/init.js new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/lib/grappelli/templates/admin/init.js diff --git a/lib/grappelli/templates/admin/invalid_setup.html b/lib/grappelli/templates/admin/invalid_setup.html new file mode 100644 index 0000000..f3e097e --- /dev/null +++ b/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/lib/grappelli/templates/admin/login.html b/lib/grappelli/templates/admin/login.html new file mode 100644 index 0000000..6f12b71 --- /dev/null +++ b/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/lib/grappelli/templates/admin/object_history.html b/lib/grappelli/templates/admin/object_history.html new file mode 100644 index 0000000..1058fc9 --- /dev/null +++ b/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/lib/grappelli/templates/admin/pagination.html b/lib/grappelli/templates/admin/pagination.html new file mode 100644 index 0000000..ecd0859 --- /dev/null +++ b/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/lib/grappelli/templates/admin/prepopulated_fields_js.html b/lib/grappelli/templates/admin/prepopulated_fields_js.html new file mode 100644 index 0000000..7ab79e9 --- /dev/null +++ b/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/lib/grappelli/templates/admin/search_form.html b/lib/grappelli/templates/admin/search_form.html new file mode 100644 index 0000000..48c4184 --- /dev/null +++ b/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/lib/grappelli/templates/admin/submit_line.html b/lib/grappelli/templates/admin/submit_line.html new file mode 100644 index 0000000..4f06ac5 --- /dev/null +++ b/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/lib/grappelli/templates/admin/template_validator.html b/lib/grappelli/templates/admin/template_validator.html new file mode 100644 index 0000000..219c442 --- /dev/null +++ b/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 %} |