Skip to content

Commit

Permalink
Fix/arruma alguns bugs de layout e melhora algumas views
Browse files Browse the repository at this point in the history
Co-authored-by: Rodrigo Gyodai <[email protected]>
  • Loading branch information
gmkoeb and GyodaiDDA committed Feb 15, 2024
1 parent c74a86e commit 39a08b8
Show file tree
Hide file tree
Showing 10 changed files with 80 additions and 75 deletions.
4 changes: 2 additions & 2 deletions app/assets/stylesheets/layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,6 @@ input[type="checkbox"]:checked {
}

.notifications{
margin-left: 21%;
margin-right: 21%;
margin-left: 21% !important;
margin-right: 21% !important;
}
3 changes: 1 addition & 2 deletions app/assets/stylesheets/navbar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,4 @@

.badge-container{
position: relative !important;
}

}
2 changes: 1 addition & 1 deletion app/views/connections/_connection_cards.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<p class="card-text fw-bold"><%= job.position %> | <%= job.company %></p>
<% end %>
<% else %>
<p class="card-text fw-bold"><%= t Profile.human_attribute_name("work_status.#{connection_profile.work_status}") %></p>
<p class="card-text fw-bold"><%= connection_profile.cover_letter%></p>
<% end %>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/home/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
<% end %>
</div>
<div>
<h3 class="text-center home-cards-title bg-white text-center py-4 my-0 rounded-1 mt-4">Pode te interessar</h3>
<h3 class="text-center home-cards-title bg-white text-center py-4 my-0 rounded-1 mt-4">Publicado recentemente</h3>
<div class="d-flex flex-column">
<% get_tags(10).uniq.each do |tag| %>
<%= link_to searches_path(query: "##{tag}"), class:"bg-white text-center home-cards my-0 py-0 rounded-1" do %>
Expand Down
14 changes: 12 additions & 2 deletions app/views/posts/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<div class="d-flex flex-column">
<%= link_to t('edit_btn'), edit_post_path(@post), class: 'btn btn-primary py-0', data: { turbo: false } %>
<%= button_to t('publish_btn'), publish_post_path(@post), method: :patch,
class: 'btn btn-primary', data: { turbo: false } if @post.scheduled? %>
class: 'btn btn-primary py-0', data: { turbo: false } if @post.scheduled? %>
<span><%= Post.human_attribute_name @post.status %></span>
</div>
<% else %>
Expand Down Expand Up @@ -95,7 +95,17 @@
</div>
<% @post.comments.each do |comment| %>
<% if comment.removed?%>
<p><%= t('comments.removed_content') %> </p>
<footer class="mx-3">
<h5>
<% if comment.user.profile.photo.present? %>
<%= image_tag comment.user.profile.photo, alt: 'Foto de perfil', width: '35rem', class: 'profile-picture rounded-circle mx-3' %>
<% else %>
<%= image_tag 'default_portfoliorrr_photo.png', alt: 'Foto de perfil', width: '35rem', class: 'profile-picture rounded-circle mx-3' %>
<% end %>
<%= link_to comment.user.full_name, comment.user.profile %> <%= '(autor)' if comment.user == @post.user %>
</h5>
<p class="comment-message"><%= t('comments.removed_content') %> </p>
</footer>
<% else %>
<div class="card-body" id="<%= dom_id(comment) %>">
<footer>
Expand Down
96 changes: 47 additions & 49 deletions app/views/profiles/_profile_details.html.erb
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
<div>
<% user_is_owner = profile.user == current_user %>
<br>
<div class="border p-3 rounded mb-3 bg-white">
<div class="d-flex gap-1">
<%= image_tag 'about-icon', width: '23rem', class: 'mb-2' %>
<h4><%= Profile.human_attribute_name(:cover_letter) %></h4>
</div>
<p class="profile-info-content pb-0 mb-0"><%= profile.cover_letter %></p>
</div>

<% if profile.personal_info[:visibility] || user_is_owner %>
<div class="border p-3 rounded mb-3 bg-white">
<div class="d-flex gap-1">
<%= image_tag 'about-icon', width: '23rem', class: 'mb-2' %>
<h4><%= Profile.human_attribute_name(:cover_letter) %></h4>
</div>
<p class="profile-info-content pb-0 mb-0"><%= profile.cover_letter %></p>
</div>
<div class="border p-3 rounded mb-3 bg-white">
<div class="d-flex gap-1">
<%= image_tag 'person-fill', width: '28rem', class: 'mb-2' %>
Expand All @@ -24,55 +23,54 @@
</div>
<% end %>
<div class="border p-3 rounded mb-3 bg-white">
<% if profile.professional_infos.visibles_list.any? || user_is_owner %>
<% if profile.professional_infos.visibles_list.any? || user_is_owner %>
<div class="border p-3 rounded mb-3 bg-white">
<div class="d-flex gap-1">
<%= image_tag 'briefcase-solid', width: '24rem', class: 'mb-2 mx-1' %>
<h3><%= ProfessionalInfo.model_name.human %></h3>
</div>
<% end %>

<p>
<%= link_to 'Adicionar Experiência Profissional', new_user_profile_professional_info_path, class:'btn btn-primary rounded-5 mt-3' if user_is_owner %>
</p>
<% professional_infos.each do |professional_info| %>
<% if professional_info.visibility || user_is_owner %>
<% if user_is_owner %>
<li class="fs-5 mb-3">
<span class="fw-semibold"><%= t(professional_info['visibility'] ? 'visibility.true' : 'visibility.false') %></span>
<% if user_is_owner %>
<%= link_to edit_professional_info_path(professional_info), id: 'edit-professional-info', class:'edit-button btn btn-outline-info border-0 p-2 rounded-5' do %>
<%= image_tag 'pencil-square', width: '20 rem' %>
<p>
<%= link_to 'Adicionar Experiência Profissional', new_user_profile_professional_info_path, class:'btn btn-primary rounded-5 mt-3' if user_is_owner %>
</p>
<% professional_infos.each do |professional_info| %>
<% if professional_info.visibility || user_is_owner %>
<% if user_is_owner %>
<li class="fs-5 mb-3">
<span class="fw-semibold"><%= t(professional_info['visibility'] ? 'visibility.true' : 'visibility.false') %></span>
<% if user_is_owner %>
<%= link_to edit_professional_info_path(professional_info), id: 'edit-professional-info', class:'edit-button btn btn-outline-info border-0 p-2 rounded-5' do %>
<%= image_tag 'pencil-square', width: '20 rem' %>
<% end %>
<% end %>
<% end %>
</li>
</li>
<% end %>
<div>
<h5 class="fw-semibold profile-info-title"><%= ProfessionalInfo.human_attribute_name(:position) %>: <%= professional_info.position %></h5>
<h6 class="profile-info-title">
<%= ProfessionalInfo.human_attribute_name(:company) %>: <%= professional_info.company %>
</h6>
</div>
<ul>
<li>
<span class="fw-semibold"><%= ProfessionalInfo.human_attribute_name(:current_job) %></span>: <%= t(professional_info.current_job) %>
</li>
<li>
<span class="fw-semibold"><%= ProfessionalInfo.human_attribute_name(:description) %></span>: <%= professional_info.description %>
</li>
<li>
<span class="fw-semibold"><%= ProfessionalInfo.human_attribute_name(:start_date) %></span>: <%= l professional_info.start_date if professional_info.start_date%>
</li>
<li>
<span class="fw-semibold"><%= ProfessionalInfo.human_attribute_name(:end_date) %></span>: <%= l professional_info.end_date if professional_info.end_date %>
</li>
</ul>
<% end %>
<div>
<h5 class="fw-semibold profile-info-title"><%= ProfessionalInfo.human_attribute_name(:position) %>: <%= professional_info.position %></h5>
<h6 class="profile-info-title">
<%= ProfessionalInfo.human_attribute_name(:company) %>: <%= professional_info.company %>
</h6>
</div>
<ul>
<li>
<span class="fw-semibold"><%= ProfessionalInfo.human_attribute_name(:current_job) %></span>: <%= t(professional_info.current_job) %>
</li>
<li>
<span class="fw-semibold"><%= ProfessionalInfo.human_attribute_name(:description) %></span>: <%= professional_info.description %>
</li>
<li>
<span class="fw-semibold"><%= ProfessionalInfo.human_attribute_name(:start_date) %></span>: <%= l professional_info.start_date if professional_info.start_date%>
</li>
<li>
<span class="fw-semibold"><%= ProfessionalInfo.human_attribute_name(:end_date) %></span>: <%= l professional_info.end_date if professional_info.end_date %>
</li>
</ul>
<% end %>
<% end %>
</div>
</div>
<% end %>
<div class="border py-1 px-2 rounded mb-3 bg-white">
<% if profile.education_infos.visibles_list.any? || user_is_owner %>
<div class="border py-1 px-2 rounded mb-3 bg-white">
<div class="d-flex gap-2">
<%= image_tag 'user-graduate-solid', width: '24rem', class: 'mb-2 mx-1' %>
<h3><%= EducationInfo.model_name.human %></h3>
Expand Down Expand Up @@ -111,8 +109,8 @@
<% end %>
</div>
</div>
<div id='profile-job-categories' class="border py-1 px-2 rounded mb-3 bg-white">
<% if profile.profile_job_categories.any? || user_is_owner %>
<div id='profile-job-categories' class="border py-1 px-2 rounded mb-3 bg-white">
<div class="d-flex gap-1">
<%= image_tag 'person-working', width: '28rem', class: 'mb-2 mx-1' %>
<h3><%= t('content.section_title') %></h3>
Expand Down
6 changes: 4 additions & 2 deletions app/views/profiles/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
<% if @profile.active? %>
<% if @posts.pinned.any? %>
<div id="fixed">
<h2 id="post-list-title"><%= t('.highlight') %></h2>
<div class="mb-3 border-bottom border-dark">
<h2 id="post-list-title"><%= t('.highlight') %></h2>
</div
<section>
<%= render partial: 'posts/listing', locals: { posts: @posts.pinned } %>
</section>
Expand All @@ -15,7 +17,7 @@
</div>
<% published_posts = @profile.user.posts.published %>
<% if published_posts.count - @profile.user.posts.pinned.count < 1 %>
<% if published_posts.count - @profile.user.posts.published.pinned.count < 1 %>
<p><%= t('.nothing_here') %> <br> <%= t('.new_posts') %> :)</p>
<% end %>

Expand Down
22 changes: 12 additions & 10 deletions app/views/shared/_navbar.html.erb
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<nav class="navbar navbar-expand-lg border-bottom bg-white">
<div class="container-fluid">
<div class="w-25 mx-3">
<%= link_to root_path do %>
<%= image_tag 'logo.svg', class:'w-50' %>
<% end %>
<div>
<%= link_to root_path do %>
<%= image_tag 'logo.svg', class:'w-50' %>
<% end %>
</div>
</div>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false">
<span class="navbar-toggler-icon"></span>
Expand Down Expand Up @@ -81,14 +83,14 @@
</ul>
</li>
<% else %>
<li class="nav-item">
<%= link_to t('sign_up'), new_user_registration_path, class: 'btn btn-secondary btn-lg mx-3' %>
</li>
<li class="nav-item">
<%= link_to t('log_in'), new_user_session_path, class: 'btn btn-primary btn-lg mx-3' %>
</li>
<% end %>
</ul>
<% end %>
</div>
<% if !user_signed_in? %>
<div class="nav-button-control d-flex justify-content-end">
<%= link_to t('sign_up'), new_user_registration_path, class: 'btn btn-secondary btn-lg mx-3' %>
<%= link_to t('log_in'), new_user_session_path, class: 'btn btn-primary btn-lg mx-3' %>
</div>
<% end %>
</div>
</nav>
3 changes: 0 additions & 3 deletions spec/system/connections/user_views_followers_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,10 @@
expect(page).not_to have_link first_followed.full_name

expect(page).to have_link second_followed.full_name, href: profile_path(second_followed.profile)
expect(page).to have_content 'Disponível Para Trabalho'

expect(page).to have_link third_followed.full_name, href: profile_path(third_followed.profile)
expect(page).to have_content 'Indisponível Para Trabalho'

expect(page).to have_link fourth_followed.full_name, href: profile_path(fourth_followed.profile)
expect(page).to have_content 'Dev Senior | Rebase'
end

it 'e deve estar logado' do
Expand Down
3 changes: 0 additions & 3 deletions spec/system/connections/user_views_following_users_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,10 @@
expect(page).not_to have_link first_follower.full_name

expect(page).to have_link second_follower.full_name, href: profile_path(second_follower.profile)
expect(page).to have_content 'Disponível Para Trabalho'

expect(page).to have_link third_follower.full_name, href: profile_path(third_follower.profile)
expect(page).to have_content 'Indisponível Para Trabalho'

expect(page).to have_link fourth_follower.full_name, href: profile_path(fourth_follower.profile)
expect(page).to have_content 'Dev Senior | Rebase'
end

it 'e deve estar logado' do
Expand Down

0 comments on commit 39a08b8

Please sign in to comment.