fnp
/
redakcja.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4cdc0fc
)
publishable setting fix
author
Radek Czajka
<radoslaw.czajka@nowoczesnapolska.org.pl>
Wed, 5 Oct 2011 11:29:12 +0000
(13:29 +0200)
committer
Radek Czajka
<radoslaw.czajka@nowoczesnapolska.org.pl>
Wed, 5 Oct 2011 11:29:12 +0000
(13:29 +0200)
apps/catalogue/models/book.py
patch
|
blob
|
history
apps/catalogue/models/chunk.py
patch
|
blob
|
history
apps/catalogue/models/listeners.py
patch
|
blob
|
history
apps/dvcs/models.py
patch
|
blob
|
history
apps/wiki/views.py
patch
|
blob
|
history
diff --git
a/apps/catalogue/models/book.py
b/apps/catalogue/models/book.py
index
db52128
..
fb59388
100755
(executable)
--- a/
apps/catalogue/models/book.py
+++ b/
apps/catalogue/models/book.py
@@
-42,7
+42,6
@@
class Book(models.Model):
ordering = ['parent_number', 'title']
verbose_name = _('book')
verbose_name_plural = _('books')
ordering = ['parent_number', 'title']
verbose_name = _('book')
verbose_name_plural = _('books')
- permissions = [('can_pubmark', 'Can mark for publishing')]
# Representing
# Representing
diff --git
a/apps/catalogue/models/chunk.py
b/apps/catalogue/models/chunk.py
index
3ce2050
..
00e18d9
100755
(executable)
--- a/
apps/catalogue/models/chunk.py
+++ b/
apps/catalogue/models/chunk.py
@@
-38,6
+38,7
@@
class Chunk(dvcs_models.Document):
ordering = ['number']
verbose_name = _('chunk')
verbose_name_plural = _('chunks')
ordering = ['number']
verbose_name = _('chunk')
verbose_name_plural = _('chunks')
+ permissions = [('can_pubmark', 'Can mark for publishing')]
# Representing
# ============
# Representing
# ============
diff --git
a/apps/catalogue/models/listeners.py
b/apps/catalogue/models/listeners.py
index
7848974
..
532f1e7
100755
(executable)
--- a/
apps/catalogue/models/listeners.py
+++ b/
apps/catalogue/models/listeners.py
@@
-40,9
+40,14
@@
def publish_listener(sender, *args, **kwargs):
post_publish.connect(publish_listener)
post_publish.connect(publish_listener)
+def publishable_listener(sender, *args, **kwargs):
+ sender.tree.touch()
+ sender.tree.book.touch()
+post_publishable.connect(publishable_listener)
+
+
def listener_create(sender, instance, created, **kwargs):
if created:
instance.chunk_set.create(number=1, slug='1')
models.signals.post_save.connect(listener_create, sender=Book)
def listener_create(sender, instance, created, **kwargs):
if created:
instance.chunk_set.create(number=1, slug='1')
models.signals.post_save.connect(listener_create, sender=Book)
-
diff --git
a/apps/dvcs/models.py
b/apps/dvcs/models.py
index
0ba8fe5
..
6cfda91
100644
(file)
--- a/
apps/dvcs/models.py
+++ b/
apps/dvcs/models.py
@@
-10,7
+10,7
@@
from django.utils.translation import ugettext_lazy as _
from mercurial import mdiff, simplemerge
from django.conf import settings
from mercurial import mdiff, simplemerge
from django.conf import settings
-from dvcs.signals import post_commit
+from dvcs.signals import post_commit
, post_publishable
from dvcs.storage import GzipFileSystemStorage
from dvcs.storage import GzipFileSystemStorage
@@
-167,7
+167,7
@@
class Change(models.Model):
def set_publishable(self, publishable):
self.publishable = publishable
self.save()
def set_publishable(self, publishable):
self.publishable = publishable
self.save()
- post_publishable
(sender=self, publishable=publishable).send(
)
+ post_publishable
.send(sender=self, publishable=publishable
)
def create_tag_model(model):
def create_tag_model(model):
diff --git
a/apps/wiki/views.py
b/apps/wiki/views.py
index
2a317f2
..
dc2ec6f
100644
(file)
--- a/
apps/wiki/views.py
+++ b/
apps/wiki/views.py
@@
-9,7
+9,7
@@
from django.http import Http404
from django.middleware.gzip import GZipMiddleware
from django.utils.decorators import decorator_from_middleware
from django.utils.encoding import smart_unicode
from django.middleware.gzip import GZipMiddleware
from django.utils.decorators import decorator_from_middleware
from django.utils.encoding import smart_unicode
-from django.utils.translation import ugettext
_lazy
as _
+from django.utils.translation import ugettext as _
from django.views.decorators.http import require_POST, require_GET
from django.views.generic.simple import direct_to_template
from django.views.decorators.http import require_POST, require_GET
from django.views.generic.simple import direct_to_template
@@
-264,14
+264,14
@@
def history(request, slug, chunk=None):
"description": change.description,
"author": change.author_str(),
"date": change.created_at,
"description": change.description,
"author": change.author_str(),
"date": change.created_at,
- "publishable":
"Publishable
\n" if change.publishable else "",
+ "publishable":
_("Publishable") + "
\n" if change.publishable else "",
"tag": ',\n'.join(unicode(tag) for tag in change.tags.all()),
})
return JSONResponse(changes)
@require_POST
"tag": ',\n'.join(unicode(tag) for tag in change.tags.all()),
})
return JSONResponse(changes)
@require_POST
-@ajax_require_permission('
wiki
.can_pubmark')
+@ajax_require_permission('
catalogue
.can_pubmark')
def pubmark(request, slug, chunk=None):
form = forms.DocumentPubmarkForm(request.POST, prefix="pubmark")
if form.is_valid():
def pubmark(request, slug, chunk=None):
form = forms.DocumentPubmarkForm(request.POST, prefix="pubmark")
if form.is_valid():