Commit e70e48d6 authored by Jonne Haß's avatar Jonne Haß

some refactoring regarding the law of demeter

parent f0619dbb
......@@ -86,7 +86,7 @@ class ApplicationController < ActionController::Base
def set_grammatical_gender
if (user_signed_in? && I18n.inflector.inflected_locale?)
gender = current_user.profile.gender.to_s.tr('!()[]"\'`*=|/\#.,-:', '').downcase
gender = current_user.gender.to_s.tr('!()[]"\'`*=|/\#.,-:', '').downcase
unless gender.empty?
i_langs = I18n.inflector.inflected_locales(:gender)
i_langs.delete I18n.locale
......
......@@ -5,10 +5,10 @@ class ConversationsController < ApplicationController
def index
@conversations = Conversation.joins(:conversation_visibilities).where(
:conversation_visibilities => {:person_id => current_user.person.id}).paginate(
:conversation_visibilities => {:person_id => current_user.person_id}).paginate(
:page => params[:page], :per_page => 15, :order => 'updated_at DESC')
@visibilities = ConversationVisibility.where(:person_id => current_user.person.id).paginate(
@visibilities = ConversationVisibility.where(:person_id => current_user.person_id).paginate(
:page => params[:page], :per_page => 15, :order => 'updated_at DESC')
@unread_counts = {}
......@@ -18,7 +18,7 @@ class ConversationsController < ApplicationController
@conversations.each { |c| @authors[c.id] = c.last_author }
@conversation = Conversation.joins(:conversation_visibilities).where(
:conversation_visibilities => {:person_id => current_user.person.id, :conversation_id => params[:conversation_id]}).first
:conversation_visibilities => {:person_id => current_user.person_id, :conversation_id => params[:conversation_id]}).first
respond_with do |format|
format.html
......@@ -31,7 +31,7 @@ class ConversationsController < ApplicationController
contact.person_id
end
params[:conversation][:participant_ids] = person_ids | [current_user.person.id]
params[:conversation][:participant_ids] = person_ids | [current_user.person_id]
params[:conversation][:author] = current_user.person
message_text = params[:conversation].delete(:text)
params[:conversation][:messages_attributes] = [ {:author => current_user.person, :text => message_text }]
......@@ -52,7 +52,7 @@ class ConversationsController < ApplicationController
def show
if @conversation = Conversation.joins(:conversation_visibilities).where(:id => params[:id],
:conversation_visibilities => {:person_id => current_user.person.id}).first
:conversation_visibilities => {:person_id => current_user.person_id}).first
if @visibility = ConversationVisibility.where(:conversation_id => params[:id], :person_id => current_user.person.id).first
@visibility.unread = 0
@visibility.save
......
......@@ -11,7 +11,7 @@ class MessagesController < ApplicationController
def create
cnv = Conversation.joins(:conversation_visibilities).where(:id => params[:conversation_id],
:conversation_visibilities => {:person_id => current_user.person.id}).first
:conversation_visibilities => {:person_id => current_user.person_id}).first
if cnv
message = Message.new(:conversation_id => cnv.id, :text => params[:message][:text], :author => current_user.person)
......
......@@ -58,7 +58,7 @@ class PhotosController < ApplicationController
end
def make_profile_photo
author_id = current_user.person.id
author_id = current_user.person_id
@photo = Photo.where(:id => params[:photo_id], :author_id => author_id).first
if @photo
......
......@@ -42,7 +42,7 @@ class ProfilesController < ApplicationController
@profile_attrs[:nsfw] ||= false
if params[:photo_id]
@profile_attrs[:photo] = Photo.where(:author_id => current_user.person.id, :id => params[:photo_id]).first
@profile_attrs[:photo] = Photo.where(:author_id => current_user.person_id, :id => params[:photo_id]).first
end
if current_user.update_profile(@profile_attrs)
......
......@@ -6,7 +6,7 @@ class ResharesController < ApplicationController
@reshare = current_user.build_post(:reshare, :root_guid => params[:root_guid])
if @reshare.save
current_user.add_to_streams(@reshare, current_user.aspects)
current_user.dispatch_post(@reshare, :url => post_url(@reshare), :additional_subscribers => @reshare.root.author)
current_user.dispatch_post(@reshare, :url => post_url(@reshare), :additional_subscribers => @reshare.root_author)
end
render :json => ExtremePostPresenter.new(@reshare, current_user), :status => 201
......
......@@ -33,9 +33,9 @@ class ServicesController < ApplicationController
current_user.services << service
if service.persisted?
fetch_photo = current_user.person.profile[:image_url].blank?
fetch_photo = current_user.profile[:image_url].blank?
current_user.update_profile(current_user.person.profile.from_omniauth_hash(user))
current_user.update_profile(current_user.profile.from_omniauth_hash(user))
Resque.enqueue(Jobs::FetchProfilePhoto, current_user.id, service.id, user["image"]) if fetch_photo
flash[:notice] = I18n.t 'services.create.success'
......@@ -44,7 +44,7 @@ class ServicesController < ApplicationController
if existing_service = Service.where(:type => service.type.to_s, :uid => service.uid).first
flash[:error] << I18n.t('services.create.already_authorized',
:diaspora_id => existing_service.user.person.profile.diaspora_handle,
:diaspora_id => existing_service.user.profile.diaspora_handle,
:service_name => provider.camelize )
end
end
......@@ -65,4 +65,4 @@ class ServicesController < ApplicationController
redirect_to services_url
end
end
\ No newline at end of file
end
......@@ -101,7 +101,7 @@ class UsersController < ApplicationController
if @user = User.find_by_username(params[:username])
respond_to do |format|
format.atom do
@posts = StatusMessage.where(:author_id => @user.person.id, :public => true).order('created_at DESC').limit(25)
@posts = StatusMessage.where(:author_id => @user.person_id, :public => true).order('created_at DESC').limit(25)
end
format.any { redirect_to person_path(@user.person) }
......@@ -140,7 +140,7 @@ class UsersController < ApplicationController
username = params[:username].split('@')[0]
user = User.find_by_username(username)
if user.present?
redirect_to user.profile.image_url
redirect_to user.image_url
else
render :nothing => true, :status => 404
end
......
......@@ -6,9 +6,9 @@ module ContactsHelper
:action => 'destroy',
:id => 42,
:aspect_id => @aspect.id,
:person_id => contact.person.id
:person_id => contact.person_id
},
:title => t('.remove_person_from_aspect', :person_name => contact.person.first_name, :aspect_name => @aspect.name),
:title => t('.remove_person_from_aspect', :person_name => contact.person_first_name, :aspect_name => @aspect.name),
:method => 'delete')
else
......@@ -17,4 +17,4 @@ module ContactsHelper
:current_user => current_user }
end
end
end
\ No newline at end of file
end
......@@ -4,7 +4,7 @@ module InvitationCodesHelper
content_tag(:div, :class => 'media well') do
person_image_link(invite.user.person, :class => 'img') +
content_tag(:div, :class => 'bd') do
I18n.translate('invitation_codes.excited', :name => invite.user.name)
I18n.translate('invitation_codes.excited', :name => invite.user_name)
end
end
end
......
......@@ -8,11 +8,11 @@ module MobileHelper
if (post.public? || reshare?(post)) && (user_signed_in? && post.author != current_user.person)
root = reshare?(post) ? post.root : post
if root.author != current_user.person.id
reshare = Reshare.where(:author_id => current_user.person.id,
if root.author != current_user.person_id
reshare = Reshare.where(:author_id => current_user.person_id,
:root_guid => root.guid).first
klass = reshare.present? ? "active" : "inactive"
link_to '', reshares_path(:root_guid => root.guid), :title => t('reshares.reshare.reshare_confirmation', :author => root.author.name), :class => "image_link reshare_action #{klass}"
link_to '', reshares_path(:root_guid => root.guid), :title => t('reshares.reshare.reshare_confirmation', :author => root.author_name), :class => "image_link reshare_action #{klass}"
end
end
end
......
......@@ -13,7 +13,7 @@ module NotificationsHelper
end
elsif note.instance_of?(Notifications::CommentOnPost) || note.instance_of?(Notifications::AlsoCommented) || note.instance_of?(Notifications::Reshared) || note.instance_of?(Notifications::Liked)
if post = note.linked_object
translation(target_type, :actors => actors, :count => actors_count, :post_author => h(post.author.name), :post_link => link_to(t('notifications.post'), post_path(post), 'data-ref' => post.id, :class => 'hard_object_link').html_safe)
translation(target_type, :actors => actors, :count => actors_count, :post_author => h(post.author_name), :post_link => link_to(t('notifications.post'), post_path(post), 'data-ref' => post.id, :class => 'hard_object_link').html_safe)
else
t(note.deleted_translation_key, :actors => actors, :count => actors_count).html_safe
end
......
......@@ -5,14 +5,14 @@
module PostsHelper
def post_page_title(post, opts={})
if post.is_a?(Photo)
I18n.t "posts.show.photos_by", :count => 1, :author => post.status_message.author.name
I18n.t "posts.show.photos_by", :count => 1, :author => post.status_message_author_name
elsif post.is_a?(Reshare)
I18n.t "posts.show.reshare_by", :author => post.author.name
I18n.t "posts.show.reshare_by", :author => post.author_name
else
if post.text.present?
truncate(post.text(:plain_text => true), :length => opts.fetch(:length, 20))
elsif post.respond_to?(:photos) && post.photos.present?
I18n.t "posts.show.photos_by", :count => post.photos.size, :author => post.author.name
I18n.t "posts.show.photos_by", :count => post.photos.size, :author => post.author_name
end
end
end
......
......@@ -3,13 +3,14 @@ module NotificationMailers
include ActionView::Helpers::TextHelper
attr_accessor :comment
delegate :post, to: :comment, prefix: true
def set_headers(comment_id)
@comment = Comment.find_by_id(comment_id)
if mail?
@headers[:from] = "\"#{@comment.author.name} (Diaspora*)\" <#{AppConfig[:smtp_sender_address]}>"
@headers[:subject] = truncate(@comment.parent.comment_email_subject, :length => TRUNCATION_LEN)
@headers[:from] = "\"#{@comment.author_name} (Diaspora*)\" <#{AppConfig[:smtp_sender_address]}>"
@headers[:subject] = truncate(@comment.comment_email_subject, :length => TRUNCATION_LEN)
@headers[:subject] = "Re: #{@headers[:subject]}"
end
end
......
......@@ -3,6 +3,10 @@ module NotificationMailers
class Base
attr_accessor :recipient, :sender
delegate :unconfirmed_email, :confirm_email_token,
:first_name, to: :recipient, prefix: true
delegate :first_name, :name, :sender, to: :sender, prefix: true
def initialize(recipient_id, sender_id=nil, *args)
@headers = {}
......
......@@ -7,8 +7,8 @@ module NotificationMailers
def set_headers(comment_id)
@comment = Comment.find(comment_id)
@headers[:from] = "\"#{@comment.author.name} (Diaspora*)\" <#{AppConfig[:smtp_sender_address]}>"
@headers[:subject] = truncate(@comment.parent.comment_email_subject, :length => TRUNCATION_LEN)
@headers[:from] = "\"#{@comment.author_name} (Diaspora*)\" <#{AppConfig[:smtp_sender_address]}>"
@headers[:subject] = truncate(@comment.comment_email_subject, :length => TRUNCATION_LEN)
@headers[:subject] = "Re: #{@headers[:subject]}"
end
end
......
module NotificationMailers
class ConfirmEmail < NotificationMailers::Base
def set_headers
@headers[:to] = name_and_address(@recipient.profile.first_name, @recipient.unconfirmed_email)
@headers[:to] = name_and_address(@recipient.first_name, @recipient.unconfirmed_email)
@headers[:subject] = I18n.t('notifier.confirm_email.subject', :unconfirmed_email => @recipient.unconfirmed_email)
end
end
......
module NotificationMailers
class Liked < NotificationMailers::Base
attr_accessor :like
delegate :target, to: :like, prefix: true
def set_headers(like_id)
@like = Like.find(like_id)
......@@ -8,4 +9,4 @@ module NotificationMailers
@headers[:subject] = I18n.t('notifier.liked.liked', :name => @sender.name)
end
end
end
\ No newline at end of file
end
module NotificationMailers
class Mentioned < NotificationMailers::Base
attr_accessor :post
delegate :author_name, to: :post, prefix: true
def set_headers(target_id)
@post = Mention.find_by_id(target_id).post
......@@ -8,4 +9,4 @@ module NotificationMailers
@headers[:subject] = I18n.t('notifier.mentioned.subject', :name => @sender.name)
end
end
end
\ No newline at end of file
end
......@@ -7,7 +7,7 @@ module NotificationMailers
@conversation = @message.conversation
@participants = @conversation.participants
@headers[:from] = "\"#{@message.author.name} (Diaspora*)\" <#{AppConfig[:smtp_sender_address]}>"
@headers[:from] = "\"#{@message.author_name} (Diaspora*)\" <#{AppConfig[:smtp_sender_address]}>"
@headers[:subject] = @conversation.subject.strip
@headers[:subject] = "Re: #{@headers[:subject]}" if @conversation.messages.size > 1
end
......
module NotificationMailers
class Reshared < NotificationMailers::Base
attr_accessor :reshare
delegate :root, to: :reshare, prefix: true
def set_headers(reshare_id)
@reshare = Reshare.find(reshare_id)
......@@ -8,4 +10,4 @@ module NotificationMailers
@headers[:subject] = I18n.t('notifier.reshared.reshared', :name => @sender.name)
end
end
end
\ No newline at end of file
end
......@@ -43,7 +43,7 @@ class Notifier < ActionMailer::Base
@invitation_code = invitation_code
mail_opts = {:to => email, :from => AppConfig[:smtp_sender_address],
:subject => I18n.t('notifier.invited_you', :name => @inviter.person.name),
:subject => I18n.t('notifier.invited_you', :name => @inviter.name),
:host => AppConfig[:pod_uri].host}
I18n.with_locale(locale) do
......
......@@ -2,6 +2,8 @@ class Block < ActiveRecord::Base
belongs_to :person
belongs_to :user
delegate :name, to: :person, prefix: true
validates :user_id, :presence => true
validates :person_id, :presence => true, :uniqueness => { :scope => :user_id }
......@@ -12,4 +14,4 @@ class Block < ActiveRecord::Base
errors[:person_id] << "stop blocking yourself!"
end
end
end
\ No newline at end of file
end
......@@ -22,6 +22,10 @@ class Comment < ActiveRecord::Base
belongs_to :commentable, :touch => true, :polymorphic => true
alias_attribute :post, :commentable
belongs_to :author, :class_name => 'Person'
delegate :name, to: :author, prefix: true
delegate :comment_email_subject, to: :parent
delegate :author_name, to: :parent, prefix: true
validates :text, :presence => true, :length => {:maximum => 65535}
validates :parent, :presence => true #should be in relayable (pending on fixing Message)
......
......@@ -7,6 +7,9 @@ class Contact < ActiveRecord::Base
belongs_to :person
validates :person, :presence => true
delegate :name, :diaspora_handle, :guid, :first_name,
to: :person, prefix: true
has_many :aspect_memberships
has_many :aspects, :through => :aspect_memberships
......@@ -72,7 +75,7 @@ class Contact < ActiveRecord::Base
incoming_aspects = Aspect.where(
:user_id => self.person.owner_id,
:contacts_visible => true).joins(:contacts).where(
:contacts => {:person_id => self.user.person.id}).select('aspects.id')
:contacts => {:person_id => self.user.person_id}).select('aspects.id')
incoming_aspect_ids = incoming_aspects.map{|a| a.id}
similar_contacts = Person.joins(:contacts => :aspect_memberships).where(
:aspect_memberships => {:aspect_id => incoming_aspect_ids}).where(people[:id].not_eq(self.user.person.id)).select('DISTINCT people.*')
......
......@@ -5,6 +5,8 @@ class InvitationCode < ActiveRecord::Base
before_create :generate_token, :set_default_invite_count
delegate :name, to: :user, prefix: true
def to_param
token
end
......
......@@ -11,6 +11,8 @@ class Message < ActiveRecord::Base
belongs_to :author, :class_name => 'Person'
belongs_to :conversation, :touch => true
delegate :name, to: :author, prefix: true
validates :text, :presence => true
validate :participant_of_parent_conversation
......
......@@ -32,7 +32,9 @@ class Person < ActiveRecord::Base
xml_attr :exported_key
has_one :profile, :dependent => :destroy
delegate :last_name, :image_url, :to => :profile
delegate :last_name, :image_url, :tag_string, :bio, :location,
:gender, :birthday, :formatted_birthday, :tags, :searchable,
to: :profile
accepts_nested_attributes_for :profile
before_validation :downcase_diaspora_handle
......
......@@ -41,6 +41,7 @@ class Photo < ActiveRecord::Base
belongs_to :status_message, :foreign_key => :status_message_guid, :primary_key => :guid
validates_associated :status_message
delegate :author_name, to: :status_message, prefix: true
attr_accessible :text, :pending
validate :ownership_of_status_message
......
......@@ -9,6 +9,7 @@ class Reshare < Post
attr_accessible :root_guid, :public
validates_presence_of :root, :on => :create
validates_uniqueness_of :root_guid, :scope => :author_id
delegate :author, to: :root, prefix: true
xml_attr :root_diaspora_id
xml_attr :root_guid
......@@ -58,7 +59,7 @@ class Reshare < Post
end
def comment_email_subject
I18n.t('reshares.comment_email_subject', :resharer => author.name, :author => root.author.name)
I18n.t('reshares.comment_email_subject', :resharer => author.name, :author => root.author_name)
end
def notification_type(user, person)
......
......@@ -146,6 +146,10 @@ class StatusMessage < Post
formatted_message(:plain_text => true)
end
def first_photo_url(*args)
photos.first.url(*args)
end
def text_and_photos_blank?
self.text.blank? && self.photos.blank?
end
......
......@@ -38,7 +38,10 @@ class User < ActiveRecord::Base
serialize :hidden_shareables, Hash
has_one :person, :foreign_key => :owner_id
delegate :guid, :public_key, :posts, :photos, :owns?, :diaspora_handle, :name, :public_url, :profile, :first_name, :last_name, :participations, :to => :person
delegate :guid, :public_key, :posts, :photos, :owns?, :image_url,
:diaspora_handle, :name, :public_url, :profile, :url,
:first_name, :last_name, :gender, :participations, to: :person
delegate :id, :guid, to: :person, prefix: true
has_many :invitations_from_me, :class_name => 'Invitation', :foreign_key => :sender_id
has_many :invitations_to_me, :class_name => 'Invitation', :foreign_key => :recipient_id
......@@ -361,7 +364,7 @@ class User < ActiveRecord::Base
params[:image_url_small] = photo.url(:thumb_small)
end
if self.person.profile.update_attributes(params)
if self.profile.update_attributes(params)
Postzord::Dispatcher.build(self, profile).post
true
else
......
......@@ -15,7 +15,7 @@ class OEmbedPresenter
def as_json(opts={})
{
:provider_name => "Diaspora",
:provider_url => AppConfig[:pod_url],
:provider_hurl => AppConfig[:pod_url],
:type => 'rich',
:version => '1.0',
:title => post_title,
......@@ -36,7 +36,7 @@ class OEmbedPresenter
end
def post_author
@post.author.name
@post.author_name
end
def post_author_url
......@@ -46,4 +46,4 @@ class OEmbedPresenter
def iframe_html
post_iframe_url(@post.id, :height => @opts[:maxheight], :width => @opts[:maxwidth])
end
end
\ No newline at end of file
end
......@@ -12,9 +12,9 @@ class PersonPresenter
if is_own_profile || person_is_following_current_user
attrs.merge!({
:location => @person.profile.location,
:birthday => @person.profile.formatted_birthday,
:bio => @person.profile.bio
:location => @person.location,
:birthday => @person.formatted_birthday,
:bio => @person.bio
})
end
......@@ -30,4 +30,4 @@ class PersonPresenter
def person_is_following_current_user
@person.shares_with(@current_user)
end
end
\ No newline at end of file
end
......@@ -55,7 +55,7 @@ class PostPresenter
end
def title
@post.text.present? ? @post.text(:plain_text => true) : I18n.translate('posts.presenter.title', :name => @post.author.name)
@post.text.present? ? @post.text(:plain_text => true) : I18n.translate('posts.presenter.title', :name => @post.author_name)
end
def template_name #kill me, lol, I should be client side
......
......@@ -4,7 +4,7 @@
= person.name
.tags
- person.profile.tags.each do |tag|
- person.tags.each do |tag|
= link_to "##{tag}", tag_path(:name => tag.name)
.add_user_to_aspect
......
......@@ -29,7 +29,7 @@
- if @contacts.size > 0
- for contact in @contacts
.stream_element{:id => contact.person.id}
.stream_element{:id => contact.person_id}
.float-right
= contact_aspect_dropdown(contact)
......@@ -41,7 +41,7 @@
.bd
= person_link(contact.person)
.info
= contact.person.diaspora_handle
= contact.person_diaspora_handle
= will_paginate @contacts
- else
......
......@@ -18,9 +18,9 @@
%li{:data=>{:contact_id=>contact.id}}
= person_image_tag contact.person
%h4.name
= link_to contact.person.name, contact.person
= link_to contact.person_name, contact.person
.description
= contact.person.diaspora_handle
= contact.person_diaspora_handle
.right
= aspect_membership_dropdown(contact, contact.person, 'right')
......
.notification_element{:data=>{:guid => n.id},:class => (n.unread ? "unread" : "read")}
%img{:src => n.actors.first.profile.image_url(:thumb_medium)}
%img{:src => n.actors.first.image_url(:thumb_medium)}
= notification_message_for(n)
%br/
%abbr.timeago{:title=>n.created_at.iso8601}
......
<%= comment_message(@notification.comment, :process_newlines => true) %>
[<%= t('notifier.comment_on_post.reply', :name => @notification.comment.post.author.first_name) %>][1]
[<%= t('notifier.comment_on_post.reply', :name => @notification.comment_post.author_first_name) %>][1]
[1]: <%= post_url(@notification.comment.post) %>
[1]: <%= post_url(@notification.comment_post) %>
<%= comment_message(@notification.comment, :process_newlines => true) %>
[<%= t('notifier.comment_on_post.reply', :name => @notification.comment.post.author.name) %>][1]
[<%= t('notifier.comment_on_post.reply', :name => @notification.comment.parent_author_name) %>][1]
[1]: <%= post_url(@notification.comment.post) %>
<%= t('notifier.hello', :name => @notification.recipient.profile.first_name) %>
<%= t('notifier.hello', :name => @notification.recipient_first_name) %>
<%= t('notifier.confirm_email.click_link', :unconfirmed_email => @notification.recipient.unconfirmed_email) %>
<%= t('notifier.confirm_email.click_link', :unconfirmed_email => @notification.recipient_unconfirmed_email) %>
<<%= confirm_email_url(:token => @notification.recipient.confirm_email_token) %>>
<<%= confirm_email_url(:token => @notification.recipient_confirm_email_token) %>>
<%= "#{t('.liked', :name => "#{@notification.sender.name}")}:" %>
<%= "#{t('.liked', :name => "#{@notification.sender_name}")}:" %>
<%= post_message(@notification.like.target, :process_newlines => true) %>
<%= post_message(@notification.like_target, :process_newlines => true) %>
[<%= t('.view_post') %>][1]
[1]: <%= post_url(@notification.like.target) %>
[1]: <%= post_url(@notification.like_target) %>
<%= post_message(@notification.post, :process_newlines => true, :length => 600) %>
[<%= t('notifier.comment_on_post.reply', :name => @notification.post.author.name) %>][1]
[<%= t('notifier.comment_on_post.reply', :name => @notification.post_author_name) %>][1]
[1]: <%= post_url(@notification.post) %>
<%= "#{t('.reshared', :name => "#{@notification.sender.name}")}:" %>
<%= "#{t('.reshared', :name => "#{@notification.sender_name}")}:" %>
<%= post_message(@notification.reshare.root, :process_newlines => true) %>
<%= post_message(@notification.reshare_root, :process_newlines => true) %>
[<%= t('.view_post') %>][1]
......
<%= @notification.sender.name %> <%= t('.sharing') %>
<%= @notification.sender_name %> <%= t('.sharing') %>
[<%= t('.view_profile', :name => @notification.sender.first_name) %>][1]
[<%= t('.view_profile', :name => @notification.sender_first_name) %>][1]
[1]: <%= local_or_remote_person_path(@notification.sender, :absolute => true) %>
......@@ -17,30 +17,30 @@
%br
-if contact.sharing? || person == current_user.person
%ul#profile_information
- unless person.profile.bio.blank?
- unless person.bio.blank?
%li
%h4
=t('.bio')
%div{ :class => direction_for(person.profile.bio) }
%div{ :class => direction_for(person.bio) }
= markdownify(person.profile.bio, :oembed => true, :newlines => true)
- unless person.profile.location.blank?
%li
%h4
=t('.location')
%div{ :class => direction_for(person.profile.location) }
= markdownify(person.profile.location, :oembed => true, :newlines => true)
%div{ :class => direction_for(person.location) }
= markdownify(person.location, :oembed => true, :newlines => true)
%li
- unless person.profile.gender.blank?
- unless person.gender.blank?
%h4
=t('.gender')
= person.profile.gender
= person.gender
%li
- unless person.profile.birthday.blank?
- unless person.birthday.blank?
%h4
=t('.born')
= birthday_format(person.profile.birthday)
= birthday_format(person.birthday)
%br
%br
......@@ -18,7 +18,7 @@
= last_post_link person
.description
- if !person.profile.tag_string.blank? && user_signed_in?
- if !person.tag_string.blank? && user_signed_in?
= Diaspora::Taggable.format_tags(person.profile.tag_string)
- if user_signed_in? && person == current_user.person
%span.hover_edit
......
......@@ -10,5 +10,5 @@
%p.photo_description
= post.text
= link_to t('.view_all', :name => post.author.name), person_photos_path(post.author), :class => "small_text"
= link_to t('.view_all', :name => post.author_name), person_photos_path(post.author), :class => "small_text"
......@@ -9,7 +9,7 @@
= person_image_link(post.author)
.from
%h2
= post.author.name
= post.author_name
#show_photo{:data=>{:guid=>post.id}}
= image_tag post.url(:scaled_full)
......