refactored the account confirmation into a partial. Also made the

text in the `.text` version consistent with the `.html` version
This commit is contained in:
Brett Walker 2017-09-06 18:28:09 +02:00
parent 47c6525a98
commit b1e68922a4
6 changed files with 38 additions and 31 deletions

View file

@ -0,0 +1,15 @@
- if @resource.unconfirmed_email.present?
#content
= email_default_heading(@resource.unconfirmed_email)
%p Click the link below to confirm your email address.
#cta
= link_to 'Confirm your email address', confirmation_url(@resource, confirmation_token: @token)
- else
#content
- if Gitlab.com?
= email_default_heading('Thanks for signing up to GitLab!')
- else
= email_default_heading("Welcome, #{@resource.name}!")
%p To get started, click the link below to confirm your account.
#cta
= link_to 'Confirm your account', confirmation_url(@resource, confirmation_token: @token)

View file

@ -0,0 +1,14 @@
<% if @resource.unconfirmed_email.present? %>
<%= @resource.unconfirmed_email %>,
Use the link below to confirm your email address.
<% else %>
<% if Gitlab.com? %>
Thanks for signing up to GitLab!
<% else %>
Welcome, <%= @resource.name %>!
<% end %>
To get started, use the link below to confirm your account.
<% end %>
<%= confirmation_url(@resource, confirmation_token: @token) %>

View file

@ -1,5 +1,5 @@
#content #content
= email_default_heading("#{@resource.user.name}, you've added a secondary email!") = email_default_heading("#{@resource.user.name}, you've added an additional email!")
%p Click the link below to confirm your email address (#{@resource.email}) %p Click the link below to confirm your email address (#{@resource.email})
#cta #cta
= link_to 'Confirm your email address', confirmation_url(@resource, confirmation_token: @token) = link_to 'Confirm your email address', confirmation_url(@resource, confirmation_token: @token)

View file

@ -1,6 +1,6 @@
<%= @resource.user.name %>, you've added a secondary email! <%= @resource.user.name %>, you've added an additional email!
You can confirm your email (<%= @resource.email %>) through the link below: Use the link below to confirm your email address (<%= @resource.email %>)
<%= confirmation_url(@resource, confirmation_token: @token) %> <%= confirmation_url(@resource, confirmation_token: @token) %>

View file

@ -1,18 +1,4 @@
- if @resource.is_a?(Email) - if @resource.is_a?(User)
= render partial: 'confirmation_instructions_account'
- else
= render partial: 'confirmation_instructions_secondary' = render partial: 'confirmation_instructions_secondary'
- else
- if @resource.unconfirmed_email.present?
#content
= email_default_heading(@resource.unconfirmed_email)
%p Click the link below to confirm your email address.
#cta
= link_to 'Confirm your email address', confirmation_url(@resource, confirmation_token: @token)
- else
#content
- if Gitlab.com?
= email_default_heading('Thanks for signing up to GitLab!')
- else
= email_default_heading("Welcome, #{@resource.name}!")
%p To get started, click the link below to confirm your account.
#cta
= link_to 'Confirm your account', confirmation_url(@resource, confirmation_token: @token)

View file

@ -1,13 +1,5 @@
<% if @resource.is_a?(Email) %> <% if @resource.is_a?(User) %>
<%= render partial: 'confirmation_instructions_account' %>
<% else %>
<%= render partial: 'confirmation_instructions_secondary' %> <%= render partial: 'confirmation_instructions_secondary' %>
<% else %>
Welcome, <%= @resource.name %>!
<% if @resource.unconfirmed_email.present? %>
You can confirm your email (<%= @resource.unconfirmed_email %>) through the link below:
<% else %>
You can confirm your account through the link below:
<% end %>
<%= confirmation_url(@resource, confirmation_token: @token) %>
<% end %> <% end %>