Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

Commit

Permalink
feat(cart): manifest link
Browse files Browse the repository at this point in the history
  • Loading branch information
Christine Yu committed Mar 5, 2015
1 parent 47e7a63 commit e304f16
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
16 changes: 2 additions & 14 deletions app/scripts/cart/templates/cart.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,8 @@ <h3 class="panel-title pull-left" data-translate>Cart Items</h3>
<span data-translate>Download Files with Metadata</span>
</a>
</li>
<li role="listitem" aria-label="{{ 'Download URLs' | translate }}">
<a data-ng-href="{{ cc.getFileIds() | makeDownloadLink }}">
<i class="fa fa-file-text-o fa-stack"></i>
<span data-translate>Download URLs</span>
</a>
</li>
<li role="listitem" aria-label="{{ 'Download Manifest' | translate }}">
<a data-ng-href="{{ cc.getFileIds() | makeDownloadLink }}">
<a data-ng-href="{{ cc.getFileIds() | makeManifestLink }}">
<i class="fa fa-file-code-o fa-stack"></i>
<span data-translate>Download Manifest</span>
</a>
Expand Down Expand Up @@ -183,14 +177,8 @@ <h3 class="panel-title pull-left" data-translate>Cart Items</h3>
<span data-translate>Download Only File</span>
</a>
</li>
<li role="listitem" aria-label="{{ 'Download URL' | translate }}">
<a data-ng-href="{{ [file.file_id] | makeDownloadLink }}">
<i class="fa fa-file-text-o fa-stack"></i>
<span data-translate>Download URL</span>
</a>
</li>
<li role="listitem" aria-label="{{ 'Download Manifest' | translate }}">
<a data-ng-href="{{ [file.file_id] | makeDownloadLink }}">
<a data-ng-href="{{ [file.file_id] | makeManifestLink }}">
<i class="fa fa-file-code-o fa-stack"></i>
<span data-translate>Download Manifest</span>
</a>
Expand Down
10 changes: 10 additions & 0 deletions app/scripts/core/core.filters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,17 @@ module ngApp.core.filters {
}
}

class MakeManifestLink {
constructor($rootScope: IScope) {
return function (ids: string[],
baseUrl: string = $rootScope.config.api) {
return baseUrl + "/manifest/" + ids.join(",");
};
}
}

angular.module("core.filters", [])
.filter("makeManifestLink", MakeManifestLink)
.filter("makeFilter", MakeFilter)
.filter("makeDownloadLink", MakeDownloadLink);
}

0 comments on commit e304f16

Please sign in to comment.