DC panel quick fix.
authorŁukasz Rekucki <lrekucki@gmail.com>
Mon, 21 Sep 2009 10:37:03 +0000 (12:37 +0200)
committerŁukasz Rekucki <lrekucki@gmail.com>
Mon, 21 Sep 2009 10:37:03 +0000 (12:37 +0200)
Last edited fix.

apps/explorer/views.py
project/static/js/editor.js
project/templates/explorer/file_list.html
project/urls.py

index 76d0456..e5876e9 100644 (file)
@@ -307,7 +307,7 @@ def file_commit(request, path, repo):
 @with_repo
 def file_dc(request, path, repo):
     errors = None
 @with_repo
 def file_dc(request, path, repo):
     errors = None
-    rpath = file_path(fileid)
+    rpath = file_path(path)
 
     if request.method == 'POST':
         form = forms.DublinCoreForm(request.POST)
 
     if request.method == 'POST':
         form = forms.DublinCoreForm(request.POST)
index 0cbb934..f94d33c 100644 (file)
@@ -425,7 +425,7 @@ Editor.prototype.saveToBranch = function(msg)
                 if(self.autosaveTimer) {
                     clearTimeout(self.autosaveTimer);
                 }
                 if(self.autosaveTimer) {
                     clearTimeout(self.autosaveTimer);
                 }
-                if (data.warnings === null) {
+                if (data.warnings === null || data.warning === undefined) {
                     self.showPopup('save-successful');
                 } else {
                     self.showPopup('save-warn', data.warnings[0]);
                     self.showPopup('save-successful');
                 } else {
                     self.showPopup('save-warn', data.warnings[0]);
index 4e5a12a..1eac095 100644 (file)
@@ -55,7 +55,7 @@ $(function() {
        
        $.each(options.recentFiles, function(index) {
                var fileId = options.recentFiles[index].fileId;
        
        $.each(options.recentFiles, function(index) {
                var fileId = options.recentFiles[index].fileId;
-               $('#recent-file-list ul').append('<li><a href="/editor/' + fileId + '/">' + fileId + '</a></li>');
+               $('#recent-file-list ul').append('<li><a href="{% url editor_base %}'+fileId+'">' + fileId + '</a></li>');
        });
 });
 </script>
        });
 });
 </script>
index a9fad54..2c1fab7 100644 (file)
@@ -22,6 +22,7 @@ urlpatterns = patterns('',
     # Editor panels
     url(r'^editor/'+PATH_SEC+'/panel/(?P<name>[a-z]+)/$', 'explorer.views.panel_view', name='panel_view'),
     url(r'^editor/'+PATH_END, 'explorer.views.display_editor', name='editor_view'),
     # Editor panels
     url(r'^editor/'+PATH_SEC+'/panel/(?P<name>[a-z]+)/$', 'explorer.views.panel_view', name='panel_view'),
     url(r'^editor/'+PATH_END, 'explorer.views.display_editor', name='editor_view'),
+    url(r'^editor/$', 'explorer.views.file_list', name='editor_base'),
 
     url(r'^editor/'+PATH_SEC+'/split$', 'explorer.views.split_text'),
     url(r'^editor/'+PATH_SEC+'/split-success',
 
     url(r'^editor/'+PATH_SEC+'/split$', 'explorer.views.split_text'),
     url(r'^editor/'+PATH_SEC+'/split-success',