Skip to content
Snippets Groups Projects
Commit 01e8cfc5 authored by Arnaud Levy's avatar Arnaud Levy
Browse files

more

parent 6fa13eeb
No related branches found
No related tags found
No related merge requests found
......@@ -3,45 +3,35 @@
<%= f.error_notification message: f.object.errors[:base].to_sentence if f.object.errors[:base].present? %>
<div class="row">
<div class="col-md-6">
<div class="card flex-fill w-100">
<div class="card-header">
<h5 class="card-title mb-0"><%= t('metadata') %></h5>
</div>
<div class="card-body">
<%= f.input :name %>
<%= f.input :phone %>
<%= f.input :address %>
<div class="row">
<div class="col-md-4">
<%= f.input :zipcode %>
</div>
<div class="col-md-8">
<%= f.input :city %>
</div>
<div class="col-xxl-6">
<%= osuny_panel title: t('metadata') do %>
<%= f.input :name %>
<%= f.input :phone %>
<%= f.input :address %>
<div class="row pure__row--small">
<div class="col-md-4">
<%= f.input :zipcode %>
</div>
<div class="col-md-8">
<%= f.input :city %>
</div>
<%= f.input :country, input_html: { class: 'form-select' } %>
<%= f.input :logo,
as: :single_deletable_file,
input_html: { accept: '.jpg,.jpeg,.png,.svg' },
preview: 200,
direct_upload: true %>
</div>
</div>
<%= f.input :country, input_html: { class: 'form-select' } %>
<%= f.input :logo,
as: :single_deletable_file,
input_html: { accept: '.jpg,.jpeg,.png,.svg' },
preview: 200,
direct_upload: true %>
<% end %>
</div>
<div class="col-md-6">
<div class="card flex-fill w-100">
<div class="card-header">
<h5 class="card-title mb-0"><%= Education::Program.model_name.human(count: 2) %></h5>
</div>
<div class="card-body">
<%= f.association :programs,
as: :check_boxes,
collection: collection_tree(current_university.education_programs),
label_method: ->(p) { sanitize p[:label] },
value_method: ->(p) { p[:id] } %>
</div>
</div>
<div class="col-xxl-6">
<%= osuny_panel title: Education::Program.model_name.human(count: 2) do %>
<%= f.association :programs,
as: :check_boxes,
collection: collection_tree(current_university.education_programs),
label_method: ->(p) { sanitize p[:label] },
value_method: ->(p) { p[:id] } %>
<% end %>
</div>
</div>
<% content_for :action_bar_right do %>
......
......@@ -2,57 +2,42 @@
<div class="row">
<div class="col-md-4">
<div class="card flex-fill w-100">
<div class="card-header">
<h2 class="card-title mb-0 h5"><%= t('metadata') %></h2>
</div>
<div class="card-body">
<h3 class="h5"><%= Education::School.human_attribute_name('address') %></h3>
<p>
<%= @school.address %><br>
<%= @school.zipcode %> <%= @school.city %><br>
<%= @school.country %>
</p>
<h3 class="h5"><%= Education::School.human_attribute_name('phone') %></h3>
<p><%= @school.phone %></p>
</div>
</div>
<div class="col-xxl-4">
<%= osuny_panel title: t('metadata') do %>
<%= osuny_label Education::School.human_attribute_name('address') %>
<p>
<%= @school.address %><br>
<%= @school.zipcode %> <%= @school.city %><br>
<%= @school.country %>
</p>
<%= osuny_label Education::School.human_attribute_name('phone') %>
<p><%= @school.phone %></p>
<% end %>
</div>
<% if @school.programs.any? %>
<div class="col-md-4">
<div class="card flex-fill w-100">
<div class="card-header">
<h2 class="card-title mb-0 h5"><%= Education::School.human_attribute_name('programs') %></h2>
</div>
<div class="card-body">
<ul class="list-unstyled">
<% @school.programs.ordered.each do |program| %>
<li><%= link_to_if can?(:read, program), program, [:admin, program] %></li>
<% end %>
</ul>
<%= @school.alumni.count %>
<%= University::Person::Alumnus.model_name.human(count: 2).downcase %>
</div>
</div>
<div class="col-xxl-4">
<%= osuny_panel title: Education::School.human_attribute_name('programs') do %>
<ul class="list-unstyled">
<% @school.programs.ordered.each do |program| %>
<li><%= link_to_if can?(:read, program), program, [:admin, program] %></li>
<% end %>
</ul>
<%= @school.alumni.count %>
<%= University::Person::Alumnus.model_name.human(count: 2).downcase %>
<% end %>
</div>
<% end %>
<% if @school.websites.any? %>
<div class="col-md-4">
<div class="card flex-fill w-100">
<div class="card-header">
<h2 class="card-title mb-0 h5"><%= Education::School.human_attribute_name('websites') %></h2>
</div>
<div class="card-body">
<ul class="list-unstyled">
<% @school.websites.each do |website| %>
<li><%= link_to website, [:admin, website] %></li>
<% end %>
</ul>
</div>
</div>
<div class="col-xxl-4">
<%= osuny_panel title: Education::School.human_attribute_name('websites') do %>
<ul class="list-unstyled">
<% @school.websites.each do |website| %>
<li><%= link_to website, [:admin, website] %></li>
<% end %>
</ul>
<% end %>
</div>
<% end %>
......
<div class="card flex-fill w-100">
<div class="card-header">
<div class="float-end">
<%= link_to t('education.schools.manage_roles'),
<%
action = ''
action += link_to t('education.schools.manage_roles'),
admin_education_school_roles_path(school_id: @school.id),
class: button_classes if can?(:update, University::Role) %>
</div>
<h2 class="card-title mb-0 h5"><%= Education::School.human_attribute_name('roles') %></h2>
</div>
<div class="card-body">
<% if @roles.any? %>
<div class="table-responsive">
<table class="<%= table_classes %>">
<thead>
class: button_classes if can?(:update, University::Role)
%>
<%= osuny_panel title: Education::School.human_attribute_name('roles'), action: action do %>
<% if @roles.any? %>
<div class="table-responsive">
<table class="<%= table_classes %>">
<thead>
<tr>
<th class="ps-0"><%= University::Role.model_name.human %></th>
<th><%= University::Role.human_attribute_name('people') %></th>
</tr>
</thead>
<tbody>
<% roles.each do |role| %>
<tr>
<th class="ps-0"><%= University::Role.model_name.human %></th>
<th><%= University::Role.human_attribute_name('people') %></th>
<td class="ps-0">
<%= link_to_if can?(:read, role),
role,
edit_admin_education_school_role_path(role, { school_id: @school.id }) %>
</td>
<td>
<ul class="list-unstyled">
<% role.involvements.includes(:person).ordered.each do |involvement| %>
<li><%= link_to_if can?(:read, involvement.person), involvement.person.to_s, admin_university_person_path(involvement.person) %></li>
<% end %>
</ul>
</td>
</tr>
</thead>
<tbody>
<% roles.each do |role| %>
<tr>
<td class="ps-0">
<%= link_to_if can?(:read, role),
role,
edit_admin_education_school_role_path(role, { school_id: @school.id }) %>
</td>
<td>
<ul>
<% role.involvements.includes(:person).ordered.each do |involvement| %>
<li><%= link_to_if can?(:read, involvement.person), involvement.person.to_s, admin_university_person_path(involvement.person) %></li>
<% end %>
</ul>
</td>
</tr>
<% end %>
</tbody>
</table>
</div>
<% end %>
</div>
</div>
<% end %>
</tbody>
</table>
</div>
<% end %>
<% end %>
<% param_name ||= :page %>
<% if involvements.total_count > 0 %>
<%= osuny_panel title: Education::Program.model_name.human(count: 2),
subtitle: "#{involvements.total_count} #{Education::Program.model_name.human(count: involvements.total_count).downcase}" do %>
subtitle: "#{involvements.total_count} #{Education::Program.model_name.human(count: involvements.total_count).downcase}" do %>
<div class="table-responsive">
<table class="<%= table_classes %>">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment