Skip to content
Snippets Groups Projects
Unverified Commit 03235ddc authored by Sébastien Gaya's avatar Sébastien Gaya
Browse files

static

parent da92a09c
No related branches found
No related tags found
No related merge requests found
Showing with 11 additions and 10 deletions
......@@ -74,7 +74,7 @@ class Communication::Website::Permalink < ApplicationRecord
def computed_path
return nil unless published?
@computed_path ||= published_path
@computed_path ||= Static.clean_path(published_path)
end
protected
......@@ -91,4 +91,5 @@ class Communication::Website::Permalink < ApplicationRecord
def set_university
self.university_id = website.university_id
end
end
......@@ -8,7 +8,7 @@ class Communication::Website::Permalink::Category < Communication::Website::Perm
end
def self.pattern_in_website(website)
"#{self.special_page(:communication_posts).path_without_language}:slug/"
"#{website.special_page(:communication_posts).path_without_language}:slug/"
end
protected
......
......@@ -13,7 +13,7 @@ module WithPermalinkInWebsite
new_permalink = Communication::Website::Permalink.for_object(self, website)
# If the object had no permalink or if its path changed, we create a new permalink
if last_permalink.nil? || new_permalink.computed_path.present? && last_permalink.path != new_permalink.computed_path
if new_permalink.computed_path.present? && (last_permalink.nil? || last_permalink.path != new_permalink.computed_path)
last_permalink&.update(is_current: false)
new_permalink.path = new_permalink.computed_path
new_permalink.save
......
---
title: "<%= @about.name %>"
<%#= render 'admin/application/static/permalink' %>
<%= render 'admin/application/static/permalink' %>
<% if @about.parent %>
parent: "<%= @about.parent.path %>"
<% end %>
......
---
title: >
<%= prepare_text_for_static @about.name %>
slug: "<%= @about.slug %>"
<%= render 'admin/application/static/permalink' %>
short_name: >
<%= prepare_text_for_static @about.short_name %>
level: <%= @about.level_i18n %>
......
---
title: >
<%= @about.to_s %>
slug: "<%= @about.slug %>"
<%= render 'admin/application/static/permalink' %>
long_name: >
<%= @about.long_name %>
kind: "<%= @about.kind %>"
......
---
title: >
Responsabilités de <%= @about.to_s %>
<%= render 'admin/application/static/permalink' %>
person: >
<%= @about.to_s %>
first_name: >
<%= @about.first_name %>
last_name: >
<%= @about.last_name %>
slug: "<%= @about.slug %>"
description: >
<%= prepare_text_for_static @about.description %>
---
---
title: >
Actualités de <%= @about.to_s %>
<%= render 'admin/application/static/permalink' %>
person: >
<%= @about.to_s %>
first_name: >
<%= @about.first_name %>
last_name: >
<%= @about.last_name %>
slug: "<%= @about.slug %>"
description: >
<%= prepare_text_for_static @about.description %>
---
---
title: >
Publications de <%= @about.to_s %>
<%= render 'admin/application/static/permalink' %>
person: >
<%= @about.to_s %>
first_name: >
<%= @about.first_name %>
last_name: >
<%= @about.last_name %>
slug: "<%= @about.slug %>"
description: >
<%= prepare_text_for_static @about.description %>
---
---
title: >
Enseignements de <%= @about.to_s %>
<%= render 'admin/application/static/permalink' %>
person: >
<%= @about.to_s %>
first_name: >
<%= @about.first_name %>
last_name: >
<%= @about.last_name %>
slug: "<%= @about.slug %>"
description: >
<%= prepare_text_for_static @about.description %>
---
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