<form role="form" enctype="multipart/form-data" method="post" action="?do=SysConfig&action=addmodule&step={{step}}">
<input type="hidden" name="token" value="{{token}}">
<input type="hidden" id="next" name="next" value="{{next}}">
<input type="hidden" name="id" value="{{id}}">
<input type="hidden" name="edit" value="{{edit}}">
<div class="form-group">
<h4><label>{{title}}</label></h4>
<h5>{{description}}</h5>
<h4>{{lang_screenUnlocked}}</h4>
<div class="input-group">
<span class="input-group-addon slx-ga3">{{lang_title}}</span>
<input type="text" tabindex="1" name="msg_value" value="{{msg_value}}" class="form-control">
</div>
</div>
<div class="form-group">
<span class="input-group-addon top-addon">{{lang_screenText}}</span>
<textarea class="form-control summernote" id ="text-id" name="text_value" rows="5" cols="30">{{text_value}}</textarea>
</div>
<hr>
<h4>{{lang_screenLocked}}</h4>
<input type="hidden" id="inherit_locked" name="inherit_locked" value="{{inherit_locked}}">
<div class="form-group">
<div class="input-group btn-group">
<span class="input-group-addon">{{lang_screenTextInherit}}</span>
<a class="btn btn-default" id="btn-inherit-on" type="button" onclick="switchMode(true)" tabindex="2">
<span class="glyphicon glyphicon-ok"></span>
</a>
<a class="btn btn-default active" id="btn-inherit-off" onclick="switchMode(false)" tabindex="3">
<span class="glyphicon glyphicon-remove"></span>
</a>
</div>
</div>
<div class="form-group">
<div class="input-group">
<span class="input-group-addon slx-ga3">{{lang_title}}</span>
<input type="text" id="msg-locked-id" tabindex="4" name="msg_locked_value" value="{{msg_locked_value}}" class="form-control">
</div>
</div>
<div class="form-group">
<span class="input-group-addon top-addon">{{lang_screenText}}</span>
<textarea class="form-control summernote" id ="text-locked-id" name="text_locked_value" rows="5" cols="30">{{text_locked_value}}</textarea>
</div>
<div class="btn-group">
<button class="btn btn-default" type="submit" onclick="goBack()" tabindex="5">{{lang_back}}</button>
</div>
<div class="btn-group pull-right">
<button type="submit" class="btn btn-primary" tabindex="6">
{{#lastStep}}
<span class="glyphicon glyphicon-floppy-disk"></span>
{{lang_save}}
{{/lastStep}}
{{^lastStep}}{{lang_next}} »{{/lastStep}}
</button>
</div>
<div class="clearfix"></div>
</form>
<script type="text/javascript">
document.addEventListener("DOMContentLoaded", function () {
// Init summernote to e.g. disable video because xscreensaver can't handle it
$('.summernote').summernote({
toolbar: [
// [groupName, [list of button]]
['style', ['bold', 'italic', 'underline', 'clear']],
['font', ['strikethrough', 'superscript', 'subscript']],
['fontsize', ['fontsize']],
['color', ['color']],
['para', ['style', 'ul', 'ol', 'paragraph']],
['height', ['height']],
['insert', ['picture', 'link', 'table', 'hr']],
['misc', ['undo', 'redo', 'codeview', 'fullscreen']]
]
});
switchMode({{inherit_locked}});
}, false);
function switchMode(mode) {
// true = inherit on
// false = inherit off
if (mode) {
$('#msg-locked-id').prop('disabled', true);
$('#text-locked-id').summernote('disable');
$('#btn-inherit-on').addClass('active');
$('#btn-inherit-off').removeClass('active');
$('#inherit_locked').val(true);
} else {
$('#msg-locked-id').prop('disabled', false);
$('#text-locked-id').summernote('enable');
$('#btn-inherit-on').removeClass('active');
$('#btn-inherit-off').addClass('active');
$('#inherit_locked').val(false);
}
}
function goBack() {
$('#next').val('{{prev}}');
}
</script>
<style>
.slx-ga3 {
min-width: 16em;
text-align: left;
}
.top-addon {
border-right: 1px solid #ccc !important;
border-top-right-radius: 4px !important;
border-bottom-left-radius: 0 !important;
border-bottom-right-radius: 0 !important;
border-bottom: 0 !important;
}
/* Used to override some summernote css to get a proper addon header */
.note-editor.note-frame {
border-color: #ccc !important;
border-top-left-radius: 0 !important;
border-top-right-radius: 0 !important;
}
</style>