Skip to content
This repository has been archived by the owner on Dec 15, 2018. It is now read-only.

Commit

Permalink
Move commit-info template to its own html file
Browse files Browse the repository at this point in the history
Summary: Now we put all templates in javasript, so the bug this was trying to fix is not there anymore

Reviewers: vishal

Reviewed By: vishal

Projects: #changes

Differential Revision: https://tails.corp.dropbox.com/D84579
  • Loading branch information
stefan-avramov committed Jan 21, 2015
1 parent be8dfef commit d1ea41d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 17 deletions.
12 changes: 12 additions & 0 deletions partials/directives/commit-info.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<div>
<h5>
<a ui-sref="build_details({project_id: commit.project.slug, build_id: commit.id})">{{title}}</a>
</h5>
<div class="info">
<span ng-if="showProject"><a ui-sref="project_builds({project_id: commit.project.slug})">{{commit.project.name}}</a> &mdash;</span>
<span class="build-tag" ng-repeat="tag in commit.tags">{{tag}}</span>
<a ui-sref="project_source_details({project_id: commit.project.slug, source_id: commit.source.id})">{{commit.target}}</a>
<span ng-if="commit.author">&mdash; {{commit.author.name}}</span>
<span ng-if="commit.stats.test_failures"> &mdash; <span style="color:red">{{commit.stats.test_failures}} test failures</span></span>
</div>
</div>
18 changes: 1 addition & 17 deletions static/js/directives/commitInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,9 @@

define(['app'], function(app) {
app.directive('commitInfo', function() {
var templateContent = '' +
'<div>' +
'<h5><a ui-sref="build_details({project_id: commit.project.slug, build_id: commit.id})">{{title}}</a></h5>' +
'<div class="info">' +
'<span ng-if="showProject"><a ui-sref="project_builds({project_id: commit.project.slug})">{{commit.project.name}}</a> &mdash;</span>' +
'<span class="build-tag" ng-repeat="tag in commit.tags">{{tag}}</span>' +
'<a ui-sref="project_source_details({project_id: commit.project.slug, source_id: commit.source.id})">{{commit.target}}</a>' +
'<span ng-if="commit.author">&mdash; {{commit.author.name}}</span>' +
'<span ng-if="commit.stats.test_failures"> &mdash; <span style="color:red">{{commit.stats.test_failures}} test failures</span></span>' +
'</div>' +
'</div>';

return {
restrict: 'E',
// Workaround for a bug in Angular 1.2.1: use template instead of templateUrl.
// For more details, see https://github.com/angular/angular.js/issues/2151.
//templateUrl: 'partials/includes/commit-info.html',
template: templateContent,
templateUrl: 'partials/directives/commit-info.html',
scope: {
commit: '=',
title: '=',
Expand All @@ -30,5 +15,4 @@
};
});
});

})();

0 comments on commit d1ea41d

Please sign in to comment.