initial import for Open Source 🎉
This commit is contained in:
parent
1898c361f3
commit
9c0dd3b722
2048 changed files with 218743 additions and 0 deletions
24
static/js/directives/ui/source-commit-link.js
Normal file
24
static/js/directives/ui/source-commit-link.js
Normal file
|
@ -0,0 +1,24 @@
|
|||
/**
|
||||
* 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;
|
||||
});
|
Reference in a new issue