diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index aac55b6..a7fa5b0 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -84,7 +84,7 @@ module ApplicationHelper [:button_to, :link_to, :link_to_unless_current].each do |method_name| class_eval <<-RUBY_EVAL, __FILE__, __LINE__ + 1 def image_#{method_name}(name, image = nil, options = nil, html_options = {}, &block) - name = svg_tag("pictograms/\#{image}") + name if image + name = svg_tag("pictograms/\#{image}") + name.to_s if image html_options[:class] = class_names( html_options[:class], diff --git a/app/models/user.rb b/app/models/user.rb index 3c43d9b..49b9b1a 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -13,6 +13,10 @@ class User < ApplicationRecord has_many :units, dependent: :destroy + def to_s + email + end + def at_least(status) User.statuses[self.status] >= User.statuses[status] end diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index ff65d54..f1b024a 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -29,7 +29,7 @@ <%= image_link_to t(".issue_tracker"), "bug-outline", issue_tracker_url, class: "extendedright" %> <% if user_signed_in? %> - <%= image_link_to_unless_current(current_user.email, "account-wrench-outline", + <%= image_link_to_unless_current(current_user, "account-wrench-outline", edit_user_registration_path) {} %> <% if current_user_disguised? %> <%= image_link_to t(".revert"), "incognito-off", revert_users_path %> diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb index 18e8799..26c5502 100644 --- a/app/views/users/index.html.erb +++ b/app/views/users/index.html.erb @@ -11,7 +11,7 @@
<% @users.each do |user| %>Hello <%= @resource.email %>!
+Hello <%= @resource %>!
We're contacting you to notify you that your password has been changed.
diff --git a/app/views/users/mailer/reset_password_instructions.html.erb b/app/views/users/mailer/reset_password_instructions.html.erb index f667dc1..f1a48b5 100644 --- a/app/views/users/mailer/reset_password_instructions.html.erb +++ b/app/views/users/mailer/reset_password_instructions.html.erb @@ -1,4 +1,4 @@ -Hello <%= @resource.email %>!
+Hello <%= @resource %>!
Someone has requested a link to change your password. You can do this through the link below.
diff --git a/app/views/users/mailer/unlock_instructions.html.erb b/app/views/users/mailer/unlock_instructions.html.erb index 41e148b..0bf243d 100644 --- a/app/views/users/mailer/unlock_instructions.html.erb +++ b/app/views/users/mailer/unlock_instructions.html.erb @@ -1,4 +1,4 @@ -Hello <%= @resource.email %>!
+Hello <%= @resource %>!
Your account has been locked due to an excessive number of unsuccessful sign in attempts.