Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/controllers/workshop_logs_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def create

def show
@workshop_log = Report.find(params[:id]).decorate
@workshop = @workshop_log.workshop.decorate
@workshop = @workshop_log.workshop&.decorate
@answers = @workshop_log.report_form_field_answers

if @workshop_log
Expand Down
4 changes: 4 additions & 0 deletions app/frontend/stylesheets/application.tailwind.css
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,7 @@
.readonly textarea {
@apply bg-gray-100 text-gray-500 cursor-not-allowed border-gray-300;
}

.rotate-180 {
transform: rotate(180deg);
}
2 changes: 1 addition & 1 deletion app/views/community_news/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</div>

<!-- Header Row -->
<div class="w-full">
<div class="w-full bg-white rounded-lg shadow-md p-6 space-y-6">
<div class="max-w-3xl mx-auto px-4 py-10 text-gray-800">

<!-- Title -->
Expand Down
2 changes: 1 addition & 1 deletion app/views/quotes/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<!-- <span-->
<!-- class="inline-flex items-center px-2 py-0.5 rounded-full-->
<!-- text-xs font-medium bg-yellow-100 text-yellow-800 whitespace-nowrap">-->
<!-- 🌟 Featured-->
<!-- 🌟 Dashboard Feature -->
<!-- </span>-->
<%# end %>
</div>
Expand Down
191 changes: 104 additions & 87 deletions app/views/resources/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,109 +1,126 @@
<div class="resource-detail py-6 min-h-screen">
<div class="max-w-5xl mx-auto px-4">
<div class="min-h-screen py-8">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="bg-violet-50 border border-gray-200 rounded-xl shadow-md hover:shadow-lg transition-shadow duration-200 p-6">
<!-- Top Right Utility Buttons -->
<div class="text-right mb-4 space-x-1">
<span class="inline-block text-md">
<%= render "bookmarks/editable_bookmark_button", resource: @resource.object %>
</span>

<div class="flex justify-end mb-6">
<% if current_user.super_user? %>
<%= link_to("Edit", edit_resource_path(@resource), class: "btn btn-primary-outline admin-only bg-blue-100") %>
<% end %>

<%= link_to ("<span title='Download #{@resource.kind} image'>" +
" Download <span class='fa fa-download'></span></span>").html_safe,
resource_download_path(@resource),
class: "btn btn-utility" if @resource.download_attachment&.file&.attached? %>
<%= render "bookmarks/editable_bookmark_button", resource: @resource.object %>
</div>
<% if current_user.super_user? %>
<%= link_to("Edit", edit_resource_path(@resource),
class: "admin-only bg-blue-100 btn btn-primary-outline") %>
<% end %>

<%= link_to ("<span title='Download #{@resource.kind} image'>" +
" Download <span class='fa fa-download'></span></span>").html_safe,
resource_download_path(@resource),
class: "btn btn-utility" if @resource.download_attachment&.file&.attached? %>
</div>

<!-- Resource Card -->
<div class="bg-white rounded-lg shadow-md p-6 space-y-6">
<!-- Resource Card -->
<div class="bg-white rounded-lg shadow-md p-6 space-y-6">

<!-- Title -->
<h2 class="text-3xl font-semibold text-gray-900">
<%= @resource.display_title %>
</h2>
<!-- Title -->
<h2 class="text-3xl font-semibold text-gray-900 mb-2">
<%= @resource.display_title %>
</h2>

<% if @resource.inactive? %>
<div class="text-red-500 mb-3">
[HIDDEN]
<div class="mb-3">
<% if @resource.featured %>
<span
class="inline-flex items-center px-2 py-0.5 rounded-full
text-xs font-medium bg-yellow-100 text-yellow-800 whitespace-nowrap">
🌟 Dashboard Feature
</span>
<% end %>
<% if @resource.inactive? %>
<span
class="inline-flex items-center px-2 py-0.5 rounded-full
text-xs font-medium bg-blue-100 text-gray-600 whitespace-nowrap">
<i class="fa-solid fa-eye-slash mr-1"></i> Hidden
</span>
<% end %>
</div>
<% end %>

<!-- Author and Date -->
<div class="flex flex-col gap-1">
<% unless @resource.toolkit_and_form? %>
<div class="flex items-center text-gray-600 text-sm gap-2">
<span><%= @resource.author %></span>
<% unless @resource.story? %>
<span class="<%= "border-l border-gray-400 pl-2" if @resource.author.present? %>">
<%= @resource.display_date %>
</span>
<% end %>
</div>
<% end %>
</div>

<div class="images">
<!-- Hero Image -->
<% if @resource.main_image&.file&.attached? %>
<div class="mb-8">
<%= image_tag @resource.main_image.file,
class: "w-full rounded-lg shadow-sm border border-gray-200",
alt: @resource.title %>
</div>
<% end %>
<!-- Author and Date -->
<div class="flex flex-col gap-1">
<% unless @resource.toolkit_and_form? %>
<div class="flex items-center text-gray-600 text-sm gap-2">
<span><%= @resource.author %></span>
<% unless @resource.story? %>
<span class="<%= "border-l border-gray-400 pl-2" if @resource.author.present? %>">
<%= @resource.display_date %>
</span>
<% end %>
</div>
<% end %>
</div>

<div class="images">
<!-- Hero Image -->
<% if @resource.main_image&.file&.attached? %>
<div class="mb-8">
<%= image_tag @resource.main_image.file,
class: "w-full rounded-lg shadow-sm border border-gray-200",
alt: @resource.title %>
</div>
<% end %>

<!-- Gallery Images -->
<% if @resource.gallery_images.any? { |img| img.persisted? && img.file.attached? } %>
<div class="resource-gallery single-resource-detail text-center mb-4">
<div class="flex flex-wrap justify-center gap-4 mx-auto max-w-3xl">
<% @resource.gallery_images.each_with_index do |gallery_image, idx| %>
<% if gallery_image.file&.attached? %>
<%= image_tag url_for(gallery_image.file),
alt: "Gallery Image #{idx + 1}",
data: { file_preview_target: "preview" },
class: "w-32 h-32 object-cover border border-gray-300 shadow-sm" %>
<!-- Gallery Images -->
<% if @resource.gallery_images.any? { |img| img.persisted? && img.file.attached? } %>
<div class="resource-gallery single-resource-detail text-center mb-4">
<div class="flex flex-wrap justify-center gap-4 mx-auto max-w-3xl">
<% @resource.gallery_images.each_with_index do |gallery_image, idx| %>
<% if gallery_image.file&.attached? %>
<%= image_tag url_for(gallery_image.file),
alt: "Gallery Image #{idx + 1}",
data: { file_preview_target: "preview" },
class: "w-32 h-32 object-cover border border-gray-300 shadow-sm" %>
<% end %>
<% end %>
<% end %>
</div>
</div>
<% end %>
</div>


<!-- URL -->
<% if @resource.url.present? %>
<div class="prose mx-auto leading-relaxed text-gray-800 text-left">
<%= link_to @resource.url, @resource.url, target: "_blank",
rel: "noopener noreferrer",
class: "text-blue-600 hover:underline break-words" %>
</div>
<% end %>
</div>


<!-- URL -->
<% if @resource.url.present? %>
<!-- Main Text -->
<div class="prose mx-auto leading-relaxed text-gray-800 text-left">
<%= link_to @resource.url, @resource.url, target: "_blank",
rel: "noopener noreferrer",
class: "text-blue-600 hover:underline break-words" %>
<%= @resource.display_text %>
</div>
<% end %>


<!-- Main Text -->
<div class="prose mx-auto leading-relaxed text-gray-800 text-left">
<%= @resource.display_text %>
</div>

<!-- Attachments -->
<% if @resource.attachments.any? %>
<div class="mt-6">
<p class="font-medium text-gray-700 mb-2">Attachment:</p>
<ul class="flex flex-wrap gap-2">
<% @resource.attachments.each do |attachment| %>
<% if attachment.file&.attached? %>
<li>
<%= link_to ("<span title='Download #{@resource.kind}'>" +
" #{ attachment.file_file_name } <span class='fa fa-download'></span></span>").html_safe,
resource_download_path(@resource,
attachment_id: attachment.id),
class: "btn btn-utility" if attachment&.file&.attached? %>
</li>
<!-- Attachments -->
<% if @resource.attachments.any? %>
<div class="mt-6">
<p class="font-medium text-gray-700 mb-2">Attachment:</p>
<ul class="flex flex-wrap gap-2">
<% @resource.attachments.each do |attachment| %>
<% if attachment.file&.attached? %>
<li>
<%= link_to ("<span title='Download #{@resource.kind}'>" +
" #{ attachment.file_file_name } <span class='fa fa-download'></span></span>").html_safe,
resource_download_path(@resource,
attachment_id: attachment.id),
class: "btn btn-utility" if attachment&.file&.attached? %>
</li>
<% end %>
<% end %>
<% end %>
</ul>
</div>
<% end %>
</ul>
</div>
<% end %>
</div>
</div>
</div>
</div>
Loading