fixes
authorRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Tue, 4 Oct 2011 15:00:34 +0000 (17:00 +0200)
committerRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Tue, 4 Oct 2011 15:00:34 +0000 (17:00 +0200)
apps/catalogue/management/commands/merge_books.py
apps/catalogue/models/book.py
apps/catalogue/templates/catalogue/book_detail.html
apps/catalogue/views.py
redakcja/settings/common.py
redakcja/settings/compress.py
redakcja/static/css/filelist.css

index 00014df..aec113e 100755 (executable)
@@ -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:
index 9f809b8..1b043a4 100755 (executable)
@@ -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)
index b93fce4..8e9c1f1 100755 (executable)
@@ -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 %}
index aa214de..ef042de 100644 (file)
@@ -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={
index 5414246..5a337fb 100644 (file)
@@ -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
 
index e4b5b08..5637cee 100644 (file)
@@ -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',
index 36bffdf..c81ee78 100644 (file)
@@ -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%;
+}
+