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

statics

parent 3bee0cda
No related branches found
No related tags found
No related merge requests found
...@@ -88,7 +88,7 @@ GEM ...@@ -88,7 +88,7 @@ GEM
autoprefixer-rails (10.4.7.0) autoprefixer-rails (10.4.7.0)
execjs (~> 2) execjs (~> 2)
aws-eventstream (1.2.0) aws-eventstream (1.2.0)
aws-partitions (1.583.0) aws-partitions (1.585.0)
aws-sdk-core (3.130.2) aws-sdk-core (3.130.2)
aws-eventstream (~> 1, >= 1.0.2) aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.525.0) aws-partitions (~> 1, >= 1.525.0)
...@@ -304,7 +304,7 @@ GEM ...@@ -304,7 +304,7 @@ GEM
ruby2_keywords (~> 0.0.1) ruby2_keywords (~> 0.0.1)
nesty (1.0.2) nesty (1.0.2)
nio4r (2.5.8) nio4r (2.5.8)
nokogiri (1.13.4) nokogiri (1.13.5)
mini_portile2 (~> 2.8.0) mini_portile2 (~> 2.8.0)
racc (~> 1.4) racc (~> 1.4)
oauth2 (1.4.9) oauth2 (1.4.9)
......
...@@ -9,6 +9,8 @@ about_featured_image_image = ".#{about_identifier}_featured_image img" ...@@ -9,6 +9,8 @@ about_featured_image_image = ".#{about_identifier}_featured_image img"
about_featured_image_alt = "##{about_identifier}_featured_image_alt" about_featured_image_alt = "##{about_identifier}_featured_image_alt"
# #communication_website_page_featured_image_credit # #communication_website_page_featured_image_credit
about_featured_image_credit = "##{about_identifier}_featured_image_credit" about_featured_image_credit = "##{about_identifier}_featured_image_credit"
# fr, en...
lang = about&.language&.iso_code if about.respond_to? :language
%> %>
<div id="unsplash-app" v-cloak> <div id="unsplash-app" v-cloak>
...@@ -55,9 +57,9 @@ about_featured_image_credit = "##{about_identifier}_featured_image_credit" ...@@ -55,9 +57,9 @@ about_featured_image_credit = "##{about_identifier}_featured_image_credit"
<p v-if="data.results.length === 0 || !data" >Aucun résultat</p> <p v-if="data.results.length === 0 || !data" >Aucun résultat</p>
<div v-for="image in data.results" class="col-6 col-lg-2"> <div v-for="image in data.results" class="col-6 col-lg-2">
<img <img
:src="image.thumb" :src="image.thumb"
:alt="image.alt" :alt="image.alt"
v-on:click="select(image)" v-on:click="select(image)"
class="img-fluid img-thumbnail mb-3" class="img-fluid img-thumbnail mb-3"
:class="image === selected ? 'bg-secondary' : ''"> :class="image === selected ? 'bg-secondary' : ''">
...@@ -72,7 +74,7 @@ about_featured_image_credit = "##{about_identifier}_featured_image_credit" ...@@ -72,7 +74,7 @@ about_featured_image_credit = "##{about_identifier}_featured_image_credit"
<div href="#" <div href="#"
v-if="page < data.total_pages" v-if="page < data.total_pages"
v-on:click="page = page + 1" v-on:click="page = page + 1"
class="btn btn-secondary">Page suivante</div> class="btn btn-secondary">Page suivante</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -91,7 +93,7 @@ about_featured_image_credit = "##{about_identifier}_featured_image_credit" ...@@ -91,7 +93,7 @@ about_featured_image_credit = "##{about_identifier}_featured_image_credit"
parameters: { parameters: {
url: '<%= admin_communication_unsplash_path(format: :json) %>', url: '<%= admin_communication_unsplash_path(format: :json) %>',
per_page: 12, per_page: 12,
lang: '<%= about&.language&.iso_code %>', lang: '<%= lang %>',
query: '<%= search || "" %>' query: '<%= search || "" %>'
}, },
page: 1, page: 1,
...@@ -113,7 +115,6 @@ about_featured_image_credit = "##{about_identifier}_featured_image_credit" ...@@ -113,7 +115,6 @@ about_featured_image_credit = "##{about_identifier}_featured_image_credit"
}, },
watch: { watch: {
page(value) { page(value) {
console.log(value)
this.search(); this.search();
} }
}, },
...@@ -124,7 +125,7 @@ about_featured_image_credit = "##{about_identifier}_featured_image_credit" ...@@ -124,7 +125,7 @@ about_featured_image_credit = "##{about_identifier}_featured_image_credit"
} }
var xmlHttp = new XMLHttpRequest(); var xmlHttp = new XMLHttpRequest();
xmlHttp.onreadystatechange = function() { xmlHttp.onreadystatechange = function() {
if (xmlHttp.readyState == 4 && xmlHttp.status == 200) { if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {
this.data = JSON.parse(xmlHttp.responseText); this.data = JSON.parse(xmlHttp.responseText);
console.log(this.data) console.log(this.data)
...@@ -150,7 +151,7 @@ about_featured_image_credit = "##{about_identifier}_featured_image_credit" ...@@ -150,7 +151,7 @@ about_featured_image_credit = "##{about_identifier}_featured_image_credit"
} }
} }
}); });
window.addEventListener('load', function(){ window.addEventListener('load', function(){
setTimeout(function() { setTimeout(function() {
app.mount('#unsplash-app'); app.mount('#unsplash-app');
......
<%
featured_image = @about&.best_featured_image || @about.featured_image
if featured_image.attached?
%>
image:
id: "<%= featured_image.blob.id %>"
alt: "<%= @about.featured_image_alt %>"
credit: >
<%= prepare_html_for_static @about.featured_image_credit, @about.university %>
<% end %>
...@@ -31,21 +31,7 @@ ...@@ -31,21 +31,7 @@
</ul> </ul>
</div> </div>
</div> </div>
<div class="card flex-fill w-100"> <%= render 'admin/application/featured_image/edit', about: category, f: f %>
<div class="card-header">
<h5 class="card-title mb-0"><%= t('activerecord.attributes.communication/website/category.featured_image') %></h5>
</div>
<div class="card-body">
<%= f.input :featured_image,
as: :single_deletable_file,
direct_upload: true,
label: false,
input_html: { accept: '.jpg,.jpeg,.png,.svg' },
preview: true
%>
<%= f.input :featured_image_alt %>
</div>
</div>
<div class="card flex-fill w-100"> <div class="card flex-fill w-100">
<div class="card-header"> <div class="card-header">
<h5 class="card-title mb-0"><%= t('seo') %></h5> <h5 class="card-title mb-0"><%= t('seo') %></h5>
......
...@@ -5,10 +5,7 @@ slug: "<%= @about.path %>" ...@@ -5,10 +5,7 @@ slug: "<%= @about.path %>"
parent: "<%= @about.parent.path %>" parent: "<%= @about.parent.path %>"
<% end %> <% end %>
position: <%= @about.position %> position: <%= @about.position %>
<% if @about.best_featured_image.attached? %> <%= render 'admin/communication/unsplash/static' %>
image: "<%= @about.best_featured_image.blob.id %>"
image_alt: "<%= @about.featured_image_alt %>"
<% end %>
description: > description: >
<%= prepare_text_for_static @about.description %> <%= prepare_text_for_static @about.description %>
--- ---
......
...@@ -5,10 +5,7 @@ breadcrumb_title: "<%= @about.breadcrumb_title.blank? ? @about.title : @about.br ...@@ -5,10 +5,7 @@ breadcrumb_title: "<%= @about.breadcrumb_title.blank? ? @about.title : @about.br
url: "<%= @about.path %>" url: "<%= @about.path %>"
position: <%= @about.position %> position: <%= @about.position %>
bodyclass: <%= @about.best_bodyclass %> bodyclass: <%= @about.best_bodyclass %>
<% if @about.best_featured_image && @about.best_featured_image.attached? %> <%= render 'admin/communication/unsplash/static' %>
image: "<%= @about.best_featured_image.blob.id %>"
image_alt: "<%= @about.featured_image_alt %>"
<% end %>
<% if @about.children.published.any? %> <% if @about.children.published.any? %>
children: children:
<% @about.children.published.ordered.each do |child| %> <% @about.children.published.ordered.each do |child| %>
......
...@@ -15,13 +15,7 @@ categories: ...@@ -15,13 +15,7 @@ categories:
- "<%= category.path %>" - "<%= category.path %>"
<% end %> <% end %>
<% end %> <% end %>
<% if @about.featured_image.attached? %> <%= render 'admin/communication/unsplash/static' %>
image:
id: "<%= @about.featured_image.blob.id %>"
alt: "<%= @about.featured_image_alt %>"
credit: >
<%= prepare_html_for_static @about.featured_image_credit, @about.university %>
<% end %>
description: > description: >
<%= prepare_text_for_static @about.description %> <%= prepare_text_for_static @about.description %>
description_short: > description_short: >
......
...@@ -7,10 +7,7 @@ url: <%= @website.special_page(:education_programs).path %><%= @about.path %>/ ...@@ -7,10 +7,7 @@ url: <%= @website.special_page(:education_programs).path %><%= @about.path %>/
description: > description: >
<%= prepare_text_for_static @about.description %> <%= prepare_text_for_static @about.description %>
position: <%= @about.position %> position: <%= @about.position %>
<% if @about.best_featured_image.attached? %> <%= render 'admin/communication/unsplash/static' %>
image: "<%= @about.best_featured_image.blob.id %>"
image_alt: "<%= @about.featured_image_alt %>"
<% end %>
category: "<%= @website.categories.find_by(program_id: @about.id)&.path %>/" category: "<%= @website.categories.find_by(program_id: @about.id)&.path %>/"
teachers: teachers:
<% teacher_involvements.each do |involvement| %> <% teacher_involvements.each do |involvement| %>
......
...@@ -6,10 +6,7 @@ issn: "<%= @about.journal.issn %>" ...@@ -6,10 +6,7 @@ issn: "<%= @about.journal.issn %>"
keywords: > keywords: >
<%= @about.keywords %> <%= @about.keywords %>
date: "<%= @about.published_at.iso8601 %>" date: "<%= @about.published_at.iso8601 %>"
<% if @about.featured_image.attached? %> <%= render 'admin/communication/unsplash/static' %>
image: "<%= @about.featured_image.blob.id %>"
image_alt: "<%= @about.featured_image_alt %>"
<% end %>
description: > description: >
<%= prepare_text_for_static @about.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