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

Merge branch 'master' of github.com:noesya/osuny

parents 14c2e8c7 2c46e4af
No related branches found
No related tags found
No related merge requests found
......@@ -3,9 +3,15 @@ class ApplicationController < ActionController::Base
include WithLocale
include WithDomain
before_action :authenticate_user!
before_action :ensure_university, :authenticate_user!
def breadcrumb
add_breadcrumb t('home'), root_path
end
private
def ensure_university
render_forbidden unless current_university
end
end
......@@ -20,7 +20,7 @@ module Communication::Website::Menu::Item::WithTargets
end
def target_for_program
"#{website.special_page(:education_programs).path}#{about.path}"
"#{website.special_page(:education_programs).path}#{about.path}".gsub("//", '/')
end
def target_for_news
......@@ -28,11 +28,11 @@ module Communication::Website::Menu::Item::WithTargets
end
def target_for_news_article
"#{website.special_page(:communication_posts).path}#{about.path}" if about&.published && about&.published_at
"#{website.special_page(:communication_posts).path}#{about.path}".gsub("//", '/') if about&.published && about&.published_at
end
def target_for_news_category
"#{website.special_page(:communication_posts).path}#{about.path}" if about
"#{website.special_page(:communication_posts).path}#{about.path}".gsub("//", '/') if about
end
def target_for_staff
......@@ -60,7 +60,7 @@ module Communication::Website::Menu::Item::WithTargets
end
def target_for_research_volume
"#{website.special_page(:research_volumes).path}#{about.path}" if about&.published && about&.published_at
"#{website.special_page(:research_volumes).path}#{about.path}".gsub("//", '/') if about&.published && about&.published_at
end
def target_for_research_articles
......@@ -68,6 +68,6 @@ module Communication::Website::Menu::Item::WithTargets
end
def target_for_research_article
"#{website.special_page(:research_articles).path}#{about.path}" if about&.published && about&.published_at
"#{website.special_page(:research_articles).path}#{about.path}".gsub("//", '/') if about&.published && about&.published_at
end
end
......@@ -123,7 +123,7 @@ module Communication::Website::WithDependencies
end
def has_persons?
has_authors? || has_administrators? || has_researchers? || has_teachers?
has_authors? || has_administrators? || has_researchers? || has_teachers? || has_people_in_blocks?
end
def has_administrators?
......
......@@ -19,7 +19,7 @@ module WithSlug
end
def generated_path
"#{parent&.path}/#{slug}".gsub(/\/+/, '/')
"#{parent.nil? ? '/' : parent.path}#{slug}/".gsub(/\/+/, '/')
end
protected
......
---
title: "<%= @about.name %>"
slug: "<%= @about.slug %>"
slug: "<%= @about.path %>"
<% if @about.parent %>
parent: "<%= @about.parent.path %>"
<% end %>
position: <%= @about.position %>
<% if @about.best_featured_image.attached? %>
image: "<%= @about.best_featured_image.blob.id %>"
......
......@@ -10,7 +10,7 @@ image: "<%= @about.best_featured_image.blob.id %>"
image_alt: "<%= @about.featured_image_alt %>"
<% end %>
<% if @about.related_category %>
category: "<%= @about.related_category.path %>/"
category: "<%= @about.related_category.path %>"
<% end %>
description: >
<%= prepare_text_for_static @about.description %>
......
......@@ -12,7 +12,7 @@ authors:
<% if @about.categories.any? %>
categories:
<% @about.categories.each do |category| %>
- "<%= category.path %>/"
- "<%= category.path %>"
<% end %>
<% end %>
<% if @about.featured_image.attached? %>
......
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