Browse Source

git CLDC-1183: use email where no user name

pull/536/head
kiddhustle 3 years ago
parent
commit
d1f01edb3b
  1. 3
      app/helpers/tab_nav_helper.rb
  2. 3
      app/views/users/new.html.erb
  3. 3
      app/views/users/show.html.erb

3
app/helpers/tab_nav_helper.rb

@ -2,7 +2,8 @@ module TabNavHelper
include GovukLinkHelper
def user_cell(user)
[govuk_link_to(user.name, user, class: "govuk-!-font-weight-bold"), user.email].join("\n")
link_text = user.name.presence || user.email
[govuk_link_to(link_text, user, class: "govuk-!-font-weight-bold"), user.email].join("\n")
end
def org_cell(user)

3
app/views/users/new.html.erb

@ -17,7 +17,8 @@
</h1>
<%= f.govuk_text_field :name,
autocomplete: "name" %>
autocomplete: "name",
label: { text: "Name (optional)" } %>
<%= f.govuk_email_field :email,
label: { text: "Email address" },

3
app/views/users/show.html.erb

@ -1,4 +1,4 @@
<% content_for :title, current_user == @user ? "Your account" : "#{@user.name}’s account" %>
<% content_for :title, current_user == @user ? "Your account" : "#{@user.name.presence || @user.email}’s account" %>
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
@ -9,7 +9,6 @@
<h2 class="govuk-heading-m">
Personal details
</h2>
<%= govuk_summary_list do |summary_list| %>
<%= summary_list.row do |row|
row.key { "Name" }

Loading…
Cancel
Save