make jobs schedules disabled if the user doesn't have permission to edit

This commit is contained in:
John Mitchell 2017-01-30 13:29:21 -05:00
parent ba2ff026b3
commit 4b2daba3f7
4 changed files with 17 additions and 6 deletions

View File

@ -25,6 +25,7 @@ export default
ngClick: "toggleSchedule($event, schedule.id)",
nosort: true,
awToolTip: "{{ schedule.play_tip }}",
ngDisabled: "!schedule.summary_fields.user_capabilities.edit",
dataTipWatch: "schedule.play_tip",
dataPlacement: 'top'
},

View File

@ -6,9 +6,11 @@
border-radius: 5px;
border: 1px solid @default-icon;
background-color: @default-icon;
width: 40px;
width: 42px;
margin-top: 2px;
cursor: pointer;
display: flex;
height: 18px;
}
.ScheduleToggle-switch {
@ -22,6 +24,10 @@
font-size: 11px;
border-top-right-radius: 4px;
border-bottom-right-radius: 4px;
padding-top: 0px;
margin-top: 0px;
border-top: 0px;
border-bottom: 0px;
}
.ScheduleToggle.is-on {

View File

@ -1271,7 +1271,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat
for (i = 0; i < field.options.length; i++) {
html += "<label class=\"radio-inline ";
html += (field.options[i].labelClass) ? ` ${field.options[i].labelClass} "` : "\"";
html += (field.options[i].labelClass) ? ` ${field.options[i].labelClass} "` : "\"";
html += (field.options[i].ngShow) ? this.attr(field.options[i], 'ngShow') : "";
html += ">";
html += "<input type=\"radio\" ";

View File

@ -509,12 +509,16 @@ angular.module('GeneratorHelpers', [systemStatus.name])
html += (field['class']) ? " " + field['class'] : "";
html += " " + field.columnClass;
html += "\"><div class='ScheduleToggle' ng-class='{\"is-on\": " + list.iterator + ".";
html += (field.flag) ? field.flag : "enabled";
html += "\}' aw-tool-tip='" + field.awToolTip + "' data-placement='" + field.dataPlacement + "' data-tip-watch='" + field.dataTipWatch + "'><div ng-show='" + list.iterator + "." ;
html += (field.flag) ? field.flag : "enabled\}' ";
html += "aw-tool-tip='" + field.awToolTip + "' data-placement='" + field.dataPlacement + "' data-tip-watch='" + field.dataTipWatch + "'><button ";
html += (field['ngDisabled']) ? `ng-disabled="${field['ngDisabled']}" ` : "";
html += "ng-show='" + list.iterator + "." ;
html += (field.flag) ? field.flag : 'enabled';
html += "' class='ScheduleToggle-switch is-on' ng-click='" + field.ngClick + "'>ON</div><div ng-show='!" + list.iterator + "." ;
html += "' class='ScheduleToggle-switch is-on' ng-click='" + field.ngClick + "'>ON</button><button ";
html += (field['ngDisabled']) ? `ng-disabled="${field['ngDisabled']}" ` : "";
html += "ng-show='!" + list.iterator + "." ;
html += (field.flag) ? field.flag : "enabled";
html += "' class='ScheduleToggle-switch' ng-click='" + field.ngClick + "'>OFF</div></div></td>";
html += "' class='ScheduleToggle-switch' ng-click='" + field.ngClick + "'>OFF</button></div></td>";
} else {
html += "<td class=\"List-tableCell " + fld + "-column";
html += (field['class']) ? " " + field['class'] : "";