From 2e23d13369b0f4ed5a349aeeb0fe8f1e3325bbb4 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Mon, 19 May 2014 10:42:31 -0400 Subject: [PATCH] grid cell values may be rendered as hrefs added links from item status -> title to catalog added links from patron items out to item status and catalog. Signed-off-by: Bill Erickson --- Open-ILS/src/templates/staff/cat/item/t_list.tt2 | 8 +++++++- .../src/templates/staff/circ/patron/t_items_out.tt2 | 9 +++++++-- Open-ILS/src/templates/staff/share/t_autogrid.tt2 | 11 ++++++++++- Open-ILS/web/js/ui/default/staff/services/grid.js | 17 +++++++++++++++-- 4 files changed, 39 insertions(+), 6 deletions(-) diff --git a/Open-ILS/src/templates/staff/cat/item/t_list.tt2 b/Open-ILS/src/templates/staff/cat/item/t_list.tt2 index d3fe261da7..220a85343e 100644 --- a/Open-ILS/src/templates/staff/cat/item/t_list.tt2 +++ b/Open-ILS/src/templates/staff/cat/item/t_list.tt2 @@ -10,6 +10,12 @@ - + + + + diff --git a/Open-ILS/src/templates/staff/circ/patron/t_items_out.tt2 b/Open-ILS/src/templates/staff/circ/patron/t_items_out.tt2 index 612c732de7..d381e326d1 100644 --- a/Open-ILS/src/templates/staff/circ/patron/t_items_out.tt2 +++ b/Open-ILS/src/templates/staff/circ/patron/t_items_out.tt2 @@ -8,11 +8,16 @@ items-provider="gridDataProvider" persist-key="circ.patron.items_out"> - + + - + + diff --git a/Open-ILS/src/templates/staff/share/t_autogrid.tt2 b/Open-ILS/src/templates/staff/share/t_autogrid.tt2 index 27439e9e34..06e8546284 100644 --- a/Open-ILS/src/templates/staff/share/t_autogrid.tt2 +++ b/Open-ILS/src/templates/staff/share/t_autogrid.tt2 @@ -261,7 +261,16 @@ ng-repeat="col in columns" style="flex:{{col.flex}}" ng-show="col.visible"> - {{itemFieldValue(item, col)}} + + + + {{itemFieldValue(item, col)}} + + + {{itemFieldValue(item, col)}} + diff --git a/Open-ILS/web/js/ui/default/staff/services/grid.js b/Open-ILS/web/js/ui/default/staff/services/grid.js index dcb48809af..5051681e6c 100644 --- a/Open-ILS/web/js/ui/default/staff/services/grid.js +++ b/Open-ILS/web/js/ui/default/staff/services/grid.js @@ -662,6 +662,12 @@ angular.module('egGridMod', return csvStr; } + // Interpolate the value for column.linkpath within the context + // of the row item to generate the final link URL. + $scope.generateLinkPath = function(col, item) { + return egCore.strings.$replace(col.linkpath, {item : item}); + } + $scope.collect = function() { grid.collect() } // asks the dataProvider for a page of data @@ -694,12 +700,18 @@ angular.module('egGridMod', return { require : '^egGrid', restrict : 'AE', - transclude : true, scope : { name : '@', // required; unique name path : '@', // optional; flesh path label : '@', // optional; display label - flex : '@' // optional; default flex width + flex : '@', // optional; default flex width + + // optional: url path string for generating links from grid cells. + // The path must be a quoted string and may include interpolation + // expressions. e.g. + // linkpath="'./cat/item/{{item.id()}}'" + linkpath : '=', + }, link : function(scope, element, attrs, egGridCtrl) { @@ -830,6 +842,7 @@ angular.module('egGridMod', flex : Number(colSpec.flex) || 2, sort : Number(colSpec.sort) || 0, required : colSpec.required, + linkpath : colSpec.linkpath, visible : colSpec.visible, hidden : colSpec.hidden, datatype : colSpec.datatype, -- 2.11.0