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