noesya/osuny

View on GitHub
app/views/admin/university/people/static.html.erb

Summary

Maintainability
Test Coverage
<%
# this version has to be incremented every time you change something in the file, to invalidate the cache
version = 7
person = @l10n.about
university = person.university
language = @l10n.language
cache_key = [person, @l10n, @website.id, version]
cache cache_key do
%>---
linkTitle: >-
  <%= @l10n.to_s_alphabetical %>
<%= render 'admin/application/static/core', about: @l10n %>
<%= render 'admin/application/static/breadcrumbs', about: @l10n %>
<%= render 'admin/application/static/design',
            about: person,
            l10n: @l10n,
            full_width: true,
            toc_offcanvas: true %>
<%= render 'admin/application/meta_description/static', about: @l10n %>
<%= render 'admin/application/summary/static', about: @l10n %>
<%= render 'admin/application/l10n/static', about: @l10n %>
person: >-
  <%= prepare_text_for_static @l10n.to_s %>
first_name: >-
  <%= prepare_text_for_static @l10n.first_name %>
last_name: >-
  <%= prepare_text_for_static @l10n.last_name %>
<% if person.phone_mobile_is_public? %>
phone: >-
  <%= prepare_text_for_static person.phone_mobile %>
<% end %>
<% if person.email_is_public? %>
email: >-
  <%= prepare_text_for_static person.email %>
<% end %>
<% if person.twitter_is_public? %>
twitter: >-
  <%= prepare_text_for_static @l10n.twitter %>
<% end %>
<% if person.linkedin_is_public? %>
linkedin: >-
  <%= prepare_text_for_static @l10n.linkedin %>
<% end %>
website: >-
  <%= prepare_text_for_static @l10n.url %>
contact_details:
<% if person.address_is_public? %>
<%= render 'admin/application/static/postal_address', about: person, l10n: @l10n, language: language %>
<%= render 'admin/application/static/contact_detail', variable: :address, data: person.address, kind: ContactDetails::Base %>
<%= render 'admin/application/static/contact_detail', variable: :zipcode, data: person.zipcode, kind: ContactDetails::Base %>
<%= render 'admin/application/static/contact_detail', variable: :city, data: person.city, kind: ContactDetails::Base %>
<%= render 'admin/application/static/contact_detail', variable: :country, data: person.country, kind: ContactDetails::Country %>
<% end %>
<%= render 'admin/application/static/contact_detail', variable: :website, data: @l10n.url, kind: ContactDetails::Website %>
<%= render 'admin/application/static/contact_detail', variable: :linkedin, data: @l10n.linkedin, kind: ContactDetails::Linkedin if person.linkedin_is_public? %>
<%= render 'admin/application/static/contact_detail', variable: :twitter, data: @l10n.twitter, kind: ContactDetails::Twitter if person.twitter_is_public? %>
<%= render 'admin/application/static/contact_detail', variable: :mastodon, data: @l10n.mastodon, kind: ContactDetails::Mastodon if person.mastodon_is_public? %>
<%= render 'admin/application/static/contact_detail', variable: :phone, data: person.phone_mobile, kind: ContactDetails::Phone if person.phone_mobile_is_public? %>
<%= render 'admin/application/static/contact_detail', variable: :phone_professional, data: person.phone_professional, kind: ContactDetails::Phone if person.phone_professional_is_public? %>
<%= render 'admin/application/static/contact_detail', variable: :phone_personal, data: person.phone_personal, kind: ContactDetails::Phone if person.phone_personal_is_public? %>
<%= render 'admin/application/static/contact_detail', variable: :email, data: person.email, kind: ContactDetails::Email if person.email_is_public? %>
<% if person.best_picture.attached? %>
image:
  id: "<%= person.best_picture.blob.id %>"
  alt: ""
  credit: >-
    <%= prepare_html_for_static @l10n.picture_credit %>
<% end %>
roles:
<% if @l10n.author.for_website?(@website) %>
  - author
<% end %>
<% if @l10n.teacher.for_website?(@website) %>
  - teacher
<% end %>
<% if @l10n.researcher.for_website?(@website) %>
  - researcher
<% end %>
<% if @l10n.administrator.for_website?(@website) %>
  - administrator
<% end %>
<% if person.involvements_as_teacher.any? %>
teachings:
<% person.involvements_as_teacher.each do |involvement|
    involvement_l10n = involvement.best_localization_for(language)
    program = involvement.target
    program_l10n = program.best_localization_for(language)
    %>
  - description: >-
      <%= involvement_l10n.description %>
    program:
      title: >-
        <%= program_l10n.to_s %>
      url: >-
        <%= program_l10n.current_permalink_in_website(@website)&.path %>
<% end %>
<% end %>
<% if person.roles_as_administrator.any? %>
administrative_missions:
<% person.roles_as_administrator.each do |role|
    role_l10n = role.best_localization_for(language)
    target = role.target
    target_l10n = target.best_localization_for(language)
    %>
  - description: >-
      <%= role_l10n.to_s %>
    target:
      title: >-
        <%= target_l10n.to_s %>
      url: >-
        <%= target_l10n.current_permalink_in_website(@website)&.path if target_l10n.respond_to? :current_permalink_in_website %>
<% end %>
<% end %>
<%= render 'admin/application/connections/backlinks', about: @l10n %>
<%= render 'admin/application/categories/static',
            about: person,
            l10n: @l10n,
            categories: university.person_categories,
            key: :persons_categories %>
biography: >-
  <%= prepare_html_for_static @l10n.biography %>
<%= render 'admin/communication/contents/static', about: @l10n %>
---
<% end %>