Skip to content
Snippets Groups Projects
Unverified Commit c3747dc7 authored by Arnaud Levy's avatar Arnaud Levy Committed by GitHub
Browse files

Merge pull request #1473 from noesya/events-categories-fix

Finalisation des catégories séparées
parents aadb98bf 9623cbdf
No related branches found
No related tags found
No related merge requests found
......@@ -29,6 +29,7 @@ class Communication::Website::Permalink < ApplicationRecord
"Communication::Website::Page" => Communication::Website::Permalink::Page,
"Communication::Website::Post" => Communication::Website::Permalink::Post,
"Communication::Website::Agenda::Event" => Communication::Website::Permalink::Agenda::Event,
"Communication::Website::Agenda::Category" => Communication::Website::Permalink::Agenda::Category,
"Education::Diploma" => Communication::Website::Permalink::Diploma,
"Education::Program" => Communication::Website::Permalink::Program,
"Research::Journal::Paper" => Communication::Website::Permalink::Paper,
......@@ -154,6 +155,7 @@ class Communication::Website::Permalink < ApplicationRecord
# Can be overwritten
def published?
# TODO probleme si pas for_website?, par exemple pour les objets directs
about.for_website?(website)
end
......
# == Schema Information
#
# Table name: communication_website_permalinks
#
# id :uuid not null, primary key
# about_type :string not null, indexed => [about_id]
# is_current :boolean default(TRUE)
# path :string
# created_at :datetime not null
# updated_at :datetime not null
# about_id :uuid not null, indexed => [about_type]
# university_id :uuid not null, indexed
# website_id :uuid not null, indexed
#
# Indexes
#
# index_communication_website_permalinks_on_about (about_type,about_id)
# index_communication_website_permalinks_on_university_id (university_id)
# index_communication_website_permalinks_on_website_id (website_id)
#
# Foreign Keys
#
# fk_rails_e9646cce64 (university_id => universities.id)
# fk_rails_f389ba7d45 (website_id => communication_websites.id)
#
class Communication::Website::Permalink::Agenda::Category < Communication::Website::Permalink
def self.required_in_config?(website)
website.feature_agenda
end
def self.static_config_key
:events_categories
end
# /agenda/:slug/
def self.pattern_in_website(website, language)
"/#{website.special_page(Communication::Website::Page::CommunicationAgenda, language: language).slug_with_ancestors}/:slug/"
end
protected
def published?
website.id == about.communication_website_id
end
def substitutions
{
slug: about.slug
}
end
end
......@@ -10,4 +10,13 @@
<% Communication::Website::Permalink.config_in_website(@website, language).each do |key, value| %>
<%= key %>: <%= value %>
<% end %>
taxonomies:
administrator: administrators
author: authors
category: categories
posts_category: posts_categories
events_category: events_categories
diploma: diplomas
researcher: researchers
teacher: teachers
<% end %>
\ No newline at end of file
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