From 7f5481b8643499fd8d5b7b1906815f12785ddf98 Mon Sep 17 00:00:00 2001 From: Chibuzor Efedigbue Date: Thu, 13 Dec 2018 08:39:10 +0100 Subject: [PATCH 01/12] removed test-digest-button from production environment --- app/views/users/profile.html.erb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/users/profile.html.erb b/app/views/users/profile.html.erb index 13e6342356..3b1c3cc654 100644 --- a/app/views/users/profile.html.erb +++ b/app/views/users/profile.html.erb @@ -233,12 +233,13 @@ <% end %> - + <%if !Rails.env.production?%> <% if @profile_user && current_user && @profile_user == current_user %> <%= form_tag "/users/test_digest_email", method: :post do %> <%= submit_tag "Test Digest Email" %> <% end %> <% end %> + <% end %>
From 0e33a8a513eaf8a6b28dae3075ae1985716c8fa4 Mon Sep 17 00:00:00 2001 From: Chibuzor Efedigbue Date: Thu, 13 Dec 2018 09:16:16 +0100 Subject: [PATCH 02/12] added space between conditionals --- app/views/users/profile.html.erb | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/app/views/users/profile.html.erb b/app/views/users/profile.html.erb index 3b1c3cc654..b2279ff3dc 100644 --- a/app/views/users/profile.html.erb +++ b/app/views/users/profile.html.erb @@ -233,12 +233,17 @@ <% end %> - <%if !Rails.env.production?%> - <% if @profile_user && current_user && @profile_user == current_user %> - <%= form_tag "/users/test_digest_email", method: :post do %> - <%= submit_tag "Test Digest Email" %> + + <%if !Rails.env.production?%> + + <% if @profile_user && current_user && @profile_user == current_user %> + + <%= form_tag "/users/test_digest_email", method: :post do %> + <%= submit_tag "Test Digest Email" %> + <% end %> + <% end %> - <% end %> + <% end %>
From 08e5c6df1bb9b1dc3b82047aaa6296ddf6fad06d Mon Sep 17 00:00:00 2001 From: Chibuzor Efedigbue Date: Thu, 13 Dec 2018 09:18:50 +0100 Subject: [PATCH 03/12] improved code readability --- app/views/users/profile.html.erb | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/app/views/users/profile.html.erb b/app/views/users/profile.html.erb index b2279ff3dc..47ad76793c 100644 --- a/app/views/users/profile.html.erb +++ b/app/views/users/profile.html.erb @@ -233,19 +233,18 @@ <% end %> + <% if Rails.env.production?%> - <%if !Rails.env.production?%> - - <% if @profile_user && current_user && @profile_user == current_user %> - - <%= form_tag "/users/test_digest_email", method: :post do %> - <%= submit_tag "Test Digest Email" %> - <% end %> + <% if @profile_user && current_user && @profile_user == current_user %> + <%= form_tag "/users/test_digest_email", method: :post do %> + <%= submit_tag "Test Digest Email" %> <% end %> <% end %> + <% end %> +
<% if params[:preview] %> From 4d23f982b65a093c545b2fb13082c834392d2740 Mon Sep 17 00:00:00 2001 From: Chibuzor Efedigbue Date: Thu, 13 Dec 2018 09:19:52 +0100 Subject: [PATCH 04/12] indented tags --- app/views/users/profile.html.erb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/views/users/profile.html.erb b/app/views/users/profile.html.erb index 47ad76793c..b42cf624f9 100644 --- a/app/views/users/profile.html.erb +++ b/app/views/users/profile.html.erb @@ -235,13 +235,13 @@ <% end %> <% if Rails.env.production?%> - <% if @profile_user && current_user && @profile_user == current_user %> + <% if @profile_user && current_user && @profile_user == current_user %> - <%= form_tag "/users/test_digest_email", method: :post do %> - <%= submit_tag "Test Digest Email" %> - <% end %> + <%= form_tag "/users/test_digest_email", method: :post do %> + <%= submit_tag "Test Digest Email" %> + <% end %> - <% end %> + <% end %> <% end %> From 2f91a6fb4ef5b98876a6d26e0f20b4d05179a449 Mon Sep 17 00:00:00 2001 From: Chibuzor Efedigbue Date: Thu, 13 Dec 2018 10:06:10 +0100 Subject: [PATCH 05/12] corrected error in conditional statement --- app/views/users/profile.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/users/profile.html.erb b/app/views/users/profile.html.erb index b42cf624f9..abaa4b8673 100644 --- a/app/views/users/profile.html.erb +++ b/app/views/users/profile.html.erb @@ -233,7 +233,7 @@ <% end %> - <% if Rails.env.production?%> + <% if !Rails.env.production?%> <% if @profile_user && current_user && @profile_user == current_user %> From b7101baaaa193f65dcd0f5cac43acbbde724faa9 Mon Sep 17 00:00:00 2001 From: Chibuzor Efedigbue Date: Thu, 13 Dec 2018 18:47:05 +0100 Subject: [PATCH 06/12] restricted the Test-Digest-Button to be viewed by Admins and Mods only regardless of the ENV --- app/views/users/profile.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/users/profile.html.erb b/app/views/users/profile.html.erb index abaa4b8673..e4b8423a6a 100644 --- a/app/views/users/profile.html.erb +++ b/app/views/users/profile.html.erb @@ -233,7 +233,7 @@ <% end %> - <% if !Rails.env.production?%> + <% if current_user.can_moderate? || current_user.role == "admin"%> <% if @profile_user && current_user && @profile_user == current_user %> From cb8081a869a5a4b6ff0f1976acdf42dc63afaa5d Mon Sep 17 00:00:00 2001 From: Chibuzor Efedigbue Date: Thu, 13 Dec 2018 18:52:23 +0100 Subject: [PATCH 07/12] changed the style of the test button to btn-primary like all the other buttons --- app/views/users/profile.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/users/profile.html.erb b/app/views/users/profile.html.erb index e4b8423a6a..cb6f0eba84 100644 --- a/app/views/users/profile.html.erb +++ b/app/views/users/profile.html.erb @@ -238,7 +238,7 @@ <% if @profile_user && current_user && @profile_user == current_user %> <%= form_tag "/users/test_digest_email", method: :post do %> - <%= submit_tag "Test Digest Email" %> + <%= submit_tag "Test Digest Email", class: "btn btn-primary" %> <% end %> <% end %> From b7d3c61e9003ef5ece8435fef60c598a3b61880e Mon Sep 17 00:00:00 2001 From: Chibuzor Efedigbue Date: Thu, 13 Dec 2018 19:02:17 +0100 Subject: [PATCH 08/12] added a space between conditionals and tags --- app/views/users/profile.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/users/profile.html.erb b/app/views/users/profile.html.erb index cb6f0eba84..682579cf01 100644 --- a/app/views/users/profile.html.erb +++ b/app/views/users/profile.html.erb @@ -233,7 +233,7 @@ <% end %> - <% if current_user.can_moderate? || current_user.role == "admin"%> + <% if current_user.can_moderate? || current_user.role == "admin" %> <% if @profile_user && current_user && @profile_user == current_user %> From 27cc7238749c49c1d733244397747d6a5ffd033e Mon Sep 17 00:00:00 2001 From: Chibuzor Efedigbue Date: Fri, 14 Dec 2018 16:55:37 +0100 Subject: [PATCH 09/12] removed redundant if statement --- app/views/users/profile.html.erb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/users/profile.html.erb b/app/views/users/profile.html.erb index 682579cf01..24dac17291 100644 --- a/app/views/users/profile.html.erb +++ b/app/views/users/profile.html.erb @@ -233,9 +233,9 @@ <% end %> - <% if current_user.can_moderate? || current_user.role == "admin" %> + - <% if @profile_user && current_user && @profile_user == current_user %> + <% if @profile_user && current_user.can_moderate? && @profile_user == current_user %> <%= form_tag "/users/test_digest_email", method: :post do %> <%= submit_tag "Test Digest Email", class: "btn btn-primary" %> @@ -243,7 +243,7 @@ <% end %> - <% end %> +
From 1a97d90b4ed577f5e0c917402c24250eb473cd51 Mon Sep 17 00:00:00 2001 From: Chibuzor 'Josiah Lawrence' Efedigbue <32690770+uzorjchibuzor@users.noreply.github.com> Date: Fri, 14 Dec 2018 17:23:10 +0100 Subject: [PATCH 10/12] adding && current_user.can_moderate? --- app/views/users/profile.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/users/profile.html.erb b/app/views/users/profile.html.erb index 24dac17291..753da90ec5 100644 --- a/app/views/users/profile.html.erb +++ b/app/views/users/profile.html.erb @@ -235,7 +235,7 @@ <% end %> - <% if @profile_user && current_user.can_moderate? && @profile_user == current_user %> + <% if @profile_user && current_user && current_user.can_moderate? && @profile_user == current_user %> <%= form_tag "/users/test_digest_email", method: :post do %> <%= submit_tag "Test Digest Email", class: "btn btn-primary" %> From 25f53e707116c4a2daed7c455411a5e57bb7d333 Mon Sep 17 00:00:00 2001 From: Chibuzor Efedigbue Date: Sun, 16 Dec 2018 08:14:35 +0100 Subject: [PATCH 11/12] removed extra spaces to make code cleaner --- app/views/users/profile.html.erb | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/app/views/users/profile.html.erb b/app/views/users/profile.html.erb index 753da90ec5..4412fed7be 100644 --- a/app/views/users/profile.html.erb +++ b/app/views/users/profile.html.erb @@ -233,17 +233,13 @@ <% end %> - - - <% if @profile_user && current_user && current_user.can_moderate? && @profile_user == current_user %> - - <%= form_tag "/users/test_digest_email", method: :post do %> - <%= submit_tag "Test Digest Email", class: "btn btn-primary" %> - <% end %> + <% if @profile_user && current_user && current_user.can_moderate? && @profile_user == current_user %> +
+ <%= form_tag "/users/test_digest_email", method: :post do %> + <%= submit_tag "Test Digest Email", class: "btn btn-info" %> <% end %> - - + <% end %>
From 3ad01a558ffa6043d9b1df676608957213b6d078 Mon Sep 17 00:00:00 2001 From: Gaurav Sachdeva Date: Sun, 16 Dec 2018 22:20:04 +0530 Subject: [PATCH 12/12] Button size changed --- app/views/users/profile.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/users/profile.html.erb b/app/views/users/profile.html.erb index 4412fed7be..d786a82de9 100644 --- a/app/views/users/profile.html.erb +++ b/app/views/users/profile.html.erb @@ -237,7 +237,7 @@ <% if @profile_user && current_user && current_user.can_moderate? && @profile_user == current_user %>
<%= form_tag "/users/test_digest_email", method: :post do %> - <%= submit_tag "Test Digest Email", class: "btn btn-info" %> + <%= submit_tag "Test Digest Email", class: "btn btn-info", style: "width: 100%;" %> <% end %> <% end %>