|
| 1 | +<% owner = current_user && @shot.user_id == current_user.id %> |
| 2 | +<% if owner || @shot.user&.public? || @shot.information&.tcl_profile_fields.present? %> |
| 3 | + <div class="bg-white shadow dark:bg-neutral-900" data-controller="modal"> |
| 4 | + <%= render "shared/modal" %> |
| 5 | + <div class="flex items-center justify-between px-4 py-6 mx-auto max-w-7xl sm:px-6 lg:px-8"> |
| 6 | + <% if !owner && @shot.user&.public? %> |
| 7 | + <div class="flex flex-col items-center min-w-full lg:flex-row"> |
| 8 | + <h1 class="flex text-2xl font-bold leading-tight sm:text-3xl text-neutral-900 dark:text-neutral-100"> |
| 9 | + <div class="flex space-x-2"> |
| 10 | + <img class="w-8 h-8 rounded" src="<%= avatar_url(@shot.user, 80) %>"> |
| 11 | + <span class="font-serif text-4xl font-bold tracking-tight text-neutral-900 dark:text-neutral-100"> |
| 12 | + Shot by <%= link_to "#{@shot.user.name}", person_path(@shot.user.slug), class: "underline hover:text-neutral-500" %> |
| 13 | + </span> |
| 14 | + <% if @shot.user.premium? %> |
| 15 | + <%= link_to premium_index_path do %> |
| 16 | + <svg class="h-9 w-9 text-terracotta-600 hover:text-terracotta-800" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"> |
| 17 | + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4M7.835 4.697a3.42 3.42 0 001.946-.806 3.42 3.42 0 014.438 0 3.42 3.42 0 001.946.806 3.42 3.42 0 013.138 3.138 3.42 3.42 0 00.806 1.946 3.42 3.42 0 010 4.438 3.42 3.42 0 00-.806 1.946 3.42 3.42 0 01-3.138 3.138 3.42 3.42 0 00-1.946.806 3.42 3.42 0 01-4.438 0 3.42 3.42 0 00-1.946-.806 3.42 3.42 0 01-3.138-3.138 3.42 3.42 0 00-.806-1.946 3.42 3.42 0 010-4.438 3.42 3.42 0 00.806-1.946 3.42 3.42 0 013.138-3.138z" /> |
| 18 | + </svg> |
| 19 | + <% end %> |
| 20 | + <% end %> |
| 21 | + </div> |
| 22 | + </h1> |
| 23 | + <div class="grow"></div> |
| 24 | + <div class="flex items-center mt-3 lg:mt-0"> |
| 25 | + <%= render "share" %> |
| 26 | + <%= render "related_shots", related_shots: @related_shots, shot: @shot if @related_shots.present? %> |
| 27 | + </div> |
| 28 | + </div> |
| 29 | + <% else %> |
| 30 | + <div class="flex flex-col items-center min-w-full sm:flex-row"> |
| 31 | + <div class="flex items-center"> |
| 32 | + <% if owner %> |
| 33 | + <div class="flex mr-3" data-controller="clipboard"> |
| 34 | + <input class="hidden" size="1" type="text" value="<%= request.url %>" readonly="readonly" data-clipboard-target="source"> |
| 35 | + <a class="inline-flex px-4 py-2 text-sm bg-white border rounded-md shadow-sm cursor-pointer border-neutral-300 dark:border-neutral-600 dark:bg-neutral-800 hover:bg-neutral-50 dark:hover:bg-neutral-900" data-action="clipboard#copy" href="#" title="Copy URL to clipboard" data-clipboard-target="container"> |
| 36 | + <svg class="w-4 h-4 -ml-1 -mr-1 text-neutral-500 dark:text-neutral-300" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" data-clipboard-target="copy"> |
| 37 | + <path d="M8 2a1 1 0 000 2h2a1 1 0 100-2H8z" /> |
| 38 | + <path d="M3 5a2 2 0 012-2 3 3 0 003 3h2a3 3 0 003-3 2 2 0 012 2v6h-4.586l1.293-1.293a1 1 0 00-1.414-1.414l-3 3a1 1 0 000 1.414l3 3a1 1 0 001.414-1.414L10.414 13H15v3a2 2 0 01-2 2H5a2 2 0 01-2-2V5zM15 11h2a1 1 0 110 2h-2v-2z" /> |
| 39 | + </svg> |
| 40 | + <svg class="hidden w-4 h-4 -ml-1 -mr-1 text-terracotta-500 dark:text-terracotta-300" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" data-clipboard-target="check"> |
| 41 | + <path d="M9 2a1 1 0 000 2h2a1 1 0 100-2H9z" /> |
| 42 | + <path fill-rule="evenodd" d="M4 5a2 2 0 012-2 3 3 0 003 3h2a3 3 0 003-3 2 2 0 012 2v11a2 2 0 01-2 2H6a2 2 0 01-2-2V5zm9.707 5.707a1 1 0 00-1.414-1.414L9 12.586l-1.293-1.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd" /> |
| 43 | + </svg> |
| 44 | + </a> |
| 45 | + </div> |
| 46 | + <div class="mr-3"> |
| 47 | + <a class="inline-flex px-4 py-2 text-sm bg-white border rounded-md shadow-sm cursor-pointer border-neutral-300 dark:border-neutral-600 dark:bg-neutral-800 hover:bg-neutral-50 dark:hover:bg-neutral-900" href="<%= edit_shot_path %>"> |
| 48 | + <svg class="w-4 h-4 -ml-1 -mr-1 text-neutral-500 dark:text-neutral-300" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"> |
| 49 | + <path d="M13.586 3.586a2 2 0 112.828 2.828l-.793.793-2.828-2.828.793-.793zM11.379 5.793L3 14.172V17h2.828l8.38-8.379-2.83-2.828z" /> |
| 50 | + </svg> |
| 51 | + </a> |
| 52 | + </div> |
| 53 | + <div class="mr-3"> |
| 54 | + <%= button_to shot_path, method: :delete, form_class: "inline-flex", class: "inline-flex px-4 py-2 border border-neutral-300 dark:border-neutral-600 rounded-md shadow-sm text-sm font-medium text-neutral-700 bg-white dark:bg-neutral-800 dark:text-neutral-300 hover:bg-red-50 dark:hover:bg-red-900", data: {turbo: false, action: "click->modal#confirm", title: "Delete Shot", text: "Are you sure you want to permanently delete shot from #{@shot.start_time.in_time_zone(@timezone).to_formatted_s(:long)}?"} do %> |
| 55 | + <svg class="w-4 h-4 -ml-1 -mr-1 text-neutral-500 dark:text-neutral-300" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor"> |
| 56 | + <path fill-rule="evenodd" d="M9 2a1 1 0 00-.894.553L7.382 4H4a1 1 0 000 2v10a2 2 0 002 2h8a2 2 0 002-2V6a1 1 0 100-2h-3.382l-.724-1.447A1 1 0 0011 2H9zM7 8a1 1 0 012 0v6a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v6a1 1 0 102 0V8a1 1 0 00-1-1z" clip-rule="evenodd" /> |
| 57 | + </svg> |
| 58 | + <% end %> |
| 59 | + </div> |
| 60 | + <% end %> |
| 61 | + <%= render "share" %> |
| 62 | + </div> |
| 63 | + <% if owner && @related_shots.present? %> |
| 64 | + <div class="grow"></div> |
| 65 | + <div class="flex mt-3 sm:mt-0"> |
| 66 | + <%= render "related_shots", related_shots: @related_shots, shot: @shot %> |
| 67 | + </div> |
| 68 | + <% end %> |
| 69 | + </div> |
| 70 | + <% end %> |
| 71 | + </div> |
| 72 | + </div> |
| 73 | +<% end %> |
0 commit comments