Commit 7b0d7258 authored by Michal Čihař's avatar Michal Čihař

Reset of git repository needs to be confirmed (issue #57).

parent 73ee3127
......@@ -7,7 +7,7 @@
<li><a href="{{ object.get_update_url }}" title="{% trans "Pull changes from remote repository" %}"{% if not perms.trans.update_translation %} class="disabled"{% endif %}>{% trans "Pull" %}</a></li>
<li><a href="{{ object.get_push_url }}" title="{% trans "Push changes to remote repository" %}"{% if not perms.trans.push_translation or not object.can_push %} class="disabled"{% endif %}>{% trans "Push" %}</a></li>
{% if perms.trans.reset_translation %}
<li><a href="{{ object.get_reset_url }}" title="{% trans "Reset all changes in local repository" %}">{% trans "Reset" %}</a></li>
<li><a href="{{ object.get_reset_url }}" title="{% trans "Reset all changes in local repository" %}" class="confirm-reset">{% trans "Reset" %}</a></li>
{% endif %}
</ul>
......
......@@ -235,6 +235,29 @@ $(function() {
$('.buttons').buttonset();
$('.buttons .disabled').button('disable');
$('.details-accordion').accordion({collapsible: true, active: -1});
$('.confirm-reset').click(function() {
$('<div title="' + gettext('Confirm reseting repository') + '"><p>' + gettext('Reseting the repository will throw away all local changes!') + '</p></div>').dialog({
modal: true,
autoOpen: true,
buttons: [
{
text: gettext("Ok"),
click: function() {
window.location = $('.confirm-reset').attr('href');
$(this).dialog("close");
},
},
{
text: gettext("Cancel"),
click: function() {
$(this).dialog("close");
}
}
]
});
return false;
});
},
show: function (e, ui) {
var $panel = $(ui.panel);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment