Replace whitenoise_root by staticfiles_dirs + fix templates (#4353)

- Update templates to use the static tag
- Update whitenoise configuration
- add support for CDN for staticfiles
This commit is contained in:
Lucie 2020-03-24 17:04:01 +01:00 коммит произвёл GitHub
Родитель 29dfccc2f3
Коммит ad13420faf
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
40 изменённых файлов: 119 добавлений и 102 удалений

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

@ -49,13 +49,19 @@ branches:
jobs:
include:
- name: Python tests
install: "./travis-scripts/python-install.sh"
before_install:
- nvm install --lts=erbium
- nvm use --lts=erbium
install:
- "./travis-scripts/python-install.sh"
- "./travis-scripts/npm-install.sh"
before_script:
- psql -c 'create database network;' -U postgres
- npm run build
- pipenv run python network-api/manage.py collectstatic --no-input --verbosity 0
script:
- pipenv run flake8 tasks.py network-api/
- pipenv run coverage run --source './network-api/networkapi' network-api/manage.py
test networkapi
- pipenv run coverage run --source './network-api/networkapi' network-api/manage.py test networkapi
after_success:
- coveralls
- name: npm tests
@ -77,8 +83,7 @@ jobs:
before_script:
- psql -c 'create database network;' -U postgres
- npm run build
- pipenv run python network-api/manage.py collectstatic --no-input --verbosity
0
- pipenv run python network-api/manage.py collectstatic --no-input --verbosity 0
- pipenv run python network-api/manage.py migrate --no-input
- pipenv run python network-api/manage.py block_inventory
- pipenv run python network-api/manage.py sync_page_translation_fields

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

@ -84,3 +84,6 @@ CLOUDINARY_API_SECRET=
SENTRY_DSN=
HEROKU_RELEASE_VERSION=
SENTRY_ENVIRONMENT=
# CDN configuration
STATIC_HOST=

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

@ -8156,7 +8156,7 @@ a.text-gray-dark:focus, a.text-gray-dark:hover {
background-color: #333333; }
@media (min-width: 768px) {
.donate-modal {
background-image: url(/_images/buyers-guide/earth.jpg);
background-image: url(../_images/buyers-guide/earth.jpg);
background-size: contain;
background-position: center center;
background-repeat: no-repeat; } }
@ -8559,7 +8559,7 @@ a.text-gray-dark:focus, a.text-gray-dark:hover {
z-index: 1; }
.commitment::before {
content: "";
background: url(/_images/hand.svg) no-repeat;
background: url(../_images/hand.svg) no-repeat;
width: 14px;
height: 20px;
display: block;

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

@ -1,6 +1,6 @@
{% extends "pages/base.html" %}
{% load bg_nav_tags localization i18n %}
{% load bg_nav_tags localization i18n static %}
{% get_current_language as lang_code %}
@ -20,7 +20,7 @@
{% block wagtail_metadata %}
<meta property="og:description" content="{% trans "Smart home gadgets, fitness trackers, toys and more, rated for their privacy & security" %}">
<meta property="og:image" content="{{request.scheme}}://{{request.get_host}}/_images/buyers-guide/evergreen-social.jpg">
<meta property="og:image" content="{{request.scheme}}://{{request.get_host}}{% static "_images/buyers-guide/evergreen-social.jpg" %}">
<meta property="og:image:type" content="image/jpg">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="628">
@ -29,7 +29,7 @@
{% block stylesheets %}
<link rel="stylesheet" href="/_css/buyers-guide.compiled.css">
<link rel="stylesheet" href="{% static "_css/buyers-guide.compiled.css" %}">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Nunito+Sans:400,300,700,300i">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Zilla+Slab:300,400,600,700,300i">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:400,700">
@ -37,9 +37,9 @@
{% block icons %}
<link rel="apple-touch-icon" type="image/png" sizes="180x180" href="/_images/favicons/apple-touch-icon-180x180@2x.png">
<link rel="icon" type="image/png" sizes="196x196" href="/_images/favicons/favicon-196x196@2x.png">
<link rel="shortcut icon" href="/_images/favicons/favicon.ico">
<link rel="apple-touch-icon" type="image/png" sizes="180x180" href="{% static "_images/favicons/apple-touch-icon-180x180@2x.png" %}">
<link rel="icon" type="image/png" sizes="196x196" href="{% static "_images/favicons/favicon-196x196@2x.png" %}">
<link rel="shortcut icon" href="{% static "_images/favicons/favicon.ico" %}">
{% endblock %}
@ -55,7 +55,7 @@
if ( !modernBrowser ) {
var scriptElement = document.createElement('script');
scriptElement.async = false;
scriptElement.src = '/_js/polyfills.compiled.js';
scriptElement.src = '{% static "_js/polyfills.compiled.js" %}';
document.head.appendChild(scriptElement);
}
</script>
@ -66,7 +66,7 @@
{% block script_bundle %}
<script src="/_js/bg-main.compiled.js" async defer></script>
<script src="{% static "_js/bg-main.compiled.js" %}" async defer></script>
{% endblock %}

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

@ -1,6 +1,6 @@
{% extends "./bg_base.html" %}
{% load env cloudinary i18n %}
{% load env cloudinary i18n static %}
{% block body_id %}home{% endblock %}
@ -18,9 +18,10 @@
<div class="row justify-content-center">
<p class="col col-lg-9 col-xl-10 body-large text-center">
{% static '_images/buyers-guide/badge-star-mini.svg' as image_src %}
{% trans "minimum security standards badge" as badge_alt %}
{% url 'min-security-view' as min_sec_url %}
{% blocktrans with url=min_sec_url image='<img src="/_images/buyers-guide/badge-star-mini.svg" width="24" height="20" alt="'|add:badge_alt|add:'">' trimmed %}
{% blocktrans trimmed with url=min_sec_url image='<img src="'|add:image_src|add:'" width="24" height="20" alt="'|add:badge_alt|add:'">' %}
How creepy is that smart speaker, that fitness tracker, those wireless headphones?
We created this guide to help you shop for safe, secure connected products.
Look for this symbol {{image}} for products that meet our <a href="{{url}}">Minimum Security Standards</a>.

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

@ -1,9 +1,9 @@
{% load i18n %}
{% load i18n static %}
{% if product.adult_content is True %}
<img
class="adult-content-badge"
src="/_images/buyers-guide/icon-18-plus-heart.svg"
src="{% static "_images/buyers-guide/icon-18-plus-heart.svg" %}"
title="{% trans "this product has adult content" %}"
alt="{% trans "this product has adult content" %}"
>

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

@ -1,4 +1,4 @@
{% load i18n %}
{% load i18n static %}
<div class="primary-info">
<div class="d-flex align-items-center">
@ -9,7 +9,7 @@
<span><strong>
{% if value == "U" %}
{% if show_value_as_symbol %}
<img src="/_images/buyers-guide/score/icon-unknown.svg" alt="{% trans "Unknown" context "Unknown rating" %}">
<img src="{% static "_images/buyers-guide/score/icon-unknown.svg" %}" alt="{% trans "Unknown" context "Unknown rating" %}">
{% else %}
{% trans "Unknown" context "Unknown rating" %}
{% endif %}
@ -17,19 +17,19 @@
{% trans "N/A" %}
{% elif value == "Yes" %}
{% if show_value_as_symbol %}
<img src="/_images/buyers-guide/score/icon-yes.svg" alt="{% trans "Yes" %}">
<img src="{% static "_images/buyers-guide/score/icon-yes.svg" %}" alt="{% trans "Yes" %}">
{% else %}
{% trans "Yes" %}
{% endif %}
{% elif value == "No" %}
{% if show_value_as_symbol %}
<img src="/_images/buyers-guide/score/icon-no.svg" alt="{% trans "No" %}">
<img src="{% static "_images/buyers-guide/score/icon-no.svg" %}" alt="{% trans "No" %}">
{% else %}
{% trans "No" %}
{% endif %}
{% else %}
{% if show_value_as_symbol %}
<img src="/_images/buyers-guide/score/icon-{{value|lower}}.svg" alt="{{value}}">
<img src="{% get_static_prefix %}_images/buyers-guide/score/icon-{{value|lower}}.svg" alt="{{value}}">
{% else %}
{{ value }}
{% endif %}

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

@ -1,9 +1,9 @@
{% load i18n %}
{% load i18n static %}
{% if product.meets_minimum_security_standards is True %}
<img
class="seal-of-approval"
src="{% if full_badge is True %}/_images/buyers-guide/badge-star.svg{% else %}/_images/buyers-guide/badge-star-mini.svg{% endif %}"
src="{% if full_badge is True %}{% static "_images/buyers-guide/badge-star.svg" %}{% else %}{% static "_images/buyers-guide/badge-star-mini.svg" %}{% endif %}"
title="{% if is_related_product is True %}{% trans "this related product meets our minimum security standards" %}{% else %}{% trans "this product meets our minimum security standards" %}{% endif %}"
alt="{% if is_related_product is True %}{% trans "this related product meets our minimum security standards" %}{% else %}{% trans "this product meets our minimum security standards" %}{% endif %}"
>

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

@ -1,6 +1,6 @@
{% extends "./bg_base.html" %}
{% load yes_no env cloudinary l10n i18n %}
{% load yes_no env cloudinary l10n i18n static %}
{% block head_extra %}
<meta property="og:title" content="{% blocktrans context "This can be localized. This is a reference to the *batteries not included mention on toys." %}privacy not included - {{ product.name }}{% endblocktrans %}" />
@ -69,7 +69,7 @@
{% include "fragments/product_criterion_primary_info.html" with label=overall_security_rating %}
<div>
<span class="security-score mb-0">{{security_score|localize}}</span><span class="full-security-score mb-0">/{{full_security_score}}</span>
<img src="/_images/buyers-guide/score/icon-star.svg" width="20" height="20" alt="{% trans "star" context "Used as a noun. Accessibility label for star image" %}">
<img src="{% static "_images/buyers-guide/score/icon-star.svg" %}" width="20" height="20" alt="{% trans "star" context "Used as a noun. Accessibility label for star image" %}">
</div>
</div>
{% trans "Encryption" as encryption %}

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

@ -1,4 +1,4 @@
{% load wagtailcore_tags wagtailimages_tags i18n %}
{% load wagtailcore_tags wagtailimages_tags i18n static %}
<div class="background-wrapper">
<div class="overlay"></div>
@ -41,7 +41,7 @@
</picture>
{% else %}
<picture>
<img src="/_images/mozfest/mozfest-home-banner-default.jpg" alt="">
<img src="{% static "_images/mozfest/mozfest-home-banner-default.jpg" %}" alt="">
</picture>
{% endif %}
{% endif %}

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

@ -1,4 +1,4 @@
{% load wagtailcore_tags wagtailimages_tags %}
{% load wagtailcore_tags wagtailimages_tags static %}
{% if page.banner %}
<picture>
@ -14,5 +14,5 @@
{% image page.banner fill-1008x288 alt="" %}
</picture>
{% else %}
<img src="/_images/mozfest/mozfest-primary-banner-default.jpg" alt="">
<img src="{% static "_images/mozfest/mozfest-primary-banner-default.jpg" %}" alt="">
{% endif %}

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

@ -1,5 +1,5 @@
{% extends "pages/base.html" %}
{% load wagtailcore_tags wagtailimages_tags homepage_tags card_tags wagtailmetadata_tags multi_image_tags i18n %}
{% load wagtailcore_tags wagtailimages_tags homepage_tags card_tags wagtailmetadata_tags multi_image_tags i18n static %}
{% block ga_identifier %}
@ -61,5 +61,5 @@
{% block script_bundle %}
{# This uses the mofo main.js for now, to make sure "things work" until we (maybe never?) create a separate bundle #}
<script src="/_js/main.compiled.js"></script>
<script src="{% static "_js/main.compiled.js" %}"></script>
{% endblock %}

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

@ -1,6 +1,6 @@
{% extends "partials/footer.html" %}
{% load i18n %}
{% load i18n static %}
{% block footer_donate %}
<!-- nothing right now -->
@ -19,7 +19,7 @@
data-newsletter="{{ mozfest_footer.newsletter }}">
</div>
<a class="logo d-block my-5 my-md-0" href="https://foundation.mozilla.org"><img src="/_images/mozilla-block-white.svg"></a>
<a class="logo d-block my-5 my-md-0" href="https://foundation.mozilla.org"><img src="{% static "_images/mozilla-block-white.svg" %}"></a>
</div>
{% endblock %}

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

@ -84,6 +84,7 @@ env = environ.Env(
HEROKU_RELEASE_VERSION=(str, None),
SENTRY_ENVIRONMENT=(str, None),
REVIEW_APP=(bool, False),
STATIC_HOST=(str, ''),
)
# Read in the environment
@ -154,8 +155,12 @@ SOCIAL_SIGNIN = SOCIAL_AUTH_GOOGLE_OAUTH2_KEY is not None and \
USE_S3 = env('USE_S3')
USE_CLOUDINARY = env('USE_CLOUDINARY')
# Detect if Django is running normally, or in test mode through "manage.py test"
TESTING = 'test' in sys.argv
INSTALLED_APPS = list(filter(None, [
'whitenoise.runserver_nostatic',
'networkapi.filebrowser_s3' if USE_S3 else None,
'social_django' if SOCIAL_SIGNIN else None,
@ -193,7 +198,6 @@ INSTALLED_APPS = list(filter(None, [
'modelcluster',
'taggit',
'whitenoise.runserver_nostatic',
'rest_framework',
'django_filters',
'gunicorn',
@ -225,8 +229,6 @@ INSTALLED_APPS = list(filter(None, [
]))
MIDDLEWARE = list(filter(None, [
'networkapi.utility.middleware.TargetDomainRedirectMiddleware',
'csp.middleware.CSPMiddleware',
'corsheaders.middleware.CorsMiddleware',
@ -234,8 +236,9 @@ MIDDLEWARE = list(filter(None, [
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'networkapi.utility.middleware.ReferrerMiddleware',
'django.middleware.gzip.GZipMiddleware',
'whitenoise.middleware.WhiteNoiseMiddleware',
'django.middleware.gzip.GZipMiddleware',
'networkapi.utility.middleware.TargetDomainRedirectMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware', # should be after SessionMiddleware and before CommonMiddleware
'django.middleware.common.CommonMiddleware',
@ -415,12 +418,16 @@ LOCALE_PATHS = (
# https://docs.djangoproject.com/en/1.10/howto/static-files/
WHITENOISE_ROOT = app('frontend')
WHITENOISE_INDEX_FILE = True
STATIC_URL = '/static/'
# Enable CloudFront for staticfiles
STATIC_HOST = env('STATIC_HOST') if not DEBUG and not REVIEW_APP else ''
STATIC_URL = STATIC_HOST + '/static/'
STATIC_ROOT = root('staticfiles')
STATICFILES_STORAGE = 'networkapi.utility.staticfiles.NonStrictCompressedManifestStaticFilesStorage'
STATICFILES_DIRS = [app('frontend')]
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
WAGTAIL_SITE_NAME = 'Mozilla Foundation'
@ -609,9 +616,6 @@ PETITION_TEST_CAMPAIGN_ID = env('PETITION_TEST_CAMPAIGN_ID')
# Buyers Guide Rate Limit Setting
BUYERS_GUIDE_VOTE_RATE_LIMIT = env('BUYERS_GUIDE_VOTE_RATE_LIMIT')
# Detect if Django is running normally, or in test mode through "manage.py test"
TESTING = 'test' in sys.argv
# Coral Talk Server URL
CORAL_TALK_SERVER_URL = env('CORAL_TALK_SERVER_URL')

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

@ -1,4 +1,4 @@
{% load wagtailmetadata_tags i18n localization settings_value wagtailuserbar %}
{% load wagtailmetadata_tags i18n localization settings_value wagtailuserbar static %}
{% get_current_language as lang_code %}
@ -29,7 +29,7 @@
{% block coral_talk_meta %}{% endblock %}
{% block stylesheets %}
<link rel="stylesheet" href="/_css/main.compiled.css">
<link rel="stylesheet" href="{% static "_css/main.compiled.css" %}">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Nunito+Sans:400,300,700,300i">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Zilla+Slab:300,400,600,700,300i">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:400,700">
@ -38,9 +38,9 @@
{% block extended_head %}{% endblock %}
{% block icons %}
<link rel="apple-touch-icon" type="image/png" sizes="180x180" href="/_images/favicons/apple-touch-icon-180x180@2x.png">
<link rel="icon" type="image/png" sizes="196x196" href="/_images/favicons/favicon-196x196@2x.png">
<link rel="shortcut icon" href="/_images/favicons/favicon.ico">
<link rel="apple-touch-icon" type="image/png" sizes="180x180" href="{% static "_images/favicons/apple-touch-icon-180x180@2x.png" %}">
<link rel="icon" type="image/png" sizes="196x196" href="{% static "_images/favicons/favicon-196x196@2x.png" %}">
<link rel="shortcut icon" href="{% static "_images/favicons/favicon.ico" %}">
{% endblock %}
{% block org_schema%}{% endblock %}
@ -78,7 +78,7 @@
{% endblock %}
{% block script_bundle %}
<script src="/_js/main.compiled.js"></script>
<script src="{% static "_js/main.compiled.js" %}"></script>
{% endblock %}
{% block extra_scripts %}{% endblock %}

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

@ -1,4 +1,4 @@
{% load i18n %}
{% load i18n static %}
<div class="container">
<div class="row py-md-5 d-flex align-items-center">
@ -11,7 +11,7 @@
<a href="/" class="btn btn-secondary">{% trans "Go to home page" %}</a>
</div>
<div class="col-md-5 pt-5 p-md-5 flex-first flex-md-last">
<img src="/_images/404.svg" class="w-100" alt="Sad anthropomorphized 404">
<img src="{% static "_images/404.svg" %}" class="w-100" alt="Sad anthropomorphized 404">
</div>
</div>
</div>

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

@ -1,4 +1,4 @@
{% load settings_value i18n %}
{% load settings_value i18n static %}
{% with wrapper_class="py-5" %}
@ -27,7 +27,7 @@
{% block left_footer_column %}
<div class="col-md-5 col-lg-6 d-flex flex-column justify-content-between">
<div class="join-us" data-form-position="footer" data-button-position="side"></div>
<a class="logo d-block my-5 my-md-0" href="https://foundation.mozilla.org" aria-label="{% trans 'Return to Homepage' %}"><img src="/_images/mozilla-block-white.svg" alt="{% trans 'Mozilla Foundation' %}"></a>
<a class="logo d-block my-5 my-md-0" href="https://foundation.mozilla.org" aria-label="{% trans 'Return to Homepage' %}"><img src="{% static "_images/mozilla-block-white.svg" %}" alt="{% trans 'Mozilla Foundation' %}"></a>
</div>
{% endblock %}

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

@ -1,5 +0,0 @@
from whitenoise.storage import CompressedManifestStaticFilesStorage
class NonStrictCompressedManifestStaticFilesStorage(CompressedManifestStaticFilesStorage):
manifest_strict = False

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

@ -1,4 +1,4 @@
{% extends "wagtailadmin/admin_base.html" %}
{% extends "wagtailadmin/base.html" %}
{% load wagtailadmin_tags wagtailcore_tags staticfiles i18n %}
{% block titletag %}{% trans "Error 404: Page not found" %}{% endblock %}
@ -11,7 +11,7 @@
<link rel="stylesheet" href="{% static 'wagtailadmin/css/layouts/404.css' %}" />
<!-- our app's additional CSS -->
<link rel="stylesheet" href="/_css/main.compiled.css">
<link rel="stylesheet" href="{% static "_css/main.compiled.css" %}">
<link rel="stylesheet" href="{% static 'wagtailadmin/css/layouts/404-additionals.css' %}" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Nunito+Sans:400,600,300,700">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Zilla+Slab:300,400">

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

@ -1,5 +1,4 @@
{% extends "wagtailadmin/base.html" %}
{% load staticfiles %}
{% block branding_logo %}
<svg id="m-l-l" viewBox="0 0 75 75" width="75" height="75">

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

@ -1,11 +1,10 @@
{% extends "wagtailadmin/login.html" %}
{% load i18n staticfiles %}
{% load i18n %}
{% block submit_buttons %}
{{ block.super }}
<span>Or</span>
<a href="{% url "social:begin" "google-oauth2" %}?next=/cms"><button type="button" class="button" tabindex="4">{% trans 'Log in with Google' %}</button></a>
{% endblock %}

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

@ -1,3 +1,5 @@
{% load static %}
<div class="profiles" data-program-type="{{ value.program_type }}" data-program-year="{{ value.program_year }}" data-profile-type="{{ value.profile_type }}">
<div class="row">
{% for profile in profiles %}
@ -6,7 +8,7 @@
<div class="thumbnail-wrapper">
<a href="https://www.mozillapulse.org/profile/{{ profile.profile_id }}" class="d-block headshot-container">
<img
src="{% if profile.thumbnail %}{{ profile.thumbnail }}{% else %}/_images/fellowships/headshot/placeholder.jpg{% endif %}"
src="{% if profile.thumbnail %}{{ profile.thumbnail }}{% else %}{% static "_images/fellowships/headshot/placeholder.jpg" %}{% endif %}"
class="headshot"
alt="Headshot">
</a>

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

@ -1,8 +1,8 @@
{% load i18n %}
{% load i18n static%}
<div class="my-5">
<div class="my-2 py-2 ih-cta">
<div class="d-flex align-items-center"><img class="mr-3" src="/_images/icon-IH.svg" alt="" width="51" height="45">
<div class="d-flex align-items-center"><img class="mr-3" src="{% static "_images/icon-IH.svg" %}" alt="" width="51" height="45">
<p class="my-0">{% blocktrans with see_more_link='href="/" id="see-more-modular-page"' %}This is part of a broader movement for a healthy internet. <a {{ see_more_link }}>See more</a>.{% endblocktrans %}</p>
</div>
</div>

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

@ -1,4 +1,4 @@
{% load wagtailcore_tags wagtailimages_tags %}
{% load wagtailcore_tags wagtailimages_tags static %}
<div id="hero">
<div class="banner">
@ -16,7 +16,7 @@
{% image page.banner fill-1008x288 alt="" %}
</picture>
{% else %}
<img src="/_images/banner-black-white-marble.jpg" alt="">
<img src="{% static "_images/banner-black-white-marble.jpg" %}" alt="">
{% endif %}
</div>

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

@ -1,5 +1,5 @@
{% extends "pages/base.html" %}
{% load wagtailcore_tags wagtailimages_tags homepage_tags card_tags wagtailmetadata_tags multi_image_tags i18n %}
{% load wagtailcore_tags wagtailimages_tags homepage_tags card_tags wagtailmetadata_tags multi_image_tags i18n static %}
{% block body_id %}youtube-regrets{% endblock %}
@ -39,7 +39,7 @@
</div>
<figure class="scroll-hint text-center d-none">
<img src="/_images/youtube-regrets/scroll.svg" width="28" height="85" />
<img src="{% static "_images/youtube-regrets/scroll.svg" %}" width="28" height="85" />
<figcaption>{% trans "Scroll" %}</figcaption>
</figure>
</div>

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

@ -1,25 +1,25 @@
{% extends "../primary_page.html" %}
{% load wagtailcore_tags wagtailimages_tags %}
{% load wagtailcore_tags wagtailimages_tags static %}
{% block content %}
<div class="container">
<div class="row my-5">
<div class="col-sm-4">
<img class="mb-3 mb-md-0" src="/_images/upcoming/mozfest-banner.jpg"></div>
<img class="mb-3 mb-md-0" src="{% static "_images/upcoming/mozfest-banner.jpg" %}"></div>
<div class="col-sm-8">
<h4 class="h3-heading">Mozfest 2018 is open for proposals!</h4>
<p>This years theme "Data and You" takes the large concepts of data: collection, surveillance, policy, its currency and its future and center it around the most important of all its parts: people. How does and will data affect peoples lives? How can we share best practices, innovative tools and grow connections that allow data to serve people instead of people serving data. The deadline for proposals is August 1st.</p><a class="cta-link" href="https://mozillafestival.org/proposals">Apply now</a>
</div>
</div>
<div class="row my-5">
<div class="col-sm-4"><img class="mb-3 mb-md-0" src="/_images/upcoming/images-upcoming-fellowships@2x.jpg"></div>
<div class="col-sm-4"><img class="mb-3 mb-md-0" src="{% static "_images/upcoming/images-upcoming-fellowships@2x.jpg" %}"></div>
<div class="col-sm-8">
<h4 class="h3-heading">Fellowships that Empower Leaders</h4>
<p>Mozilla Fellowships provide resources, tools, community and amplification to those building a more humane digital world. Mozilla Fellowships are a transformative experience for emerging leaders concerned with making the internet a safer, more accessible resource for everyone.</p><a class="cta-link" href="https://foundation.mozilla.org/fellowships">Learn more and apply</a>
</div>
</div>
<div class="row my-5">
<div class="col-sm-4"><img class="mb-3 mb-md-0" src="/_images/upcoming/images-upcoming-internet-health-report@2x.jpg"></div>
<div class="col-sm-4"><img class="mb-3 mb-md-0" src="{% static "_images/upcoming/images-upcoming-internet-health-report@2x.jpg" %}"></div>
<div class="col-sm-8">
<h4 class="h3-heading">Internet Health Report</h4>
<p>Is the Internet getting healthier? Is it under threat? Do we all have a voice on the web? Mozillas Internet Health Report is an open source initiative that combines research from multiple sources to document whats healthy and unhealthy.</p><a class="cta-link" href="https://foundation.mozilla.org/internet-health-report/">Read the report</a>

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

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="32px" height="32px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 52 (66869) - http://www.bohemiancoding.com/sketch -->
<title>_Icons / 32px - Social / Twitter 2</title>
<desc>Created with Sketch.</desc>
<g id="_Icons-/-32px---Social--/-Twitter-2" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M10.2378952,28.7175836 C21.9357743,28.7175836 28.3367347,19.0169033 28.3367347,10.618744 C28.3367347,10.3458349 28.3367347,10.0729257 28.3243297,9.80001656 C29.5648259,8.9068593 30.6440576,7.77800775 31.5,6.50029667 C30.3587435,7.00890011 29.1306523,7.34383409 27.8405362,7.50509859 C29.1554622,6.72358599 30.1602641,5.47068483 30.6440576,3.98208939 C29.4159664,4.71398214 28.0514206,5.23499055 26.60004,5.52030467 C25.4339736,4.27980848 23.7841136,3.51070083 21.9605842,3.51070083 C18.44998,3.51070083 15.5968387,6.36384209 15.5968387,9.87444633 C15.5968387,10.3706448 15.6588635,10.8544383 15.7581032,11.3258269 C10.4735894,11.0653227 5.78451381,8.52230547 2.64605842,4.67676726 C2.1002401,5.61954437 1.79011605,6.71118102 1.79011605,7.87724745 C1.79011605,10.0853307 2.91896759,12.0329097 4.61844738,13.1741662 C3.57643057,13.1369513 2.59643858,12.8516372 1.7404962,12.3802487 C1.7404962,12.4050586 1.7404962,12.4298685 1.7404962,12.4670834 C1.7404962,15.543514 3.93617447,18.1237461 6.83893557,18.7067793 C6.30552221,18.8556388 5.74729892,18.9300686 5.16426571,18.9300686 C4.75490196,18.9300686 4.35794318,18.8928537 3.97338936,18.8184239 C4.77971188,21.3490362 7.13665466,23.1849705 9.91536615,23.2345904 C7.73209284,24.9464751 4.99059624,25.963682 2.01340536,25.963682 C1.50480192,25.963682 0.996198479,25.9388721 0.5,25.8768473 C3.30352141,27.6631618 6.65286114,28.7175836 10.2378952,28.7175836" id="Icon" fill="#FFFFFF"></path>
</g>
</svg>

После

Ширина:  |  Высота:  |  Размер: 1.9 KiB

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

@ -51,7 +51,7 @@ $btn-shadow-width: 3px;
position: absolute;
top: 1rem;
right: 1rem;
background: center right/10px 10px url("/_images/buyers-guide/icon-x.svg")
background: center right/10px 10px url(../_images/buyers-guide/icon-x.svg)
no-repeat transparent;
padding-right: 15px;
display: flex;

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

@ -1,6 +1,6 @@
#creepiness-score {
display: flex;
border-image: url(/_images/buyers-guide/gradient-bar.svg) 7/0px 6px 6px;
border-image: url(../_images/buyers-guide/gradient-bar.svg) 7/0px 6px 6px;
border-style: solid;
tbody {
@ -52,7 +52,7 @@
//Show a different creep-face in each bar of the graph
.creep-face {
background-image: url("/_images/buyers-guide/faces/sprite-resized-64-colors.png");
background-image: url(../_images/buyers-guide/faces/sprite-resized-64-colors.png);
background-position: center 0;
background-size: 35px auto;
background-color: transparent;

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

@ -6,7 +6,7 @@ export default class Creepometer extends React.Component {
this.faceCount = 40; // Number of face frames
this.faceHeight = 70; // pixel height for one frame
this.framePath = `/_images/buyers-guide/faces/`;
this.framePath = `../../../../static/_images/buyers-guide/faces/`;
this.state = {
dragging: false,

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

@ -2,7 +2,7 @@
margin-top: 70px;
.slider {
background: url("/_images/buyers-guide/gradient-bar.svg") no-repeat 0 center /
background: url(../_images/buyers-guide/gradient-bar.svg) no-repeat 0 center /
contain;
position: relative;
height: 100px;

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

@ -46,10 +46,10 @@
}
.likely th::before {
background: url("/_images/buyers-guide/icon-thumb-up.svg") no-repeat;
background: url(../_images/buyers-guide/icon-thumb-up.svg) no-repeat;
}
.unlikely th::before {
background: url("/_images/buyers-guide/icon-thumb-down.svg") no-repeat;
background: url(../_images/buyers-guide/icon-thumb-down.svg) no-repeat;
}
}

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

@ -41,7 +41,7 @@ $category-nav-border-bottom-thickness: 4px;
top: 0;
left: 0;
content: "";
background: url("/_images/buyers-guide/icon-heart.svg") no-repeat center
background: url(../_images/buyers-guide/icon-heart.svg) no-repeat center
calc(50% + 2px) / contain;
width: $icon-width;
height: 100%;

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

@ -7,7 +7,7 @@
margin: 0 0.2em;
font-variant: normal;
color: transparent;
background-image: url(/_images/buyers-guide/faces/most-emoji.png);
background-image: url(../_images/buyers-guide/faces/most-emoji.png);
background-size: 100% 100%;
background-position: center center;
background-repeat: no-repeat;

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

@ -1,6 +1,6 @@
#view-home {
.page-header {
background: url(/_images/buyers-guide/evergreen-header.jpg) center center /
background: url(../_images/buyers-guide/evergreen-header.jpg) center center /
cover no-repeat;
height: 200px;
@ -91,14 +91,14 @@
height: $recommendation-height;
&.positive {
background-image: url(/_images/buyers-guide/icon-thumb-up.svg);
background-image: url(../_images/buyers-guide/icon-thumb-up.svg);
background-position: 0 0;
background-repeat: no-repeat;
background-size: 100% 100%;
}
&.negative {
background-image: url(/_images/buyers-guide/icon-thumb-down.svg);
background-image: url(../_images/buyers-guide/icon-thumb-down.svg);
background-position: 0 0;
background-repeat: no-repeat;
background-size: 100% 100%;
@ -179,7 +179,7 @@
display: inline-block;
width: $face-dimension;
height: $face-dimension;
background-image: url(/_images/buyers-guide/faces/sprite-resized-64-colors.png);
background-image: url(../_images/buyers-guide/faces/sprite-resized-64-colors.png);
background-position: 0 0;
background-repeat: no-repeat;
background-size: 100%;
@ -214,7 +214,7 @@
display: inline-block;
width: 2em;
height: $sb-height;
background-image: url(/_images/buyers-guide/icon-bubble.svg);
background-image: url(../_images/buyers-guide/icon-bubble.svg);
background-size: auto $sb-height;
background-position: -100px 0;
background-repeat: no-repeat;

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

@ -87,7 +87,7 @@ $product-detail-padding-x: (
top: 0;
left: 0;
content: "";
background-image: url(/_images/buyers-guide/icon-product-link.svg);
background-image: url(../_images/buyers-guide/icon-product-link.svg);
background-repeat: no-repeat;
background-position: center 65%;
background-size: contain;
@ -188,7 +188,7 @@ $product-detail-padding-x: (
position: absolute;
top: 0;
left: 0;
background: url("/_images/buyers-guide/badge-star-mini.svg") center /
background: url(../_images/buyers-guide/badge-star-mini.svg) center /
contain no-repeat;
width: $badge-width-mobile;
height: 100%;
@ -255,7 +255,7 @@ $product-detail-padding-x: (
button.toggle {
align-self: center;
margin-left: 10px;
background: url(/_images/buyers-guide/plus.svg) center center no-repeat;
background: url(../_images/buyers-guide/plus.svg) center center no-repeat;
background-size: contain;
border: 0;
width: 24px;
@ -279,7 +279,7 @@ $product-detail-padding-x: (
left: 0;
right: 0;
height: 228px;
background-image: url("/_images/buyers-guide/dot-pattern.svg");
background-image: url(../_images/buyers-guide/dot-pattern.svg);
background-size: 9px 9px;
}
}

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

@ -5,7 +5,7 @@
&::before {
content: "";
background: url(/_images/hand.svg) no-repeat;
background: url(../_images/hand.svg) no-repeat;
width: 14px;
height: 20px;
display: block;

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

@ -9,7 +9,7 @@
&::before {
width: 50px;
height: 40px;
background: url("/_images/double-quote-glyph.svg");
background: url(../_images/double-quote-glyph.svg);
content: "";
display: block;
margin: 0 auto 10px;

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

@ -49,18 +49,18 @@ body.mozfest {
}
&.btn-pause {
background-image: url("/_images/mozfest/pause-circle.svg");
background-image: url("../_images/mozfest/pause-circle.svg");
&:hover {
background-image: url("/_images/mozfest/pause-circle-hover.svg");
background-image: url("../_images/mozfest/pause-circle-hover.svg");
}
}
&.btn-play {
background-image: url("/_images/mozfest/play-circle.svg");
background-image: url("../_images/mozfest/play-circle.svg");
&:hover {
background-image: url("/_images/mozfest/play-circle-hover.svg");
background-image: url("../_images/mozfest/play-circle-hover.svg");
}
}
}

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

@ -80,7 +80,7 @@
margin-right: 5px;
background-size: contain;
background-repeat: no-repeat;
background-image: url("/_images/glyphs/map-marker-icon.svg");
background-image: url("../_images/glyphs/map-marker-icon.svg");
}
}
}