diff --git a/rhodecode/templates/pullrequests/pullrequest_show.mako b/rhodecode/templates/pullrequests/pullrequest_show.mako
--- a/rhodecode/templates/pullrequests/pullrequest_show.mako
+++ b/rhodecode/templates/pullrequests/pullrequest_show.mako
@@ -211,7 +211,7 @@
% if c.at_version_num != ver_pr:
- ${len(c.comment_versions[ver_pr]['at'])}/${len(c.inline_versions[ver_pr]['at'])}
+ G:${len(c.comment_versions[ver_pr]['at'])} / I:${len(c.inline_versions[ver_pr]['at'])}
% endif
@@ -225,9 +225,13 @@
% endfor
-
- |
@@ -619,18 +623,35 @@
};
var curVal = getVal($(curNode).val());
+ var cleared = false;
+
$.each(self.$verSource, function(index, value){
var elVal = getVal($(value).val());
+
if(elVal > curVal){
+ if ($(value).is(':checked')) {
+ cleared = true;
+ }
$(value).attr('disabled', 'disabled');
$(value).removeAttr('checked');
+ $(value).css({'opacity': 0.1});
}
else{
+ $(value).css({'opacity': 1});
$(value).removeAttr('disabled');
}
});
- self.setLockAction(false, $(curNode).data('verPos'));
+ if (cleared) {
+ // if we unchecked an active, set the next one to same loc.
+ $(this.$verSource).filter('[value={0}]'.format(
+ curVal)).attr('checked', 'checked');
+ }
+
+ self.setLockAction(false,
+ $(curNode).data('verPos'),
+ $(this.$verSource).filter(':checked').data('verPos')
+ );
};
@@ -652,16 +673,21 @@
};
- this.setLockAction = function (state, selectedVersion) {
- if(state){
- $('#show-version-diff').attr('disabled','disabled')
- $('#show-version-diff').addClass('disabled')
- $('#show-version-diff').html($('#show-version-diff').data('labelText'));
+ this.setLockAction = function (state, selectedVersion, otherVersion) {
+ if (state) {
+ $('#show-version-diff').attr('disabled', 'disabled');
+ $('#show-version-diff').addClass('disabled');
+ $('#show-version-diff').html($('#show-version-diff').data('labelTextLocked'));
}
- else{
+ else {
$('#show-version-diff').removeAttr('disabled');
- $('#show-version-diff').removeClass('disabled')
- //$('#show-version-diff').html(_gettext('show changes for v') + selectedVersion)
+ $('#show-version-diff').removeClass('disabled');
+
+ if (selectedVersion == otherVersion) {
+ $('#show-version-diff').html($('#show-version-diff').data('labelTextShow'));
+ } else {
+ $('#show-version-diff').html($('#show-version-diff').data('labelTextDiff'));
+ }
}
};