From 20efe76b8b03e716fc9fe3ba3cd51263324e778f Mon Sep 17 00:00:00 2001 From: Ricky Rosario Date: Tue, 15 Mar 2011 11:31:29 -0400 Subject: [PATCH] Added top section for warnings to landing pages. [bug 638819] --- apps/landings/templates/landings/base.html | 3 ++ .../templates/landings/mobile/base.html | 3 ++ apps/landings/views.py | 28 +++++++++++-------- media/css/home.css | 7 ++++- media/css/mobile.css | 7 +++++ 5 files changed, 36 insertions(+), 12 deletions(-) diff --git a/apps/landings/templates/landings/base.html b/apps/landings/templates/landings/base.html index fa28b85dd..67af1d6b8 100644 --- a/apps/landings/templates/landings/base.html +++ b/apps/landings/templates/landings/base.html @@ -19,6 +19,9 @@
+
+ {% if top %}{{ top.html|safe }}{% endif %} +
{{ quick.html|safe }}
diff --git a/apps/landings/templates/landings/mobile/base.html b/apps/landings/templates/landings/mobile/base.html index 2ab3e781d..c10b7d1c5 100644 --- a/apps/landings/templates/landings/mobile/base.html +++ b/apps/landings/templates/landings/mobile/base.html @@ -7,6 +7,9 @@ {% set include_showfor = True %} {% block content %} +
+ {% if top %}{{ top.html|safe }}{% endif %} +

{{ _('Common Questions') }}

{{ common.html|safe }} diff --git a/apps/landings/views.py b/apps/landings/views.py index 983bd9c4b..e39edf020 100644 --- a/apps/landings/views.py +++ b/apps/landings/views.py @@ -1,26 +1,33 @@ import jingo from mobility.decorators import mobile_template -from tower import ugettext_lazy as _lazy from sumo.parser import get_object_fallback from wiki.models import Document from wiki.views import SHOWFOR_DATA -HOME_DOCS = {'quick': 'Home page - Quick', 'explore': 'Home page - Explore'} +HOME_DOCS = {'quick': 'Home page - Quick', 'explore': 'Home page - Explore', + 'top': 'Home page - Top'} MOBILE_DOCS = {'quick': 'Mobile home - Quick', - 'explore': 'Mobile home - Explore'} -SYNC_DOCS = {'quick': 'Sync home - Quick', 'explore': 'Sync home - Explore'} + 'explore': 'Mobile home - Explore', + 'top': 'Mobile home - Top'} +SYNC_DOCS = {'quick': 'Sync home - Quick', 'explore': 'Sync home - Explore', + 'top': 'Sync home - Top'} FXHOME_DOCS = {'quick': 'FxHome home - Quick', - 'explore': 'FxHome home - Explore'} + 'explore': 'FxHome home - Explore', + 'top': 'FxHome home - Top'} HOME_DOCS_FOR_MOBILE = {'common': - 'Desktop home for mobile - Common Questions'} + 'Desktop home for mobile - Common Questions', + 'top': 'Home page - Top'} MOBILE_DOCS_FOR_MOBILE = {'common': - 'Mobile home for mobile - Common Questions'} + 'Mobile home for mobile - Common Questions', + 'top': 'Mobile home - Top'} SYNC_DOCS_FOR_MOBILE = {'common': - 'Sync home for mobile - Common Questions'} + 'Sync home for mobile - Common Questions', + 'top': 'Sync home - Top'} FXHOME_DOCS_FOR_MOBILE = {'common': - 'FxHome home for mobile - Common Questions'} + 'FxHome home for mobile - Common Questions', + 'top': 'FxHome home - Top'} @mobile_template('landings/{mobile/}home.html') @@ -51,7 +58,6 @@ def _data(docs, locale): """Add the documents and showfor data to the context data.""" data = {} for side, title in docs.iteritems(): - message = _lazy(u'The template "%s" does not exist.') % title - data[side] = get_object_fallback(Document, title, locale, message) + data[side] = get_object_fallback(Document, title, locale) data.update(SHOWFOR_DATA) return data diff --git a/media/css/home.css b/media/css/home.css index 2fab97617..cecd4e862 100644 --- a/media/css/home.css +++ b/media/css/home.css @@ -74,6 +74,11 @@ html[lang=ja] body div#featured { padding-bottom: 0; } +#home-content-top { + font-size: 14px; + margin: 20px 10px 0; +} + #home-content-quick, #home-content-explore { float: left; font-size: 14px; @@ -114,7 +119,7 @@ html[lang=ja] body div#featured { #home-content-explore { border-left: 2px dotted #a8c4ef; - margin-top: 40px; + margin: 20px 0 0; padding-left: 20px; width: 460px; } diff --git a/media/css/mobile.css b/media/css/mobile.css index 7e3dcf321..dbe7957d6 100644 --- a/media/css/mobile.css +++ b/media/css/mobile.css @@ -115,6 +115,13 @@ article p { margin: 14px 0; } +/*************************************/ +/* Landing Page - Top content */ +/*************************************/ +#home-content { + margin: 21px 14px 0; +} + /*************************************/ /* Landing Page - Common Questions */ /*************************************/