webstaff: first Acq menu-entry and embedded UI
authorJason Etheridge <jason@esilibrary.com>
Mon, 17 Oct 2016 17:53:36 +0000 (13:53 -0400)
committerKathy Lussier <klussier@masslnc.org>
Tue, 22 Nov 2016 19:10:03 +0000 (14:10 -0500)
* General Search

Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Open-ILS/src/templates/staff/acq/index.tt2 [new file with mode: 0644]
Open-ILS/src/templates/staff/navbar.tt2
Open-ILS/web/js/ui/default/staff/acq/app.js [new file with mode: 0644]

diff --git a/Open-ILS/src/templates/staff/acq/index.tt2 b/Open-ILS/src/templates/staff/acq/index.tt2
new file mode 100644 (file)
index 0000000..7c26ae3
--- /dev/null
@@ -0,0 +1,21 @@
+[%
+  WRAPPER "staff/base.tt2";
+  ctx.page_title = l("Acquisitions");
+  ctx.page_app = "egAcquisitions";
+%]
+
+[% BLOCK APP_JS %]
+<script src="[% ctx.media_prefix %]/js/dojo/opensrf/md5.js"></script>
+<script src="[% ctx.media_prefix %]/js/ui/default/staff/services/grid.js"></script>
+<script src="[% ctx.media_prefix %]/js/ui/default/staff/services/eframe.js"></script>
+<script src="[% ctx.media_prefix %]/js/ui/default/staff/services/ui.js"></script>
+<script src="[% ctx.media_prefix %]/js/ui/default/staff/services/user.js"></script>
+<!--<script src="[% ctx.media_prefix %]/js/ui/default/staff/reporter/services/template.js"></script>-->
+<!--[% INCLUDE 'staff/reporter/share/report_strings.tt2' %]-->
+<script src="[% ctx.media_prefix %]/js/ui/default/staff/acq/app.js"></script>
+<link rel="stylesheet" href="[% ctx.base_path %]/staff/css/acq.css" />
+[% END %]
+
+<div ng-view></div>
+
+[% END %]
index 7430f6a..4a80382 100644 (file)
        </ul>
       </li>
 
+      <!-- acquisitions -->
+      <li class="dropdown" uib-dropdown>
+        <a href uib-dropdown-toggle>[% l('Acquisitions') %]<b class="caret"></b>
+        </a>
+        <ul uib-dropdown-menu>
+          <li>
+            <a href="./acq/legacy/search/unified" target="_self">
+              <span class="glyphicon glyphicon-search"></span>
+              [% l('General Search') %]
+            </a>
+          </li>
+          <li class="divider"></li>
+       </ul>
+      </li>
+
       <!-- admin -->
       <li class="dropdown" uib-dropdown>
         <a href uib-dropdown-toggle>[% l('Administration') %]<b class="caret"></b></a>
diff --git a/Open-ILS/web/js/ui/default/staff/acq/app.js b/Open-ILS/web/js/ui/default/staff/acq/app.js
new file mode 100644 (file)
index 0000000..902da6e
--- /dev/null
@@ -0,0 +1,46 @@
+angular.module('egAcquisitions',
+    ['ngRoute', 'ui.bootstrap', 'egCoreMod','egUiMod'])
+
+.config(['$routeProvider','$locationProvider','$compileProvider', 
+ function($routeProvider , $locationProvider , $compileProvider) {
+
+    $locationProvider.html5Mode(true);
+    $compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|blob):/); 
+    var resolver = {delay : function(egStartup) {return egStartup.go()}};
+
+    var eframe_template = 
+        '<eg-embed-frame url="acq_url" handlers="funcs"></eg-embed-frame>';
+
+    $routeProvider.when('/acq/legacy/:noun/:verb', {
+        template: eframe_template,
+        controller: 'EmbedAcqCtl',
+        resolve : resolver
+    });
+
+    // default page 
+    $routeProvider.otherwise({
+        templateUrl : './t_splash',
+        resolve : resolver
+    });
+}])
+
+.controller('EmbedAcqCtl', 
+       ['$scope','$routeParams','$location','egCore',
+function($scope , $routeParams , $location , egCore) {
+
+    $scope.funcs = {
+        ses : egCore.auth.token(),
+    }
+
+    var acq_path = '/eg/acq/' + 
+        $routeParams.noun + '/' + $routeParams.verb;
+
+    // embed URL must include protocol/domain or it will be loaded via
+    // push-state, resulting in an infinitely nested pages.
+    $scope.acq_url = 
+        $location.absUrl().replace(/\/eg\/staff.*/, acq_path);
+
+    console.log('Loading Acq URL: ' + $scope.acq_url);
+
+}])
+