mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-20 19:08:21 +00:00
[back] fix
This commit is contained in:
@@ -124,13 +124,6 @@ $('.text-diff').each(function() {
|
|||||||
$(this).attr('href', $(this).attr('href') + '&referer=' + encodeURIComponent(location.href));
|
$(this).attr('href', $(this).attr('href') + '&referer=' + encodeURIComponent(location.href));
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.go-back').click(function() {
|
{% include 'snippets/go_back_js.html' %}
|
||||||
var referer = '{{referer|escapejs}}';
|
|
||||||
var str = location.protocol + '//' + location.host;
|
|
||||||
if (referer.indexOf(str) == 0) {
|
|
||||||
location.href = referer;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@@ -12,7 +12,7 @@
|
|||||||
{% block wide_page_content %}
|
{% block wide_page_content %}
|
||||||
<h2 class="repo-trash-hd">{% blocktrans %}<span class="op-target">{{repo_dir_name}}</span> Trash{% endblocktrans %}</h2>
|
<h2 class="repo-trash-hd">{% blocktrans %}<span class="op-target">{{repo_dir_name}}</span> Trash{% endblocktrans %}</h2>
|
||||||
{% if referer %}
|
{% if referer %}
|
||||||
<a href="{{referer}}" class="go-back" title="{% trans "Back" %}">
|
<a href="#" class="go-back" title="{% trans "Back" %}">
|
||||||
<span class="icon-chevron-left"></span>
|
<span class="icon-chevron-left"></span>
|
||||||
</a>
|
</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -179,5 +179,7 @@ $('table').on("click", ".restore-file, .restore-dir", function() {
|
|||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% include 'snippets/go_back_js.html' %}
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@@ -14,7 +14,7 @@
|
|||||||
<h2>{% blocktrans with repo_name=repo.props.name %}<span class="op-target">{{repo_name}}</span> Modification History{% endblocktrans %}</h2>
|
<h2>{% blocktrans with repo_name=repo.props.name %}<span class="op-target">{{repo_name}}</span> Modification History{% endblocktrans %}</h2>
|
||||||
|
|
||||||
{% if referer %}
|
{% if referer %}
|
||||||
<a href="{{referer}}" class="go-back" title="{% trans "Back" %}">
|
<a href="#" class="go-back" title="{% trans "Back" %}">
|
||||||
<span class="icon-chevron-left"></span>
|
<span class="icon-chevron-left"></span>
|
||||||
</a>
|
</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -81,5 +81,7 @@
|
|||||||
$('.view-snapshot').each(function() {
|
$('.view-snapshot').each(function() {
|
||||||
$(this).attr('href', $(this).attr('href') + '&referer=' + encodeURIComponent(location.href));
|
$(this).attr('href', $(this).attr('href') + '&referer=' + encodeURIComponent(location.href));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
{% include 'snippets/go_back_js.html' %}
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
<h2 class="repo-snapshot-hd">{% blocktrans with repo_name=repo.props.name %}<span class="op-target">{{repo_name}}</span> Snapshot{% endblocktrans %} <span class="commit-time">({{ current_commit.props.ctime|tsstr_sec }})</span></h2>
|
<h2 class="repo-snapshot-hd">{% blocktrans with repo_name=repo.props.name %}<span class="op-target">{{repo_name}}</span> Snapshot{% endblocktrans %} <span class="commit-time">({{ current_commit.props.ctime|tsstr_sec }})</span></h2>
|
||||||
|
|
||||||
{% if referer %}
|
{% if referer %}
|
||||||
<a href="{{referer}}" class="go-back" title="{% trans "Back" %}">
|
<a href="#" class="go-back" title="{% trans "Back" %}">
|
||||||
<span class="icon-chevron-left"></span>
|
<span class="icon-chevron-left"></span>
|
||||||
</a>
|
</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -122,5 +122,7 @@ $('.restore-file, .restore-dir').click(function() {
|
|||||||
$('.repo-history-view-link').each(function() {
|
$('.repo-history-view-link').each(function() {
|
||||||
$(this).attr('href', $(this).attr('href') + '&referer=' + encodeURIComponent(location.href));
|
$(this).attr('href', $(this).attr('href') + '&referer=' + encodeURIComponent(location.href));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
{% include 'snippets/go_back_js.html' %}
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
8
seahub/templates/snippets/go_back_js.html
Normal file
8
seahub/templates/snippets/go_back_js.html
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
$('.go-back').click(function() {
|
||||||
|
var referer = '{{referer|escapejs}}';
|
||||||
|
var str = location.protocol + '//' + location.host;
|
||||||
|
if (referer.indexOf(str) == 0) { // check referer
|
||||||
|
location.href = referer;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
});
|
@@ -12,7 +12,7 @@
|
|||||||
<h2 class="file-modification-hd"><span class="op-target">{{ u_filename }}</span> {% trans "modification details" %} <a href="{% url 'user_profile' current_commit.creator_name %}">{% avatar current_commit.creator_name 16 %}</a><span class="modifier">{{ current_commit.creator_name|email2nickname }}</span><span class="time">{{ current_commit.ctime|translate_seahub_time }}</span></h2>
|
<h2 class="file-modification-hd"><span class="op-target">{{ u_filename }}</span> {% trans "modification details" %} <a href="{% url 'user_profile' current_commit.creator_name %}">{% avatar current_commit.creator_name 16 %}</a><span class="modifier">{{ current_commit.creator_name|email2nickname }}</span><span class="time">{{ current_commit.ctime|translate_seahub_time }}</span></h2>
|
||||||
|
|
||||||
{% if referer %}
|
{% if referer %}
|
||||||
<a href="{{referer}}" class="go-back" title="{% trans "Back" %}">
|
<a href="#" class="go-back" title="{% trans "Back" %}">
|
||||||
<span class="icon-chevron-left"></span>
|
<span class="icon-chevron-left"></span>
|
||||||
</a>
|
</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -49,5 +49,6 @@
|
|||||||
|
|
||||||
{% block extra_script %}
|
{% block extra_script %}
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
{% include 'snippets/go_back_js.html' %}
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
Reference in New Issue
Block a user