From: Łukasz Rekucki
Date: Mon, 28 Sep 2009 14:25:43 +0000 (+0200)
Subject: Merge branch 'zuber-view-refactor'
X-Git-Url: https://git.mdrn.pl/redakcja.git/commitdiff_plain/b348abeb083671e831f711d3d41949a9b3f3a7b4?hp=5a1de03a12a386e83a5c579fefd8e6ffbedc2794
Merge branch 'zuber-view-refactor'
Conflicts:
apps/api/handlers/library_handlers.py
---
diff --git a/apps/api/handlers/library_handlers.py b/apps/api/handlers/library_handlers.py
index b30f2e78..7db7b795 100644
--- a/apps/api/handlers/library_handlers.py
+++ b/apps/api/handlers/library_handlers.py
@@ -268,6 +268,8 @@ class DocumentTextHandler(BaseHandler):
f.write(json.dumps(includes))
f.close()
+ lib._fileadd(resolve('parts'))
+
# update the parts cache
PartCache.update_cache(docid, current.owner,\
stored_includes, includes)
@@ -438,4 +440,4 @@ class MergeHandler(BaseHandler):
"parent_user_resivion": udoc.revision,
"parent_revision": doc.revision,
"revision": udoc.revision,
- })
\ No newline at end of file
+ })
diff --git a/apps/explorer/templatetags/explorer_tags.py b/apps/explorer/templatetags/explorer_tags.py
index a797b3a2..98af0136 100755
--- a/apps/explorer/templatetags/explorer_tags.py
+++ b/apps/explorer/templatetags/explorer_tags.py
@@ -11,4 +11,6 @@ def bookname(fileid):
' '.join(s.capitalize() for s in part.split('_'))\
for part in fileid.split('$'))
-
+@register.inclusion_tag('explorer/file_tree_part.html')
+def tree_part(document):
+ return {'document': document}
\ No newline at end of file
diff --git a/apps/explorer/views.py b/apps/explorer/views.py
index c10e33ba..eca439ca 100644
--- a/apps/explorer/views.py
+++ b/apps/explorer/views.py
@@ -59,9 +59,16 @@ def ajax_login_required(view):
@with_repo
def file_list(request, repo):
import api.forms
+ from api.resources import library_resource
+
bookform = api.forms.DocumentUploadForm()
+
+ # short-circut the api document list
+ doctree = library_resource.handler.read(request)
+ print doctree['documents']
+
return direct_to_template(request, 'explorer/file_list.html', extra_context={
- 'files': repo.documents(), 'bookform': bookform,
+ 'filetree': doctree['documents'], 'bookform': bookform,
})
@permission_required('explorer.can_add_files')
diff --git a/apps/wysiwyg/views.py b/apps/wysiwyg/views.py
index e588c49e..81e1690d 100644
--- a/apps/wysiwyg/views.py
+++ b/apps/wysiwyg/views.py
@@ -2,4 +2,8 @@
from django.views.generic.simple import direct_to_template
def index(request):
- return direct_to_template(request, 'wysiwyg.html', extra_context={})
\ No newline at end of file
+ return direct_to_template(request,
+ 'wysiwyg.html', extra_context={
+ 'listA': [1,2,3,4],
+ 'listB': [5,6,7,8],
+ })
\ No newline at end of file
diff --git a/project/static/css/filelist.css b/project/static/css/filelist.css
index 0e4f2a0e..91e9b8dc 100755
--- a/project/static/css/filelist.css
+++ b/project/static/css/filelist.css
@@ -27,6 +27,20 @@
width: 35%;
}
+ul.file-tree-part {
+ margin: 0.5em 1em;
+ padding: 0em;
+}
+
+ul.file-tree-part li {
+ list-style: square;
+ padding: 0em;
+}
+
+ul.file-tree-part a {
+ padding: 0em;
+}
+
diff --git a/project/static/css/master.css b/project/static/css/master.css
index dbf5c77f..7caa732f 100644
--- a/project/static/css/master.css
+++ b/project/static/css/master.css
@@ -37,6 +37,7 @@ body {
background-color: white;
}
+/*
ul {
margin: 20px;
padding: 0;
@@ -46,7 +47,7 @@ li {
margin: 0;
padding: 0;
list-style: none;
-}
+} */
a {
text-decoration: none;
diff --git a/project/templates/explorer/file_list.html b/project/templates/explorer/file_list.html
index 9628f042..a9b59e4c 100644
--- a/project/templates/explorer/file_list.html
+++ b/project/templates/explorer/file_list.html
@@ -64,12 +64,12 @@ $(function() {
-
{% load explorer_tags %}
- {% for file in files %}
-
{{ file|bookname }}
+
+ {% for file in filetree %}
+ {% tree_part file %}
{% endfor %}
-
+
diff --git a/project/templates/explorer/file_tree_part.html b/project/templates/explorer/file_tree_part.html
new file mode 100644
index 00000000..f65cf28a
--- /dev/null
+++ b/project/templates/explorer/file_tree_part.html
@@ -0,0 +1,13 @@
+{% load explorer_tags %}
+
+
+ {{ document.name|bookname }}
+ {% if document.parts %}
+
+ {% for part in document.parts %}
+ {% tree_part part %}
+ {% endfor %}
+
+ {% endif %}
+
+
diff --git a/project/templates/wysiwyg.html b/project/templates/wysiwyg.html
index 409e4f25..ec6eaed3 100644
--- a/project/templates/wysiwyg.html
+++ b/project/templates/wysiwyg.html
@@ -1,42 +1,15 @@
{% extends 'base.html' %}
-{% block extrahead %}
-
-{% endblock %}
-
{% block maincontent %}
Wysiwyg editor
This part is not editable!
+ {% for a,b in listA,listB %}
+
+ {{ a }} / {{ b }}
+ {% endfor %}
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Suspendisse a urna eu enim rutrum elementum nec sed nibh. Quisque sed tortor
@@ -59,34 +32,4 @@
Donec semper tempus ante, eget gravida erat varius et. Suspendisse aliquam rutrum nunc ac pulvinar. Aliquam erat volutpat. Nulla consectetur ultricies imperdiet. Nulla tincidunt est vitae augue porttitor a faucibus odio facilisis. In nec nisl odio. Aliquam et libero tortor, eu tincidunt mi. Vivamus suscipit erat sed mi hendrerit fringilla. Integer iaculis tempus nulla, at egestas velit faucibus ut. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Vestibulum vel massa enim. Aliquam erat volutpat. In ligula tortor, fermentum eu suscipit at, posuere vel nunc. Nullam nibh magna, sollicitudin at semper et, mattis ut quam. Curabitur accumsan semper elit ac posuere. Sed sit amet lorem tortor, vel porttitor justo. Fusce odio metus, bibendum ut bibendum sit amet, luctus a ipsum.
-{% endblock %}
-
-{% block extrabody %}
-
{% endblock %}
\ No newline at end of file