{% extends "admin/change_form.html" %}
{% load i18n cyclope_utils %}

{% block extrahead %}{{ block.super }}

<script type="text/javascript">
  $(function (){
     html = '<div class="form-row"><label for="id_colour_palette">{% trans "Colour palette" %}</label>'
            +'<select id="colour_palette"><option value=""></option>'
            +'{% for name, color in adminform.form.Meta.palette %}<option value="{{ color }}">{{ name }}</option>{% endfor %}'
            +'</select><p class="help">{% trans "You may pick a colour palette to start your design" %}</p></div>'
     $('fieldset.colours h2').after(html);
     $('#colour_palette').change(function(){
        var colours = this.value.split(',');
        var inputs = $('input.color');
        for (i in inputs){
          inputs[i].color.fromString(colours[i]);
        }
     });
});
</script>
{% endblock %}

{% block breadcrumbs %}{% if not is_popup %}
<div class="breadcrumbs">
     <a href="../../../">{% trans "Home" %}</a> &rsaquo; {{ opts.verbose_name }}
</div>
{% endif %}{% endblock %}
