@@ -, +, @@ --- koha-tmpl/intranet-tmpl/prog/css/login.css | 8 ++--- .../intranet-tmpl/prog/en/modules/auth.tt | 12 +++++++ .../prog/en/modules/circ/set-library.tt | 33 ++----------------- .../prog/js/register_selection.js | 27 +++++++++++++++ 4 files changed, 46 insertions(+), 34 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/js/register_selection.js --- a/koha-tmpl/intranet-tmpl/prog/css/login.css +++ a/koha-tmpl/intranet-tmpl/prog/css/login.css @@ -96,6 +96,10 @@ label { padding: 3px; } +#login select { + width: 98%; +} + #login ul { list-style: none; margin: 0; @@ -113,10 +117,6 @@ label { width: 97%; } -#login #branch { - width : 99%; -} - #login #submit, #login .button { font-size: 1.4em; padding : .3em .6em; --- a/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt @@ -1,7 +1,9 @@ [% USE raw %] +[% USE Asset %] [% USE Koha %] [% USE Branches %] [% USE Categories %] +[% USE Registers %] [% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %]
+ + +
+[% END %] + @@ -121,6 +132,7 @@ [% MACRO jsinclude BLOCK %] + [% Asset.js("js/register_selection.js") | $raw %] + [% Asset.js("js/register_selection.js") | $raw %] [% END %] [% INCLUDE 'intranet-bottom.inc' %] --- a/koha-tmpl/intranet-tmpl/prog/js/register_selection.js +++ a/koha-tmpl/intranet-tmpl/prog/js/register_selection.js @@ -0,0 +1,27 @@ +$(document).ready(function() { + $("#branch").on("change", function() { + var selectedBranch = $("#branch").children( + "option:selected").val(); + + $("#register_id").children().each(function() { + // default to no-register + if ($(this).is("#noregister")) { + $(this).prop("selected", true) + } + // display branch registers + else if ($(this).hasClass(selectedBranch)) { + $(this).prop("disabled", false); + $(this).show(); + // default to branch default if there is one + if ($(this).hasClass("default")) { + $(this).prop("selected", true) + } + } + // hide non-branch registers + else { + $(this).hide(); + $(this).prop("disabled", true); + } + }); + }); +}); --