Skip to content

Commit 1562708

Browse files
Make the Google button label different between Login and Registration
Changes: * Change the shared Devise view use a local variable to define the Google button label * Define the value of the Google button label in the Login and Registration views * Remove unused label
1 parent 0023c5c commit 1562708

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

app/views/devise/registrations/new.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<h2 class="heading">Register for GovHack <%= @competition.year %></h2>
66
<%= render 'components/registration_status', page: 'sign_up' %>
77
<div class="google-oath">
8-
<%= link_to (render "devise/shared/google"), user_google_omniauth_authorize_path, method: :post %>
8+
<%= link_to (render "devise/shared/google", locals: { google_label: 'Sign up with Google' }), user_google_omniauth_authorize_path, method: :post %>
99
<hr class="grey-border">
1010
<p class="alt-text">or register below</p>
1111
</div>

app/views/devise/sessions/new.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<section class="signup-form">
55
<h2 class="heading">Log in to Hackerspace</h2>
66
<div class="google-oath">
7-
<%= link_to (render "devise/shared/google"), user_google_omniauth_authorize_path, method: :post %>
7+
<%= link_to (render "devise/shared/google", locals: { google_label: 'Log in with Google'}), user_google_omniauth_authorize_path, method: :post %>
88
<hr class="grey-border">
99
<p class="alt-text"> or log in below</p>
1010
</div>

app/views/devise/shared/_google.html.erb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
</div>
1515
</div>
1616
<div class="message">
17-
<p>Sign up with Google</p>
18-
<p>Log in with Google</p>
17+
<p><%= locals[:google_label] %></p>
1918
</div>
2019
</div>
2120
</div>

0 commit comments

Comments
 (0)