Commit 99073bd8 authored by Alexandre Friquet's avatar Alexandre Friquet
Browse files

Design club novels as newsletter items: refs #100.

parent 94f91931
......@@ -66,6 +66,7 @@
@import "partners";
@import "events";
@import "platform";
@import "club_novels";
.danger {
color: $oligaa-red;
......
#page #columns #content section#club_novels {
ul {
list-style-type: none;
margin: 0;
padding: 0;
li.club_novel {
@extend .card-block-narrow;
@include clearfix;
div.description {
@include span-columns(5,6);
text-align: justify;
h2 {
font-size: 110%;
}
h3 {
color: $oligaa-yellow;
}
div.attached_files {
}
&.pushed {
@include push(1);
}
}
div.aside {
@include span-columns(1 omega,6);
ul.gallery {
list-style-type: none;
margin: 0;
padding: 0;
li {
display: none;
&:first-of-type {
display: block;
}
img {
width: 100%;
}
}
}
span.images-number {
text-align: center;
}
ul.activities {
list-style-type: none;
margin: 0;
padding: 0;
img {
width: 50%;
display: block;
margin: auto;
}
}
}
}
}
ul#unpublished > li {
background: rgba(100%, 0, 0, 0.1);
}
div.pagination {
padding: 1em 0;
text-align: center;
}
}
......@@ -17,9 +17,4 @@ class ClubNovel < ApplicationRecord
def published
published_at.present?
end
def public_label
published ? "OUI" : "NON"
end
end
<li class="club_novel">
<h2>
<% if admin? %>
<span class="no_print">
<%= custom_edit_link edit_club_novel_path(club_novel), :short, class: %w(tight) %>
<%= custom_delete_link club_novel, :short, class: %w(tight) %>
</span>
<% end -%>
<%= raw textilize_without_paragraph club_novel.title %>
</h2>
<span>Publique :</span> <%= club_novel.public_label %>
<div class="description">
<h2>
<% if admin? %>
<span class="no_print">
<%= custom_edit_link edit_club_novel_path(club_novel), :short, class: %w(tight) %>
<%= custom_delete_link club_novel, :short, class: %w(tight) %>
</span>
<% end -%>
<%= textilize raw club_novel.content %>
<%= raw textilize_without_paragraph club_novel.title %>
</h2>
<% unless club_novel.attached_files.empty? %>
<h3>Pièces jointes</h3>
<dl class="attachments">
<%= render partial: 'attachment', collection: club_novel.attached_files %>
</dl>
<% end -%>
<%= textilize raw club_novel.content %>
<div class="item_aside">
<% unless club_novel.attached_files.empty? %>
<h3>Pièces jointes</h3>
<dl class="attachments">
<%= render partial: 'attachment', collection: club_novel.attached_files %>
</dl>
<% end -%>
</div>
<div class="aside">
<ul class="activities">
<% club_novel.activities.each do |activity| %>
<li>
......
......@@ -83,8 +83,11 @@ feature "Manage club novels" do
click_update_button
end
within "section#club_novels" do
expect(page).to have_content "Publique : OUI"
within "section#club_novels" do
expect(page).not_to have_selector("ul#unpublished")
within "ul#published" do
expect(page).to have_selector("h2", text: club_novel.title)
end
end
visit edit_club_novel_path(club_novel)
......@@ -93,8 +96,11 @@ feature "Manage club novels" do
click_update_button
end
within "section#club_novels" do
expect(page).to have_content "Publique : NON"
within "section#club_novels" do
expect(page).not_to have_selector("ul#published")
within "ul#unpublished" do
expect(page).to have_selector("h2", text: club_novel.title)
end
end
end
......@@ -118,7 +124,7 @@ feature "Manage club novels" do
expect(current_path).to eq club_novels_path
within "section#content li", text: club_novel.title do
within "div.item_aside" do
within "div.aside" do
within "ul.gallery" do
expect(first('img')[:alt]).to eq(image1.title)
expect(page).to have_css('img', visible: false, count: 2)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment