1
0
mirror of https://github.com/quay/quay.git synced 2026-01-26 06:21:37 +03:00
Files
quay/static/js/directives/ui/source-commit-link.js
2019-11-12 11:09:47 -05:00

25 lines
717 B
JavaScript

/**
* An element which displays a link to a commit in Git or Mercurial or another source control.
*/
angular.module('quay').directive('sourceCommitLink', function () {
var directiveDefinitionObject = {
priority: 0,
templateUrl: '/static/directives/source-commit-link.html',
replace: false,
transclude: true,
restrict: 'C',
scope: {
'commitSha': '=commitSha',
'urlTemplate': '=urlTemplate',
'showTransclude': '=showTransclude'
},
controller: function($scope, $element) {
$scope.getUrl = function(sha, template) {
if (!template) { return ''; }
return template.replace('{sha}', sha);
};
}
};
return directiveDefinitionObject;
});