diff --git a/share/templates/repo/share_admin.html b/share/templates/repo/share_admin.html index a03fd27693..d6e9110fa6 100644 --- a/share/templates/repo/share_admin.html +++ b/share/templates/repo/share_admin.html @@ -50,7 +50,7 @@ {% else %} 已过期 {% endif %} - 查看链接 + 查看链接 删除 {% endfor %} @@ -58,9 +58,9 @@ {% endif %} - + {% endblock %} @@ -80,10 +80,11 @@ $("table tr:gt(0)").hover( ); $(".view-link").click(function() { + var t = $(this).attr('data'); var l = '{{ protocol }}://' + '{{ domain }}{{ SITE_ROOT }}share/' + t + '/'; - $('textarea[name="share-link"]').val(l); - $("#view-link-form").modal({appendTo: "#main", containerCss:{padding:18}}); + $('.view-link-alert').text("共享链接为:" + l); + $("#view-link").modal({appendTo: "#main", containerCss:{padding:18}}); return false; }); diff --git a/share/views.py b/share/views.py index 15fd8c3a58..3ac7306032 100644 --- a/share/views.py +++ b/share/views.py @@ -87,16 +87,6 @@ def share_repo(request): messages.add_message(request, messages.INFO, to_email) except SearpcError, e: messages.add_message(request, messages.ERROR, to_email) -# else: -# # add email to contacts if not in contacts list -# # TODO: condition should be removed -# if from_email != to_email and Contact.objects.filter(user_email=from_email, contact_email=to_email).count() = 0: -# contact = Contact() -# contact.user_email = from_email -# contact.contact_email = to_email -# contact.contact_name = '' -# contact.note = '' -# contact.save() else: # share repo to anonymous user kwargs = {'repo_id': repo_id, diff --git a/templates/repo.html b/templates/repo.html index 0302575810..de84a73241 100644 --- a/templates/repo.html +++ b/templates/repo.html @@ -24,7 +24,11 @@ {% if not repo.props.encrypted or password_set %} {% if can_access %}
-

最新修改(更多)

+

最新修改 + {% if request.user.is_authenticated %} + (更多) + {% endif %} +

{{ latest_commit.props.desc|translate_commit_desc }}

by diff --git a/views.py b/views.py index 94e300e57b..f3447a889e 100644 --- a/views.py +++ b/views.py @@ -252,10 +252,10 @@ def repo(request, repo_id): return render_repo(request, repo_id) +@login_required def repo_history(request, repo_id): """ - If repo is public, anyone can view repo history; - If repo is not public, only persons who repo is share to can view. + View repo history """ repo_ap = seafserv_threaded_rpc.repo_query_access_property(repo_id) if not repo_ap: @@ -310,6 +310,7 @@ def repo_history(request, repo_id): 'is_owner': is_owner, }, context_instance=RequestContext(request)) +@login_required def repo_history_dir(request, repo_id): # get repo web access property, if no repo access property in db, then # assume repo ap is 'own'