mmsc_app/app/views/public/articles/_article.html.haml
Nicolas Bally a6aa1f6074 Initial
2020-05-25 11:40:11 +02:00

69 lines
1.8 KiB
Plaintext

-lang_article = article.lang_articles.find_by_lang_site_id(@lang.id)
-#if article.without_text_image_file
-#img_url = "https://3p.quartz.xyz"+article.without_text_image_file.file.large.url
-if article.image_file
-img_url = "https://3p.quartz.xyz"+article.image_file.file.large.medium.url
-if !@new_site
=link_to article_path(:slug => lang_article.slug, :lang => @lang.slug), :class => "article-1x" do
.img.with_ratio{:data => {:ratio => 0.62}, :style => "background-image:url('#{img_url}');background-size:100%;background-size:cover;"}
.comment
%div=i(:"comment-o")
=article.comments.where(:enabled => true).count.to_s
.date
%div
=article.published_at.day
=article.published_at.month
.description
-if !article.title_cached
%h2= lang_article.title
=simple_format lang_article.description
-if article.image_file and article.image_file.photograph
-@page_images_credits << article.image_file.photograph
-else
=link_to article_path(:slug => lang_article.slug, :lang => @lang.slug), :class => "article" do
.img.with_ratio{:style => "background-image:url('#{img_url}');background-size:100%;background-size:cover;", :data => {:ratio => 0.62}}
.description
%h2= lang_article.title
.date
-cats = []
-article.categories.uniq.each do |cat|
-cats << cat.lang(I18n.locale.to_s).name
=cats.join(", ")
%span.sep
="|"
=l article.published_at, :format => :human_date
%span.sep
="|"
%span.sep=i(:"comment-o")
=article.comments.where(:enabled => true).count.to_s
.cta
%span.btn
=qit("Lire l'article")
>
.clear