From 2c1e65a4ed41ac973d7386d02973b062a365f4ad Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= <fpeters@entrouvert.com>
Date: Tue, 22 Jan 2019 14:26:15 +0100
Subject: [PATCH] general: remove support for "iframe" mode (#29955)

---
 auquotidien/modules/events.py |  6 +-----
 auquotidien/modules/root.py   | 28 +++++-----------------------
 2 files changed, 6 insertions(+), 28 deletions(-)

diff --git a/auquotidien/modules/events.py b/auquotidien/modules/events.py
index 930707d..dc89f45 100644
--- a/auquotidien/modules/events.py
+++ b/auquotidien/modules/events.py
@@ -132,11 +132,7 @@ class Event(StorableObject):
             r += htmltext('</ul>')
 
         if self.url:
-            if get_response().iframe_mode:
-                r += htmltext('<a class="external" href="%s" target="_top">%s</a>') % (
-                        self.url, _('More information'))
-            else:
-                r += htmltext('<a class="external" href="%s">%s</a>') % (
+            r += htmltext('<a class="external" href="%s">%s</a>') % (
                         self.url, _('More information'))
         r += htmltext('</dd>')
         return r.getvalue()
diff --git a/auquotidien/modules/root.py b/auquotidien/modules/root.py
index 5adcdd7..a4698a7 100644
--- a/auquotidien/modules/root.py
+++ b/auquotidien/modules/root.py
@@ -363,8 +363,7 @@ class AnnouncesDirectory(Directory):
             r += htmltext('<p>')
             r += _('You have been unsubscribed from announces')
             r += htmltext('</p>')
-            if not get_response().iframe_mode:
-                r += htmltext('<a href="%s">%s</a>') % (root_url, _('Back Home'))
+            r += htmltext('<a href="%s">%s</a>') % (root_url, _('Back Home'))
         else:
             r += htmltext('<p>')
             r += _('Do you want to stop receiving announces by sms ?')
@@ -469,8 +468,7 @@ class AnnouncesDirectory(Directory):
             r += htmltext('<p>')
             r += _('You have been subscribed to the announces.')
             r += htmltext('</p>')
-            if not get_response().iframe_mode:
-                r += htmltext('<a href="%s">%s</a>') % (root_url, _('Back Home'))
+            r += htmltext('<a href="%s">%s</a>') % (root_url, _('Back Home'))
             return r.getvalue()
 
         # asking email confirmation before subscribing someone
@@ -492,8 +490,7 @@ class AnnouncesDirectory(Directory):
         r += htmltext('<p>')
         r += _('You have been sent an email for confirmation')
         r += htmltext('</p>')
-        if not get_response().iframe_mode:
-            r += htmltext('<a href="%s">%s</a>') % (root_url, _('Back Home'))
+        r += htmltext('<a href="%s">%s</a>') % (root_url, _('Back Home'))
         return r.getvalue()
 
     def emailconfirm(self):
@@ -605,8 +602,7 @@ class AnnouncesDirectory(Directory):
             r += htmltext('<p>')
             r += _('You have been unsubscribed from announces')
             r += htmltext('</p>')
-            if not get_response().iframe_mode:
-                r += htmltext('<a href="%s">%s</a>') % (root_url, _('Back Home'))
+            r += htmltext('<a href="%s">%s</a>') % (root_url, _('Back Home'))
 
         else:
             r += htmltext('<p>')
@@ -896,10 +892,6 @@ class AlternateRootDirectory(OldRootDirectory):
             return redirect(misc.get_variadic_url(redirect_url,
                 get_publisher().substitutions.get_context_variables()))
 
-        if get_response().iframe_mode:
-            # never display home page in an iframe
-            return redirect('%sservices' % root_url)
-
         template.html_top()
         r = TemplateIO(html=True)
         get_response().filter['is_index'] = True
@@ -977,17 +969,7 @@ class AlternateRootDirectory(OldRootDirectory):
         else:
             r += htmltext('<h3>%s</h3>') % _('Services')
 
-        if get_response().iframe_mode:
-            if get_request().user:
-                message = TextsDirectory.get_html_text('welcome-logged')
-            else:
-                message = TextsDirectory.get_html_text('welcome-unlogged')
-
-            if message:
-                r += htmltext('<div id="welcome-message">')
-                r += message
-                r += htmltext('</div>')
-        elif 'auquotidien-welcome-in-services' in get_response().filter.get('keywords', []):
+        if 'auquotidien-welcome-in-services' in get_response().filter.get('keywords', []):
             homepage_text = TextsDirectory.get_html_text('aq-home-page')
             if homepage_text:
                 r += htmltext('<div id="home-page-intro">')
-- 
2.20.1

