|
Lines 2-7
Link Here
|
| 2 |
[% USE raw %] |
2 |
[% USE raw %] |
| 3 |
[% USE Asset %] |
3 |
[% USE Asset %] |
| 4 |
[% USE TablesSettings %] |
4 |
[% USE TablesSettings %] |
|
|
5 |
[% USE Branches %] |
| 5 |
[%- USE KohaSpan -%] |
6 |
[%- USE KohaSpan -%] |
| 6 |
[% USE KohaTimes %] |
7 |
[% USE KohaTimes %] |
| 7 |
[% PROCESS 'i18n.inc' %] |
8 |
[% PROCESS 'i18n.inc' %] |
|
Lines 9-14
Link Here
|
| 9 |
[% INCLUDE 'doc-head-open.inc' %] |
10 |
[% INCLUDE 'doc-head-open.inc' %] |
| 10 |
[% IF library %][% SET OpacLibraryInfo = library.opac_info( lang => lang ) %][% END %] |
11 |
[% IF library %][% SET OpacLibraryInfo = library.opac_info( lang => lang ) %][% END %] |
| 11 |
|
12 |
|
|
|
13 |
[% SET ui_staff_color_background = Branches.GetBranchCustomization( Branches.GetLoggedInBranchcode, 'colors.background') %] |
| 14 |
|
| 12 |
<title |
15 |
<title |
| 13 |
>[% FILTER collapse %] |
16 |
>[% FILTER collapse %] |
| 14 |
[% IF op == 'add_form' %] |
17 |
[% IF op == 'add_form' %] |
|
Lines 512-522
Link Here
|
| 512 |
<label for="colorpicker">Primary branch color: </label> |
515 |
<label for="colorpicker">Primary branch color: </label> |
| 513 |
</div> |
516 |
</div> |
| 514 |
<div class="fg-input"> |
517 |
<div class="fg-input"> |
| 515 |
<input type="color" name="colorpicker" id="colorpicker" value="[% library.ui_staff_customization | html %]" /> |
518 |
<input type="color" id="colorpicker" value="[% ui_staff_color_background | html %]" /> |
| 516 |
<input type="text" name="ui_staff_customization" id="ui_staff_customization" readonly="readonly" size="10" maxlength="16" value="[% library.ui_staff_customization | html %]" /> |
519 |
<input type="text" id="ui_staff_customization_background" readonly="readonly" size="10" maxlength="16" value="[% ui_staff_color_background | html %]" /> |
| 517 |
<a href="#" class="clear_color"><i class="fa fa-fw fa-trash-can"></i> Clear</a> |
520 |
<a href="#" class="clear_color"><i class="fa fa-fw fa-trash-can"></i> Clear</a> |
| 518 |
</div> |
521 |
</div> |
| 519 |
</div> |
522 |
</div> |
|
|
523 |
<input type="hidden" name="ui_staff_customization" id="ui_staff_customization" value="[% library.ui_staff_customization | html %]" /> |
| 520 |
</fieldset> |
524 |
</fieldset> |
| 521 |
[% IF additional_fields.size %] |
525 |
[% IF additional_fields.size %] |
| 522 |
[% INCLUDE 'additional-fields-entry.inc' available=additional_fields values=additional_field_values wrap_fieldset=1 %] |
526 |
[% INCLUDE 'additional-fields-entry.inc' available=additional_fields values=additional_field_values wrap_fieldset=1 %] |
|
Lines 817-822
Link Here
|
| 817 |
} |
821 |
} |
| 818 |
</style> |
822 |
</style> |
| 819 |
<script> |
823 |
<script> |
|
|
824 |
function updateCustomizations() { |
| 825 |
let customizations = { colors: {} }; |
| 826 |
try { |
| 827 |
var currentJson = $hiddenField.val(); |
| 828 |
if (currentJson) { |
| 829 |
customizations = JSON.parse(currentJson); |
| 830 |
} |
| 831 |
} catch(e) { |
| 832 |
customizations = { colors: {} }; |
| 833 |
} |
| 834 |
if (!customizations.colors) customizations.colors = {}; |
| 835 |
|
| 836 |
// Get value from colorpicker, fallback to input |
| 837 |
let background = $('#colorpicker').val() || $('#ui_staff_customization_background').val(); |
| 838 |
if ( background ) { |
| 839 |
customizations.colors.background = background; |
| 840 |
} |
| 841 |
$('#ui_staff_customization').val(JSON.stringify(customizations)); |
| 842 |
} |
| 843 |
|
| 820 |
var table_settings = [% TablesSettings.GetTableSettings( 'admin', 'libraries', 'libraries', 'json' ) | $raw %]; |
844 |
var table_settings = [% TablesSettings.GetTableSettings( 'admin', 'libraries', 'libraries', 'json' ) | $raw %]; |
| 821 |
var calendarFirstDayOfWeek = '[% Koha.Preference('CalendarFirstDayOfWeek') | html %]'; |
845 |
var calendarFirstDayOfWeek = '[% Koha.Preference('CalendarFirstDayOfWeek') | html %]'; |
| 822 |
|
846 |
|
|
Lines 1032-1045
Link Here
|
| 1032 |
} |
1056 |
} |
| 1033 |
$( "#" + target ).hide(); |
1057 |
$( "#" + target ).hide(); |
| 1034 |
}); |
1058 |
}); |
| 1035 |
$("#colorpicker").on("change", function(){ |
1059 |
|
| 1036 |
let ui_staff_customization = this.value; |
1060 |
$('#colorpicker').on('change input', function() { |
| 1037 |
$("#ui_staff_customization").val( ui_staff_customization ); |
1061 |
var color = $(this).val(); |
|
|
1062 |
$('#ui_staff_customization_background').val(color); |
| 1063 |
updateCustomizations(); |
| 1064 |
}); |
| 1065 |
|
| 1066 |
$('#ui_staff_customization_background').on('change blur', function() { |
| 1067 |
var color = $(this).val(); |
| 1068 |
if (color.match(/^#[0-9A-Fa-f]{6}$/)) { |
| 1069 |
$('#colorpicker').val(color); |
| 1070 |
} |
| 1071 |
updateCustomizations(); |
| 1038 |
}); |
1072 |
}); |
| 1039 |
|
1073 |
|
| 1040 |
$(".clear_color").on("click", function(e){ |
1074 |
$('.clear_color').on('click', function(e) { |
| 1041 |
e.preventDefault(); |
1075 |
e.preventDefault(); |
| 1042 |
$("#ui_staff_customization, #colorpicker").val( "" ); |
1076 |
$('#colorpicker').val(""); |
|
|
1077 |
$('#ui_staff_customization_background').val(''); |
| 1078 |
updateCustomizations(); |
| 1043 |
}); |
1079 |
}); |
| 1044 |
</script> |
1080 |
</script> |
| 1045 |
[% END %] |
1081 |
[% END %] |
| 1046 |
- |
|
|