Commit graph

9387 commits

Author SHA1 Message Date
Karl Hobley
82464f6cdd Removed serialize_fields method 2015-08-15 18:18:00 +01:00
Karl Hobley
dd37d3f5ff Made page parent into a DRF field
This adds a bit of messy code into endpoints.py. I'll clean that up in a later PR

Ref: https://github.com/torchbox/wagtail/pull/1579#discussion_r36741886
2015-08-15 18:18:00 +01:00
Karl Hobley
a6462a3ab7 Made "meta" its own field type
Ref: https://github.com/torchbox/wagtail/pull/1579#discussion_r36741624
2015-08-15 18:18:00 +01:00
Karl Hobley
8d6c200e88 Let DRF handle the id field
Ref: https://github.com/torchbox/wagtail/pull/1579#discussion_r36741624
2015-08-15 16:35:00 +01:00
Matt Westcott
8c583e68d8 decorate wrapper functions with functools.wraps 2015-08-15 16:51:55 +02:00
Matt Westcott
a8e7200b1a use triple-quoted string for docstring 2015-08-15 16:46:37 +02:00
Matt Westcott
f8e08929eb Remove unused import of ContentType 2015-08-15 02:39:31 +02:00
Matt Westcott
164013bd43 When registering user/group permissions, specify add/change/delete permissions explicitly.
This ensures that we don't pull in any other permissions that may happen to exist (but are not relevant to the Wagtail admin). Also, ensure that we pick up the appropriate user model as returned by get_user_model, as this is the one used for permission checks in the views.
2015-08-15 02:39:31 +02:00
Matt Westcott
45e3354a44 Check add/change/delete permissions as appropriate within user admin UI
...instead of using change_user for everything
2015-08-15 02:39:30 +02:00
Matt Westcott
e1f4b9a68c Show groups menu item iff user has add, change or delete permission on groups (rather than checking 'auth' permissions en masse) 2015-08-15 02:39:30 +02:00
Matt Westcott
90b009583e Convert remaining permission_required decorators to the wagtailadmin one 2015-08-15 02:39:30 +02:00
Matt Westcott
2c948bbe15 Remove redundant access_admin permission check from styleguide.
All admin views added through register_admin_urls have this applied automatically.
2015-08-15 02:39:30 +02:00
Matt Westcott
7d32c55d7f Add a permission_required decorator as a non-broken replacement for Django's one.
This is functionally equivalent to any_permission_required with a single permission passed, but it's better to make permission_required its own thing so that developers don't have the mental hurdle of seeing an unfamiliar decorator and wondering what 'any' refers to...
2015-08-15 02:39:30 +02:00
Matt Westcott
b3a55a3588 Make documents admin usable by users who have change_document permission but not add_document 2015-08-15 02:39:30 +02:00
Matt Westcott
169eb8a85c Make images admin usable by users who have change_image permission but not add_image 2015-08-15 02:39:29 +02:00
Matt Westcott
04b95ce99e Remove 'delete' permission checkboxes for image and document.
For these models, permission to edit implies permission to delete, so the delete permission is redundant.
2015-08-15 02:39:29 +02:00
Matt Westcott
d11f8efc80 Remove 'user profile' from the set of registered permission types.
This is never used, as Wagtail has no interface for editing user profiles; if one were to exist, it would make more sense for this to be linked to User permissions.
2015-08-15 02:39:29 +02:00
Karl Hobley
5d0c4caf3b Search results messages
- Number of items matched
 - Different message when no items found
2015-08-14 15:50:48 +01:00
Karl Hobley
f9632b98d3 JavaScript for snippet chooser search 2015-08-14 15:50:48 +01:00
Karl Hobley
8ed3b79706 Use main listing template in chooser 2015-08-14 15:50:48 +01:00
Karl Hobley
aa4edc67d3 Snippets chooser pagination now fetches results.html
Instead of going through modal workflow. This is similar to how the chooser works elsewhere in wagtail
2015-08-14 15:50:48 +01:00
Karl Hobley
cc66159441 Added snippet chooser results template
So search results can be loaded with ajax
2015-08-14 15:50:47 +01:00
Karl Hobley
eddc129a69 Added search form to snippets chooser 2015-08-14 15:50:47 +01:00
Karl Hobley
d43fa39f89 Ajaxify snippet search 2015-08-14 15:50:47 +01:00
Karl Hobley
9fced68f89 Add search to snippet chooser view 2015-08-14 15:50:47 +01:00
Karl Hobley
3efbac7dfc Added search to snippet listing view 2015-08-14 15:50:47 +01:00
Karl Hobley
f8a4ff4e6a Added SearchableSnippet test model 2015-08-14 13:58:52 +01:00
Matt Westcott
371c9dc9a5 Merge branch 'kaedroho-fetch-translations' 2015-08-14 13:11:26 +02:00
Karl Hobley
ce743768f5 Fetched translations from transfex 2015-08-14 10:58:35 +01:00
Matt Westcott
a1886d4d5b fix another styleguide link missed when converting to namespaced URLs 2015-08-14 11:44:06 +02:00
Karl Hobley
6a9a80a16d Don't reopen files that are from external hosting
Fixes #1397
2015-08-13 17:28:20 +01:00
Karl Hobley
20036e5b5f Implemented Image.is_stored_locally helper function 2015-08-13 17:19:47 +01:00
Karl Hobley
870ce11bd6 Failing tests for #1397
Testing the following with an external image backend:
 - Uploading through image chooser (fails)
 - Visiting the edit page of an image with a null file_size (fails)
 - Editing an image, changing the image file
 - Adding a new image

The latter two do not fail, I thought I'd add them to reduce risk of regressions in the future
2015-08-13 16:59:08 +01:00
Karl Hobley
ef73c7ec12 Use wagtailsearch in page chooser 2015-08-13 14:51:15 +01:00
Matt Westcott
7785beecc6 Allow AdminPageChooser edit link to be hidden, and hide it on the page permissions interface 2015-08-12 17:08:22 +01:00
Matt Westcott
7c26217ea0 Remove 'Clear choice' action from page chooser in page permissions interface.
This appeared because we reassigned the field's 'widget' attribute after the field was initialised - this means that the field never gets to pass its 'required=True' flag on to the widget. We avoid this by defining the field as a whole, in the Django-approved way (which also means we don't need to override __init__).
2015-08-12 16:13:44 +01:00
Alex Gleason
af901c3706 Fixes #1298 2015-08-11 23:01:39 -05:00
Matt Westcott
e867b48446 Merge pull request #1593 from torchbox/revert-1581-multiple-page-types-in-page-chooser
Revert "Multiple page types in page chooser"
2015-08-11 18:00:25 +01:00
Matt Westcott
85707d5925 Revert "Multiple page types in page chooser" 2015-08-11 18:00:05 +01:00
Matt Westcott
31c6198afb Merge pull request #1592 from torchbox/revert-1590-fix-1581
Revert "Fix a couple of bugs in #1581"
2015-08-11 17:59:49 +01:00
Matt Westcott
90ebd2ed73 Revert "Fix a couple of bugs in #1581" 2015-08-11 17:59:38 +01:00
Karl Hobley
e1cb885de2 Merge pull request #1590 from kaedroho/fix-1581
Fix a couple of bugs in #1581
2015-08-11 17:08:44 +01:00
Karl Hobley
3550a17401 Fix crash
content_types is a dictionary of model classes => content types.

content_type__in requires a list of content types so .values() is called
2015-08-11 16:44:37 +01:00
Karl Hobley
4aabac1bdc JS changes for #1581
These got lost somehow...
2015-08-11 16:43:57 +01:00
Tom Dyson
f8d2a9f456 Merge pull request #1565 from gasman/fix/remove-menu-classes
Remove all menu-{section_name} classnames on the <body> element and menu item <li>s
2015-08-11 12:39:03 +01:00
Tom Dyson
de78b8d609 Merge pull request #1573 from kaedroho/fix-editorspicks-references
Fixed a couple of references to editors picks
2015-08-11 12:33:44 +01:00
Michael van Tellingen
51bf76ba70 Don't call Site.get_root_paths() twice in Page.url property 2015-08-08 15:54:01 +02:00
hanpama
de3d22b8da Correct omitted parameter in assertion 2015-08-08 02:34:38 +09:00
hanpama
4f761136d4 Remove unused local var and Fix some indentations 2015-08-07 22:12:38 +09:00
hanpama
e819de91b5 Fix URL names with namespace 2015-08-07 22:03:10 +09:00