From: Łukasz Rekucki Date: Sun, 27 Sep 2009 20:05:55 +0000 (+0200) Subject: Changes to index display. X-Git-Url: https://git.mdrn.pl/redakcja.git/commitdiff_plain/4e359249db1606a8cf23192c89a287523322e1ec Changes to index display. --- 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 b413b2c4..44bd62ec 100644 --- a/project/static/css/master.css +++ b/project/static/css/master.css @@ -38,6 +38,7 @@ body { padding: 0.2em 1em; } +/* ul { margin: 20px; padding: 0; @@ -47,7 +48,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 }}

+
+
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