diff options
author | maxwell <maxwell@joindiaspora.com> | 2010-09-13 23:20:47 +0400 |
---|---|---|
committer | maxwell <maxwell@joindiaspora.com> | 2010-09-13 23:20:47 +0400 |
commit | 24d957cb3276d44a9d1da9ced39dcde5c830947a (patch) | |
tree | 05deba573b4d19e7ec085c3ad5bbdb42a2a0e6a1 | |
parent | 27f1b2958159dd1c8ac345e5ae96f21f3f7b6443 (diff) |
MS IZ removed the views and redirected the edit route
-rw-r--r-- | app/controllers/albums_controller.rb | 1 | ||||
-rw-r--r-- | app/controllers/photos_controller.rb | 2 | ||||
-rw-r--r-- | app/views/aspects/show.html.haml | 2 | ||||
-rw-r--r-- | app/views/photos/show.html.haml | 3 |
4 files changed, 6 insertions, 2 deletions
diff --git a/app/controllers/albums_controller.rb b/app/controllers/albums_controller.rb index dd7c417e3..c946f7508 100644 --- a/app/controllers/albums_controller.rb +++ b/app/controllers/albums_controller.rb @@ -34,6 +34,7 @@ class AlbumsController < ApplicationController def edit @album = Album.find_by_id params[:id] + redirect_to @album unless current_user.owns? @album end def update diff --git a/app/controllers/photos_controller.rb b/app/controllers/photos_controller.rb index 3c0fe4b4e..b684c986d 100644 --- a/app/controllers/photos_controller.rb +++ b/app/controllers/photos_controller.rb @@ -71,6 +71,8 @@ class PhotosController < ApplicationController def edit @photo = Photo.find_by_id params[:id] @album = @photo.album + + redirect_to @photo unless current_user.owns? @album end def update diff --git a/app/views/aspects/show.html.haml b/app/views/aspects/show.html.haml index 5925354f0..aea12cfe5 100644 --- a/app/views/aspects/show.html.haml +++ b/app/views/aspects/show.html.haml @@ -6,7 +6,7 @@ %ul#stream - for post in @posts - = render type_partial(post), :post => post + = render type_partial(post), :post => post unless post.class == Album #pagination = will_paginate @posts diff --git a/app/views/photos/show.html.haml b/app/views/photos/show.html.haml index cbe3505f9..37ccdcc9e 100644 --- a/app/views/photos/show.html.haml +++ b/app/views/photos/show.html.haml @@ -21,7 +21,8 @@ = @photo.image .right - = link_to 'Edit Photo', edit_photo_path(@photo), :class => "button" + -if current_user.owns? @album + = link_to 'Edit Photo', edit_photo_path(@photo), :class => "button" .sub_header = link_to "<< prev", url_to_prev(@photo, @album) |