From 8b99f77e898d1b0fab06fc0db39083b401f9e742 Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Mon, 4 Mar 2013 05:31:52 +0100 Subject: [PATCH] Attempt to make the layout sane when showing a campaign landing page in an iframe --- public_html/rewrite.php | 17 +++++++++++++---- public_html/static/css/style.css | 29 +++++++++++++++++++++++++++-- public_html/templates/layout.tpl | 2 +- 3 files changed, 41 insertions(+), 7 deletions(-) diff --git a/public_html/rewrite.php b/public_html/rewrite.php index d0f355d..42536aa 100644 --- a/public_html/rewrite.php +++ b/public_html/rewrite.php @@ -103,9 +103,18 @@ $router->routes = array( 'authenticator' => "authenticators/subscription.php", 'auth_error' => "modules/error/nosuchsubscription.php" ), - "^/campaign/([a-zA-Z0-9-]+)$" => "modules/landing.php", - "^/campaign/([a-zA-Z0-9-]+)/subscribe$" => "modules/subscribe.php", - "^/campaign/([a-zA-Z0-9-]+)/donate/([0-9]+)$" => "modules/donate.php", + "^/campaign/([a-zA-Z0-9-]+)$" => array( + 'target' => "modules/landing.php", + '_resizable' => true + ), + "^/campaign/([a-zA-Z0-9-]+)/subscribe$" => array( + 'target' => "modules/subscribe.php", + '_resizable' => true + ), + "^/campaign/([a-zA-Z0-9-]+)/donate/([0-9]+)$" => array( + 'target' => "modules/donate.php", + '_resizable' => true + ), "^/thanks/([a-zA-Z0-9-]+)$" => "modules/thanks.php", "^/test$" => "modules/test.php" ) @@ -123,4 +132,4 @@ catch (RouterException $e) } echo(NewTemplater::Render("layout", $locale->strings, array("contents" => $sPageContents, "title" => $sPageTitle, - "padded" => (isset($router->uVariables['padded']) ? $router->uVariables['padded'] : true)))); + "padded" => (isset($router->uVariables['padded']) ? $router->uVariables['padded'] : true), "resizable" => !empty($router->uVariables['resizable'])))); diff --git a/public_html/static/css/style.css b/public_html/static/css/style.css index 8bd5ac8..9e690d0 100644 --- a/public_html/static/css/style.css +++ b/public_html/static/css/style.css @@ -4,7 +4,7 @@ body { - padding: 0px; + padding: 3px; margin: 0px; background-color: #E5EFD7; font-family: Lato, sans-serif; @@ -16,6 +16,13 @@ body margin: 0px auto; } +.wrapper-resizable +{ + max-width: 960px; + width: auto; + margin: 0px auto; +} + pre.debug { white-space: pre-wrap; /* css-3 */ @@ -633,7 +640,8 @@ table.payment-methods td.remove button .main .more .wrapper { - width: 730px; + width: auto; + max-width: 730px; margin: 0px auto; } @@ -892,3 +900,20 @@ a.button:hover { background-color: #4FA22A; } + +@media all and (max-width: 750px) +{ + .subscribe #field_email + { + width: 240px; + } +} + + +@media all and (max-width: 620px) +{ + .subscribe #field_email + { + width: 190px; + } +} diff --git a/public_html/templates/layout.tpl b/public_html/templates/layout.tpl index 6386b93..a4d38e3 100644 --- a/public_html/templates/layout.tpl +++ b/public_html/templates/layout.tpl @@ -9,7 +9,7 @@ -
+

ReDonate