Zamiana sztywnego dowiÄ…zania w skrypcie w file_xml.html na URL.
authorzuber <marek@stepniowski.com>
Tue, 18 Aug 2009 21:17:58 +0000 (23:17 +0200)
committerzuber <marek@stepniowski.com>
Tue, 18 Aug 2009 21:17:58 +0000 (23:17 +0200)
project/templates/explorer/file_xml.html
project/urls.py

index c23ad41..cef1800 100644 (file)
@@ -8,7 +8,7 @@
     <script type="text/javascript" charset="utf-8">        
         $(function() {
             $('#id_folders').change(function() {
     <script type="text/javascript" charset="utf-8">        
         $(function() {
             $('#id_folders').change(function() {
-                $('#images').load('/images/' + $('#id_folders').val() + '/', function() {
+                $('#images').load('{% url folder_image_ajax %}' + $('#id_folders').val() + '/', function() {
                     $('#images').data('lastScroll', -1000);
                 });
             });
                     $('#images').data('lastScroll', -1000);
                 });
             });
index 3b75849..19f0520 100644 (file)
@@ -12,6 +12,7 @@ urlpatterns = patterns('',
     url(r'^file/(?P<path>[^/]+)/$', 'explorer.views.file_xml', name='file_xml'),
     url(r'^html/(?P<path>[^/]+)/$', 'explorer.views.file_html', name='file_html'),
     url(r'^images/(?P<folder>[^/]+)/$', 'explorer.views.folder_images', name='folder_image'),
     url(r'^file/(?P<path>[^/]+)/$', 'explorer.views.file_xml', name='file_xml'),
     url(r'^html/(?P<path>[^/]+)/$', 'explorer.views.file_html', name='file_html'),
     url(r'^images/(?P<folder>[^/]+)/$', 'explorer.views.folder_images', name='folder_image'),
+    url(r'^images/$', 'explorer.views.folder_images', {'folder': '.'}, name='folder_image_ajax'),
     
     # Admin panel
     url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
     
     # Admin panel
     url(r'^admin/doc/', include('django.contrib.admindocs.urls')),