Skip to content

Commit

Permalink
fix merge
Browse files Browse the repository at this point in the history
  • Loading branch information
bhoggard committed Dec 29, 2024
2 parents 3ab9468 + 13dcc57 commit f4a5feb
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 18 deletions.
2 changes: 2 additions & 0 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ def show_users?
end

def has_profile?
return false unless profile

artist? || admin?
end

Expand Down
2 changes: 1 addition & 1 deletion app/views/artworks/_info.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</div>
<% if @artwork.price.present? %>
<div class="text-xl py-2">
Price: <%= @artwork.price %>
Price: <%= number_with_delimiter(@artwork.price) %>
</div>
<% end %>
<% if @artwork.description.present? %>
Expand Down
1 change: 0 additions & 1 deletion app/views/main/_artwork.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<section class="p-4">
<div class=""><%= artwork.artist_name %></div>
<div class="text-gray-500 italic"><%= artwork.title %></div>
<div class="text-black text-lg mb-1">Price: <%= artwork.price.present? ? artwork.price : "N/A" %></div>
<div class=" text-sm text-gray-700"><%= simple_format artwork.description %></div>
</section>
</a>
Expand Down
2 changes: 1 addition & 1 deletion app/views/main/_info.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
Location: <%= @artwork.location %>
</div>
<div class="text-2xl py-2">
Price: <%= @artwork.price.present? ? @artwork.price : "N/A" %>
Price: <%= @artwork.price.present? ? number_with_delimiter(@artwork.price) : "N/A" %>
</div>
<% if @artwork.description.present? %>
<div class="mt-2 text-slate-500">
Expand Down
41 changes: 26 additions & 15 deletions app/views/main/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,18 @@

<!--Carousel items-->
<div
class="relative w-full overflow-hidden after:clear-both after:block after:content-['']">
class="relative w-full after:clear-both after:block after:content-['']">
<% @artwork.images.each_with_index do | image, i | %>
<a data-fslightbox href="<%= image.file.url %>">
<div
class="relative float-left -mr-[100%] w-full transition-opacity duration-[600ms] ease-in-out motion-reduce:transition-none opacity-0 pointer-events-none <%= "!opacity-100 pointer-events-auto" if i == 0 %>"
class="relative float-left -mr-[100%] w-full transition-opacity duration-[300ms] ease-in-out motion-reduce:transition-none
opacity-0 cursor-default <%= "!opacity-100 pointer-events-auto" if i == 0 %>"
data-carousel-item
style="backface-visibility: hidden">
<%= image_tag image.file.url, alt: image.caption, class: "block w-full" %>
<div
class="absolute inset-x-[15%] bottom-0 py-5 text-center text-white block">
<h5 class="text-slate-200"><%= image.caption %></h5>
class="absolute inset-x-[15%] -bottom-16 <%= "-bottom-20" if @artwork.images.length > 1 %> py-5 text-center block">
<h5 class="text-black"><%= image.caption %></h5>

</div>
</div>
Expand All @@ -30,22 +31,26 @@
<% if @artwork.images.length > 1 %>
<!--Carousel indicators-->
<div
class="absolute bottom-6 left-0 right-0 z-[2] mx-[15%] mb-4 flex list-none justify-center p-0"
class="absolute -bottom-12 left-0 right-0 z-[2] mx-[15%] mb-4 flex list-none justify-center p-0"
data-twe-carousel-indicators>
<% @artwork.images.each_with_index do |artwork, i| %>
<button
type="button"
aria-label="Slide <%= i %>" data-carousel-slide-to="<%= i %>"
class="mx-[3px] box-content h-[3px] w-[30px] flex-initial cursor-pointer
border-0 border-y-[10px] border-solid border-transparent bg-white
border-0 border-y-[10px] border-solid border-transparent bg-black
bg-clip-padding p-0 -indent-[999px] opacity-50 transition-opacity
duration-[600ms] ease-[cubic-bezier(0.25,0.1,0.25,1.0)] motion-reduce:transition-none <%= '!opacity-100' if i == 0 %>"></button>
<% end %>
</div>

<!--Carousel controls - prev item-->
<button
class="absolute bottom-0 left-0 top-0 z-[1] flex w-[15%] items-center justify-center border-0 bg-none p-0 text-center text-white opacity-50 transition-opacity duration-150 ease-[cubic-bezier(0.25,0.1,0.25,1.0)] hover:text-white hover:no-underline hover:opacity-90 hover:outline-none focus:text-white focus:no-underline focus:opacity-90 focus:outline-none motion-reduce:transition-none"
class="absolute bottom-0 left-0 top-0 z-[1] flex w-[15%] items-center justify-center
border-0 bg-none p-0 text-center text-white opacity-50 transition-opacity duration-150
ease-[cubic-bezier(0.25,0.1,0.25,1.0)] hover:text-white hover:no-underline hover:opacity-90
hover:outline-none focus:text-white focus:no-underline focus:opacity-90 focus:outline-none
motion-reduce:transition-none"
type="button"
data-carousel-prev>
<span class="inline-block h-8 w-8">
Expand All @@ -69,7 +74,11 @@
</button>
<!--Carousel controls - next item-->
<button
class="absolute bottom-0 right-0 top-0 z-[1] flex w-[15%] items-center justify-center border-0 bg-none p-0 text-center text-white opacity-50 transition-opacity duration-150 ease-[cubic-bezier(0.25,0.1,0.25,1.0)] hover:text-white hover:no-underline hover:opacity-90 hover:outline-none focus:text-white focus:no-underline focus:opacity-90 focus:outline-none motion-reduce:transition-none"
class="absolute bottom-0 right-0 top-0 z-[1] flex w-[15%] items-center justify-center border-0
bg-none p-0 text-center text-white opacity-50 transition-opacity duration-150
ease-[cubic-bezier(0.25,0.1,0.25,1.0)] hover:text-white hover:no-underline hover:opacity-90
hover:outline-none focus:text-white focus:no-underline focus:opacity-90 focus:outline-none
motion-reduce:transition-none"
type="button"
data-carousel-next>
<span class="inline-block h-8 w-8">
Expand Down Expand Up @@ -97,15 +106,17 @@

</div>

<div class="lg:row-start-1 lg:col-start-4 lg:row-span-2">
<div class="lg:row-start-1 lg:col-start-4 lg:row-span-2 mt-8 <%= "mt-12" if @artwork.images.length > 1 %>">
<%= render "info" %>
</div>
<section class="lg:col-span-3 lg:row-start-3 lg:row-span-4">
<div class="pb-2">
About artist:
</div>
<%= simple_format(@artwork.user.profile&.bio) %>
</section>
<% if @artwork.user.profile&.bio&.present? %>
<section class="mt-10 lg:col-span-3 lg:row-start-3 lg:row-span-4">
<div class="pb-2">
About artist:
</div>
<%= simple_format(@artwork.user.profile&.bio) %>
</section>
<% end %>
</div>

<%= javascript_include_tag "lightbox-refresh" %>
Expand Down

0 comments on commit f4a5feb

Please sign in to comment.