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

school website

parent 209bf79f
No related branches found
No related tags found
No related merge requests found
...@@ -32,7 +32,7 @@ class Communication::Website < ApplicationRecord ...@@ -32,7 +32,7 @@ class Communication::Website < ApplicationRecord
dependent: :destroy dependent: :destroy
def self.about_types def self.about_types
[nil, Research::Journal.name] [nil, Education::School.name, Research::Journal.name]
end end
def domain_url def domain_url
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
# #
class Education::School < ApplicationRecord class Education::School < ApplicationRecord
belongs_to :university belongs_to :university
has_one :website, class_name: 'Communication::Website', foreign_key: :about
def to_s def to_s
"#{name}" "#{name}"
......
...@@ -13,6 +13,8 @@ ...@@ -13,6 +13,8 @@
case website.about_type case website.about_type
when Research::Journal.name when Research::Journal.name
collection = current_university.research_journals collection = current_university.research_journals
when Education::School.name
collection = current_university.education_schools
end end
%> %>
<%= f.input :about_id, <%= f.input :about_id,
......
<% content_for :title, @website %> <% content_for :title, @website %>
<% content_for :title_right do %> <% content_for :title_right do %>
<%= link_to @website.domain_url, @website.domain_url, target: :_blank %><br> <% unless @website.domain.blank? %>
<%= link_to @website.domain_url, @website.domain_url, target: :_blank %><br>
<% end %>
<%= I18n.t("activerecord.attributes.communication/website.about_#{@website.about_type}") %> <%= I18n.t("activerecord.attributes.communication/website.about_#{@website.about_type}") %>
<%= link_to @website.about, [:admin, @website.about] unless @website.about.nil? %> (<%= link_to @website.about, [:admin, @website.about] unless @website.about.nil? %>)
<% end %> <% end %>
<div class="card mt-5"> <div class="card mt-5">
......
<% content_for :title, @school %> <% content_for :title, @school %>
<% content_for :title_right do %>
<% if @school.website %>
<%= Communication::Website.model_name.human %>
<i class="fas fa-arrow-right small"></i>
<%= link_to @school.website, [:admin, @school.website] %><br>
<% end %>
<% end %>
<p> <p>
<%= @school.address %><br> <%= @school.address %><br>
<%= @school.zipcode %> <%= @school.city %><br> <%= @school.zipcode %> <%= @school.city %><br>
......
<% content_for :title, @journal %> <% content_for :title, @journal %>
<p>ISSN : <%= @journal.issn %></p> <% content_for :title_right do %>
<% if @journal.website %>
<% if @journal.website %> <%= Communication::Website.model_name.human %>
<p> <i class="fas fa-arrow-right small"></i>
Site : <%= link_to @journal.website, [:admin, @journal.website] %><br>
<%= link_to @journal.website, [:admin, @journal.website] %> <% end %>
</p> <% if @journal.issn %><%= Research::Journal.human_attribute_name('issn') %> <%= @journal.issn %><% end %>
<% end %> <% end %>
<div class="card mt-5"> <div class="card mt-5">
<div class="card-header"> <div class="card-header">
<div class="float-end"> <div class="float-end">
......
...@@ -40,7 +40,7 @@ en: ...@@ -40,7 +40,7 @@ en:
about_type: About about_type: About
about_: Nothing (independent website) about_: Nothing (independent website)
about_Research::Journal: Journal website about_Research::Journal: Journal website
about_School: School website about_Education::School: School website
communication/website/imported/medium: communication/website/imported/medium:
filename: Filename filename: Filename
communication/website/page: communication/website/page:
......
...@@ -40,7 +40,7 @@ fr: ...@@ -40,7 +40,7 @@ fr:
about_type: Sujet du site about_type: Sujet du site
about_: Aucun sujet (site indépendant) about_: Aucun sujet (site indépendant)
about_Research::Journal: Site de revue scientifique about_Research::Journal: Site de revue scientifique
about_School: Site d'école about_Education::School: Site d'école
communication/website/imported/medium: communication/website/imported/medium:
filename: Nom du fichier filename: Nom du fichier
communication/website/page: communication/website/page:
......
...@@ -19,6 +19,7 @@ en: ...@@ -19,6 +19,7 @@ en:
attributes: attributes:
research/journal: research/journal:
title: Title title: Title
issn: ISSN
research/journal/article: research/journal/article:
title: Title title: Title
researchers: Authors researchers: Authors
......
...@@ -19,6 +19,7 @@ fr: ...@@ -19,6 +19,7 @@ fr:
attributes: attributes:
research/journal: research/journal:
title: Titre title: Titre
issn: ISSN
research/journal/article: research/journal/article:
title: Titre title: Titre
researchers: Auteu·rs·rices researchers: Auteu·rs·rices
......
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