From a307cec41c8f4146cc3218faeec11b9a042b564c Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Thu, 8 Oct 2015 02:09:41 +0000 Subject: [PATCH] webstaff: implement subfield stacking in MARC editor Signed-off-by: Galen Charlton Signed-off-by: Kathy Lussier --- .../src/templates/staff/cat/share/t_marcedit.tt2 | 4 ++++ Open-ILS/src/templates/staff/css/cat.css.tt2 | 5 +++++ .../web/js/ui/default/staff/cat/services/marcedit.js | 12 +++++++++++- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/templates/staff/cat/share/t_marcedit.tt2 b/Open-ILS/src/templates/staff/cat/share/t_marcedit.tt2 index 808438f61c..92dc60b55c 100644 --- a/Open-ILS/src/templates/staff/cat/share/t_marcedit.tt2 +++ b/Open-ILS/src/templates/staff/cat/share/t_marcedit.tt2 @@ -141,6 +141,10 @@
+
diff --git a/Open-ILS/src/templates/staff/css/cat.css.tt2 b/Open-ILS/src/templates/staff/css/cat.css.tt2 index 7a5e12dcae..a94f56ef17 100644 --- a/Open-ILS/src/templates/staff/css/cat.css.tt2 +++ b/Open-ILS/src/templates/staff/css/cat.css.tt2 @@ -28,6 +28,11 @@ margin: 0px; } +.marcedit_stacked_subfield { + display: block; + margin-left: 3em; +} + input.marcedit:focus { background-color: lightcyan; } diff --git a/Open-ILS/web/js/ui/default/staff/cat/services/marcedit.js b/Open-ILS/web/js/ui/default/staff/cat/services/marcedit.js index ae88380100..ce6f4c876e 100644 --- a/Open-ILS/web/js/ui/default/staff/cat/services/marcedit.js +++ b/Open-ILS/web/js/ui/default/staff/cat/services/marcedit.js @@ -418,9 +418,10 @@ angular.module('egMarcMod', ['egCoreMod', 'ui.bootstrap']) ''+ ''+ ''+ - ''+ + ''+ // FIXME: template should probably be moved to file to improve // translatibility + '' + '
', scope: { field: "=", onKeydown: '=', contextFunctions: '=' }, replace: true, controller : ['$scope','$modal', function ( $scope, $modal ) { + $scope.stackSubfields = $scope.$parent.$parent.stackSubfields; $scope.isAuthorityControlled = function () { return ($scope.$parent.$parent.record_type == 'bre') && $scope.$parent.$parent.controlSet.bibFieldByTag($scope.field.tag); @@ -636,6 +639,13 @@ angular.module('egMarcMod', ['egCoreMod', 'ui.bootstrap']) $scope.controlfields = []; $scope.datafields = []; $scope.controlSet = egTagTable.getAuthorityControlSet(); + $scope.stackSubfields = { enabled : false }; + egCore.hatch.getItem('cat.marcedit.stack_subfields').then(function(val) { + $scope.stackSubfields.enabled = val; + }); + $scope.$watch('stackSubfields.enabled', function (newVal, oldVal) { + if (newVal != oldVal) egCore.hatch.setItem('cat.marcedit.stack_subfields', newVal); + }); egTagTable.loadTagTable({ marcRecordType : $scope.record_type }); -- 2.43.2