removed references of mine? method in all views
This commit is contained in:
parent
ec13527717
commit
890f927492
10 changed files with 16 additions and 16 deletions
|
|
@ -13,8 +13,7 @@ module SocketsHelper
|
|||
begin
|
||||
v = render_to_string(:partial => type_partial(object), :locals => {:post => object}) unless object.is_a? Retraction
|
||||
rescue Exception => e
|
||||
Rails.logger.error("web socket view rendering failed for some reason." + v.inspect)
|
||||
Rails.logger.error("Socketed object was #{object.inspect}")
|
||||
Rails.logger.error("web socket view rendering failed for object #{object.inspect}.")
|
||||
raise e
|
||||
end
|
||||
action_hash = {:class =>object.class.to_s.underscore.pluralize, :html => v, :post_id => obj_id(object)}
|
||||
|
|
|
|||
|
|
@ -107,6 +107,7 @@ class Person
|
|||
end
|
||||
|
||||
def owns?(post)
|
||||
puts self.class
|
||||
self.id == post.person.id
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
.album{:id => post.id, :class => ("mine" if mine?(post))}
|
||||
.album{:id => post.id, :class => ("mine" if current_user.owns?(post))}
|
||||
|
||||
%div.name
|
||||
= link_to post.name, object_path(post)
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
= @album.name
|
||||
|
||||
-if mine? @album
|
||||
-if current_user.owns? @album
|
||||
.button.right#add_photos_button
|
||||
= link_to 'Add Photos', '#'
|
||||
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
.sub_header
|
||||
="updated #{how_long_ago(@album)}"
|
||||
|
||||
-unless mine? @album
|
||||
-unless current_user.owns? @album
|
||||
%h4= "by #{@album.person.real_name}"
|
||||
|
||||
#thumbnails
|
||||
|
|
@ -25,6 +25,6 @@
|
|||
#content_bottom
|
||||
.back
|
||||
= link_to "⇧ albums", albums_path
|
||||
-if mine? @album
|
||||
-if current_user.owns? @album
|
||||
.button.right
|
||||
= link_to 'Edit Album', edit_album_path(@album)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
%li.message{:id => post.id, :class => ("mine" if mine?(post))}
|
||||
%li.message{:id => post.id, :class => ("mine" if current_user.owns?(post))}
|
||||
|
||||
= person_image_tag(post.person)
|
||||
|
||||
|
|
@ -15,6 +15,6 @@
|
|||
= link_to "show comments (#{post.comments.count})", '#', :class => "show_post_comments"
|
||||
= render "comments/comments", :post => post
|
||||
|
||||
- if mine?(post)
|
||||
- if current_user.owns?(post)
|
||||
.destroy_link
|
||||
= link_to 'Delete', blog_path(post), :confirm => 'Are you sure?', :method => :delete, :remote=> true
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
%li.message{:id => post.id, :class => ("mine" if mine?(post))}
|
||||
%li.message{:id => post.id, :class => ("mine" if current_user.owns?(post))}
|
||||
|
||||
= person_image_tag(post.person)
|
||||
|
||||
|
|
@ -16,6 +16,6 @@
|
|||
= link_to "show comments (#{post.comments.count})", '#', :class => "show_post_comments"
|
||||
= render "comments/comments", :post => post
|
||||
|
||||
- if mine?(post)
|
||||
- if current_user.owns?(post)
|
||||
.destroy_link
|
||||
= link_to 'Delete', bookmark_path(post), :confirm => 'Are you sure?', :method => :delete, :remote => true
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
#content_bottom
|
||||
.back
|
||||
= link_to "⇧ #{@album.name}", album_path(@album)
|
||||
-if mine? @album
|
||||
-if current_user.owns? @album
|
||||
.button.right
|
||||
= link_to 'Delete Photo', @photo, :confirm => 'Are you sure?', :method => :delete
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
#content_bottom
|
||||
.back
|
||||
= link_to "⇧ #{@album.name}", album_path(@album)
|
||||
-if mine? @album
|
||||
-if current_user.owns? @album
|
||||
.button.right
|
||||
= link_to 'Delete Photo', @photo, :confirm => 'Are you sure?', :method => :delete
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
%li.message{:id => post.id, :class => ("mine" if mine?(post))}
|
||||
%li.message{:id => post.id, :class => ("mine" if current_user.owns?(post))}
|
||||
= person_image_link(post.person)
|
||||
= yield post_yield_tag(post)
|
||||
= = render type_partial(post), :post => post
|
||||
= = render type_partial(post), :post => post
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
%li.message{:id => post.id, :class => ("mine" if mine?(post))}
|
||||
%li.message{:id => post.id, :class => ("mine" if current_user.owns?(post))}
|
||||
|
||||
= person_image_link(post.person)
|
||||
|
||||
|
|
@ -12,6 +12,6 @@
|
|||
= link_to "show comments (#{post.comments.count})", '#', :class => "show_post_comments"
|
||||
= render "comments/comments", :post => post
|
||||
|
||||
- if mine?(post)
|
||||
- if current_user.owns?(post)
|
||||
.destroy_link
|
||||
= link_to 'Delete', status_message_path(post), :confirm => 'Are you sure?', :method => :delete, :remote => true
|
||||
|
|
|
|||
Loading…
Reference in a new issue