This repository has been archived on 2020-03-24. You can view files and clone it, but cannot push or open issues or pull requests.
quay/static/js/directives/ui/source-commit-link.js
2015-04-30 15:33:19 -04:00

23 lines
679 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) {
return template.replace('{sha}', sha);
};
}
};
return directiveDefinitionObject;
});