webstaff: teach volcopy editor how to be embeddable
authorGalen Charlton <gmc@esilibrary.com>
Mon, 5 Oct 2015 22:00:57 +0000 (22:00 +0000)
committerKathy Lussier <klussier@masslnc.org>
Tue, 2 Feb 2016 19:58:48 +0000 (14:58 -0500)
The route /eg/staff/cat/volcopy/$key/embedded will
load the volume/copy editor in an embedded mode; specifically,

[1] the navbar and record summary will not be displayed
[2] "Save & Exit" becomes "Save changes"

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Open-ILS/src/templates/staff/cat/volcopy/t_edit.tt2
Open-ILS/src/templates/staff/cat/volcopy/t_view.tt2
Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js

index cb40f24..519765e 100644 (file)
                         </div>
                     </div>
                     <div class="col-xs-2" ng-show="only_vols">
-                        <button class="btn btn-default center-block" ng-click="workingToComplete() && saveAndExit()" type="button">[% l('Save & Exit') %]</button>
+                        <button class="btn btn-default center-block" ng-click="workingToComplete() && saveAndExit()" type="button">
+                            <span ng-if="embedded">[% l('Save changes') %]</span>
+                            <span ng-if="!embedded">[% l('Save & Exit') %]</span>
+                        </button>
                     </div>
                 </div>
             </div>
index 0379fad..f37726e 100644 (file)
@@ -1,8 +1,18 @@
-<eg-record-summary record-id="record_id" record="summaryRecord"></eg-record-summary>
+<style ng-if="embedded">
+eg-navbar {
+    display: none;
+}
+#top-content-container {
+    padding-top: 0px;
+}
+</style>
+
+<eg-record-summary ng-if="!embedded"
+     record-id="record_id" record="summaryRecord"></eg-record-summary>
 
 <!-- tabbed copy data view -->
 
-<ul class="nav nav-tabs">
+<ul class="nav nav-tabs" ng-if="!embedded">
   <li ng-class="{active : tab == 'edit'}">
     <a ng-click="tab = 'edit'" >[% l('Edit') %]</a>
   </li>
index 990062b..9f7faaa 100644 (file)
@@ -25,6 +25,11 @@ angular.module('egVolCopy',
         resolve : resolver
     });
 
+    $routeProvider.when('/cat/volcopy/:dataKey/:mode', {
+        templateUrl: './cat/volcopy/t_view',
+        controller: 'EditCtrl',
+        resolve : resolver
+    });
 })
 
 .factory('itemSvc', 
@@ -654,6 +659,8 @@ function($scope , $q , $window , $routeParams , $location , $timeout , egCore ,
         }
     };
 
+    $scope.embedded = ($routeParams.mode && $routeParams.mode == 'embedded') ? true : false;
+
     $scope.saveDefaults = function () {
         egCore.hatch.setItem('cat.copy.defaults', $scope.defaults);
     }