From 68dfba474e7943994254f4503fecfc6c74ada197 Mon Sep 17 00:00:00 2001 From: Arnaud Levy <contact@arnaudlevy.com> Date: Tue, 15 Feb 2022 17:11:50 +0100 Subject: [PATCH] better show --- .../organization_chart/_show.html.erb | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/app/views/admin/communication/website/blocks/templates/organization_chart/_show.html.erb b/app/views/admin/communication/website/blocks/templates/organization_chart/_show.html.erb index 32092f13f..d099275bf 100644 --- a/app/views/admin/communication/website/blocks/templates/organization_chart/_show.html.erb +++ b/app/views/admin/communication/website/blocks/templates/organization_chart/_show.html.erb @@ -1,6 +1,19 @@ <% @block.data['elements'].each do |element| %> <h2><%= element['title'] %></h2> - <% element['persons'].each do |person| %> - <p><b><%= person['slug'] %></b>, <%= person['role'] %></p> - <% end %> + <div class="row"> + <% element['persons'].each do |person| %> + <% + p = current_university.people.find_by slug: person['slug'] + next if p.nil? + %> + <div class="col-md-3"> + <article class="card"> + <div class="card-body"> + <h3 class="card-title h5"><%= link_to p, [:admin, p] %></h3> + <p class="mb-0"><%= person['role'] %></p> + </div> + </article> + </div> + <% end %> + </div> <% end %> -- GitLab