<h2>Latest Pack</h2>
-<img class="banner" ng-src="{{rockEndpoint}}{{pack.banner}}" alt="swage" />
+<a ng-href="{{pack.mirrors[pack.mirrors.length-1].uri}}">
+ <img class="banner" ng-src="{{rockEndpoint}}{{pack.banner}}" alt="banner" />
+</a>
<table>
<tr>
<th>Title:</th>
}
});
};
- $scope.asdf = 'hello';
+
+ var slugify = function(text)
+ {
+ return text.toString().toLowerCase()
+ .replace(/\s+/g, '-') // Replace spaces with -
+ .replace(/[^\w\-]+/g, '') // Remove all non-word chars
+ .replace(/\-\-+/g, '-') // Replace multiple - with single -
+ .replace(/^-+/, '') // Trim - from start of text
+ .replace(/-+$/, ''); // Trim - from end of text
+ };
+
$scope.pack = data;
$scope.rockEndpoint = rockEndpoint;
$scope.contributors = data.contributors.join(', ');
+
+ if($scope.pack.mirrors[$scope.pack.mirrors.length - 1].source !== 'Permalink')
+ {
+ $scope.pack.mirrors.push({
+ source: 'Permalink',
+ uri: "#/pack/" + $scope.pack.hash.substr(0,8) + "/" + slugify($scope.pack.title)
+ });
+ }
+
$rootScope.$$phase || $rootScope.$apply();
});
}
<h2>Most Popular</h2>
-<img class="banner" ng-src="{{rockEndpoint}}{{banner}}" alt="swage" />
+<a ng-href="{{packOrSimfile.mirrors[packOrSimfile.mirrors.length-1].uri}}">
+ <img class="banner" ng-src="{{rockEndpoint}}{{banner}}" alt="banner" />
+</a>
<table>
<tr>
<th>Title:</th>
$scope.banner = data.banner;
$scope.packOrSimfile = data;
+ var slugify = function(text)
+ {
+ return text.toString().toLowerCase()
+ .replace(/\s+/g, '-') // Replace spaces with -
+ .replace(/[^\w\-]+/g, '') // Remove all non-word chars
+ .replace(/\-\-+/g, '-') // Replace multiple - with single -
+ .replace(/^-+/, '') // Trim - from start of text
+ .replace(/-+$/, ''); // Trim - from end of text
+ };
+
+ if($scope.packOrSimfile.mirrors[$scope.packOrSimfile.mirrors.length - 1].source !== 'Permalink')
+ {
+ $scope.packOrSimfile.mirrors.push({
+ source: 'Permalink',
+ uri: "#/pack/" + $scope.packOrSimfile.hash.substr(0,8) + "/" + slugify($scope.packOrSimfile.title)
+ });
+ }
+
+ //this is here to cover the case where a simfile is the most downloaded thing
if(data.contributors)
{
$scope.contributors = data.contributors.join(', ');
.replace(/\-\-+/g, '-') // Replace multiple - with single -
.replace(/^-+/, '') // Trim - from start of text
.replace(/-+$/, ''); // Trim - from end of text
- }
+ };
var filesizeBytes = function(size)
{
$scope.contributors = getContributors($scope.pack.contributors);
- if($scope.pack.mirrors[$scope.pack.mirrors.length - 1].source !== 'Standalone Link')
+ if($scope.pack.mirrors[$scope.pack.mirrors.length - 1].source !== 'Permalink')
{
$scope.pack.mirrors.push({
- source: 'Standalone Link',
+ source: 'Permalink',
uri: "#/pack/" + $scope.pack.hash.substr(0,8) + "/" + slugify($scope.pack.title)
});
}
-<img ng-src="{{rockEndpoint + simfile.banner}}" alt="swage" />
+<img ng-src="{{rockEndpoint + simfile.banner}}" alt="banner" />
<table>
<tr>
<th>Title:</th>
<th>Double:</th>
<td>
<ul>
- <li ng-repeat="stepchart in steps.double">
+ <li ng-repeat="stepchart in simfile.steps.double">
<div class="difficulty {{stepchart.difficulty}}">{{stepchart.rating}} ({{stepchart.artist}})</div>
</li>
</ul>