On peut maintenant intégrer l'adl dans une iframe

This commit is contained in:
echarp 2014-08-24 14:24:53 +02:00
parent 144737b54d
commit 275da73e92
4 changed files with 51 additions and 6 deletions

View File

@ -12,14 +12,22 @@
html
color: black
height: 100%
line-height: 1.3em
font-family: georgia, serif
padding-bottom: 6px
background-color: #9CC5EE
// Integrating adl in another website
&.iframe
background-color: transparent
body
border: none
background-color: transparent
.region_selector, .lug_search, .formats, #banner
display: none
body
border: 1px solid #68A6E5
margin: 5px 5px 0
margin: 0.3em
padding: 0 10px 10px 10px
text-align: center
border-bottom: 0px

View File

@ -10,10 +10,8 @@ class EventsController < ApplicationController
def index
respond_to do |format|
format.html
format.rss do
@events = @events.future_in params[:daylimit]
end
format.html { render layout: 'iframe' if params[:iframe] }
format.rss { @events = @events.future_in params[:daylimit] }
format.ics { @events = @events.last_year.order :id }
format.xml { @events = @events.includes(:related_region).order :id }
end

View File

@ -0,0 +1,23 @@
!!! 5
/[if IE]
%html.iframe.no-js(lang="#{I18n.locale}")
%head
= display_meta_tags site: t('.title')
%meta(http-equiv='Content-Type' content='text/html; charset=utf-8')
%meta(name='viewport' content='width=device-width, initial-scale=1.0')
%meta(name='robots' content='index, follow')
= favicon_link_tag '/favicon.ico'
= auto_discovery_link_tag :rss, { controller: '/events', format: :rss }
= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true
= javascript_include_tag 'application', 'data-turbolinks-track' => true
= csrf_meta_tags
%body(class="#{controller.controller_name} #{controller.action_name}")
= render 'layouts/flash', flash: flash if flash.present?
%main= yield
%em#loading.fa.fa-spin.fa-circle-o-notch

16
public/iframeSample.html Normal file
View File

@ -0,0 +1,16 @@
<!DOCTYPE html>
<html>
<style type="text/css">
html, body, iframe {
width: 100%;
border: none;
height: 100%;
margin: 0;
background-color: #dfd;
}
iframe { height: 99%; }
</style>
<body>
<iframe src='http://localhost:3000?iframe=true'></iframe>
</body>
</html>