saut de page articles
This commit is contained in:
parent
bf25544169
commit
137e9b2a78
@ -30,7 +30,7 @@ class Admin::PlumeArticlesController < ApplicationController
|
|||||||
|
|
||||||
|
|
||||||
def edit
|
def edit
|
||||||
|
@admin = true
|
||||||
@plume_article = PlumeArticle.find(params[:id])
|
@plume_article = PlumeArticle.find(params[:id])
|
||||||
|
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@ class Portlet::DynamicContentsController < ApplicationController
|
|||||||
layout "admin"
|
layout "admin"
|
||||||
|
|
||||||
def new
|
def new
|
||||||
|
@admin = true
|
||||||
@dynamic_content = DynamicContent.new
|
@dynamic_content = DynamicContent.new
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
@ -16,6 +17,7 @@ class Portlet::DynamicContentsController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
|
@admin = true
|
||||||
@dynamic_content = DynamicContent.new(params.require(:dynamic_content).permit!)
|
@dynamic_content = DynamicContent.new(params.require(:dynamic_content).permit!)
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
@ -46,6 +48,7 @@ class Portlet::DynamicContentsController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def edit
|
def edit
|
||||||
|
@admin = true
|
||||||
@dynamic_content = DynamicContent.find(params[:id])
|
@dynamic_content = DynamicContent.find(params[:id])
|
||||||
@portlet = Portlet.find(params[:portlet_id])
|
@portlet = Portlet.find(params[:portlet_id])
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
@ -68,6 +71,7 @@ class Portlet::DynamicContentsController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def update
|
def update
|
||||||
|
@admin = true
|
||||||
@dynamic_content = DynamicContent.find(params[:id])
|
@dynamic_content = DynamicContent.find(params[:id])
|
||||||
@portlet = @dynamic_content.portlet
|
@portlet = @dynamic_content.portlet
|
||||||
|
|
||||||
@ -93,6 +97,7 @@ class Portlet::DynamicContentsController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
|
@admin = true
|
||||||
@portlet = Portlet.find(params[:portlet_id])
|
@portlet = Portlet.find(params[:portlet_id])
|
||||||
@dynamic_content = DynamicContent.find(params[:id])
|
@dynamic_content = DynamicContent.find(params[:id])
|
||||||
@dynamic_content.destroy
|
@dynamic_content.destroy
|
||||||
|
@ -4,7 +4,7 @@ class DynamicContent < ActiveRecord::Base
|
|||||||
|
|
||||||
belongs_to :item
|
belongs_to :item
|
||||||
|
|
||||||
NAMES = {}
|
NAMES = {"saut" => "Saut de page"}
|
||||||
|
|
||||||
def self.picto
|
def self.picto
|
||||||
"cog"
|
"cog"
|
||||||
|
@ -1,6 +1,12 @@
|
|||||||
%tr#plume_article_row.plume_article_row{:id => plume_article.id}
|
%tr#plume_article_row.plume_article_row{:id => plume_article.id}
|
||||||
|
|
||||||
%td=plume_article.title
|
%td=plume_article.title
|
||||||
|
%td
|
||||||
|
-if plume_article.article_type == "demi"
|
||||||
|
Demi article
|
||||||
|
-else
|
||||||
|
Article pleine page
|
||||||
|
|
||||||
|
|
||||||
%td
|
%td
|
||||||
=link_to "voir", public_plume_article_path(plume_article), :target => "plume_article_#{plume_article.id}"
|
=link_to "voir", public_plume_article_path(plume_article), :target => "plume_article_#{plume_article.id}"
|
||||||
@ -9,6 +15,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
%td{:style => "width:140px"}
|
%td{:style => "width:140px"}
|
||||||
= link_to i(:"trash-o"), [:admin, plume_article], :confirm => 'Voulez-vous vraiment supprimer cet plume_article ?', :method => :delete, :remote => true
|
= link_to i(:"trash-o"), [:admin, plume_article], :confirm => 'Voulez-vous vraiment supprimer cet plume_article ?', :method => :delete, :remote => true
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
-@public = true
|
||||||
!!!
|
!!!
|
||||||
|
|
||||||
%html{:lang => "fr", "xml:lang" => "fr", :xmlns => "http://www.w3.org/1999/xhtml"}
|
%html{:lang => "fr", "xml:lang" => "fr", :xmlns => "http://www.w3.org/1999/xhtml"}
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
-@public = true
|
||||||
!!!
|
!!!
|
||||||
|
|
||||||
%html{:lang => "fr", "xml:lang" => "fr", :xmlns => "http://www.w3.org/1999/xhtml"}
|
%html{:lang => "fr", "xml:lang" => "fr", :xmlns => "http://www.w3.org/1999/xhtml"}
|
||||||
|
18
app/views/portlets/dynamic_contents/_saut.html.haml
Normal file
18
app/views/portlets/dynamic_contents/_saut.html.haml
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
-if @plume_article and @print
|
||||||
|
=raw "</div></div></div></div><div class='page'>"
|
||||||
|
.page_header{:style => ""}
|
||||||
|
.right
|
||||||
|
=image_tag "http://lepicvert.org/plume-header.png"
|
||||||
|
%span
|
||||||
|
La Plume
|
||||||
|
="N°#{@plume_article.plume.number}"
|
||||||
|
.left= @plume_article.plume_cat.title
|
||||||
|
.clear
|
||||||
|
|
||||||
|
=raw "<div class='page_inner'><div class='render_block'><div class='row-fluid'>"
|
||||||
|
-elsif @admin
|
||||||
|
%hr
|
||||||
|
Saut de page
|
||||||
|
%hr
|
||||||
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
|||||||
|
-@print = true
|
||||||
|
|
||||||
%html
|
%html
|
||||||
%head
|
%head
|
||||||
%meta{:charset => "utf-8"}/
|
%meta{:charset => "utf-8"}/
|
||||||
@ -39,7 +41,7 @@
|
|||||||
-@plume.plume_cats.order(:position).each do |plume_cat|
|
-@plume.plume_cats.order(:position).each do |plume_cat|
|
||||||
-if plume_cat.title != "Brèves"
|
-if plume_cat.title != "Brèves"
|
||||||
-plume_cat.plume_articles.each do |plume_article|
|
-plume_cat.plume_articles.each do |plume_article|
|
||||||
|
-@plume_article = plume_article
|
||||||
-if plume_article.article_type == "page" or (plume_article.article_type == "demi" and i ==0) and plume_article.plume_cat
|
-if plume_article.article_type == "page" or (plume_article.article_type == "demi" and i ==0) and plume_article.plume_cat
|
||||||
.page_header
|
.page_header
|
||||||
.right
|
.right
|
||||||
|
Loading…
x
Reference in New Issue
Block a user