2018-04-26 14:40:03 +02:00
|
|
|
%table#features
|
2018-04-25 15:09:24 +02:00
|
|
|
- Flipflop.feature_set.features.each do |feature|
|
|
|
|
- if !feature.group || feature.group.key != :production
|
|
|
|
%tr
|
|
|
|
%td= feature.title
|
|
|
|
%td
|
2018-04-26 14:40:03 +02:00
|
|
|
= check_box_tag "enable-feature", "enable", field.data[feature.name], data: { url: enable_feature_manager_administrateur_path(field.resource.id), key: feature.key }
|
|
|
|
|
|
|
|
:javascript
|
|
|
|
window.onload = function() {
|
|
|
|
$('#features input[type=checkbox]').on('change', function(evt) {
|
|
|
|
let url = $(evt.target).data('url');
|
|
|
|
let key = $(evt.target).data('key');
|
|
|
|
let features = {};
|
|
|
|
features[key] = $(evt.target).prop('checked');
|
|
|
|
$.ajax(url, {
|
|
|
|
method: 'put',
|
|
|
|
contentType: 'application/json',
|
|
|
|
dataType: 'json',
|
|
|
|
data: JSON.stringify({
|
|
|
|
features: features
|
|
|
|
})
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|