Skip to content

Commit

Permalink
Merge remote branch 'upstream/develop' into feature-moderation
Browse files Browse the repository at this point in the history
Conflicts:
	cms/tests/page.py
	cms/utils/moderator.py
  • Loading branch information
adaptivelogic committed Nov 13, 2012
2 parents fc636b5 + 014068b commit 6a4f1f9
Show file tree
Hide file tree
Showing 28 changed files with 230 additions and 58 deletions.
5 changes: 5 additions & 0 deletions AUTHORS
Expand Up @@ -33,10 +33,12 @@ Contributors (in alphabetical order):
* Andrew Cassidy
* Andrew Schoen
* angular_circle
* Anton Parkhomenko
* Antoni Aloy López
* Arne Gellhaus
* Artem Skoretskiy
* Arthur Debert
* Aymeric Augustin
* Batiste Bieler
* behrooz
* Behrooz Nobakht
Expand Down Expand Up @@ -68,6 +70,7 @@ Contributors (in alphabetical order):
* eged
* Egor V. Nazarkin
* Ekrem Seren
* Erlend Dalen
* Eric Eldredge
* Erik Allik
* Eugen MechanisM
Expand Down Expand Up @@ -170,6 +173,7 @@ Contributors (in alphabetical order):
* Rebecca Breu
* Remco Wendt
* Restless Being
* Richard Barran
* Robert Buchholz
* Robert Clark
* Robert Pogorzelski
Expand Down Expand Up @@ -204,6 +208,7 @@ Contributors (in alphabetical order):
* tiret
* Ulrich Petri
* Vasil Vangelovski
* Viliam Segeda
* wangJunjie
* Wayne Moore
* wid
Expand Down
12 changes: 8 additions & 4 deletions CHANGELOG.txt
Expand Up @@ -110,6 +110,14 @@

- fixed an incompatibility with Python 2.5

==== 2.3.4 (2012-11-09) ====

- Fixed WymEditor
- Fixed Norwegian translations
- Fixed a bug that could lead to slug clashes
- Fixed page change form (jQuery and permissions)
- Fixed placeholder field permission checks

==== 2.4.0 ===-

- CMS_LANGUAGE setting has changed
Expand All @@ -122,7 +130,3 @@
- CMS_FLAT_URLS has been removed






2 changes: 1 addition & 1 deletion cms/__init__.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
__version__ = '2.3.3.post0'
__version__ = '2.3.4.post0'

# patch settings
try:
Expand Down
41 changes: 21 additions & 20 deletions cms/locale/it/LC_MESSAGES/django.po
Expand Up @@ -6,16 +6,17 @@
# babu <marco.badan@gmail.com>, 2011.
# Denis Darii <sinednx@gmail.com>, 2011.
# Iacopo Spalletti <i.spalletti@nephila.it>, 2011.
# <i.spalletti@nephila.it>, 2012.
# karim79 <karim@gorjux.net>, 2011.
# Marco Barberis <mbarberis@gmail.com>, 2011.
# <sbrentegani@gmail.com>, 2011.
msgid ""
msgstr ""
"Project-Id-Version: django-cms\n"
"Report-Msgid-Bugs-To: https://github.com/divio/django-cms/issues\n"
"POT-Creation-Date: 2012-09-19 14:44+0200\n"
"PO-Revision-Date: 2012-09-19 14:44+0000\n"
"Last-Translator: Patrick Lauber <patrick.lauber@divio.ch>\n"
"POT-Creation-Date: 2012-09-21 14:52+0200\n"
"PO-Revision-Date: 2012-11-09 15:24+0000\n"
"Last-Translator: yakky <i.spalletti@nephila.it>\n"
"Language-Team: divio.ch <developers@divio.ch>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
Expand Down Expand Up @@ -287,7 +288,7 @@ msgstr "Errore del database"
#: admin/pageadmin.py:779
msgid ""
"Error! You don't have permissions to move this page. Please reload the page"
msgstr ""
msgstr "Errore! Non hai il permesso di spostare questa pagina. Ricarica la pagina"

#: admin/pageadmin.py:880
msgid "Page was successfully approved."
Expand Down Expand Up @@ -922,15 +923,15 @@ msgstr "Google Map"

#: plugins/googlemap/cms_plugins.py:19
msgid "Advanced"
msgstr ""
msgstr "Avanzato"

#: plugins/googlemap/forms.py:23
msgid "Must be a positive integer followed by “px” or “%”."
msgstr ""
msgstr "Deve essere un intero seguito da “px” o \"%\""

#: plugins/googlemap/forms.py:26
msgid "Must be a positive integer followed by “px”."
msgstr ""
msgstr "Deve essere un intero seguito da “px”."

#: plugins/googlemap/models.py:10
msgid "map title"
Expand All @@ -954,7 +955,7 @@ msgstr "contenuti aggiuntivi"

#: plugins/googlemap/models.py:19
msgid "Displayed under address in the bubble."
msgstr ""
msgstr "Mostrato sotto l'indirizzo nel fumetto."

#: plugins/googlemap/models.py:21
msgid "zoom level"
Expand Down Expand Up @@ -986,11 +987,11 @@ msgstr "route planer"

#: plugins/googlemap/models.py:37
msgid "Plugin width (in pixels or percent)."
msgstr ""
msgstr "Larghezza del plugin (in pixel o percentuale)."

#: plugins/googlemap/models.py:39
msgid "Plugin height (in pixels)."
msgstr ""
msgstr "Altezza del plugin (in pixel)."

#: plugins/googlemap/models.py:47
msgid "Map"
Expand Down Expand Up @@ -1053,23 +1054,23 @@ msgstr "Un indirizzo email ha priorità rispetto a un link testuale."

#: plugins/link/models.py:14
msgid "target"
msgstr ""
msgstr "target"

#: plugins/link/models.py:15
msgid "same window"
msgstr ""
msgstr "stessa finestra"

#: plugins/link/models.py:16
msgid "new window"
msgstr ""
msgstr "nuova finestra"

#: plugins/link/models.py:17
msgid "parent window"
msgstr ""
msgstr "finestra superiore"

#: plugins/link/models.py:18
msgid "topmost frame"
msgstr ""
msgstr "finestra principale"

#: plugins/picture/cms_plugins.py:9
msgid "Picture"
Expand Down Expand Up @@ -1730,7 +1731,7 @@ msgstr "Una versione precedente di un plugin non può essere salvata!"

#: templates/admin/cms/page/plugin_forms_ok.html:26
msgid "Your changes to this plugin have not been saved."
msgstr ""
msgstr "Le tue modifiche al plugin non sono state salvate."

#: templates/admin/cms/page/plugin_forms_ok.html:26
msgid "Plugin saved successfully."
Expand Down Expand Up @@ -1906,11 +1907,11 @@ msgstr "colonna a destra"

#: test_utils/project/placeholderapp/cms_plugins.py:7
msgid "Test Plugin"
msgstr ""
msgstr "Plugin Test"

#: test_utils/project/pluginapp/plugins/extra_context/cms_plugins.py:9
msgid "Extra Context"
msgstr ""
msgstr "Context aggiuntivo"

#: test_utils/project/pluginapp/plugins/manytomany_rel/cms_plugins.py:13
msgid "Articles"
Expand Down Expand Up @@ -1976,8 +1977,8 @@ msgid ""
msgid_plural ""
"Pages %(pages)s have the same url '%(url)s' as current page "
"\"%(instance)s\"."
msgstr[0] ""
msgstr[1] ""
msgstr[0] "La pagina %(pages)s ha lo stesso url '%(url)s' della pagina corrente \"%(instance)s\"."
msgstr[1] "Le pagine %(pages)s hanno lo stesso url '%(url)s' della pagina corrente \"%(instance)s\"."

#~ msgid "move"
#~ msgstr "move request"
Expand Down
File renamed without changes.
Expand Up @@ -13,10 +13,10 @@ msgstr ""
"PO-Revision-Date: 2012-09-19 14:44+0000\n"
"Last-Translator: Patrick Lauber <patrick.lauber@divio.ch>\n"
"Language-Team: divio.ch <developers@divio.ch>\n"
"Language: nb\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: no\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Poedit-Country: SWITZERLAND\n"
"X-Poedit-Language: English\n"
Expand Down
File renamed without changes.
Expand Up @@ -15,7 +15,6 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: no\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#: static/cms/js/change_form.js:31
Expand Down
4 changes: 2 additions & 2 deletions cms/models/pagemodel.py
Expand Up @@ -7,9 +7,9 @@
from cms.models.pluginmodel import CMSPlugin
from cms.publisher.errors import MpttPublisherCantPublish
from cms.utils import i18n, urlutils, page as page_utils
from cms.utils import timezone
from cms.utils.copy_plugins import copy_plugins_to
from cms.utils.helpers import reversion_register
from datetime import datetime
from django.conf import settings
from django.contrib.sites.models import Site
from django.core.urlresolvers import reverse
Expand Down Expand Up @@ -342,7 +342,7 @@ def save(self, no_signals=False, commit=True, **kwargs):
# Published pages should always have a publication date
# if the page is published we set the publish date if not set yet.
if self.publication_date is None and self.published:
self.publication_date = datetime.now()
self.publication_date = timezone.now()

if self.reverse_id == "":
self.reverse_id = None
Expand Down
7 changes: 4 additions & 3 deletions cms/models/pluginmodel.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
import os
import warnings
from datetime import datetime, date
from datetime import date

from django.conf import settings
from django.core.exceptions import ValidationError, ObjectDoesNotExist
Expand All @@ -14,6 +14,7 @@
from cms.models.placeholdermodel import Placeholder
from cms.plugin_rendering import PluginContext, render_plugin
from cms.utils.helpers import reversion_register
from cms.utils import timezone

from mptt.models import MPTTModel, MPTTModelBase

Expand Down Expand Up @@ -81,13 +82,13 @@ class CMSPlugin(MPTTModel):
position = models.PositiveSmallIntegerField(_("position"), blank=True, null=True, editable=False)
language = models.CharField(_("language"), max_length=15, blank=False, db_index=True, editable=False)
plugin_type = models.CharField(_("plugin_name"), max_length=50, db_index=True, editable=False)
creation_date = models.DateTimeField(_("creation date"), editable=False, default=datetime.now)
creation_date = models.DateTimeField(_("creation date"), editable=False, default=timezone.now)
changed_date = models.DateTimeField(auto_now=True)
level = models.PositiveIntegerField(db_index=True, editable=False)
lft = models.PositiveIntegerField(db_index=True, editable=False)
rght = models.PositiveIntegerField(db_index=True, editable=False)
tree_id = models.PositiveIntegerField(db_index=True, editable=False)
child_plugins_instances = None
child_plugin_instances = None

class Meta:
app_label = 'cms'
Expand Down
7 changes: 4 additions & 3 deletions cms/models/query.py
Expand Up @@ -5,6 +5,7 @@
from cms.publisher.query import PublisherQuerySet
from django.conf import settings
from cms.exceptions import NoHomeFound
from cms.utils import timezone


class PageQuerySet(PublisherQuerySet):
Expand Down Expand Up @@ -51,21 +52,21 @@ def published(self, site=None):

if settings.CMS_SHOW_START_DATE:
pub = pub.filter(
Q(publication_date__lt=datetime.now()) |
Q(publication_date__lt=timezone.now()) |
Q(publication_date__isnull=True)
)

if settings.CMS_SHOW_END_DATE:
pub = pub.filter(
Q(publication_end_date__gte=datetime.now()) |
Q(publication_end_date__gte=timezone.now()) |
Q(publication_end_date__isnull=True)
)

return pub

def expired(self):
return self.on_site().filter(
publication_end_date__lte=datetime.now())
publication_end_date__lte=timezone.now())

# - seems this is not used anymore...
# def get_pages_with_application(self, path, language):
Expand Down
4 changes: 2 additions & 2 deletions cms/models/titlemodels.py
@@ -1,10 +1,10 @@
# -*- coding: utf-8 -*-
from datetime import datetime
from django.db import models
from django.utils.translation import ugettext_lazy as _
from cms.models.managers import TitleManager
from cms.models.pagemodel import Page
from cms.utils.helpers import reversion_register
from cms.utils import timezone


class Title(models.Model):
Expand All @@ -20,7 +20,7 @@ class Title(models.Model):
meta_keywords = models.CharField(_("keywords"), max_length=255, blank=True, null=True)
page_title = models.CharField(_("title"), max_length=255, blank=True, null=True, help_text=_("overwrite the title (html title tag)"))
page = models.ForeignKey(Page, verbose_name=_("page"), related_name="title_set")
creation_date = models.DateTimeField(_("creation date"), editable=False, default=datetime.now)
creation_date = models.DateTimeField(_("creation date"), editable=False, default=timezone.now)

objects = TitleManager()

Expand Down
2 changes: 1 addition & 1 deletion cms/static/cms/css/pages.css
Expand Up @@ -131,7 +131,7 @@ a.collapsed span.collapsed{
}

.ac_loading {
background: white url('../indicator.gif') right center no-repeat;
background: white url('../images/indicator.gif') right center no-repeat;
}

.ac_odd {
Expand Down
38 changes: 32 additions & 6 deletions cms/static/cms/js/plugins/cms.placeholders.js
Expand Up @@ -218,7 +218,6 @@ CMS.$(document).ready(function ($) {
// add array to new position
if(dir === 'moveup') array.splice(index-1, 0, values.plugin_id);
if(dir === 'movedown') array.splice(index+1, 0, values.plugin_id);

// now lets do the ajax request
$.ajax({
'type': 'POST',
Expand All @@ -232,12 +231,39 @@ CMS.$(document).ready(function ($) {

// lets refresh the elements in the dom as well
function refreshPluginPosition() {
if(dir === 'moveup' && index !== bound+1) plugin.insertBefore($(holders[index-1]));
if(dir === 'movedown' && index !== -1) plugin.insertAfter($(holders[index+1]));
var target;
var before = false;
if(dir === 'moveup' && index !== bound+1){
before = true;
target = $(holders[index-1]);
}
if(dir === 'movedown' && index !== -1){
target = $(holders[index+1]);
}
// move in or out of boundary
if(dir === 'moveup' && index === bound+1) plugin.insertAfter($(holders[index-2]));
if(dir === 'movedown' && index === -1) plugin.insertBefore($(holders[index+1]));

if(dir === 'moveup' && index === bound+1){
target = $(holders[index-2]);
}
if(dir === 'movedown' && index === -1){
target = $(holders[index+1]);
before = true;
}
var target_id = target.attr('id').split("-")[1];
if(before){
plugin.insertBefore(target);
}else{
var target_content = $("#cms_placeholdercontent-"+target_id);
if(target_content.length > 0){
plugin.insertAfter(target_content);
}else{
plugin.insertAfter(target);
}
}
var content = $("#cms_placeholdercontent-"+values.plugin_id);
if(content.length > 0){
content.insertAfter($("#cms_placeholder-"+values.plugin_id));
}

// close overlay
that.hideOverlay();

Expand Down
2 changes: 1 addition & 1 deletion cms/static/cms/js/wymeditor/skins/django/skin.css
Expand Up @@ -135,4 +135,4 @@
/* End hide from IE-mac */

/*WYMEDITOR_LINK*/
a.wym_wymeditor_link { text-indent: -9999px; float: right; display: block; width: 50px; height: 15px; background: url(../wymeditor_icon.png); overflow: hidden; text-decoration: none; }
a.wym_wymeditor_link { text-indent: -9999px; float: right; display: block; width: 50px; height: 15px; background: url(../../../../wymeditor/skins/wymeditor_icon.png); overflow: hidden; text-decoration: none; }

0 comments on commit 6a4f1f9

Please sign in to comment.