aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/controllers/application_controller.rb7
-rw-r--r--app/models/user.rb5
-rw-r--r--app/views/users/_user.html.erb10
3 files changed, 12 insertions, 10 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 63775a30f..cdb304bbf 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -6,11 +6,11 @@ class ApplicationController < ActionController::Base
# Load helpers in rails engine
helper LanguageEngine::Engine.helpers
-
+
def set_locale
I18n.locale = session[:language] || I18n.default_locale
end
-
+
protected
def current_organisation
@@ -25,6 +25,5 @@ class ApplicationController < ActionController::Base
# Overwriting the sign_out redirect path method
def after_sign_out_path_for(resource_or_scope)
new_user_session_path
- end
-
+ end
end
diff --git a/app/models/user.rb b/app/models/user.rb
index b898a9514..bbde7d0d9 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -21,8 +21,11 @@ class User < ActiveRecord::Base
self.password_confirmation ||= self.password
end
- # remove organisation and referentials if last user of it
after_destroy :check_destroy_organisation
+
+ private
+
+ # remove organisation and referentials if last user of it
def check_destroy_organisation
if organisation.users.empty?
organisation.destroy
diff --git a/app/views/users/_user.html.erb b/app/views/users/_user.html.erb
index 56e18c33f..c4b396650 100644
--- a/app/views/users/_user.html.erb
+++ b/app/views/users/_user.html.erb
@@ -6,19 +6,19 @@
<%= link_to( edit_user_registration_path(user), :class => "btn btn-default btn-sm" ) do %>
<span class="fa fa-pencil"></span>
<% end %>
- <% end %>
+ <% end %>
<%= link_to organisation_user_path(user), :method => :delete, :data => {:confirm => t('users.actions.destroy_confirm')}, :class => "btn btn-danger btn-sm" do %>
<span class="fa fa-trash-o"></span>
<% end %>
</span>
<h5>
- <%= link_to( organisation_user_path(user), :class => "preview", :title => "#{User.model_name.human.capitalize} #{user.email}") do %>
+ <%= link_to( organisation_user_path(user), :class => "preview", :title => "#{User.model_name.human.capitalize} #{user.email}") do %>
<%= user_gravatar_image_tag(user, 20) %>
- <span class="name">
- <%= truncate(user.name, :length => 15) %>
+ <span class="name">
+ <%= truncate(user.name, :length => 15) %>
</span>
<% end %>
</h5>
- </div>
+ </div>
</div>
</div>