#2: Fixed album editing URL + ui-sref cleanup.

This commit is contained in:
Peter Deltchev 2016-03-19 01:28:35 -07:00
parent d3ea7cccb6
commit 8d29b39ea5
4 changed files with 4 additions and 3 deletions

View file

@ -212,6 +212,7 @@ class Album extends Model implements Searchable
'user' => [
'id' => (int) $album->user->id,
'name' => $album->user->display_name,
'slug' => $album->user->slug,
'url' => $album->user->url,
],
'user_data' => $userData,

View file

@ -11,7 +11,7 @@
<div class="list">
<ul class="account-albums-listing stretch-to-bottom">
<li ng-repeat="album in albums track by album.id" ng-class="{selected: album.id == data.selectedAlbum.id}">
<a ui-sref=".edit({album_id: {{::album.id}}})">
<a ui-sref=".edit(::{album_id: album.id})">
<img pfm-src-loader="album.covers.normal" pfm-src-size="normal" class="image" />
<span class="title">{{album.title}}</span>
<span class="published">{{album.created_at | date:'MM/dd/yyyy'}}</span>

View file

@ -2,7 +2,7 @@
<div class="list">
<ul class="account-tracks-listing stretch-to-bottom">
<li ng-repeat="track in tracks track by track.id" ng-class="{selected: track.id == data.selectedTrack.id, 'is-not-published': !track.is_published}">
<a ui-sref=".edit({track_id: {{::track.id}}})" ng-click="selectTrack(track)">
<a ui-sref=".edit(::{track_id: track.id})" ng-click="selectTrack(track)">
<img class="image" ng-src="{{track.cover_url}}" />
<span class="title">{{track.title}}</span>
<span class="published">{{track.created_at | date:'MM/dd/yyyy'}}</span>

View file

@ -21,7 +21,7 @@
</li>
<li><a href="#" class="btn" pfm-eat-click ng-click="share()">Share</a></li>
<li><pfm-favourite-button resource="::album" type="album"></pfm-favourite-button></li>
<li ng-show="::album.permissions.edit"><a class="btn btn-small" ng-href="/account/albums/edit/{{::album.id}}">Edit</a></li>
<li ng-if="::album.permissions.edit"><a class="btn btn-small" ui-sref="content.artist.account.albums.edit(::{slug: album.user.slug, album_id: album.id})">Edit</a></li>
</ul>
<header>