From 5e86c24c21136291aad91fab2ca455d4cf2b7418 Mon Sep 17 00:00:00 2001 From: Nick Smith Date: Tue, 25 Oct 2016 12:30:28 +0100 Subject: [PATCH 01/10] Convert AbstractMedia.search_fields to list --- setup.py | 2 +- wagtailmedia/models.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index a89b8c80..d36a34b1 100644 --- a/setup.py +++ b/setup.py @@ -50,7 +50,7 @@ ], install_requires=[ 'Django>=1.8.1,<1.10', - 'wagtail>=1.4', + 'wagtail>=1.5.3', ], extras_require={ 'testing': testing_extras, diff --git a/wagtailmedia/models.py b/wagtailmedia/models.py index b07886d9..d4d6e081 100644 --- a/wagtailmedia/models.py +++ b/wagtailmedia/models.py @@ -55,9 +55,9 @@ class AbstractMedia(CollectionMember, TagSearchable): objects = MediaQuerySet.as_manager() - search_fields = TagSearchable.search_fields + CollectionMember.search_fields + ( + search_fields = TagSearchable.search_fields + CollectionMember.search_fields + [ index.FilterField('uploaded_by_user'), - ) + ] def __str__(self): return self.title From 4eed0cd97304a4f5e00be1d65858a1bd64706af4 Mon Sep 17 00:00:00 2001 From: Nick Smith Date: Fri, 28 Oct 2016 10:53:24 +0100 Subject: [PATCH 02/10] Add .button class to buttons in admin Fixes #3 --- wagtailmedia/templates/wagtailmedia/media/add.html | 2 +- wagtailmedia/templates/wagtailmedia/media/confirm_delete.html | 2 +- wagtailmedia/templates/wagtailmedia/media/edit.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wagtailmedia/templates/wagtailmedia/media/add.html b/wagtailmedia/templates/wagtailmedia/media/add.html index 79f2a718..4cde251e 100644 --- a/wagtailmedia/templates/wagtailmedia/media/add.html +++ b/wagtailmedia/templates/wagtailmedia/media/add.html @@ -38,7 +38,7 @@ {% include "wagtailadmin/shared/field_as_li.html" with field=field %} {% endfor %}
  • - +
  • diff --git a/wagtailmedia/templates/wagtailmedia/media/confirm_delete.html b/wagtailmedia/templates/wagtailmedia/media/confirm_delete.html index 21140d9f..74f293fe 100644 --- a/wagtailmedia/templates/wagtailmedia/media/confirm_delete.html +++ b/wagtailmedia/templates/wagtailmedia/media/confirm_delete.html @@ -9,7 +9,7 @@

    {% trans "Are you sure you want to delete this media file?" %}

    {% csrf_token %} - +
    {% endblock %} diff --git a/wagtailmedia/templates/wagtailmedia/media/edit.html b/wagtailmedia/templates/wagtailmedia/media/edit.html index 17e91d40..bdeb15f5 100644 --- a/wagtailmedia/templates/wagtailmedia/media/edit.html +++ b/wagtailmedia/templates/wagtailmedia/media/edit.html @@ -36,7 +36,7 @@ {% endif %} {% endfor %}
  • - + {% if user_can_delete %} {% trans "Delete" %} {% endif %} From 0e86e35c381fca6f54223374fd67b695dd13dc97 Mon Sep 17 00:00:00 2001 From: Nick Smith Date: Fri, 28 Oct 2016 13:39:19 +0100 Subject: [PATCH 03/10] Disable HTML5 form validation Fixes #4 --- .../templates/wagtailmedia/chooser/chooser.html | 2 +- wagtailmedia/templates/wagtailmedia/media/add.html | 2 +- .../templates/wagtailmedia/media/confirm_delete.html | 2 +- wagtailmedia/templates/wagtailmedia/media/edit.html | 2 +- wagtailmedia/templates/wagtailmedia/media/index.html | 4 ++-- wagtailmedia/tests/test_views.py | 12 ++++++------ 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/wagtailmedia/templates/wagtailmedia/chooser/chooser.html b/wagtailmedia/templates/wagtailmedia/chooser/chooser.html index 50fb71dd..55d09af7 100644 --- a/wagtailmedia/templates/wagtailmedia/chooser/chooser.html +++ b/wagtailmedia/templates/wagtailmedia/chooser/chooser.html @@ -5,7 +5,7 @@