Fixes #21 Webdav seems to be functional from subfolder
This commit is contained in:
parent
5dee0c03e2
commit
e8afc9f584
@ -132,6 +132,10 @@ table { width:100%%; }
|
||||
def projectless_path
|
||||
'/'+path.split('/').drop(2).join('/')
|
||||
end
|
||||
|
||||
def path_prefix
|
||||
public_path.gsub(/#{Regexp.escape(path)}$/, '')
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@ -601,7 +601,7 @@ module RedmineDmsf
|
||||
end
|
||||
|
||||
lock_entity = lock.folder || lock.file
|
||||
lock_path = "#{request.scheme}://#{request.host}:#{request.port}/dmsf/webdav/#{URI.escape(lock_entity.project.identifier)}/"
|
||||
lock_path = "#{request.scheme}://#{request.host}:#{request.port}#{path_prefix}#{URI.escape(lock_entity.project.identifier)}/"
|
||||
lock_path << lock_entity.dmsf_path.map {|x| URI.escape(x.respond_to?('name') ? x.name : x.title) }.join('/')
|
||||
lock_path << "/" if lock_entity.is_a?(DmsfFolder) && lock_path[-1,1] != '/'
|
||||
doc.lockroot { doc.href lock_path }
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user