Permalink
Browse files

Merge branch 'master' into pkg

Conflicts:
	docs/Makefile
	docs/conf.py
	docs/static/basic.css
	docs/static/default.css
	docs/static/doctools.js
	docs/static/jquery.js
	docs/static/pygments.css
	docs/static/searchtools.js
	docs/templates/defindex.html
	docs/templates/genindex-single.html
	docs/templates/genindex-split.html
	docs/templates/genindex.html
	docs/templates/layout.html
	docs/templates/modindex.html
	docs/templates/page.html
	docs/templates/search.html
  • Loading branch information...
2 parents c5ee3c1 + f0eb9c9 commit 57cf537ce37b44e616499294be871b1690ace532 Jonas Obrist committed Oct 13, 2010
Showing with 6,593 additions and 1,172 deletions.
  1. +3 −0 .gitignore
  2. +1 −1 MANIFEST.in
  3. +14 −1 README.md
  4. +3 −3 cms/__init__.py
  5. +8 −8 cms/admin/change_list.py
  6. +1 −1 cms/admin/dialog/views.py
  7. +17 −18 cms/admin/forms.py
  8. +5 −11 cms/admin/pageadmin.py
  9. +22 −18 cms/admin/placeholderadmin.py
  10. +4 −14 cms/admin/views.py
  11. +0 −90 cms/docs/contribution.txt
  12. +255 −366 cms/locale/it/LC_MESSAGES/django.po
  13. +15 −15 cms/locale/pl/LC_MESSAGES/django.po
  14. +1,927 −0 cms/locale/sv/LC_MESSAGES/django.po
  15. +37 −0 cms/locale/sv/LC_MESSAGES/djangojs.po
  16. +1 −1 cms/media/cms/js/change_list.js
  17. +2 −2 cms/middleware/media.py
  18. +203 −0 cms/migrations/0031_improved_language_code_support.py
  19. +8 −10 cms/models/__init__.py
  20. +4 −7 cms/models/fields.py
  21. +14 −14 cms/models/pagemodel.py
  22. +1 −1 cms/models/permissionmodels.py
  23. +6 −3 cms/models/placeholdermodel.py
  24. +9 −8 cms/models/pluginmodel.py
  25. +5 −8 cms/models/titlemodels.py
  26. +1 −1 cms/plugin_pool.py
  27. +1 −1 cms/plugins/file/migrations/0004_table_rename.py
  28. +1 −1 cms/plugins/flash/migrations/0004_table_rename.py
  29. +1 −1 cms/plugins/googlemap/migrations/0002_table_rename.py
  30. +1 −1 cms/plugins/link/migrations/0006_table_rename.py
  31. +1 −1 cms/plugins/picture/migrations/0005_table_rename.py
  32. +1 −1 cms/plugins/snippet/migrations/0003_table_rename.py
  33. +2 −2 cms/plugins/text/migrations/0004_table_rename.py
  34. +2 −2 cms/templates/cms/toolbar/toolbar.html
  35. +31 −47 cms/templatetags/cms_tags.py
  36. +3 −4 cms/tests/__init__.py
  37. +64 −6 cms/tests/base.py
  38. +9 −2 cms/tests/menu.py
  39. +52 −60 cms/tests/placeholder.py
  40. +2 −1 cms/tests/reversion_tests.py
  41. +1 −1 cms/urls.py
  42. +88 −0 docs/Makefile
  43. +137 −115 {cms → }/docs/app_integration.txt
  44. +206 −0 docs/conf.py
  45. +121 −79 {cms → }/docs/configuration.txt
  46. +97 −0 docs/contribution.txt
  47. +38 −37 {cms → }/docs/custom_plugins.txt
  48. 0 {cms → }/docs/i18n.txt
  49. +7 −3 {cms → }/docs/index.txt
  50. +7 −6 {cms → }/docs/installation.txt
  51. +3 −4 {cms → }/docs/navigation.txt
  52. +13 −1 {cms → }/docs/placeholders.txt
  53. +21 −20 {cms → }/docs/plugin_reference.txt
  54. +45 −37 {cms → }/docs/plugins.txt
  55. 0 {cms → }/docs/sitemap.txt
  56. +405 −0 docs/static/basic.css
  57. +210 −0 docs/static/default.css
  58. +231 −0 docs/static/doctools.js
  59. BIN {cms → }/docs/static/file.png
  60. +32 −0 docs/static/jquery.js
  61. BIN {cms → }/docs/static/minus.png
  62. BIN {cms → }/docs/static/plus.png
  63. +61 −0 docs/static/pygments.css
  64. BIN {cms → }/docs/static/screen1.png
  65. BIN {cms → }/docs/static/screen2.png
  66. BIN {cms → }/docs/static/screen3.png
  67. +467 −0 docs/static/searchtools.js
  68. +26 −0 docs/templates/defindex.html
  69. +46 −0 docs/templates/genindex-single.html
  70. +30 −0 docs/templates/genindex-split.html
  71. +57 −0 docs/templates/genindex.html
  72. +196 −0 docs/templates/layout.html
  73. +42 −0 docs/templates/modindex.html
  74. +4 −0 docs/templates/page.html
  75. +45 −0 docs/templates/search.html
  76. +5 −0 {cms → }/docs/templatetags.txt
  77. +40 −28 {cms → }/docs/tutorial.txt
  78. +3 −105 example/settings.py
  79. +3 −2 example/urls.py
  80. +1 −0 menus/menu_pool.py
  81. +7 −0 menus/settings.py
  82. +2 −2 menus/templatetags/menu_tags.py
  83. +19 −0 runtests.sh
  84. +0 −1 setup.py
  85. +121 −0 tests/bootstrap.py
  86. +35 −0 tests/buildout.cfg
  87. 0 example/cms → tests/testapp/__init__.py
  88. +16 −0 tests/testapp/manage.py
  89. 0 tests/testapp/models.py
  90. 0 tests/testapp/placeholderapp/__init__.py
  91. +72 −0 tests/testapp/placeholderapp/admin.py
  92. +38 −0 tests/testapp/placeholderapp/models.py
  93. 0 tests/testapp/sampleapp/__init__.py
  94. +10 −0 tests/testapp/sampleapp/admin.py
  95. +11 −0 tests/testapp/sampleapp/cms_app.py
  96. BIN tests/testapp/sampleapp/media/sampleapp/img/gift.jpg
  97. +62 −0 tests/testapp/sampleapp/menu.py
  98. +27 −0 tests/testapp/sampleapp/models.py
  99. +5 −0 tests/testapp/sampleapp/templates/sampleapp/category_view.html
  100. +21 −0 tests/testapp/sampleapp/templates/sampleapp/home.html
  101. +9 −0 tests/testapp/sampleapp/urls.py
  102. +11 −0 tests/testapp/sampleapp/views.py
  103. +180 −0 tests/testapp/settings.py
  104. +11 −0 tests/testapp/templates/404.html
  105. +42 −0 tests/testapp/templates/base.html
  106. +32 −0 tests/testapp/templates/col_three.html
  107. +24 −0 tests/testapp/templates/col_two.html
  108. +3 −0 tests/testapp/templates/menu/breadcrumb.html
  109. +4 −0 tests/testapp/templates/menu/language_chooser.html
  110. +22 −0 tests/testapp/templates/menu/menu.html
  111. +1 −0 tests/testapp/templates/menu/sub_menu.html
  112. +1 −0 tests/testapp/templates/menu/test_language_chooser.html
  113. +164 −0 tests/testapp/templates/nav_playground.html
  114. +13 −0 tests/testapp/templates/placeholder_tests/base.html
  115. +3 −0 tests/testapp/templates/placeholder_tests/child.html
  116. +14 −0 tests/testapp/templates/placeholder_tests/outside.html
  117. +11 −0 tests/testapp/templates/placeholder_tests/outside_base.html
  118. +21 −0 tests/testapp/templates/placeholder_tests/test_five.html
  119. +22 −0 tests/testapp/templates/placeholder_tests/test_four.html
  120. +16 −0 tests/testapp/templates/placeholder_tests/test_one.html
  121. +17 −0 tests/testapp/templates/placeholder_tests/test_seven.html
  122. +25 −0 tests/testapp/templates/placeholder_tests/test_six.html
  123. +17 −0 tests/testapp/templates/placeholder_tests/test_three.html
  124. +17 −0 tests/testapp/templates/placeholder_tests/test_two.html
  125. +3 −0 tests/testapp/templates/sidebar_submenu.html
  126. +9 −0 tests/testapp/templates/sidebar_submenu_root.html
  127. +7 −0 tests/testapp/testrunner.py
  128. +23 −0 tests/testapp/urls.py
View
@@ -6,11 +6,14 @@ cms/django
*.DS_Store
*.svn
.*
+*.xml
+cms.sqlite
cms/media/cms_page_media/
cms/docs/build
example/run
example/local_settings.py
reversion/
+htmlcov
build
dist
.ropeproject
View
@@ -5,7 +5,7 @@ include CHANGELOG.txt
recursive-include cms/locale *
recursive-include cms/templates *
recursive-include cms/media *
-recursive-include cms/docs *.txt *.png
recursive-include cms/plugins *
recursive-include menus/templates *
recursive-include mptt/tests/fixtures *.json
+recursive-include docs *
View
@@ -43,7 +43,20 @@ Installation instructions can be found [here](http://www.django-cms.org/en/docum
Sourcecode
----------
-Can be found [here](http://github.com/digi604/django-cms-2.0/) on github.
+Can be found [here](http://github.com/divio/django-cms/) on github.
+
+Running tests
+-------------
+
+`virtualenv` is highly recommended to run tests.
+
+Here's a quick drilldown on how this should work on a unix system:
+- virtualenv --no-site-packages <this directory>
+- source bin/activate
+- ./runtests.sh
+
+The first run will bork and complain about PIL (since it's not always available as an egg, it's not in the dependencies).
+Running `easy_install pil` should take care of it on linuxes.
Help
----
View
@@ -1,7 +1,7 @@
VERSION = (2, 1, 0, 'beta3')
-if VERSION[-1] != "final":
+if VERSION[-1] != "final": # pragma: no cover
__version__ = '.'.join(map(str, VERSION))
-else:
+else: # pragma: no cover
__version__ = '.'.join(map(str, VERSION[:-1]))
@@ -11,7 +11,7 @@
if 'cms' in settings.INSTALLED_APPS:
from conf import patch_settings
patch_settings()
-except ImportError:
+except ImportError: # pragma: no cover
"""
This exception means that either the application is being built, or is
otherwise installed improperly. Both make running patch_settings
View
@@ -1,13 +1,13 @@
-from django.conf import settings
-from django.contrib.sites.models import Site
-from django.contrib.admin.views.main import ChangeList, ALL_VAR, IS_POPUP_VAR,\
- ORDER_TYPE_VAR, ORDER_VAR, SEARCH_VAR
-from cms.models import Title, PagePermission, Page, PageModerator
-from cms.utils import get_language_from_request
-from cms.utils.permissions import get_user_sites_queryset
from cms.exceptions import NoHomeFound
-from cms.models.moderatormodels import MASK_PAGE, MASK_CHILDREN,\
+from cms.models import Title, Page, PageModerator
+from cms.models.moderatormodels import MASK_PAGE, MASK_CHILDREN, \
MASK_DESCENDANTS, PageModeratorState
+from cms.utils import get_language_from_request
+from cms.utils.permissions import get_user_sites_queryset
+from django.conf import settings
+from django.contrib.admin.views.main import ChangeList, ALL_VAR, IS_POPUP_VAR, \
+ ORDER_TYPE_VAR, ORDER_VAR, SEARCH_VAR
+from django.contrib.sites.models import Site
from menus.utils import find_children
@@ -14,7 +14,7 @@ def get_copy_dialog(request, page_id):
target = get_object_or_404(Page, pk=request.REQUEST['target'])
if not page.has_change_permission(request) or \
- not target.has_add_permission(request):
+ not target.has_add_permission(request): # pragma: no cover
raise Http404
context = {
View
@@ -1,27 +1,26 @@
-from django.conf import settings
+from cms.apphook_pool import apphook_pool
+from cms.forms.widgets import UserSelectAdminWidget
+from cms.models import Page, PagePermission, PageUser, ACCESS_PAGE, \
+ PageUserGroup
+from cms.utils.page import is_valid_page_slug
+from cms.utils.permissions import get_current_user, get_subordinate_users, \
+ get_subordinate_groups, mail_page_user_change
+from cms.utils.urlutils import any_path_re
from django import forms
-from django.template.defaultfilters import slugify
-from django.utils.translation import ugettext_lazy as _, get_language
-from django.forms.util import ErrorList
+from django.conf import settings
from django.contrib.auth.forms import UserCreationForm
-from django.contrib.auth.models import User, Permission, Group
+from django.contrib.auth.models import Permission
from django.contrib.contenttypes.models import ContentType
-from django.db.models.fields import BooleanField
-
-
-from cms.models import Page, Title, PagePermission, PageUser, ACCESS_PAGE,\
- PageUserGroup
-from cms.utils.urlutils import any_path_re
-from cms.utils.permissions import get_current_user, get_subordinate_users,\
- get_subordinate_groups, mail_page_user_change
-from cms.forms.widgets import UserSelectAdminWidget
-from cms.utils.page import is_valid_page_slug
-from django.forms.widgets import HiddenInput
from django.contrib.sites.models import Site
from django.core.exceptions import ValidationError
+from django.db.models.fields import BooleanField
+from django.forms.util import ErrorList
+from django.forms.widgets import HiddenInput
+from django.template.defaultfilters import slugify
+from django.utils.translation import ugettext_lazy as _, get_language
from menus.menu_pool import menu_pool
-from django.utils.functional import lazy
-from cms.apphook_pool import apphook_pool
+
+
class PageAddForm(forms.ModelForm):
View
@@ -4,8 +4,9 @@
from cms.admin.permissionadmin import PAGE_ADMIN_INLINES, \
PagePermissionInlineAdmin
from cms.admin.views import save_all_plugins, revert_plugins
-from cms.forms.widgets import PluginEditor
+from cms.apphook_pool import apphook_pool
from cms.exceptions import NoPermissionsException
+from cms.forms.widgets import PluginEditor
from cms.models import Page, Title, CMSPlugin, PagePermission, \
PageModeratorState, EmptyTitle, GlobalPagePermission
from cms.models.managers import PagePermissionsPermissionManager
@@ -21,12 +22,9 @@
from cms.utils.permissions import has_page_add_permission, \
has_page_change_permission, get_user_permission_level, \
has_global_change_permissions_permission
-from cms.utils.plugins import get_placeholders, get_page_from_plugin_or_404
from cms.utils.placeholder import get_page_from_placeholder_if_exists
-from cms.apphook_pool import apphook_pool
-
-from menus.menu_pool import menu_pool
-
+from cms.utils.plugins import get_placeholders, get_page_from_plugin_or_404
+from copy import deepcopy
from django import template
from django.conf import settings
from django.contrib import admin
@@ -43,13 +41,9 @@
from django.template.context import RequestContext
from django.template.defaultfilters import title, escape, force_escape, escapejs
from django.utils.encoding import force_unicode
-from django.utils.text import capfirst
from django.utils.translation import ugettext_lazy as _
-
+from menus.menu_pool import menu_pool
import os
-from copy import deepcopy
-
-
model_admin = admin.ModelAdmin
create_on_success = lambda x: x
@@ -1,21 +1,20 @@
-from django.contrib.admin import ModelAdmin
-from django.http import (HttpResponseRedirect, HttpResponse, Http404,
- HttpResponseBadRequest, HttpResponseForbidden, HttpResponseNotAllowed)
-from django.shortcuts import render_to_response, get_object_or_404
-from django.db import transaction
-from django.conf import settings
-from django.template.defaultfilters import title, escape, force_escape, escapejs
-from django.template import RequestContext
-from django.utils.encoding import force_unicode
-from django.utils.translation import ugettext_lazy as _
+from cms.forms.fields import PlaceholderFormField
+from cms.models.fields import PlaceholderField
from cms.models.placeholdermodel import Placeholder
from cms.models.pluginmodel import CMSPlugin
-from cms.models.fields import PlaceholderField
-from cms.forms.fields import PlaceholderFormField
from cms.plugin_pool import plugin_pool
from cms.utils import get_language_from_request
+from copy import deepcopy
+from django.conf import settings
+from django.contrib.admin import ModelAdmin
+from django.http import HttpResponse, Http404, HttpResponseBadRequest
+from django.shortcuts import render_to_response, get_object_or_404
+from django.template import RequestContext
+from django.template.defaultfilters import force_escape, escapejs
+from django.utils.translation import ugettext_lazy as _
import os
+
class PlaceholderAdmin(ModelAdmin):
class Media:
@@ -43,8 +42,7 @@ def get_fieldsets(self, request, obj=None):
placeholder_fields = self._get_placeholder_fields(form)
if self.declared_fieldsets:
# check those declared fieldsets
- found = []
- fieldsets = tuple(self.declared_fieldsets)
+ fieldsets = list(deepcopy(self.declared_fieldsets))
for label, fieldset in fieldsets:
fields = list(fieldset['fields'])
for field in fieldset['fields']:
@@ -55,12 +53,16 @@ def get_fieldsets(self, request, obj=None):
placeholder_fields.remove(field)
else:
fields.remove(field)
- fieldset['fields'] = fields
+ if fields:
+ fieldset['fields'] = fields
+ else:
+ # no fields in the fieldset anymore, delete the fieldset
+ fieldsets.remove((label, fieldset))
for placeholder in placeholder_fields:
- fieldsets += (self.get_label_for_placeholder(placeholder), {
+ fieldsets.append((self.get_label_for_placeholder(placeholder), {
'fields': (placeholder,),
'classes': ('plugin-holder', 'plugin-holder-nopage',),
- },)
+ },))
return fieldsets
fieldsets = []
fieldsets.append((None, {'fields': [f for f in form.base_fields.keys() if not f in placeholder_fields]}))
@@ -69,7 +71,9 @@ def get_fieldsets(self, request, obj=None):
'fields': (placeholder,),
'classes': ('plugin-holder', 'plugin-holder-nopage',),
}))
- fieldsets.append((None, {'fields': list(self.get_readonly_fields(request, obj))}))
+ readonly_fields = self.get_readonly_fields(request, obj)
+ if readonly_fields:
+ fieldsets.append((None, {'fields': list(readonly_fields)}))
return fieldsets
def get_label_for_placeholder(self, placeholder):
View
@@ -1,18 +1,8 @@
-from django.shortcuts import get_object_or_404, render_to_response
-from django.http import HttpResponse, Http404, HttpResponseForbidden, HttpResponseBadRequest
-from django.contrib.admin.views.decorators import staff_member_required
-from django.utils.translation import ugettext, ugettext_lazy as _
-from django.template.context import RequestContext
-from django.conf import settings
-from django.template.defaultfilters import escapejs, force_escape
-from django.views.decorators.http import require_POST
-
-from cms.models import Page, Title, CMSPlugin, MASK_CHILDREN, MASK_DESCENDANTS,\
- MASK_PAGE
-from cms.plugin_pool import plugin_pool
-from cms.utils.admin import render_admin_menu_item
-from django.core.exceptions import ObjectDoesNotExist, PermissionDenied
+from cms.models import Page, Title, CMSPlugin
from cms.utils import get_language_from_request
+from django.http import Http404
+from django.shortcuts import get_object_or_404
+
def save_all_plugins(request, page, placeholder, excludes=None):
if not page.has_change_permission(request):
View
@@ -1,90 +0,0 @@
-Contribution Guide
-==================
-
-Translators
------------
-
-For translators we have a `transifex account <http://www.transifex.net/projects/p/django-cms/>`_
-where you can translate the .po files and don't need to install git or mercurial to be able to contribute.
-All changes there will be automatically sent to the project.
-
-Developers
-----------
-
-For contributing to django-cms follow these steps:
-
-* You need either `git <http://git-scm.com/>`_ or `Mercurial <http://www.selenic.com/mercurial/>`_
- with the `hg-git <http://hg-git.github.com/>`_ extension installed.
-
-* You need an account on `github <http://www.github.com/>`_.
-
-* On github you can see all the `open tickets <http://github.com/digi604/django-cms-2.0/issues>`_.
- Please be sure to check there first before you open a new one.
-
-* Go to the `project-page <http://github.com/digi604/django-cms-2.0/>`_ and click on the fork button.
- This creates your own repository of django-cms2 and enables you to push updates to this repository.
- On your fork you should see "Your Clone URL:". Copy the URL and clone it with git or hg-git.
-
-::
-
- $ git clone YOURURL
-
-or::
-
- $ hg gclone YOURURL
-
-Make your changes and commit.
-::
-
- $ git commit
-
-or::
-
- $ hg commit
-
-After you are finished you can push to github.
-::
-
- $ git push origin
-
-or::
-
- $ hg gpush origin
-
-After you have done the push, your changes should show up in the
-`project network <http://github.com/digi604/django-cms-2.0/network>`_.
-
-You can now press on "pull request" to send the project leaders a message of what
-your changes contain and inform them that there are new changes ready to be
-incorporated into the master tree.
-
-After some time you local and github repository will probably become
-out-of-date. To get the newest changesets add a new remote:
-::
-
- $ git remote add upstream git://github.com/digi604/django-cms-2.0.git
-
-or::
-
- $ hg gremote add upstream git://github.com/digi604/django-cms-2.0.git
-
-After this you can do a fetch from upstream:
-::
-
- $ git fetch upstream # only download
- $ git pull upstream master # download and merge master branch
-
-or::
-
- $ hg gfetch upstream # download
- $ hg update # merge
-
-Now your repository is up-to-date again.
-
-It is also good practice to use a branch for every bug / feature you commit if you have more than one or you need more then one commit.
-This helps that we can merge the whole branch and don't have to cherry-pick the single commits that make up the fix / feature.
-Also it allows us to give you instructions if something is missing (tests, docs) and you don't have to interfere
-with other things you might be working on.
-
-If you have questions you may wish to read some tutorials about git or Mercurial
-or ask on IRC or the mailing list.
Oops, something went wrong.

0 comments on commit 57cf537

Please sign in to comment.