Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small fixes #1266

Merged
merged 7 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from 6 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/organizations/home_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ class Organizations::HomeController < Organizations::BaseController

def index
@pets = Pet.with_photo
.unadopted
.includes(images_attachments: :blob)
.where(organization: Current.organization)
.sample(4)
end
end
8 changes: 4 additions & 4 deletions app/views/devise/registrations/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<section class="container d-flex flex-column">
<div class="row align-items-center justify-content-center g-0 min-vh-100">
<section class="container d-flex flex-column py-6">
<div class="row justify-content-center">
<div class="col-lg-5 col-md-8 py-8 py-xl-0">
<!-- Card -->
<div class="card shadow">
Expand All @@ -9,9 +9,9 @@
<div class='d-flex justify-content-center'>
<div class='d-flex flex-column align-items-center mb-3'>
<% if Current.organization.avatar.attached? %>
<%= image_tag Current.organization.avatar, alt: current_organization_name, title: current_organization_name, class: 'rounded', height: 100, width: 100 %>
<%= image_tag Current.organization.avatar, alt: current_organization_name, title: current_organization_name, height: 75 %>
<% end %>
<h1 class='text-muted'><%= Current.tenant.name %></h1>
<h1><%= Current.tenant.name %></h1>
</div>
</div>
<h1 class="mb-1 fw-bold">Sign up</h1>
Expand Down
10 changes: 6 additions & 4 deletions app/views/devise/sessions/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<section class="container d-flex flex-column">
<div class="row align-items-center justify-content-center g-0 min-vh-100">
<section class="container d-flex flex-column py-6">
<div class="row justify-content-center">

<div class="col-lg-5 col-md-8 py-8 py-xl-0">
<!-- Card -->
Expand All @@ -9,8 +9,10 @@
<div class="mb-4">
<div class='d-flex justify-content-center'>
<div class='d-flex flex-column align-items-center mb-3'>
<%= image_tag 'brand/pet-rescue.png', class: 'mb-0', alt: 'logo-icon', height: 100, width: 100 %>
<h1 class='text-muted'><%= Current.tenant.name %></h1>
<% if Current.organization.avatar.attached? %>
<%= image_tag Current.organization.avatar, alt: current_organization_name, title: current_organization_name, height: 75 %>
<% end %>
<h1><%= Current.tenant.name %></h1>
</div>
</div>
<h1 class="mb-1 fw-bold">Log in</h1>
Expand Down
4 changes: 2 additions & 2 deletions app/views/layouts/dashboard/_sidebar.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<!-- Brand logo -->
<p class="navbar-brand flex-column">
<%= link_to home_index_path, class: "nav-link" do %>
<% if Current.organization.avatar.attached? %>
<%= image_tag Current.organization.avatar, alt: current_organization_name, title: current_organization_name, class: 'rounded-1' %>
<% if Current.organization.avatar.attached? && Current.organization.avatar.persisted? %>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

without this if you upload a logo on the org and it fails validation we get an error

<%= image_tag Current.organization.avatar, alt: current_organization_name, title: current_organization_name %>
<% else %>
<%= current_organization_name %>
<% end %>
Expand Down
14 changes: 9 additions & 5 deletions app/views/layouts/shared/_navbar.html.erb
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
<nav class="navbar navbar-expand-lg bg-transparent shadow-none px-0 py-3">
<div class="container-fluid px-4">
<%= image_tag('png/logo.png', width: '40px', height: '35px', alt: 'Organization logo',
class: 'pe-2') %>
<%= link_to home_index_path, class: 'navbar-brand fw-bold text-black' do %>
<%= Current.organization.name %>
<% end %>
<div class="d-flex gap-2">
<% if Current.organization.avatar.attached? %>
<%= image_tag Current.organization.avatar, alt: current_organization_name, title: current_organization_name, height: 30 %>
<% end %>

<%= link_to home_index_path, class: 'navbar-brand fw-bold text-black' do %>
<%= Current.organization.name %>
<% end %>
</div>

<div class="d-flex align-items-center order-lg-3">
<div>
Expand Down
8 changes: 4 additions & 4 deletions app/views/organizations/home/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,21 @@

<!--//? ADOPTION -->
<section class="pt-5 pb-5" id="adopt">
<div class="container mb-md-5 mt-md-5">
<div class="container mb-md-5 mt-md-5 d-flex flex-column align-items-center">

<!--//? section heading -->
<div class="text-center mb-5">
<div class="mb-5">
<h2 class="section-heading text-uppercase text-xl">
<%= t('.adopt')%>
</h2>
</div>
<!--//? bootstrap cards -->
<div class="row row-cols-1 row-cols-md-2 row-cols-lg-4 mt-4">
<div class="row row-cols-1 row-cols-md-2 row-cols-lg-4 mt-4 w-100 justify-content-center">
<% @pets.each do |pet| %>
<%= link_to adoptable_pet_path(pet) do %>
<div class="col">
<div class="card featured-pets h-100 mt-4 mt-lg-0">
<%= image_tag(pet.images.first, alt: pet.name) %>
<%= image_tag(pet.images.first, alt: pet.name, height: 275, style: "object-fit: cover;") %>
<div class="card-img-overlay p-0"></div>
<div class="card-footer">
<p class="card-text text-black">
Expand Down
2 changes: 1 addition & 1 deletion app/views/organizations/staff/organizations/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
<div class='form-group mt-3'>
<%= form.file_field :avatar,
class: "custom-attachments",
label: 'Attach picture' %>
label: 'Attach logo' %>
</div>
<% end %>
</div>
Expand Down
Loading