redically simplified offline experience

This commit is contained in:
Matt Claypotch 2012-11-29 16:12:04 -08:00
Родитель 23728dd97d
Коммит c16b5325e8
5 изменённых файлов: 79 добавлений и 30 удалений

Просмотреть файл

@ -60,7 +60,7 @@
}
}
.home {
.home, .offline {
#site-header {
h1 {
background: url(../../img/mkt/logos/mp_icon_wordmark_200x30.png) no-repeat;

Просмотреть файл

@ -0,0 +1,18 @@
@import 'lib';
.offline {
h3 {
text-align: center;
margin: 2em;
}
button {
display: block;
margin: auto;
}
#site-header h1 {
position: relative;
margin: 0 auto;
left: auto;
}
}

Просмотреть файл

@ -116,6 +116,14 @@ CSS = {
'css/mkt/browse.less',
'css/mkt/filters.less',
),
'mkt/offline': (
'css/mkt/reset.less',
'css/mkt/typography.less',
'css/mkt/site.less',
'css/mkt/header.less',
'css/mkt/buttons.less',
'css/mkt/offline.less',
),
'mkt/ecosystem': (
'css/mkt/reset.less',
'css/mkt/typography.less',

Просмотреть файл

@ -1,18 +1,52 @@
{% extends 'mkt/base.html' %}
<!DOCTYPE html>
<html lang="{{ LANG }}" dir="{{ DIR }}">
<head>
<meta charset="utf-8">
{% if not settings.ENGAGE_ROBOTS %}
<meta name="robots" content="noindex">
{% endif %}
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1, maximum-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes">
<title>{{ _('Firefox Marketplace') }}</title>
{% set pagetype = 'offline' %}
<link rel="shortcut icon" href="{{ MEDIA_URL }}img/mkt/aurora_fav.ico">
{% block content %}
<section class="infobox" data-offline="true">
<p class="online">
{{ _('Loading the Firefox Marketplace...') }}
</p>
<p class="offline">
{{ _('Sorry, you need to be online to access the Marketplace.') }}
<button>Try Again</button>
<a href="{{ url('users.logout') }}">{{ _('Log out') }}</a>
</p>
</section>
{% endblock %}
{{ css('mkt/offline') }}
</head>
<body class="html-{{ DIR }} {{ CARRIER }} force-mobile offline">
<header id="site-header" class="c{{ ' no-consumer' if not request.can_view_consumer }}">
<section>
<h1>{{ _('Firefox Marketplace') }}</h1>
</section>
</header>
<div id="container">
<div id="page" role="main"
data-context="{{
{'type': 'offline',
'cache': 'no',
'hash': 'offline',
'title': _('Firefox Marketplace'),
'headertitle': _('Firefox Marketplace'),
'bodyclass': 'offline',
'parent': '',
'category': ''}|json }}">
{% block content %}
<section class="infobox">
<h3>
{{ _('Sorry, you need to be online to access the Marketplace.') }}
</h3>
<div>
<button onclick="window.location.reload()">Try Again</button>
</div>
</section>
{% endblock %}
</div>
</div>
{% block dbgoverlay %}{% endblock %}
</body>
</html>
{% block offline_pixel %}{% endblock %}

Просмотреть файл

@ -296,17 +296,13 @@ USE_APPCACHE = False
# These are absolute paths to add to the cache. Wildcards are not allowed here.
# These paths will be added as-is to the cache section.
APPCACHE_TO_CACHE = [
'https://login.persona.org/include.js',
]
APPCACHE_NET_PATHS = [
'*'
]
APPCACHE_FALLBACK_PATHS = {
'/app/': '/offline/home',
'/settings/': '/offline/home',
}
APPCACHE_FALLBACK_PATHS = {}
for url in CARRIER_URLS:
APPCACHE_FALLBACK_PATHS['/%s' % url] = '/offline/home';
@ -321,14 +317,10 @@ for url in CARRIER_URLS:
def APPCACHE_MEDIA_TO_CACHE():
from jingo_minify import helpers
bundle = 'mkt/consumer'
bundle = 'mkt/offline'
# TODO(Kumar) refactor jingo-minify so we don't have to copy/paste this
# logic.
js_build_id = helpers.BUILD_ID_JS
bundle_full = "js:%s" % bundle
if bundle_full in helpers.BUNDLE_HASHES:
js_build_id = helpers.BUNDLE_HASHES[bundle_full]
css_build_id = helpers.BUILD_ID_CSS
bundle_full = "css:%s" % bundle
@ -336,7 +328,6 @@ def APPCACHE_MEDIA_TO_CACHE():
css_build_id = helpers.BUNDLE_HASHES[bundle_full]
return (
'js/%s-min.js?build=%s' % (bundle, js_build_id),
'css/%s-min.css?build=%s' % (bundle, css_build_id),
)
@ -345,13 +336,11 @@ def APPCACHE_MEDIA_TO_CACHE():
# APPCACHE_MEDIA_TO_CACHE = APPCACHE_MEDIA_DEBUG
def APPCACHE_MEDIA_DEBUG():
for f in list(asset_bundles.CSS['mkt/consumer']):
for f in list(asset_bundles.CSS['mkt/offline']):
if f.endswith('.less'):
yield f + '.css'
else:
yield f
for path in asset_bundles.JS['mkt/consumer']:
yield path
# Allowed `installs_allowed_from` values for manifest validator.
VALIDATOR_IAF_URLS = ['https://marketplace.firefox.com']