From 62c101767e4e7eddca2876f88de779f5b481ee1c Mon Sep 17 00:00:00 2001 From: Harris Lapiroff Date: Wed, 22 May 2013 15:08:05 -0400 Subject: [PATCH 1/6] Bumped grappelli requirement. --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 8a91d14..23062d9 100644 --- a/setup.py +++ b/setup.py @@ -36,7 +36,7 @@ ], extras_require = { 'docs': ["sphinx>=1.0"], - 'grappelli': ['django-grappelli>=2.3'], + 'grappelli': ['django-grappelli>=2.4'], 'migrations': ['south>=0.7.2'], 'waldo-recaptcha': ['recaptcha-django'], 'sobol-eventlet': ['eventlet'], From 7813ef8949ef456fa97d54283e302efcb8cef0c1 Mon Sep 17 00:00:00 2001 From: Harris Lapiroff Date: Wed, 22 May 2013 15:28:31 -0400 Subject: [PATCH 2/6] Updated attribute table to use newstyle grappelli namespaced classes. --- .../grappelli_tabular_attribute.html | 50 ++++++++++--------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/philo/templates/admin/philo/edit_inline/grappelli_tabular_attribute.html b/philo/templates/admin/philo/edit_inline/grappelli_tabular_attribute.html index 25c1ac4..2546faa 100644 --- a/philo/templates/admin/philo/edit_inline/grappelli_tabular_attribute.html +++ b/philo/templates/admin/philo/edit_inline/grappelli_tabular_attribute.html @@ -1,31 +1,31 @@ {% load i18n adminmedia grp_tags %} -
-

{{ inline_admin_formset.opts.verbose_name_plural|capfirst }}

-
    +

    {{ inline_admin_formset.opts.verbose_name_plural|capfirst }}

    + {{ inline_admin_formset.formset.management_form }} {{ inline_admin_formset.formset.non_form_errors }} -
    -
    -
    +
    +
    +
    {% for field in inline_admin_formset.fields %} {% if not field.widget.is_hidden %} -
    {{ field.label|capfirst }}
    +
    {{ field.label|capfirst }}
    {% endif %} {% endfor %} -
    Content type
    -
    Value
    +
    Content type
    +
    Value
    {% if inline_admin_formset.formset.can_delete %}
     
    {% endif %}
    {% for inline_admin_form in inline_admin_formset %} -
    {% if inline_admin_form.form.non_field_errors %}
    • {{ inline_admin_form.form.non_field_errors }}
    @@ -40,11 +40,11 @@

    {{ inline_admin_formset.opts.verbose_name|title }} {% endfor %} {% endfor %} {% endspaceless %} -
    +
    {% for fieldset in inline_admin_form %} {% for line in fieldset %} {% for field in line %} -
    +
    {% if field.is_readonly %}

    {{ field.contents }}

    {% else %} @@ -55,16 +55,16 @@

    {{ inline_admin_formset.opts.verbose_name|title }} {% endfor %} {% endfor %} {% endfor %} - {% with inline_admin_form.form.content_type as field %}
    {{ field }}{{ field.errors.as_ul }}
    {% endwith %} - {% with inline_admin_form.form.value as field %}
    {{ field }}{{ field.errors.as_ul }}
    {% endwith %} -
    + {% with inline_admin_form.form.content_type as field %}
    {{ field }}{{ field.errors.as_ul }}
    {% endwith %} + {% with inline_admin_form.form.value as field %}
    {{ field }}{{ field.errors.as_ul }}
    {% endwith %} +
    {% spaceless %} -
      - {% if inline_admin_form.show_url %}{% endif %} +
        + {% if inline_admin_form.show_url %}{% endif %} {% if inline_admin_formset.opts.sortable_field_name %} -
      • +
      • {% endif %} - {% if inline_admin_formset.formset.can_delete %}
      • {{ inline_admin_form.deletion_field.field }} {% endif %} + {% if inline_admin_formset.formset.can_delete %}
      • {{ inline_admin_form.deletion_field.field }} {% endif %}
      {% endspaceless %}
    @@ -74,11 +74,13 @@

    {{ inline_admin_formset.opts.verbose_name|title }}

    {% endfor %}

    - From a57a9cb0fa65367cc925810ba7386e8fc69a339b Mon Sep 17 00:00:00 2001 From: Harris Lapiroff Date: Wed, 22 May 2013 15:41:31 -0400 Subject: [PATCH 3/6] Fixed up container editing to use new grappelli classes and HTML structure. --- .../edit_inline/grappelli_tabular_container.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/philo/templates/admin/philo/edit_inline/grappelli_tabular_container.html b/philo/templates/admin/philo/edit_inline/grappelli_tabular_container.html index 621fea6..3a29120 100644 --- a/philo/templates/admin/philo/edit_inline/grappelli_tabular_container.html +++ b/philo/templates/admin/philo/edit_inline/grappelli_tabular_container.html @@ -4,8 +4,8 @@ {{ inline_admin_formset.formset.management_form }} {% comment %}Don't render the formset at all if there aren't any forms.{% endcomment %} {% if inline_admin_formset.formset.forms %} -
    - {{ inline_admin_formset.opts.verbose_name_plural|capfirst }}

    +
    + {{ inline_admin_formset.opts.verbose_name_plural|capfirst }} {{ inline_admin_formset.formset.non_form_errors }} {% for inline_admin_form in inline_admin_formset %} {% if inline_admin_form.has_auto_field %}{{ inline_admin_form.pk_field.field }}{% endif %} @@ -20,14 +20,14 @@ {% endfor %}{% endspaceless %} {% endfor %} {% for form in inline_admin_formset.formset.forms %} -
    +
    {{ form.non_field_errors }} -
    +
    {% for field in form %} {% if not field.is_hidden %} {% comment %}This will be true for one field: the content/content reference{% endcomment %} -
    -
    +
    +
    {{ field }} {{ field.errors }} {% if field.field.help_text %} From 40031e3385aa834a2a9ed4e1a3b2cdc833ca863c Mon Sep 17 00:00:00 2001 From: Harris Lapiroff Date: Wed, 22 May 2013 16:00:03 -0400 Subject: [PATCH 4/6] Cleanup to EmbedWidget styles and javascript. --- philo/static/philo/css/EmbedWidget.css | 24 ++---------------------- philo/static/philo/js/EmbedWidget.js | 7 ++++--- 2 files changed, 6 insertions(+), 25 deletions(-) diff --git a/philo/static/philo/css/EmbedWidget.css b/philo/static/philo/css/EmbedWidget.css index 6741034..fd31767 100644 --- a/philo/static/philo/css/EmbedWidget.css +++ b/philo/static/philo/css/EmbedWidget.css @@ -10,27 +10,7 @@ background-color:#EEE; } .embed-widget textarea{ - margin-top:0; -} -.embed-widget button, .embed-widget select{ - vertical-align:middle; - margin-right:3px; -} -.embed-toolbar button{ - background:#FFF; - border:1px solid #CCC; - border-radius:3px; - -webkit-border-radius:3px; - -moz-border-radius:3px; - color:#666; -} -.embed-toolbar button:hover{ - color:#444; -} -.embed-toolbar button:active{ - color:#FFF; - background:#666; - border-color:#666; + margin-top: 0; } .grappelli .embed-widget{ @@ -48,4 +28,4 @@ padding-bottom:3px; background:none; border:none; -} \ No newline at end of file +} diff --git a/philo/static/philo/js/EmbedWidget.js b/philo/static/philo/js/EmbedWidget.js index 7293125..abad617 100644 --- a/philo/static/philo/js/EmbedWidget.js +++ b/philo/static/philo/js/EmbedWidget.js @@ -9,13 +9,14 @@ EmbedWidgets = widget.EmbedWidgets, EmbedBars = widget.EmbedBars, EmbedButtons = widget.EmbedButtons, - EmbedSelects = widget.EmbedSelects; + EmbedSelects = widget.EmbedSelects, + LoupeImageUrl = 'grappelli' in window ? "/grapelli/img/admin/selector-search.gif" : __admin_media_prefix__ + "img/selector-search.gif"; EmbedFields.wrap($('
    ')); EmbedWidgets = $('.embed-widget'); EmbedWidgets.prepend($('
    ')); EmbedBars = $('.embed-toolbar'); - EmbedBars.append(''); + EmbedBars.append(' Lookup'); EmbedButtons = $('.embed-button'); EmbedSelects = $('.embed-select'); @@ -85,7 +86,7 @@ optgroup_el, group; // append a title - $this.append(''); + $this.append(''); // for each group for (name in optgroups){ From 35dfa1ff1ddf6b5fd2e9d01e4690b95333ca27f3 Mon Sep 17 00:00:00 2001 From: Harris Lapiroff Date: Wed, 22 May 2013 16:04:43 -0400 Subject: [PATCH 5/6] Updated requirements listed in readme to be accurate. --- README | 2 +- README.markdown | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README b/README index 19977cd..c6fdd44 100644 --- a/README +++ b/README @@ -4,7 +4,7 @@ Prerequisites: * Python 2.5.4+ * Django 1.3+ * django-mptt e734079+ - * (optional) django-grappelli 2.0+ + * (optional) django-grappelli 2.4+ * (optional) south 0.7.2+ * (philo.contrib.penfield) django-taggit 0.9.3+ * (philo.contrib.waldo, optional) recaptcha-django r6+ diff --git a/README.markdown b/README.markdown index 2653f52..74a1438 100644 --- a/README.markdown +++ b/README.markdown @@ -5,7 +5,7 @@ Prerequisites: * [Python 2.5.4+](http://www.python.org/) * [Django 1.3+](http://www.djangoproject.com/) * [django-mptt e734079+](https://github.com/django-mptt/django-mptt/) - * (optional) [django-grappelli 2.0+](http://code.google.com/p/django-grappelli/) + * (optional) [django-grappelli 2.4+](https://github.com/sehmaschine/django-grappelli/) * (optional) [south 0.7.2+](http://south.aeracode.org/) * (philo.contrib.penfield) [django-taggit 0.9.3+](https://github.com/alex/django-taggit/) * (philo.contrib.waldo, optional) [recaptcha-django r6+](http://code.google.com/p/recaptcha-django/) From 8b49d612c386dd7f4c489e9ec7ae2f69146130a5 Mon Sep 17 00:00:00 2001 From: Harris Lapiroff Date: Wed, 22 May 2013 16:15:02 -0400 Subject: [PATCH 6/6] Added a label to the embed widget, because the new design is sort of unclear. --- philo/static/philo/css/EmbedWidget.css | 2 +- philo/static/philo/js/EmbedWidget.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/philo/static/philo/css/EmbedWidget.css b/philo/static/philo/css/EmbedWidget.css index fd31767..e986c89 100644 --- a/philo/static/philo/css/EmbedWidget.css +++ b/philo/static/philo/css/EmbedWidget.css @@ -24,7 +24,7 @@ margin:0 -3px; } .grappelli .embed-toolbar{ - padding:0; + padding:0 5px; padding-bottom:3px; background:none; border:none; diff --git a/philo/static/philo/js/EmbedWidget.js b/philo/static/philo/js/EmbedWidget.js index abad617..934af0e 100644 --- a/philo/static/philo/js/EmbedWidget.js +++ b/philo/static/philo/js/EmbedWidget.js @@ -16,7 +16,7 @@ EmbedWidgets = $('.embed-widget'); EmbedWidgets.prepend($('
    ')); EmbedBars = $('.embed-toolbar'); - EmbedBars.append(' Lookup'); + EmbedBars.append('Embed Media: Lookup'); EmbedButtons = $('.embed-button'); EmbedSelects = $('.embed-select');