View | Details | Raw Unified | Return to bug 37054
Collapse All | Expand All

(-)a/Koha/Library.pm (-1 / +2 lines)
Lines 369-375 sub to_api_mapping { Link Here
369
        branchnotes      => 'notes',
369
        branchnotes      => 'notes',
370
        marcorgcode      => 'marc_org_code',
370
        marcorgcode      => 'marc_org_code',
371
        opacusercss      => undef,
371
        opacusercss      => undef,
372
        opacuserjs       => undef
372
        opacuserjs       => undef,
373
        library_color    => undef
373
    };
374
    };
374
}
375
}
375
376
(-)a/Koha/Template/Plugin/Branches.pm (+5 lines)
Lines 45-50 sub GetName { Link Here
45
    return $branchname;
45
    return $branchname;
46
}
46
}
47
47
48
sub GetLoggedInBranch {
49
    my ($self) = @_;
50
    return Koha::Libraries->find( $self->GetLoggedInBranchcode );
51
}
52
48
sub GetLoggedInBranchcode {
53
sub GetLoggedInBranchcode {
49
    my ($self) = @_;
54
    my ($self) = @_;
50
55
(-)a/admin/branches.pl (+1 lines)
Lines 98-103 if ( $op eq 'add_form' ) { Link Here
98
        public
98
        public
99
        opacuserjs
99
        opacuserjs
100
        opacusercss
100
        opacusercss
101
        library_color
101
    );
102
    );
102
    my $is_a_modif = $input->param('is_a_modif');
103
    my $is_a_modif = $input->param('is_a_modif');
103
104
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-open.inc (+8 lines)
Lines 33-35 Link Here
33
33
34
[% IF ( bidi ) %]<html lang="[% lang | html %]" dir="[% bidi | html %]">[% ELSE %]<html lang="[% lang | html %]">[% END %]
34
[% IF ( bidi ) %]<html lang="[% lang | html %]" dir="[% bidi | html %]">[% ELSE %]<html lang="[% lang | html %]">[% END %]
35
<head>
35
<head>
36
[% SET library_color = Branches.GetLoggedInBranch.library_color %]
37
[% IF library_color %]
38
    <style>
39
        :root {
40
            --library-color: [% library_color %]
41
        }
42
    </style>
43
[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt (-1 / +23 lines)
Lines 507-512 Link Here
507
                        <a class="collapse-textarea btn btn-link" id="collapse_opacusercss" data-target="opacusercss" data-syntax="css" style="display:none" href="#">Collapse<br /></a>
507
                        <a class="collapse-textarea btn btn-link" id="collapse_opacusercss" data-target="opacusercss" data-syntax="css" style="display:none" href="#">Collapse<br /></a>
508
                    </div>
508
                    </div>
509
                </div>
509
                </div>
510
                <div class="fg-row">
511
                    <div class="fg-label">
512
                        <label for="colorpicker">Primary branch color: </label>
513
                    </div>
514
                    <div class="fg-input">
515
                        <input type="color" name="colorpicker" id="colorpicker" value="[% library.library_color | html %]" />
516
                        <input type="text" name="library_color" id="library_color" readonly="readonly" size="10" maxlength="16" value="[% library.library_color | html %]" />
517
                        <a href="#" class="clear_color"><i class="fa fa-fw fa-trash-can"></i> Clear</a>
518
                    </div>
519
                </div>
510
            </fieldset>
520
            </fieldset>
511
            [% IF additional_fields.size %]
521
            [% IF additional_fields.size %]
512
                [% INCLUDE 'additional-fields-entry.inc' available=additional_fields values=additional_field_values wrap_fieldset=1 %]
522
                [% INCLUDE 'additional-fields-entry.inc' available=additional_fields values=additional_field_values wrap_fieldset=1 %]
Lines 747-752 Link Here
747
                                <span>Library hours not set</span>
757
                                <span>Library hours not set</span>
748
                            [% END %]
758
                            [% END %]
749
                        </li>
759
                        </li>
760
                        <li>
761
                            <span class="label">Library color</span>
762
                            [% library.library_color | html %]
763
                        </li>
750
                    </ol>
764
                    </ol>
751
                </div>
765
                </div>
752
                <!-- /.rows -->
766
                <!-- /.rows -->
Lines 1018-1023 Link Here
1018
            }
1032
            }
1019
            $( "#" + target ).hide();
1033
            $( "#" + target ).hide();
1020
        });
1034
        });
1035
        $("#colorpicker").on("change", function(){
1036
            let library_color = this.value;
1037
            $("#library_color").val( library_color );
1038
        });
1039
1040
        $(".clear_color").on("click", function(e){
1041
            e.preventDefault();
1042
            $("#library_color, #colorpicker").val( "" );
1043
        });
1021
    </script>
1044
    </script>
1022
[% END %]
1045
[% END %]
1023
1046
1024
- 

Return to bug 37054