Skip to content

Commit

Permalink
changes to hall of fame and adding authentication to team so that pla…
Browse files Browse the repository at this point in the history
…yers do not share the same number
  • Loading branch information
ger619 committed Apr 8, 2024
1 parent 0fa1f5a commit ae4569b
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 7 deletions.
1 change: 1 addition & 0 deletions app/controllers/hall_of_fames_controller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
class HallOfFamesController < ApplicationController
before_action :authenticate_user!, except: %i[index show]
before_action :set_hall_of_fame, only: %i[show edit update destroy]

# GET /hall_of_fames or /hall_of_fames.json
Expand Down
4 changes: 3 additions & 1 deletion app/views/hall_of_fames/_hall_of_fame.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@

<% if action_name != "show" %>
<%= link_to "Show this hall of fame", hall_of_fame, class: "rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %>
<%= link_to "Edit this hall of fame", edit_hall_of_fame_path(hall_of_fame), class: "rounded-lg py-3 ml-2 px-5 bg-gray-100 inline-block font-medium" %>
<% if current_user %>
<%= link_to "Edit this hall of fame", edit_hall_of_fame_path(hall_of_fame), class: "rounded-lg py-3 ml-2 px-5 bg-gray-100 inline-block font-medium" %>
<% end %>
<hr class="mt-6">
<% end %>
</div>
2 changes: 2 additions & 0 deletions app/views/hall_of_fames/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@

<div class="flex justify-between items-center">
<h1 class="font-bold text-4xl">Hall of fames</h1>
<% if current_user %>
<%= link_to "New hall of fame", new_hall_of_fame_path, class: "rounded-lg py-3 px-5 bg-blue-600 text-white block font-medium" %>
<% end %>
</div>

<div id="hall_of_fames" class="min-w-full">
Expand Down
5 changes: 4 additions & 1 deletion app/views/hall_of_fames/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@

<%= render @hall_of_fame %>

<%= link_to "Edit this hall_of_fame", edit_hall_of_fame_path(@hall_of_fame), class: "mt-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %>
<% if current_user%>
<%= link_to "Edit this hall_of_fame", edit_hall_of_fame_path(@hall_of_fame), class: "mt-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %>
<div class="inline-block ml-2">
<%= button_to "Destroy this hall_of_fame", hall_of_fame_path(@hall_of_fame), method: :delete, class: "mt-2 rounded-lg py-3 px-5 bg-gray-100 font-medium" %>
</div>

<%= link_to "Back to hall_of_fames", hall_of_fames_path, class: "ml-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %>
<% end %>
</div>
</div>
6 changes: 6 additions & 0 deletions app/views/layouts/_footer.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@
</h5>

</div>
<div class="flex flex-col gap-2">
<h5 class="text-[#fae115]">
<%= link_to "HALL OF FAME", hall_of_fames_path %>
</h5>
</div>
<div class="flex flex-col gap-2">
<h5 class="text-[#fae115]">
<%= link_to "SHOP", product_index_path %>
Expand All @@ -65,6 +70,7 @@
</ul>
-->
</div>

</div>
<div class="w-[80%] mx-auto flex flex-col gap-2">
<h1 class="text-3xl font-bold pt-4">Newsletter</h1>
Expand Down
11 changes: 6 additions & 5 deletions app/views/layouts/_navbar.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@
<li class="hover:underline text-[#f4e721] underline-offset-8 hover:text-[#f4e721]">
<%= link_to "OUR CLUB", club_index_path %>
</li>
<li class="hover:underline text-[#f4e721] underline-offset-8 hover:text-[#f4e721] ">
<%= link_to "SHOP", product_index_path %>
</li>
<li class="hover:underline text-[#f4e721] underline-offset-8 hover:text-[#f4e721] ">
<%= link_to "HALL OF FAME", hall_of_fames_path %>
</li>
<li class="hover:underline text-[#f4e721] underline-offset-8 hover:text-[#f4e721] ">
<%= link_to "SHOP", product_index_path %>
</li>
<% if current_user %>
<li class="hover:underline text-[#f4e721] underline-offset-8 hover:text-[#f4e721]">
<%= button_to "LOGOUT", destroy_user_session_path, method: :delete, data: { turbo_method: :delete } %>
Expand Down Expand Up @@ -112,11 +112,12 @@
<%= link_to "OUR CLUB", club_index_path %>
</li>
<li class="hover:underline text-[#f4e721] underline-offset-8 hover:text-[#f4e721] ">
<%= link_to "SHOP", product_index_path %>
<%= link_to "HALL OF FAME", hall_of_fames_path %>
</li>
<li class="hover:underline text-[#f4e721] underline-offset-8 hover:text-[#f4e721] ">
<%= link_to "HALL OF FAME", hall_of_fames_path %>
<%= link_to "SHOP", product_index_path %>
</li>

</ul>
</div>

Expand Down

0 comments on commit ae4569b

Please sign in to comment.