Merge remote-tracking branch 'origin/master' into merge_master

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
Roberto Rosario
2017-05-24 15:02:36 -04:00
10 changed files with 169 additions and 9 deletions

View File

@@ -16,11 +16,16 @@ class DocumentMetadataForm(forms.Form):
label=_('Name'), required=False,
widget=forms.TextInput(attrs={'readonly': 'readonly'})
)
value = forms.CharField(label=_('Value'), required=False)
value = forms.CharField(label=_('Value'), required=False,
widget=forms.TextInput(attrs={'class': 'metadata-value'})
)
update = forms.BooleanField(
initial=True, label=_('Update'), required=False
)
class Media:
js = ('metadata/js/metadata_form.js',)
def __init__(self, *args, **kwargs):
super(DocumentMetadataForm, self).__init__(*args, **kwargs)

View File

@@ -0,0 +1,11 @@
'use strict';
waitForJQuery(function() {
jQuery(document).ready(function() {
$('.metadata-value').on('input', function(event) {
// Check the checkbox next to a metadata value input when there is
// data entry in the value's input.
$(event.target).parents('tr').find(':checkbox').prop('checked', true);
});
});
});