1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-11 11:51:27 +00:00

fixed 'path' bug for file upload, rewrite file update, rm unused files

This commit is contained in:
llj
2013-07-31 15:34:35 +08:00
parent 08f7063e32
commit 240b105c65
7 changed files with 76 additions and 218 deletions

View File

@@ -1,75 +0,0 @@
<!DOCTYPE HTML>
<!--
/*
* jQuery File Upload Plugin postMessage API 1.1.1
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2011, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
-->
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery File Upload Plugin postMessage API</title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
</head>
<body>
<script>
/*jslint unparam: true, regexp: true */
/*global $, Blob, FormData, location */
'use strict';
var origin = /^http:\/\/example.org/,
target = new RegExp('^(http(s)?:)?\\/\\/' + location.host + '\\/');
$(window).on('message', function (e) {
e = e.originalEvent;
var s = e.data,
xhr = $.ajaxSettings.xhr(),
f;
if (!origin.test(e.origin)) {
throw new Error('Origin "' + e.origin + '" does not match ' + origin);
}
if (!target.test(e.data.url)) {
throw new Error('Target "' + e.data.url + '" does not match ' + target);
}
$(xhr.upload).on('progress', function (ev) {
ev = ev.originalEvent;
e.source.postMessage({
id: s.id,
type: ev.type,
timeStamp: ev.timeStamp,
lengthComputable: ev.lengthComputable,
loaded: ev.loaded,
total: ev.total
}, e.origin);
});
s.xhr = function () {
return xhr;
};
if (!(s.data instanceof Blob)) {
f = new FormData();
$.each(s.data, function (i, v) {
f.append(v.name, v.value);
});
s.data = f;
}
$.ajax(s).always(function (result, statusText, jqXHR) {
if (!jqXHR.done) {
jqXHR = result;
result = null;
}
e.source.postMessage({
id: s.id,
status: jqXHR.status,
statusText: statusText,
result: result,
headers: jqXHR.getAllResponseHeaders()
}, e.origin);
});
});
</script>
</body>
</html>

9
media/js/html5shiv.js vendored Normal file
View File

@@ -0,0 +1,9 @@
/*
HTML5 Shiv v3.6.2pre | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
Uncompressed source: https://github.com/aFarkas/html5shiv
*/
(function(l,f){function m(){var a=e.elements;return"string"==typeof a?a.split(" "):a}function i(a){var b=n[a[o]];b||(b={},h++,a[o]=h,n[h]=b);return b}function p(a,b,c){b||(b=f);if(g)return b.createElement(a);c||(c=i(b));b=c.cache[a]?c.cache[a].cloneNode():r.test(a)?(c.cache[a]=c.createElem(a)).cloneNode():c.createElem(a);return b.canHaveChildren&&!s.test(a)?c.frag.appendChild(b):b}function t(a,b){if(!b.cache)b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag();
a.createElement=function(c){return!e.shivMethods?b.createElem(c):p(c,a,b)};a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+m().join().replace(/\w+/g,function(a){b.createElem(a);b.frag.createElement(a);return'c("'+a+'")'})+");return n}")(e,b.frag)}function q(a){a||(a=f);var b=i(a);if(e.shivCSS&&!j&&!b.hasCSS){var c,d=a;c=d.createElement("p");d=d.getElementsByTagName("head")[0]||d.documentElement;c.innerHTML="x<style>article,aside,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}</style>";
c=d.insertBefore(c.lastChild,d.firstChild);b.hasCSS=!!c}g||t(a,b);return a}var k=l.html5||{},s=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,r=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,j,o="_html5shiv",h=0,n={},g;(function(){try{var a=f.createElement("a");a.innerHTML="<xyz></xyz>";j="hidden"in a;var b;if(!(b=1==a.childNodes.length)){f.createElement("a");var c=f.createDocumentFragment();b="undefined"==typeof c.cloneNode||
"undefined"==typeof c.createDocumentFragment||"undefined"==typeof c.createElement}g=b}catch(d){g=j=!0}})();var e={elements:k.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup main mark meter nav output progress section summary time video",version:"3.6.2pre",shivCSS:!1!==k.shivCSS,supportsUnknownElements:g,shivMethods:!1!==k.shivMethods,type:"default",shivDocument:q,createElement:p,createDocumentFragment:function(a,b){a||(a=f);if(g)return a.createDocumentFragment();
for(var b=b||i(a),c=b.frag.cloneNode(),d=0,e=m(),h=e.length;d<h;d++)c.createElement(e[d]);return c}};l.html5=e;q(f)})(this,document);

View File

@@ -1,11 +0,0 @@
/*
### jQuery Multiple File Upload Plugin v1.48 - 2012-07-19 ###
* Home: http://www.fyneworks.com/jquery/multiple-file-upload/
* Code: http://code.google.com/p/jquery-multifile-plugin/
*
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
###
*/
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('3(L.1y)(6(a){a.7.2=6(b){3(5.N==0)8 5;3(R Q[0]=="14"){3(5.N>1){l c=Q;8 5.K(6(){a.7.2.Y(a(5),c)})}a.7.2[Q[0]].Y(5,a.2b(Q).2a(1)||[]);8 5}l b=a.G({},a.7.2.v,b||{});a("29").1m("2-M").P("2-M").1u(a.7.2.T);3(a.7.2.v.X){a.7.2.1i(a.7.2.v.X);a.7.2.v.X=V}5.1m(".2-17").P("2-17").K(6(){L.2=(L.2||0)+1;l c=L.2;l d={e:5,E:a(5),I:a(5).I()};3(R b=="28")b={k:b};l e=a.G({},a.7.2.v,b||{},(a.1e?d.E.1e():a.27?d.E.12():V)||{},{});3(!(e.k>0)){e.k=d.E.B("1I")}3(!(e.k>0)){e.k=(r(d.e.1n.u(/\\b(k|24)\\-([0-9]+)\\b/o)||[""]).u(/[0-9]+/o)||[""])[0];3(!(e.k>0))e.k=-1;23 e.k=r(e.k).u(/[0-9]+/o)[0]}e.k=18 22(e.k);e.j=e.j||d.E.B("j")||"";3(!e.j){e.j=d.e.1n.u(/\\b(j\\-[\\w\\|]+)\\b/o)||"";e.j=(18 r(e.j)).p(/^(j|1a)\\-/i,"")}a.G(d,e||{});d.s=a.G({},a.7.2.v.s,d.s);a.G(d,{n:0,C:[],1Y:[],1b:d.e.A||"2"+r(c),1s:6(a){8 d.1b+(a>0?"1W"+r(a):"")},z:6(b,c){l e=d[b],f=a(c).B("t");3(e){l g=e(c,f,d);3(g!=V)8 g}8 13}});3(r(d.j).N>1){d.j=d.j.p(/\\W+/g,"|").p(/^\\W|\\W$/g,"");d.1f=18 1U("\\\\.("+(d.j?d.j:"")+")$","o")}d.H=d.1b+"1T";d.E.1H(\'<J O="2-1H" A="\'+d.H+\'"></J>\');d.1k=a("#"+d.H+"");d.e.y=d.e.y||"m"+c+"[]";3(!d.F){d.1k.16(\'<J O="2-F" A="\'+d.H+\'1p"></J>\');d.F=a("#"+d.H+"1p")}d.F=a(d.F);d.Z=6(b,e){d.n++;b.2=d;3(e>0)b.A=b.y="";3(e>0)b.A=d.1s(e);b.y=r(d.1r.p(/\\$y/o,a(d.I).B("y")).p(/\\$A/o,a(d.I).B("A")).p(/\\$g/o,c).p(/\\$i/o,e));3(d.k>0&&d.n-1>d.k)b.10=13;d.11=d.C[e]=b;b=a(b);b.19("").B("t","")[0].t="";b.P("2-17");b.1S(6(){a(5).1O();3(!d.z("1L",5,d))8 q;l c="",f=r(5.t||"");3(d.j&&f&&!f.u(d.1f))c=d.s.1z.p("$1a",r(f.u(/\\.\\w{1,4}$/o)));1B(l g 26 d.C)3(d.C[g]&&d.C[g]!=5)3(d.C[g].t==f)c=d.s.1D.p("$m",f.u(/[^\\/\\\\]+$/o));l h=a(d.I).I();h.P("2");3(c!=""){d.1F(c);d.n--;d.Z(h[0],e);b.1G().1J(h);b.D();8 q}a(5).1C({1A:"1K",1x:"-1M"});b.1N(h);d.1w(5,e);d.Z(h[0],e+1);3(!d.z("1P",5,d))8 q});a(b).12("2",d)};d.1w=6(b,c){3(!d.z("1Q",b,d))8 q;l e=a(\'<J O="2-1R"></J>\'),f=r(b.t||""),g=a(\'<1v O="2-1h" 1h="\'+d.s.U.p("$m",f)+\'">\'+d.s.m.p("$m",f.u(/[^\\/\\\\]+$/o)[0])+"</1v>"),h=a(\'<a O="2-D" 1V="#\'+d.H+\'">\'+d.s.D+"</a>");d.F.16(e.16(h," ",g));h.1t(6(){3(!d.z("1X",b,d))8 q;d.n--;d.11.10=q;d.C[c]=V;a(b).D();a(5).1G().D();a(d.11).1C({1A:"",1x:""});a(d.11).S().19("").B("t","")[0].t="";3(!d.z("1Z",b,d))8 q;8 q});3(!d.z("20",b,d))8 q};3(!d.2)d.Z(d.e,0);d.n++;d.E.12("2",d)})};a.G(a.7.2,{S:6(){l b=a(5).12("2");3(b)b.F.21("a.2-D").1t();8 a(5)},T:6(b){b=(R b=="14"?b:"")||"1d";l c=[];a("15:m.2").K(6(){3(a(5).19()=="")c[c.N]=5});8 a(c).K(6(){5.10=13}).P(b)},1c:6(b){b=(R b=="14"?b:"")||"1d";8 a("15:m."+b).25(b).K(6(){5.10=q})},M:{},1i:6(b,c,d){l e,f;d=d||[];3(d.1l.1g().1E("1j")<0)d=[d];3(R b=="6"){a.7.2.T();f=b.Y(c||L,d);1q(6(){a.7.2.1c()},1o);8 f}3(b.1l.1g().1E("1j")<0)b=[b];1B(l g=0;g<b.N;g++){e=b[g]+"";3(e)(6(b){a.7.2.M[b]=a.7[b]||6(){};a.7[b]=6(){a.7.2.T();f=a.7.2.M[b].Y(5,Q);1q(6(){a.7.2.1c()},1o);8 f}})(e)}}});a.7.2.v={j:"",k:-1,1r:"$y",s:{D:"x",1z:"2c 2d 2e a $1a m.\\2f 2g...",m:"$m",U:"2h U: $m",1D:"2i m 2j 2k 2l U:\\n$m"},X:["1u","2m","2n","2o","2p"],1F:6(a){2q(a)}};a.7.S=6(){8 5.K(6(){2r{5.S()}2s(a){}})};a(6(){a("15[2t=m].2u").2()})})(1y)',62,155,'||MultiFile|if||this|function|fn|return|||||||||||accept|max|var|file||gi|replace|false|String|STRING|value|match|options|||name|trigger|id|attr|slaves|remove||list|extend|wrapID|clone|div|each|window|intercepted|length|class|addClass|arguments|typeof|reset|disableEmpty|selected|null||autoIntercept|apply|addSlave|disabled|current|data|true|string|input|append|applied|new|val|ext|instanceKey|reEnableEmpty|mfD|metadata|rxAccept|toString|title|intercept|Array|wrapper|constructor|not|className|1e3|_list|setTimeout|namePattern|generateID|click|submit|span|addToList|top|jQuery|denied|position|for|css|duplicate|indexOf|error|parent|wrap|maxlength|prepend|absolute|onFileSelect|3000px|after|blur|afterFileSelect|onFileAppend|label|change|_wrap|RegExp|href|_F|onFileRemove|files|afterFileRemove|afterFileAppend|find|Number|else|limit|removeClass|in|meta|number|form|slice|makeArray|You|cannot|select|nTry|again|File|This|has|already|been|ajaxSubmit|ajaxForm|validate|valid|alert|try|catch|type|multi'.split('|'),0,{}))

View File

@@ -9,7 +9,7 @@
#footer { display:none; }
</style>
<!-- Shim to make HTML5 elements usable in older Internet Explorer versions -->
<!--[if lt IE 9]><script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
<!--[if lt IE 9]><script src="{{ MEDIA_URL}}js/html5shiv.js"></script><![endif]-->
{% endblock %}
{% block main_panel %}
@@ -68,22 +68,22 @@
{% if no_quota %}
<p class="error">{% trans "The owner of this library has ran out of space." %}</p>
{% else %}
<form id="fileupload" enctype="multipart/form-data" method="post" action="{{ajax_upload_url}}">{% csrf_token %}
<form id="upload-file-form" enctype="multipart/form-data" method="post" action="{{ajax_upload_url}}">{% csrf_token %}
<input type="hidden" name="parent_dir" id="parent_dir" value="{{ path }}" />
<div class="row fileupload-buttonbar">
<div>
<span class="fileinput-button vam">
<span class="icon-plus"></span>
<span>{% trans "Add files..." %}</span>
<input type="file" name="file" multiple>
<span>{% trans "Add Files" %}</span>
<input type="file" name="file" multiple />
</span>
<button type="submit" class="start vam">
<span class="icon-upload"></span>
<span>{% trans "Start upload" %}</span>
<span>{% trans "Start All" %}</span>
</button>
<button type="reset" class="cancel vam">
<span class="icon-ban-circle"></span>
<span>{% trans "Cancel upload" %}</span>
<span>{% trans "Cancel All" %}</span>
</button>
</div>
<div class="fileupload-progress fade">
@@ -93,32 +93,33 @@
<div class="progress-extended"></div>
</div>
</div>
<div class="fileupload-loading"></div>
<table class="table table-striped"><tbody class="files" data-toggle="modal-gallery" data-target="#modal-gallery"></tbody></table>
</form>
{% endif %}
</div>
<div id="update-file-dialog" class="hide">
<h3>{% trans "Update File" %}</h3>
<h3 class="hd">{% trans "Update %(file_name)s" %}</h3>
{% if no_quota %}
<p class="error">{% trans "The owner of this library has ran out of space." %}</p>
{% else %}
<form id="update-file-form" enctype="multipart/form-data" method="post" action="{{ update_url }}?head={{ repo.head_cmmt_id }}">{% csrf_token %}
<form id="update-file-form" enctype="multipart/form-data" method="post" action="{{ ajax_update_url }}?head={{ repo.head_cmmt_id }}">{% csrf_token %}
<input type="hidden" name="target_file" />
<input type="file" name="file" id="file-update-input" />
<p>({% trans "Smaller than" %} {{ max_upload_file_size|filesizeformat }})</p>
<p class="error">{{ error_msg }}</p>
<input type="submit" value="{% trans "Update" %}" class="submit" />
</form>
<div id="update-progress-con" class="upload-progress-con hide">
<p>{% trans "Uploaded:" %} <span class="upload-progress-text">{% trans "Fetching..." %}</span></p>
<div class="upload-progress-bar"></div>
<button class="upload-cancel">{% trans "Cancel" %}</button>
<iframe class="hide"><!--for chrome--></iframe>
<div class="fileupload-buttonbar">
<span class="fileinput-button vam">
<span>{% trans "Choose a file" %}</span>
<input type="file" name="file" />
</span>
<span class="vam">({% blocktrans with max_file_size=max_upload_file_size|filesizeformat %}Smaller than {{ max_file_size }} {% endblocktrans %})</span>
<div class="fileupload-progress fade">
<div class="progress progress-success progres-striped active">
<div class="bar" style="width:0%"></div>
</div>
<div class="progress-extended"></div>
</div>
</div>
<table class="table table-striped"><tbody class="files" data-toggle="modal-gallery" data-target="#modal-gallery"></tbody></table>
</form>
{% endif %}
</div>
@@ -331,15 +332,17 @@ $('#upload-file').click(function () {
reqDirData('{% url 'repo_dir_data' repo.id %}?p=' + e(cur_path));
}
});
$('#upload-file-form input[name="parent_dir"]').val(cur_path);
var form = $('#upload-file-form');
$('input[name="parent_dir"]', form).val(cur_path);
// Initialize the jQuery File Upload widget:
$('#fileupload').fileupload({
form.fileupload({
sequentialUploads: true
});
// Enable iframe cross-domain access via redirect option:
$('#fileupload').fileupload(
form.fileupload(
'option',
'redirect',
window.location.href.replace(/\/repo\/[-a-z0-9]{36}\/.*/, '/media/cors/result.html?%s')
@@ -672,11 +675,36 @@ $('.file-cp, .file-mv, .dir-cp, .dir-mv').click(function () {
return false;
});
$('.update-file').click(function() {
$('.file-update').click(function() {
var file_name = $(this).parents('.file-item').data('name');
$('#update-file-form input[name="target_file"]').val(cur_path + file_name);
$('#update-file-dialog').modal({focus:false});
$('#simplemodal-container').css({'width':'auto', 'height':'auto'});
var form = $('#update-file-form');
$('#update-file-dialog').modal({
focus:false,
containerCss: {width:600, height:$(window).height()/2},
onClose: function() {
$.modal.close();
reqDirData('{% url 'repo_dir_data' repo.id %}?p=' + e(cur_path));
}
});
$('input[name="target_file"]', form).val(cur_path + file_name);
var hd = $('#update-file-dialog .hd');
hd.html(hd.html().replace('%(file_name)s', '<span class="op-target">' + file_name + '</span>'));
// Initialize the jQuery File Upload widget:
form.fileupload({
maxFileSize: {{max_upload_file_size}}, // in bytes
maxNumberOfFiles: 1 // only 1 file can be uploaded
});
// Enable iframe cross-domain access via redirect option:
form.fileupload(
'option',
'redirect',
window.location.href.replace(/\/repo\/[-a-z0-9]{36}\/.*/, '/media/cors/result.html?%s')
);
return false;
});
@@ -972,5 +1000,4 @@ window.onload = function() {
{% include "snippets/shared_link_js.html" %}
{% include "snippets/bottom_bar.html" %}
</script>
{% include 'snippets/file_upload_progress_js.html' %}
{% endblock %}

View File

@@ -1,98 +0,0 @@
{% load i18n %}
{% if not cloud_mode or not no_quota %}
<script type="text/javascript">
function gen_uuid() {
var uuid = "";
for (var i=0; i < 32; i++) {
uuid += Math.floor(Math.random() * 16).toString(16);
}
return uuid;
}
function submitAndShowProgress(form, upload_progress_con) {
var uuid = gen_uuid(); // id for this upload so we can fetch progress info.
upload_progress_con.removeClass('hide');
// Append X-Progress-ID uuid form action
var form_action = form.attr('action');
form.attr('action', form_action += (form_action.indexOf('?') == -1 ? '?' : '&') + 'X-Progress-ID=' + uuid);
form.submit();
form.find('.submit').addClass('hide');
// Update progress: not work in chrome.
function updateProgress() {
$.ajax({
url: '{{ httpserver_root }}/upload_progress/?X-Progress-ID=' + uuid + '&callback=?',
dataType: 'jsonp',
cache: false,
success: function(data) {
if (data) {
upload_progress_con.find('.upload-progress-text').html(filesizeformat(data.uploaded, 2) + ' / ' + filesizeformat(data.length, 2));
upload_progress_con.children('.upload-progress-bar').progressbar({
value: data.uploaded / data.length * 100
});
}
}
});
setTimeout(updateProgress, 1000);
};
updateProgress();
// Update progress bar: for chrome
if ($.browser.safari) {
upload_progress_con.children('iframe').attr('src', '{{ SITE_ROOT }}file_upload_progress_page/?uuid=' + uuid + '&upload_progress_con_id=' + upload_progress_con.attr('id'));
}
return false;
};
$('#upload-file-form .submit').click(function () {
if (!$.trim($('#upload-file-list').html())) { // when choose a file repeatedly, $('#upload-file-form input[type="file"]').val() is empty, so don't use that to check
$('#upload-file-form .error').html("{% trans "Please choose a file at first." %}").removeClass('hide');
return false;
}
var total_size = 0;
$.each($('#upload-file-form input[type=file]'), function() {
if(this.files && this.files.length > 0) {
total_size += this.files[0].size;
}
});
if (total_size > {{ max_upload_file_size }}) {
$('#upload-file-form .error').html('{% trans "File size surpasses the limit." %}').removeClass('hide');
return false;
}
$('#upload-file-form .error').addClass('hide');
$.fn.MultiFile.disableEmpty(); // disable dummy element before submiting the form
submitAndShowProgress($('#upload-file-form'), $('#upload-progress-con'))
return false;
});
$('#update-file-form .submit').click(function () {
if (!$.trim($('#file-update-input').val())) {
$('#update-file-form .error').html('{% trans "Please choose a file at first." %}').removeClass('hide');
return false;
}
var file = $('#file-update-input')[0];
var size = 0;
if (file.files && file.files.length > 0) {
size = file.files[0].size;
}
if (size > {{ max_upload_file_size }}) {
$('#update-file-form .error').html('{% trans "File size surpasses the limit." %}').removeClass('hide');
return false;
}
$('#update-file-form .error').addClass('hide');
submitAndShowProgress($('#update-file-form'), $('#update-progress-con'))
return false;
});
$('.upload-cancel').click(function() {
location.reload();
});
</script>
{% endif %}

View File

@@ -101,7 +101,7 @@
<div class="displayed-op">
<a class="op download" href="{{ SITE_ROOT }}repo/{{ repo.props.id }}/{{ dirent.props.obj_id }}/?file_name={{ dirent.props.obj_name|urlencode }}&op=download">{% trans "Download"%}</a>
{% if user_perm == 'rw' %}
<a class="op update-file" href="#">{% trans "Update"%}</a>
<a class="op file-update" href="#">{% trans "Update"%}</a>
{% if not repo.encrypted %}
<a class="op file-share" href="#" data-link="{{ dirent.sharelink }}" data-token="{{ dirent.sharetoken }}">{% trans "Share" %}</a>
{% endif %}

View File

@@ -111,15 +111,21 @@ def get_ajax_upload_url(request, repo_id):
api_upload_url = get_api_upload_url(request, repo_id)
return api_upload_url.replace('api', 'aj')
def get_update_url(request, repo_id):
def get_api_update_url(request, repo_id):
username = request.user.username
if get_user_permission(request, repo_id) == 'rw':
token = seafile_api.get_httpserver_access_token(repo_id, 'dummy',
'update', username)
return gen_file_upload_url(token, 'update')
return gen_file_upload_url(token, 'update-api')
else:
return ''
def get_ajax_update_url(request, repo_id):
"""Get file upload url for AJAX.
"""
api_update_url = get_api_update_url(request, repo_id)
return api_update_url.replace('api', 'aj')
def get_fileshare(repo_id, username, path):
if path == '/': # no shared link for root dir
return None
@@ -192,7 +198,7 @@ def render_repo(request, repo):
repo_group_str = ''
upload_url = get_upload_url(request, repo.id)
ajax_upload_url = get_ajax_upload_url(request, repo.id)
update_url = get_update_url(request, repo.id)
ajax_update_url = get_ajax_update_url(request, repo.id)
fileshare = get_fileshare(repo.id, username, path)
dir_shared_link = get_dir_share_link(fileshare)
@@ -215,7 +221,7 @@ def render_repo(request, repo):
'max_upload_file_size': max_upload_file_size,
'upload_url': upload_url,
'ajax_upload_url': ajax_upload_url,
'update_url': update_url,
'ajax_update_url': ajax_update_url,
'httpserver_root': httpserver_root,
'protocol': protocol,
'domain': domain,