-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #121 from TreinaDev/listagem-visitantes-cadastrados
Listagem de visitantes cadastrados e Filtros para listagens
- Loading branch information
Showing
21 changed files
with
958 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
<section class="bg-white rounded-5 py-4 px-5 shadow"> | ||
|
||
<h1>Visitantes/Funcionários cadastrados no <%= @condo.name %></h1> | ||
|
||
<div class="d-flex justify-content-start mb-4"> | ||
<%= link_to find_condo_visitors_path(@condo), class:'btn btn-dark d-flex justify-content-center align-items-center rounded-pill px-4' do %> | ||
Ver Agenda | ||
<i class="bi bi-calendar ms-2 mb-1"></i> | ||
<% end %> | ||
</div> | ||
|
||
<%= form_with url: all_condo_visitors_path(@condo), method: :get do |f| %> | ||
<div class="form-row p-2 row"> | ||
<div class="form-group col-md-4 pe-3"> | ||
<%= f.label :visitor_name, I18n.t("activerecord.attributes.visitor.visitor_name") %> | ||
<%= f.text_field :visitor_name, class: "form-control" %> | ||
</div> | ||
<div class="form-group col-md-2 pe-3"> | ||
<%= f.label :identity_number, I18n.t("activerecord.attributes.visitor.identity_number") %> | ||
<%= f.text_field :identity_number, class: "form-control" %> | ||
</div> | ||
<div class="form-group col-md-4 pe-3"> | ||
<%= f.label :resident_name, I18n.t("activerecord.attributes.visitor.resident_name") %> | ||
<%= f.text_field :resident_name, class: "form-control" %> | ||
</div> | ||
<div class="form-group col-md-2 pe-3"> | ||
<%= f.label :visit_date, I18n.t("activerecord.attributes.visitor.visit_date_query") %> | ||
<%= f.date_field :visit_date, class: "form-control" %> | ||
</div> | ||
<div class="d-flex justify-content-center"> | ||
<%= f.submit "Pesquisar", class: "btn btn-dark rounded-pill d-inline-flex align-items-center mt-3 px-4 shadow-sm" %> | ||
</div> | ||
</div> | ||
<% end %> | ||
|
||
<div class="table-responsive"> | ||
<table class="table table-hover table-sm align-middle caption-top "> | ||
|
||
<% if @result %> | ||
<caption><%= "#{@visitors.count} #{Visitor.model_name.human(count: @visitors.count).downcase} #{I18n.t('activerecord.attributes.visitor.found', count: @visitors.count).downcase}" %></caption> | ||
<% end %> | ||
|
||
<thead> | ||
<tr> | ||
<th scope="col" class="col-3">Nome Completo</th> | ||
<th scope="col" class="col-1">RG</th> | ||
<th scope="col" class="col-1">Categoria</th> | ||
<th scope="col" class="col-1">Unidade</th> | ||
<th scope="col" class="col-3">Responsável</th> | ||
<th scope="col" class="col-2">Data Autorizada</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<% if @visitors.any? %> | ||
<% @visitors.each do |visitor| %> | ||
<tr id="visitor-<%= visitor.id %>"> | ||
<td><%= visitor.full_name %></td> | ||
<td><%= visitor.identity_number %></td> | ||
<td><%= I18n.t("activerecord.attributes.visitor.categories.#{visitor.category}") %></td> | ||
<td><%= visitor.resident.residence.tower_identifier %></td> | ||
<td><%= visitor.resident.full_name %></td> | ||
<td><%= I18n.l(visitor.visit_date) %> | ||
<% if visitor.employee? %> | ||
<span class="badge text-bg-warning ms-1 rounded-pill"><%= I18n.t("activerecord.attributes.visitor.recurrences.#{visitor.recurrence}") %></span> | ||
<% end %> | ||
</td> | ||
</tr> | ||
<% end %> | ||
<% elsif @result %> | ||
<p class="alert alert-warning text-center">Não foi possível encontrar visitantes com os filtros informados</p> | ||
<% else %> | ||
<p class="alert alert-warning text-center">No momento, não há visitantes cadastrados para este condomínio</p> | ||
<% end %> | ||
</tbody> | ||
</table> | ||
</div> | ||
</section> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.