From: Radek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl> Date: Tue, 4 Oct 2011 15:00:34 +0000 (+0200) Subject: fixes X-Git-Url: https://git.mdrn.pl/redakcja.git/commitdiff_plain/bd743f7ae0f46d0d2a68f80e3c3cf14313d61aa3?ds=sidebyside fixes --- diff --git a/apps/catalogue/management/commands/merge_books.py b/apps/catalogue/management/commands/merge_books.py index 00014dfd..aec113ed 100755 --- a/apps/catalogue/management/commands/merge_books.py +++ b/apps/catalogue/management/commands/merge_books.py @@ -111,8 +111,8 @@ class Command(BaseCommand): force = options.get('force') guess = options.get('guess') dry_run = options.get('dry_run') - new_slug = options.get('new_slug') - new_title = options.get('new_title') + new_slug = options.get('new_slug').decode('utf-8') + new_title = options.get('new_title').decode('utf-8') verbose = options.get('verbose') if guess: diff --git a/apps/catalogue/models/book.py b/apps/catalogue/models/book.py index 9f809b86..1b043a47 100755 --- a/apps/catalogue/models/book.py +++ b/apps/catalogue/models/book.py @@ -278,6 +278,8 @@ class Book(models.Model): """ Publishes a book on behalf of a (local) user. """ + raise NotImplementedError("Publishing not possible yet.") + from apiclient import api_call changes = self.get_current_changes(publishable=True) diff --git a/apps/catalogue/templates/catalogue/book_detail.html b/apps/catalogue/templates/catalogue/book_detail.html index b93fce45..8e9c1f10 100755 --- a/apps/catalogue/templates/catalogue/book_detail.html +++ b/apps/catalogue/templates/catalogue/book_detail.html @@ -79,6 +79,8 @@ {% endcomment %} </p> + {% trans "This book cannot be published yet" %} + {% comment %} <!-- Angel photos: Angels in Ely Cathedral (http://www.flickr.com/photos/21804434@N02/4483220595/) / @@ -90,7 +92,8 @@ <button id="publish-button" type="submit"> <span>{% trans "Publish" %}</span></button> <img src="{{ STATIC_URL }}img/angel-right.png" style="vertical-align: middle" /> - </form></p> + </form> + {% endcomment %} {% else %} {% trans "This book cannot be published yet" %} {% endif %} diff --git a/apps/catalogue/views.py b/apps/catalogue/views.py index aa214de7..ef042de2 100644 --- a/apps/catalogue/views.py +++ b/apps/catalogue/views.py @@ -88,12 +88,12 @@ def create_missing(request, slug=None): creator = request.user else: creator = None - book = Book.objects.create( + book = Book.create( + text=form.cleaned_data['text'], + creator=creator, slug=form.cleaned_data['slug'], title=form.cleaned_data['title'], ) - book.chunk_set.all().update(creator=creator) - book[0].commit(text=form.cleaned_data['text'], author=creator) return http.HttpResponseRedirect(reverse("wiki_editor", args=[book.slug])) else: @@ -147,10 +147,11 @@ def upload(request): if not error_list: for filename, slug, title in ok_list: - Book.create(creator=creator, + book = Book.create( + text=zip.read(filename).decode('utf-8'), + creator=creator, slug=slug, title=title, - text=zip.read(filename).decode('utf-8'), ) return direct_to_template(request, "catalogue/document_upload.html", extra_context={ diff --git a/redakcja/settings/common.py b/redakcja/settings/common.py index 5414246d..5a337fb0 100644 --- a/redakcja/settings/common.py +++ b/redakcja/settings/common.py @@ -139,8 +139,13 @@ IMAGE_DIR = 'images' import djcelery djcelery.setup_loader() - +BROKER_BACKEND = "djkombu.transport.DatabaseTransport" +BROKER_HOST = "localhost" +BROKER_PORT = 5672 +BROKER_USER = "guest" +BROKER_PASSWORD = "guest" +BROKER_VHOST = "/" SHOW_APP_VERSION = False diff --git a/redakcja/settings/compress.py b/redakcja/settings/compress.py index e4b5b085..5637cee6 100644 --- a/redakcja/settings/compress.py +++ b/redakcja/settings/compress.py @@ -61,7 +61,7 @@ COMPRESS_JS = { }, 'catalogue': { 'source_filenames': ( - 'js/catalogue.js', + 'js/catalogue/catalogue.js', 'js/slugify.js', ), 'output_filename': 'compressed/catalogue_scripts_?.js', diff --git a/redakcja/static/css/filelist.css b/redakcja/static/css/filelist.css index 36bffdff..c81ee78b 100644 --- a/redakcja/static/css/filelist.css +++ b/redakcja/static/css/filelist.css @@ -61,7 +61,7 @@ body { #catalogue_layout_left_column { overflow: visible; float: left; - /*max-width: 50%;*/ + max-width: 60%; padding-right: 2%; border-right: 1px dashed black; @@ -69,7 +69,7 @@ body { #catalogue_layout_right_column { float: left; - max-width: 35%; + max-width: 30%; margin-left: 5%; } @@ -167,3 +167,11 @@ td { #publish-button:active { background: -moz-linear-gradient(top, #88f, #fff); } + + +/* book list */ + +.book-search-column input { + width: 96%; +} +