Skip to content

Commit

Permalink
removed test-digest-button for Users other than Admins and Moderators (
Browse files Browse the repository at this point in the history
…publiclab#4293)

* removed test-digest-button from production environment

* added space between conditionals

* improved code readability

* indented tags

* corrected error in conditional statement

* restricted the Test-Digest-Button to be viewed by Admins and Mods only regardless of the ENV

* changed the style of the test button to btn-primary like all the other buttons

* added a space between conditionals and tags

* removed redundant if statement

* adding && current_user.can_moderate?

* removed extra spaces to make code cleaner

* Button size changed
  • Loading branch information
uzorjchibuzor authored and grvsachdeva committed Dec 16, 2018
1 parent 4393524 commit 4097f37
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/views/users/profile.html.erb
Expand Up @@ -234,9 +234,10 @@
</div>
<% end %>
<% if @profile_user && current_user && @profile_user == current_user %>
<% if @profile_user && current_user && current_user.can_moderate? && @profile_user == current_user %>
<br />
<%= form_tag "/users/test_digest_email", method: :post do %>
<%= submit_tag "Test Digest Email" %>
<%= submit_tag "Test Digest Email", class: "btn btn-info", style: "width: 100%;" %>
<% end %>
<% end %>

Expand Down

0 comments on commit 4097f37

Please sign in to comment.