Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/diaspora/diaspora.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormaxwell <maxwell@joindiaspora.com>2010-09-13 23:20:47 +0400
committermaxwell <maxwell@joindiaspora.com>2010-09-13 23:20:47 +0400
commit24d957cb3276d44a9d1da9ced39dcde5c830947a (patch)
tree05deba573b4d19e7ec085c3ad5bbdb42a2a0e6a1
parent27f1b2958159dd1c8ac345e5ae96f21f3f7b6443 (diff)
MS IZ removed the views and redirected the edit route
-rw-r--r--app/controllers/albums_controller.rb1
-rw-r--r--app/controllers/photos_controller.rb2
-rw-r--r--app/views/aspects/show.html.haml2
-rw-r--r--app/views/photos/show.html.haml3
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)