From e751ef24ef762d285ad6f191d71be77dbd785878 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C5=81ukasz=20Rekucki?= Date: Fri, 11 Sep 2009 19:05:30 +0200 Subject: [PATCH 1/1] Toolbar in HTML panel fixed. Allow dot in names. --- apps/explorer/forms.py | 4 ++-- apps/explorer/views.py | 2 +- project/templates/explorer/panels/dceditor.html | 1 + project/templates/explorer/panels/gallery.html | 2 ++ project/templates/explorer/panels/htmleditor.html | 5 ++--- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/apps/explorer/forms.py b/apps/explorer/forms.py index c6aa09d2..fffdeb87 100644 --- a/apps/explorer/forms.py +++ b/apps/explorer/forms.py @@ -61,7 +61,7 @@ class MergeForm(forms.Form): class BookUploadForm(forms.Form): file = forms.FileField(label='Source OCR file') - bookname = forms.RegexField(regex='[0-9\w_-]+', \ + bookname = forms.RegexField(regex=r'[0-9\.\w_-]+', \ label='Publication name', help_text='Example: slowacki-beniowski') autoxml = forms.BooleanField(required=False, initial=True, label=u"Generate DublinCore template") @@ -73,7 +73,7 @@ class ImageFoldersForm(forms.Form): self.fields['folders'].choices = [('', '-- Wybierz folder z obrazkami --')] + [(fn, fn) for fn in models.get_image_folders()] class SplitForm(forms.Form): - partname = forms.RegexField(regex='[0-9\w_-]+', \ + partname = forms.RegexField(regex='[0-9\.\w_-]+', \ label='Part name', help_text='Example: rozdział-2') autoxml = forms.BooleanField(required=False, initial=False, label=u"Split as new publication") fulltext = forms.CharField(widget=forms.HiddenInput(), required=False) diff --git a/apps/explorer/views.py b/apps/explorer/views.py index 52ff9630..601f689c 100644 --- a/apps/explorer/views.py +++ b/apps/explorer/views.py @@ -61,7 +61,7 @@ def file_list(request, repo): fl = [] for file in repo.repo[latest_default]: - m = re.match(u'^pub_([\\w\\$0-9_-]+).xml$', file.decode('utf-8'), re.UNICODE) + m = re.match(u'^pub_([\\w\\$\\.0-9_-]+).xml$', file.decode('utf-8'), re.UNICODE) if m is not None: fl.append(m.group(1)) diff --git a/project/templates/explorer/panels/dceditor.html b/project/templates/explorer/panels/dceditor.html index fd613695..215f54fe 100644 --- a/project/templates/explorer/panels/dceditor.html +++ b/project/templates/explorer/panels/dceditor.html @@ -15,6 +15,7 @@ panel_hooks = { self.contentDiv.trigger('panel:contentChanged', self); }); }); + self._endload(); }, saveInfo: function(saveInfo) { var myInfo = { diff --git a/project/templates/explorer/panels/gallery.html b/project/templates/explorer/panels/gallery.html index 565a6360..ac8cf6a8 100644 --- a/project/templates/explorer/panels/gallery.html +++ b/project/templates/explorer/panels/gallery.html @@ -34,6 +34,8 @@ panel_hooks = { $('.images-wrap', contentDiv).lazyload('.image-box', {threshold: 640 * 10, scrollTreshold: 640 * 5} ); + + self._endload(); }, refresh: function() { return true; // gallery is always fresh diff --git a/project/templates/explorer/panels/htmleditor.html b/project/templates/explorer/panels/htmleditor.html index 3599dfed..d27d8cc7 100644 --- a/project/templates/explorer/panels/htmleditor.html +++ b/project/templates/explorer/panels/htmleditor.html @@ -5,9 +5,8 @@