From 1f58a10a88c18512abc9c84f49a04a18e00fa8c5 Mon Sep 17 00:00:00 2001 From: zuber Date: Sat, 22 Aug 2009 23:45:58 +0200 Subject: [PATCH 1/1] Dodanie panelu htmleditor. --- apps/explorer/views.py | 8 +++----- project/static/css/master.css | 2 +- project/static/js/panels.js | 2 +- project/templates/explorer/file_xml.html | 4 +++- .../templates/explorer/panels/htmleditor.html | 18 ++++++++++++++++++ project/urls.py | 6 +++--- 6 files changed, 29 insertions(+), 11 deletions(-) create mode 100644 project/templates/explorer/panels/htmleditor.html diff --git a/apps/explorer/views.py b/apps/explorer/views.py index 3b3fdb1d..68fd1921 100644 --- a/apps/explorer/views.py +++ b/apps/explorer/views.py @@ -57,11 +57,9 @@ def gallery_panel(request, path): }) -def file_html(request, path): - return direct_to_template(request, 'explorer/file_html.html', extra_context={ - 'object': html.transform(repo.get_file(path).data(), is_file=False), - 'hash': path, - 'image_folders_form': forms.ImageFoldersForm(), +def htmleditor_panel(request, path): + return direct_to_template(request, 'explorer/panels/htmleditor.html', extra_context={ + 'html': html.transform(repo.get_file(path).data(), is_file=False), }) diff --git a/project/static/css/master.css b/project/static/css/master.css index a9c0a41b..7fa5ddac 100644 --- a/project/static/css/master.css +++ b/project/static/css/master.css @@ -124,7 +124,7 @@ label { /* ================= */ /* = Gallery panel = */ /* ================= */ -.images-wrap { +.images-wrap, .htmleditor { overflow-x: hidden; overflow-y: scroll; } diff --git a/project/static/js/panels.js b/project/static/js/panels.js index 2f20a28a..abbd2182 100644 --- a/project/static/js/panels.js +++ b/project/static/js/panels.js @@ -56,7 +56,7 @@ $(function() { resizePanels(); }) - $('#left-panel-wrap').bind('resizable:resize', resizePanels) + $('#left-panel-wrap').bind('resizable:stop', resizePanels) .resizable('#slider', {minWidth: 8}); resizePanels(); diff --git a/project/templates/explorer/file_xml.html b/project/templates/explorer/file_xml.html index 992bb8d4..dfbbc56e 100644 --- a/project/templates/explorer/file_xml.html +++ b/project/templates/explorer/file_xml.html @@ -22,6 +22,7 @@ @@ -36,7 +37,8 @@
diff --git a/project/templates/explorer/panels/htmleditor.html b/project/templates/explorer/panels/htmleditor.html new file mode 100644 index 00000000..0eab0b28 --- /dev/null +++ b/project/templates/explorer/panels/htmleditor.html @@ -0,0 +1,18 @@ +
+
+ {{ html|safe }} +
+
+ \ No newline at end of file diff --git a/project/urls.py b/project/urls.py index 7a90ed1f..cc433c05 100644 --- a/project/urls.py +++ b/project/urls.py @@ -10,13 +10,13 @@ urlpatterns = patterns('', # Example: url(r'^$', 'explorer.views.file_list', name='file_list'), url(r'^file/(?P[^/]+)/$', 'explorer.views.file_xml', name='file_xml'), - url(r'^html/(?P[^/]+)/$', 'explorer.views.file_html', name='file_html'), url(r'^images/(?P[^/]+)/$', 'explorer.views.folder_images', name='folder_image'), url(r'^images/$', 'explorer.views.folder_images', {'folder': '.'}, name='folder_image_ajax'), # Editor panels - url(r'^editor/(?P[^/]+)/panels/xmleditor$', 'explorer.views.xmleditor_panel', name='xmleditor_panel'), - url(r'^editor/(?P[^/]+)/panels/gallery$', 'explorer.views.gallery_panel', name='gallery_panel'), + url(r'^editor/(?P[^/]+)/panels/xmleditor/$', 'explorer.views.xmleditor_panel', name='xmleditor_panel'), + url(r'^editor/(?P[^/]+)/panels/gallery/$', 'explorer.views.gallery_panel', name='gallery_panel'), + url(r'^editor/(?P[^/]+)/panels/htmleditor/$', 'explorer.views.htmleditor_panel', name='htmleditor_panel'), # Admin panel url(r'^admin/doc/', include('django.contrib.admindocs.urls')), -- 2.20.1