Skip to content

Commit

Permalink
Adding news tab features, Adding club features
Browse files Browse the repository at this point in the history
  • Loading branch information
ger619 committed May 22, 2024
1 parent c13eb57 commit a120e97
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 14 deletions.
28 changes: 27 additions & 1 deletion app/views/club/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,31 @@
<div class="mb-2 md:p-4 lg:p-4 sm:p-8 md:bg-[#FAE115] font-bold text-2xl md:text-3xl">
Edit Club Details & History
</div>
<%= render 'club/form' %>

<%= form_with model: @club, url: club_path(@club), method: :patch do |f| %>

<div class="md:w-[1280px] flex flex-col gap-4 md:my-12 md:mx-auto bg-[#F7F3ED] md:p-4">
<h1 class="md:text-5xl text-2xl ">
Ensure you have installed grammarly and it is working!
</h1>
<p class="text-xl font-light mt-5">
Edit Club details
</p>

<div class="flex justify-between">
<%= f.text_field :header, class: "h-[50px] w-[45%] p-2 border-b border-black bg-[#F7F3ED] focus:outline-none" ,placeholder: "Header for Club Details i.e. Management, History, etc", required: true %>
<%= f.file_field :photo, class: "h-[50px] flex items-center p-2 w-[45%] bg-[#F7F3ED] border-black focus:outline-none" ,placeholder: "Upload A Photo" %>
<%= image_tag(f.object.photo, class:"w-[300px]") if f.object.photo.present? %>


</div>

<%= f.text_area :body, class: "tinymce bg-[#F7F3ED] w-[100%] p-2 border-b border-black focus:outline-none", size: "70x20" ,placeholder: "Add the details to 600 words *" %>
<%= tinymce %>
<%= f.submit "POST", class: "w-[300px] mt-10 mb-10 md:mb-10 md:mt-16 mx-auto p-4 bg-[#F4E721] text-3xl text-black" %>
</div>

<% end %>

</div>
28 changes: 16 additions & 12 deletions app/views/club/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,40 @@
<% end %>
</div>
<% @club.each do |club| %>
<div class="flex flex-col gap-4 flex odd:flex-row-reverse md:flex-row items-center border-t-2 border-[#FAE115] my-4 bg-[#fdfee9] p-10">
<div class="flex flex-col ">
<h1 class="md:text-4xl text-3xl uppercase mt-5 font-normal mb-8">
<div class="md:flex flex-col justify-between gap-8 odd:flex-row-reverse even:flex-row border-t-2 border-[#FAE115] bg-[#fdfee9] md:p-10 p-4 m-4">
<div>
<div class="flex flex-col">
<h1 class="md:text-4xl text-2xl uppercase mt-5 font-normal truncate md:w-full truncate w-[300px]">
<%= club.header %>
</h1>
<p class="md:w-[500px] font-light text-xl truncate">
<%= raw club.body %>
</p>
<h6 class="w-[300px] truncate">
<%= render html: raw(club.body), class: "font-bold text-4xl" %>
</h6>
</div>

<div class="flex">
<div class="flex gap-4">
<%= link_to club_path(club.id) do %>
<button class="p-4 bg-[#F4E721] font-normal my-3 py-3 text-2xl mr-3 rounded uppercase">
<button class="md:p-4 p-2 bg-[#F4E721] font-bold text-sm my-3 text-2xl rounded uppercase w-full ">
Read More
</button>
<% end %>
<% if current_user && current_user.role === 'moderator' %>
<%= link_to edit_club_path(club.id) do %>
<button class="p-4 bg-[#F4E721] font-normal my-3 py-3 text-2xl mr-3 rounded uppercase" >
<button class="md:p-4 p-2 bg-[#F4E721] font-bold text-sm my-3 text-2xl rounded uppercase" >
Edit
</button>
<% end %>
<%= button_to 'Delete', club, method: :delete, data: { turbo_method: :delete }, class: "p-4 bg-[#F4E721] font-normal my-3 py-3 text-2xl rounded uppercase" %>
<%= button_to 'Delete', club, method: :delete, data: { turbo_method: :delete }, class: "md:p-4 p-2 bg-[#F4E721] font-bold text-sm my-3 text-2xl rounded uppercase" %>
<% end %>
</div>
</div>
</div>


<div class="">
<%= image_tag club.photo, class: "w-[800px] h-[400px] object-cover", alt: "This is text" if club.photo.present? %>
<%= image_tag club.photo, class: "w-[600px] object-cover", alt: "This is text" if club.photo.present? %>
</div>
</div>

Expand Down
2 changes: 1 addition & 1 deletion app/views/news/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

<div class="flex justify-between">
<%= f.text_field :header_news, class: "h-[50px] flex items-center p-2 w-[45%] border-b bg-[#F7F3ED] border-black focus:outline-none" ,placeholder: "Header of News" %>
<%= f.select :type_of_news, %w[Injuries News Fans League], prompt: 'Type of News', class: "h-[50px] flex items-center p-2 w-[45%] border-b bg-[#F7F3ED] border-black focus:outline-none" ,placeholder: "Type of News" %>
<%= f.select :type_of_news, ['Injuries', 'News', 'Fans', 'League', 'Latest News', 'Club News', 'Features'], prompt: 'Type of News', class: "h-[50px] flex items-center p-2 w-[45%] border-b bg-[#F7F3ED] border-black focus:outline-none" ,placeholder: "Type of News" %>

</div>
<div class="flex justify-between">
Expand Down

0 comments on commit a120e97

Please sign in to comment.