Commit graph

232 commits

Author SHA1 Message Date
Gregor Müllegger
42d89a7585 Moving permission checking from AdminModel2Mixin to PermissionMixin were it belongs. 2013-05-29 10:47:45 +02:00
Gregor Müllegger
2771d160a7 Using new permission handling in templates. 2013-05-29 10:47:45 +02:00
Gregor Müllegger
8c88362197 Removing old permission handling. 2013-05-29 10:44:22 +02:00
Gregor Müllegger
d0635b79c3 Adding a IsSuperuserPermission class. 2013-05-29 10:44:22 +02:00
Gregor Müllegger
02a68faadd Adding more information to the docstring of the template permission handler. 2013-05-29 10:44:22 +02:00
Gregor Müllegger
635bbca553 Adding |for_view filter to bind permissions for a view name. 2013-05-29 10:44:22 +02:00
Gregor Müllegger
9ce77ae572 Adding possibility to traverse permissions by admin name. 2013-05-29 10:44:22 +02:00
Gregor Müllegger
2aca9df7e2 Adding possibility to swap model admin that is checked for permissions in the template. 2013-05-29 10:44:22 +02:00
Gregor Müllegger
c6a11efca8 Adding ability to check for permissions of any registered model admin in the templates. 2013-05-29 10:44:22 +02:00
Gregor Müllegger
e7cadd5ab5 Allow ModelAdmin2 instances to have names. 2013-05-29 10:44:22 +02:00
Gregor Müllegger
65d54083ce Adding reference documentation for permission handling. 2013-05-29 10:44:22 +02:00
Gregor Müllegger
ab778191c6 Adding the ability to check for permissions in templates. 2013-05-29 10:44:22 +02:00
Gregor Müllegger
324cdbaa17 Moving permission logic of views into its own mixin. Also allow to check permission on other views via the PermissionMixin. 2013-05-29 10:43:09 +02:00
Gregor Müllegger
0c7615b733 Implementing a class-based permission handling. 2013-05-29 10:43:09 +02:00
Andrew Ingram
23b0389c1a Rename app-index view to app_index 2013-05-28 13:24:18 +01:00
Andrew Ingram
3bb555fb56 add missing test for utils.model_app_label 2013-05-28 13:24:02 +01:00
Andrew Ingram
9f41c3f56e Initial stab at breadcrumbs
There's currently a lot of copy-pasting of breadcrumbs, this can be revisited once we have a better understanding of how we're going to handle navigation.

I've also tried to make template context variables more logical and consistent throughout.
2013-05-26 01:55:43 +01:00
Daniel Greenfeld
a94416d99e Merge pull request #149 from AndrewIngram/l18n
Template internationalization
2013-05-25 14:26:00 -07:00
Andrew Ingram
a4d77a9309 Template internationalization 2013-05-25 18:44:48 +01:00
Ben Tappin
c79f53bb02 Add tests for admin2 templatetags and fix bug. 2013-05-25 16:45:26 +01:00
Daniel Greenfeld
906b8cbf4e Adding endline to bump things forward 2013-05-24 20:48:43 +02:00
Daniel Greenfeld
99204be715 Added tests for djadmin.utils 2013-05-24 16:22:54 +02:00
Ben Tappin
30cacb7569 Use PK instead of ID in the model list view and template. 2013-05-24 12:06:35 +01:00
Daniel Greenfeld
0236a5cc07 small correction on model naming 2013-05-23 22:34:15 +02:00
Daniel Greenfeld
a3eea0aaf9 Merge branch 'bugfix/delete-action-message-display' of git://github.com/chrislawlor/django-admin2 into chrislawlor-bugfix/delete-action-message-display 2013-05-23 22:30:24 +02:00
Daniel Greenfeld
dca4d849d7 Merge branch 'floppify-auth-forms' of git://github.com/gregmuellegger/django-admin2 into gregmuellegger-floppify-auth-forms 2013-05-23 22:25:16 +02:00
Chris Lawlor
396f49665e Fixes message display after action handling.
Calls unicode to force encoding of object name to a localized
unicode string. Also fixes deleted object count by saving
len(queryset) to a local var before calling queryset.delete(), as
the len after queryset.delete() is always zero.
2013-05-23 15:37:50 -04:00
Gregor Müllegger
d10838c2ed Don't copy input_type attribute from original widget when the floppyform widget has a much more appropriate HTML5 type. 2013-05-23 20:59:35 +02:00
Daniel Greenfeld
5f1f91167f test cleanup 2013-05-23 20:22:44 +02:00
Daniel Greenfeld
0092325262 Used filters to present results of views better for #128 2013-05-23 20:11:04 +02:00
Daniel Greenfeld
611b34fd64 Wrapped all calls to model._meta with model_options function. fix #134 2013-05-23 20:00:14 +02:00
Daniel Greenfeld
d8409a2070 For #134, this moves many independant functions to the utils module and begins conversion of naked ._meta use to using the utils.model_options wrapper 2013-05-23 19:46:03 +02:00
Daniel Greenfeld
638ae91756 PEP-8 work 2013-05-23 19:30:15 +02:00
Daniel Greenfeld
5129541154 merge and adding requirements for floppy-forms 2013-05-23 19:23:23 +02:00
Daniel Greenfeld
a62d3aceff merge conflict resolutions 2013-05-23 13:01:27 +02:00
Gregor Müllegger
77fa844184 Also take form field into account when floppifying widgets. That way all specific floppyform widgets will be used for modelforms (like EmailInput, NumberInput, etc.). 2013-05-22 22:16:03 +02:00
Gregor Müllegger
984b6fb8d4 Using own modelform_factory to produce forms that are using floppyforms widgets. That allows better customization in the frontend. 2013-05-22 19:29:51 +02:00
Gregor Müllegger
188c12d647 Implementing a modelform_factory that takes care of converting all widgets on the modelform to floppyform widgets if possible. 2013-05-22 19:29:12 +02:00
Daniel Greenfeld
af96990275 Move mixins to their own directory so the apiviews aren't directly importing from views 2013-05-22 18:40:53 +02:00
Daniel Greenfeld
cd82aad51b Merge pull request #132 from audreyr/cruft-cleanup
Remove unused Admin2Form class.
2013-05-22 09:01:10 -07:00
Peter Inglesby
ade92956d0 Handle actions by POSTing to ModelListView 2013-05-22 11:32:01 +01:00
Peter Inglesby
79e6dfad83 Add delete_selected action 2013-05-22 11:32:01 +01:00
Peter Inglesby
8b6b56a1a8 Add messages to base.html 2013-05-22 11:32:01 +01:00
Peter Inglesby
88c0ce4e9f Remove stray closing tag. 2013-05-22 11:32:01 +01:00
Audrey Roy
0d6ab93b84 Remove unused Admin2Form class. 2013-05-22 10:38:23 +02:00
Andrew Ingram
a1ce27d4c2 Improve the rendering of inline form sets 2013-05-22 01:06:25 +01:00
Andrew Ingram
05f69775b2 Merge remote-tracking branch 'origin/develop' into inline-formsets
Conflicts:
	djadmin2/templates/admin2/bootstrap/model_add_form.html
	djadmin2/templates/admin2/bootstrap/model_edit_form.html
	djadmin2/views.py
2013-05-22 00:58:53 +01:00
Audrey Roy
b79523c659 Refactor duplicate model add/edit forms. 2013-05-21 15:45:08 -07:00
Daniel Greenfeld
5836a1cb97 Merge branch 'develop' of https://github.com/twoscoops/django-admin2 into develop 2013-05-22 00:38:24 +02:00
Daniel Greenfeld
192229e513 Fix admin2_tags templatetag reference that was bad 2013-05-22 00:37:14 +02:00
Audrey Roy
16ceca0dfe Model edit form now reuses save logic 2013-05-21 23:50:50 +02:00
Daniel Greenfeld
ce835ffc79 Merge branch 'feature/save-options' of git://github.com/chrislawlor/django-admin2 into chrislawlor-feature/save-options 2013-05-21 23:18:53 +02:00
Chris Lawlor
f66ffe8c86 Use admin2_url, redirect create form to index view.
Uses the template tag admin2_url to create namespaced view names
from inside of views.

Create model form now redirects to the model index page, as
django.contrib.admin. does.

Removed get_success_url from ModelListView, as generic.ListView
does not call this method.
2013-05-21 14:01:30 -04:00
Andrew Ingram
c051b8807a Merge remote-tracking branch 'origin/develop' into inline-formsets 2013-05-21 00:11:28 +01:00
Andrew Ingram
262c759604 Merge remote-tracking branch 'origin/develop' into rename-templatetag-module 2013-05-21 00:05:25 +01:00
Andrew Ingram
3dcaeb4023 rename admin2_urls to admin2_tags 2013-05-20 23:45:22 +01:00
Daniel Greenfeld
0e03d7a5b0 bike shedding 2013-05-21 00:25:38 +02:00
Audrey Roy
55168a0ea0 Fix delete text to match original admin. 2013-05-20 23:33:37 +02:00
Chris Lawlor
f9a1540e09 Add 'title' and 'page_title' template blocks.
Makes template page title styling consistent across all templates.
2013-05-20 16:17:44 -04:00
Daniel Greenfeld
21a4f94359 Merge pull request #115 from chrislawlor/feature/template-context-refactor
Adds model name to AdminModel2Mixin template context.
2013-05-20 10:38:19 -07:00
Daniel Greenfeld
2b4449a769 Merge pull request #117 from chrislawlor/feature/model-create-page-title
Adds page title to model create page
2013-05-20 10:37:47 -07:00
Daniel Greenfeld
baf573bf11 Added immutable admin object per #99 2013-05-20 18:45:59 +02:00
Daniel Greenfeld
4f08ea2165 PEP-8 before working on #99 2013-05-20 18:09:58 +02:00
Daniel Greenfeld
b9ca57bd00 PEP-8 before working on #99 2013-05-20 18:04:51 +02:00
Chris Lawlor
3d2b347063 Adds model name to AdminModel2Mixin template context.
All views subclassing AdminModel2Mixin will need the model
name in their template context, so moving it to the base
class so child views don't all have to override
get_context_data.
2013-05-20 10:34:35 -04:00
Chris Lawlor
32f5e4802f Adds page title to model create page 2013-05-20 09:07:19 -04:00
Chris Lawlor
c6c44bbdd0 Implements model save options, issue #110 2013-05-20 08:45:34 -04:00
Daniel Greenfeld
999eb32d74 Adding warnings about refactoring 2013-05-20 00:50:41 +02:00
Daniel Greenfeld
a2f73e0fb5 Merge pull request #108 from ludw/headerui
Header UI style
2013-05-19 15:46:32 -07:00
Daniel Greenfeld
83eb8da62a Merge pull request #107 from ludw/master
Fixed small issue in modellistview
2013-05-19 15:45:57 -07:00
Ludvig Wadenstein
7c08296772 Fixed bug with modellist if more than one item 2013-05-19 20:56:41 +02:00
Ludvig Wadenstein
36491b4894 Replaced change password and logout links with dropdown 2013-05-19 20:46:14 +02:00
Andrew Ingram
c625a80eaa Merge remote-tracking branch 'origin/master' into inline-formsets
Conflicts:
	djadmin2/templates/admin2/bootstrap/model_edit_form.html
2013-05-19 19:17:51 +01:00
Daniel Greenfeld
234d2a9a6f Prep for version 0.2.0 2013-05-19 17:23:58 +02:00
Daniel Greenfeld
6a351eb466 Merge pull request #104 from audreyr/edit-form-enhancements-72
Edit form improvement - part of #72
2013-05-19 08:18:57 -07:00
Daniel Greenfeld
4d44d3e534 warnings in models 2013-05-19 17:19:18 +02:00
Audrey Roy
b19b477888 Edit form improvement - part of #72 2013-05-19 17:13:20 +02:00
Daniel Greenfeld
0859342ae4 Merge pull request #97 from RaphaelKimmig/rename-modeladmin-model_admin
rename modeladmin to model_admin fixes #91
2013-05-19 07:30:40 -07:00
Raphael Kimmig
973ec97b2e Merge remote-tracking branch 'upstream/master' into rename-modeladmin-model_admin
Conflicts:
	djadmin2/core.py
	djadmin2/templates/admin2/bootstrap/index.html
	djadmin2/views.py
2013-05-19 15:45:24 +02:00
Gregor Müllegger
e745291445 Fixing issue that permissions cannot be hyperlinked from users and group API resource. 2013-05-19 15:32:51 +02:00
Raphael Kimmig
603db79ca1 rename modeladmin to model_admin fixes #91 2013-05-19 15:16:21 +02:00
Daniel Greenfeld
4f5eb65d5c Merge pull request #92 from ludw/modellistui
Modellist UI cleaned up, #78
2013-05-19 06:05:57 -07:00
Daniel Greenfeld
0c1238dff6 Merge pull request #90 from gregmuellegger/rest-api-integration
Rest api integration
2013-05-19 05:48:51 -07:00
Daniel Greenfeld
7597e045a3 fix a merge mistake by yours truly. 2013-05-19 14:46:35 +02:00
Daniel Greenfeld
b4d4a6bde7 merge of @RaphaelKimmig's work 2013-05-19 14:44:27 +02:00
Daniel Greenfeld
594d6f9b27 Documentation and cleanup of core 2013-05-19 14:38:27 +02:00
Ludvig Wadenstein
bff0269729 Replaced edit detail delete with just a link to edit 2013-05-19 14:32:58 +02:00
Ludvig Wadenstein
ed9f1c3b69 More style changes on model list 2013-05-19 14:29:29 +02:00
Daniel Greenfeld
0e63bc8e7e Merge branch 'master' of github.com:pydanny/django-admin2 2013-05-19 14:26:54 +02:00
Gregor Müllegger
cd625a6046 Fixing a bug that was introduced during rebasing. 2013-05-19 14:26:10 +02:00
Daniel Greenfeld
539dac9957 remove unnecessary exceptions file 2013-05-19 14:26:03 +02:00
Gregor Müllegger
dc0ecdfe0c Adding a link to the API from the admin frontend. 2013-05-19 14:23:19 +02:00
Gregor Müllegger
0da7584e99 We don't need detail pages for apps in the API. 2013-05-19 14:23:18 +02:00
Gregor Müllegger
fe140bbf39 Integrating the new app registry so that the API can generate a nice index page. 2013-05-19 14:23:18 +02:00
Gregor Müllegger
4e03b7ce16 Fixing called function for API index view kwargs. 2013-05-19 14:23:18 +02:00
Gregor Müllegger
bc899a9389 Adding support for pagination. 2013-05-19 14:23:18 +02:00
Gregor Müllegger
8ea3b97786 Using django's TestCase and instead of the one from unittest. 2013-05-19 14:23:18 +02:00
Gregor Müllegger
631727d0f0 Tests for the API index view. 2013-05-19 14:23:18 +02:00
Gregor Müllegger
09dd2095e3 Fixing names for views beeing more consistent and tests for API views. 2013-05-19 14:22:50 +02:00
Gregor Müllegger
73a41f5632 Fixing tests for API. 2013-05-19 14:22:18 +02:00