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

person

parent 9cd7d8b0
No related branches found
No related tags found
No related merge requests found
......@@ -24,7 +24,13 @@ class Admin::University::PeopleController < Admin::University::ApplicationContro
response.headers['Content-Disposition'] = "attachment; filename=#{filename}"
}
end
end
def search
@term = params[:term].to_s
@people = current_university.people
.for_search_term(@term)
.ordered
end
def show
......
......@@ -178,6 +178,10 @@ class University::Person < ApplicationRecord
"#{first_name} #{last_name}"
end
def to_s_with_mail
"#{to_s} (#{email})"
end
def to_s_alphabetical
"#{last_name} #{first_name}"
end
......
......@@ -7,7 +7,7 @@
label: false,
as: :autocomplete,
url: search_admin_university_organizations_path(lang: nil, website_id: nil),
placeholder: t("extranet.experiences.search_organization"),
placeholder: t("university.organization.search"),
input_html: {
data: {
type: 'University::Organization',
......
<%
@people = @website.connected_people.ordered.page params[:page]
%>
<%= osuny_panel University::Person.model_name.human(count: 2) do %>
<%= simple_form_for :association, class_name: 'association' do |f| %>
<%= f.input :name,
label: false,
as: :autocomplete,
url: search_admin_university_people_path(lang: nil, website_id: nil),
placeholder: t("university.person.search"),
input_html: {
data: {
type: 'University::Person',
target: connect_admin_communication_website_page_path(@page)
}
}
%>
<% end %>
<table class="<%= table_classes%>">
<tbody>
<% @people.each do |person| %>
<tr>
<td><%= link_to person, [:admin, person] %></td>
<td><%= link_to 'Déconnecter',
disconnect_admin_communication_website_page_path(@page, objectId: person.id, objectType: person.class),
class: button_classes_danger,
method: :post %></td>
</tr>
<% end %>
</tbody>
</table>
<%= paginate @people, theme: 'bootstrap-5' %>
<% end %>
json.array! @people do |person|
json.id person.id
json.label person.to_s_with_mail
json.value person.to_s_with_mail
end
\ No newline at end of file
......@@ -213,7 +213,8 @@ en:
manage_alumni: Manage alumni
manage_cohorts: Manage cohorts
manage_experiences: Manage experiences
organisation:
organization:
search: Search by name
employees: Employees
import_hint_html: "Possible values for <i>kind</i> are: company, non_profit, government.<br><i>Siren</i>, <i>nic</i>, <i>zipcode</i> and <i>phone</i> fields must have a text format, not numbers.<br><i>Country</i> field must contain the ISO 3166 code of the country, so 2 upcase characters (<a href=\"https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes\" target=\_blank\">list</a>)."
logo: Logo
......@@ -228,6 +229,7 @@ en:
import_hint_html: "Possible values for <i>gender</i> are: m (male), f (female) and n (non binary).<br><i>Phone_professional</i>, <i>phone_personal</i>, <i>mobile</i> and <i>zipcode</i> fields must have a text format, not numbers.<br><i>Country</i> field must contain the ISO 3166 code of the country, so 2 upcase characters (<a href=\"https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes\" target=\_blank\">list</a>).<br><i>Social_twitter</i> field should have no @."
title: Experiences imports
personal_data_warning: Warning! The information provided below can be publicly visible on the websites and the extranets about you.
search: Search by name
taught_programs: Taught programs
sso: SSO
sso_key: SSO Key
......@@ -214,6 +214,7 @@ fr:
manage_cohorts: Gérer les promotions
manage_experiences: Gérer les expériences professionnelles
organization:
search: Rechercher par nom d'organisation
employees: Employé·e·s
import_hint_html: "Les valeurs possibles pour <i>kind</i> sont : company, non_profit, government.<br>Les champs <i>siren</i>, <i>nic</i>, <i>zipcode</i> et <i>phone</i> doivent être au format texte, pas nombre.<br>Le champ <i>country</i> doit contenir le code ISO 3166 du pays, sur 2 caratères en majuscule (<a href=\"https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes\" target=\_blank\">liste</a>)"
logo: Logo
......@@ -227,6 +228,7 @@ fr:
import_btn: Importer des expériences
import_hint_html: "Les valeurs pour <i>gender</i> peuvent être m (masculin), f (féminin) et n (non binaire).<br>Les champs <i>phone_professional</i>, <i>phone_personal</i>, <i>mobile</i> et <i>zipcode</i> doivent être au format texte, pas nombre.<br>Le champ <i>country</i> doit contenir le code ISO 3166 du pays, sur 2 caratères en majuscule (<a href=\"https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes\" target=\_blank\">liste</a>)<br>Le champ <i>social_twitter</i> ne doit pas contenir d'@."
title: Imports d'expériences
search: Rechercher par nom de personne
personal_data_warning: Attention ! Les informations renseignées ici sont susceptibles d'être visibles publiquement sur les sites web et les extranets vous concernant.
taught_programs: Formations enseignées
sso: SSO
......
......@@ -16,6 +16,7 @@ namespace :university do
end
resources :people do
collection do
get :search, defaults: { format: 'json' }
resources :categories, controller: 'people/categories', as: 'person_categories'
end
member do
......
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