testimonies

This commit is contained in:
Nicolas Bally 2017-03-25 13:22:54 +01:00
parent 82ad1e2ab0
commit 44a3a33a09
6 changed files with 50 additions and 7 deletions

View File

@ -340,3 +340,34 @@ ul, ol{
padding: 0;
margin: 0 0 10px 25px;
}
#testimony_index{
.testimony{
padding:1px;
clear:both;
img{
float:left;
width:150px;
margin-bottom:1em;
margin-right:1em;
}
margin:1em 0;
margin-bottom:3em;
blockquote{
margin-top:30px;
a{
color:black;}
margin-bottom:0.5em;
}
.author{
text-align:right;
}
}
}

View File

@ -25,5 +25,10 @@ class Public::TestimoniesController < ApplicationController
end
def index
@testimonies = Testimony.all
end
end

View File

@ -58,7 +58,9 @@
=image_tag("front/right.png", :class => "next-testimony")
.author=link_to testimony.author, testimony_path(:slug => testimony.id.to_s+"-"+testimony.author.to_slug)
%br
%br
%div{:style => "text-align:right;"}=link_to "Tous les témoignages", testimonies_path
:coffeescript

View File

@ -1,6 +1,7 @@
#testimony_header
=link_to image_tag(testimony.image_file.image.url(:square)), testimony_link(testimony) if testimony.image_file
.quote
=link_to testimony.quote, testimony_link(testimony)
.testimony
=link_to image_tag(testimony.image_file.file.square.url()), testimony_path(testimony) if testimony.image_file
%blockquote
=link_to testimony.quote, testimony_path(testimony)
.author=link_to testimony.author, testimony_link(testimony)
.author=link_to testimony.author+" - lire la suite >", testimony_path(testimony)
.clear{:style => "clear:both;"}

View File

@ -0,0 +1,4 @@
#testimony_index
%h1 Témoignages
=render @testimonies

View File

@ -18,7 +18,7 @@ CMSnb::Application.routes.draw do
get 'rubriques/:id.html' => "public/portfolios#show", :as => "public_portfolio"
get 'vos-temoignages/:slug.:f' => 'public/testimonies#show', :as => :testimony, :f => "html"
get 'vos-temoignages.:f' => 'public/testimonies#index', :as => :testimonies, :f => "html"
namespace :student do
root :to => "topics#index", :id => 1
resources :student_topics