diff --git a/app/controllers/my_profile/memberships_controller.rb b/app/controllers/my_profile/memberships_controller.rb index 125d98f..517e9f5 100644 --- a/app/controllers/my_profile/memberships_controller.rb +++ b/app/controllers/my_profile/memberships_controller.rb @@ -37,7 +37,7 @@ class MembershipsController < MyProfileController @community = Community.find(params[:id]) if request.post? if @community.destroy - flash[:notice] = _('%s was destroyed!') % @community.display_name + flash[:notice] = _('%s was destroyed!') % @community.short_name redirect_to :action => 'index' end end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 53cfd64..3445726 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -400,10 +400,10 @@ module ApplicationHelper # #profile_image) and its name below it. def profile_image_link( profile, size=:portrait, tag='li' ) if profile.class == Person - name = profile.display_name + name = profile.short_name city = content_tag 'span', content_tag( 'span', profile.city, :class => 'locality' ), :class => 'adr' else - name = profile.display_name + name = profile.short_name city = '' end content_tag tag, diff --git a/app/models/profile.rb b/app/models/profile.rb index 6c16530..bbda4e8 100644 --- a/app/models/profile.rb +++ b/app/models/profile.rb @@ -382,9 +382,10 @@ class Profile < ActiveRecord::Base TinyMceArticle.new(attrs) end - def display_name + include ActionView::Helpers::TextHelper + def short_name if self[:nickname].blank? - self.name + truncate self.identifier, 15, '...' else self[:nickname] end diff --git a/app/views/blocks/profile_info.rhtml b/app/views/blocks/profile_info.rhtml index 501013f..639dc84 100644 --- a/app/views/blocks/profile_info.rhtml +++ b/app/views/blocks/profile_info.rhtml @@ -1,6 +1,6 @@
<%= _('Are you sure you want to destroy %s?') % @community.display_name %>
+<%= _('Are you sure you want to destroy %s?') % @community.short_name %>
<% form_tag do %> <%= hidden_field_tag(:confirmation, 1) %> - <%= submit_button(:ok, _("Yes, I want to destroy.") % @community.display_name) %> + <%= submit_button(:ok, _("Yes, I want to destroy.") % @community.short_name) %> <%= button(:cancel, _("No, I don't want."), :action => 'index') %> <% end %> diff --git a/app/views/memberships/index.rhtml b/app/views/memberships/index.rhtml index 97cb751..603ea29 100644 --- a/app/views/memberships/index.rhtml +++ b/app/views/memberships/index.rhtml @@ -9,7 +9,7 @@ <%= profile_image_link(membership, :portrait, 'div') %>