Skip to content

Commit

Permalink
Added top section for warnings to landing pages. [bug 638819]
Browse files Browse the repository at this point in the history
  • Loading branch information
rlr committed Mar 16, 2011
1 parent 47d0cd8 commit 20efe76
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 12 deletions.
3 changes: 3 additions & 0 deletions apps/landings/templates/landings/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ <h1>{{ h1_text|safe }}</h1>
</div>
</div>
<div id="home-content">
<div id="home-content-top">
{% if top %}{{ top.html|safe }}{% endif %}
</div>
<div id="home-content-quick">
{{ quick.html|safe }}
</div>
Expand Down
3 changes: 3 additions & 0 deletions apps/landings/templates/landings/mobile/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
{% set include_showfor = True %}

{% block content %}
<div id="home-content">
{% if top %}{{ top.html|safe }}{% endif %}
</div>
<h2>{{ _('Common Questions') }}</h2>
<div class="common-questions">
{{ common.html|safe }}
Expand Down
28 changes: 17 additions & 11 deletions apps/landings/views.py
Original file line number Diff line number Diff line change
@@ -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')
Expand Down Expand Up @@ -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
7 changes: 6 additions & 1 deletion media/css/home.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down
7 changes: 7 additions & 0 deletions media/css/mobile.css
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,13 @@ article p {
margin: 14px 0;
}

/*************************************/
/* Landing Page - Top content */
/*************************************/
#home-content {
margin: 21px 14px 0;
}

/*************************************/
/* Landing Page - Common Questions */
/*************************************/
Expand Down

0 comments on commit 20efe76

Please sign in to comment.