From 018affc145e0b3c823e3e7dcaaada39858f5c8b3 Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Wed, 13 Nov 2024 10:07:50 +0000 Subject: Very ghetto resource featured card layout --- app/views/layouts/_navbar.html.erb | 3 +++ app/views/pdfresources/_pdfresource.html.erb | 29 ++++++++++++++-------------- app/views/pdfresources/index.html.erb | 23 +++++++++++----------- 3 files changed, 29 insertions(+), 26 deletions(-) (limited to 'app') diff --git a/app/views/layouts/_navbar.html.erb b/app/views/layouts/_navbar.html.erb index 7a50848..0bc947a 100644 --- a/app/views/layouts/_navbar.html.erb +++ b/app/views/layouts/_navbar.html.erb @@ -20,6 +20,9 @@
  • Contact
  • +
  • + <%= link_to "Log out", Current.session, class: "block py-2 px-3", data: { turbo_method: :delete }%> +
  • diff --git a/app/views/pdfresources/_pdfresource.html.erb b/app/views/pdfresources/_pdfresource.html.erb index d947dd1..2e0d86c 100644 --- a/app/views/pdfresources/_pdfresource.html.erb +++ b/app/views/pdfresources/_pdfresource.html.erb @@ -1,7 +1,16 @@ -
    +

    - Name: - <%= pdfresource.name %> +

    + <%= image_tag url_for(pdfresource.thumbnails.first), class: "object-cover"%> +
    +

    + +

    + <%= pdfresource.name %> +

    + +

    + <%= pdfresource.card_description %>

    @@ -16,12 +25,6 @@ <% end %>

    -

    - Thumbnails: - <% pdfresource.thumbnails.each do |thumbnail| %> -

    <%= link_to thumbnail.filename, thumbnail %>
    - <% end %> -

    Price: @@ -48,9 +51,7 @@ <%= pdfresource.description %>

    -

    - Card description: - <%= pdfresource.card_description %> +

    + <%= link_to "Show this pdfresource", pdfresource, class: "ml-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %>

    - -
    +
    \ No newline at end of file diff --git a/app/views/pdfresources/index.html.erb b/app/views/pdfresources/index.html.erb index 5da2312..309dcdd 100644 --- a/app/views/pdfresources/index.html.erb +++ b/app/views/pdfresources/index.html.erb @@ -5,19 +5,18 @@ <% content_for :title, "Alphabet Learning - Resources" %> - <%= link_to "Log out", Current.session, class: "underline my-3", data: { turbo_method: :delete }%> - -
    -

    Resources

    - <%= link_to "Add new resource", new_pdfresource_path, class: "rounded-lg py-3 px-5 bg-blue-600 text-white block font-medium" %> +
    +

    Featured Resources

    - -
    - <% @pdfresources.each do |pdfresource| %> - <%= render pdfresource %> -

    - <%= link_to "Show this pdfresource", pdfresource, class: "ml-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %> -

    + +
    + <% @pdfresources.where("feature_slot < 4").each do |pdfresource| %> + <%= render pdfresource %> <% end %>
    + + <% if Current.session.user.is_admin %> + <%= link_to "Add new resource", new_pdfresource_path, class: "rounded-lg py-3 px-5 bg-blue-600 text-white block font-medium" %> + <% end %> +
    -- cgit v1.2.3