Skip to content

Commit

Permalink
Restore wnp 124 pdf page for wnp 135 na
Browse files Browse the repository at this point in the history
  • Loading branch information
maureenlholland committed Jan 21, 2025
1 parent c188a00 commit 0ea50b8
Show file tree
Hide file tree
Showing 8 changed files with 343 additions and 0 deletions.
76 changes: 76 additions & 0 deletions bedrock/firefox/templates/firefox/whatsnew/whatsnew-fx135-na.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{#
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at https://mozilla.org/MPL/2.0/.
#}

{% extends "firefox/whatsnew/base.html" %}

{% block page_css %}
{{ css_bundle('firefox_whatsnew_135_pdf') }}
{% endblock %}

{% block wnp_content %}
<section class="wnp-content-main mzp-l-content mzp-t-content-md">
<h1 class="wnp-main-title">
{{ picture(
url="img/firefox/whatsnew/whatsnew135-pdf/edit-pdfs-light.svg",
sources=[
{
"media": "(prefers-color-scheme: light)",
"srcset": {
"img/firefox/whatsnew/whatsnew135-pdf/edit-pdfs-light.svg": "default",
}
},
{
"media": "(prefers-color-scheme: dark)",
"srcset": {
"img/firefox/whatsnew/whatsnew135-pdf/edit-pdfs-dark.svg": "default",
}
}
],
optional_attributes={
"alt": "Edit PDFs in Firefox",
"width": "435",
"height": "222",
}
) }}
</h1>

<div class="wnp-loading"></div>

<div class="wnp-editor">
<p class="wnp-main-tagline">
Say goodbye to the hassle of printing or filling out PDFs in other apps. Quickly and easily edit documents right in your browser.
</p>


<p class="wnp-main-cta">
<a class="mzp-c-button mzp-t-product" href="https://assets.mozilla.net/wnp124-en/wnp-fx124-en.pdf" data-cta-type="button" data-cta-text="Try it now" target="_blank" rel="noopener">
Try it now
</a>
</p>
</div>

<div class="wnp-default">
<p class="wnp-main-tagline">
Say goodbye to the hassle of printing or filling out PDFs in other apps. With Firefox as your default browser, quickly and easily edit documents right in your browser.
</p>

<p class="wnp-main-cta is-not-default">
<a class="mzp-c-button mzp-t-product" href="{{ url('firefox.set-as-default.thanks') }}" data-cta-type="button" data-cta-text="Set Firefox to default" target="_blank" rel="noopener">
Set Firefox to default
</a>
</p>
</div>

<p class="wnp-sign-off">
<strong>Powered by Mozilla.</strong> Putting people before profits since 1998.
</p>
</section>

{% endblock %}

{% block js %}
{{ js_bundle('firefox_whatsnew_135_pdf') }}
{% endblock %}
22 changes: 22 additions & 0 deletions bedrock/firefox/tests/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,28 @@ def test_fx_135_0_0beta_pl(self, render_mock):

# end 135 beta whatsnew tests

# begin 135 na whatsnew tests

@override_settings(DEV=True)
def test_fx_135_0_0_en_US(self, render_mock):
"""Should use whatsnew-fx135-na template for en-US locale"""
req = self.rf.get("/firefox/whatsnew/")
req.locale = "en-US"
self.view(req, version="135.0")
template = render_mock.call_args[0][1]
assert template == ["firefox/whatsnew/whatsnew-fx135-na.html"]

@override_settings(DEV=True)
def test_fx_135_0_0_en_CA(self, render_mock):
"""Should use whatsnew-fx135-na template for en-CA locale"""
req = self.rf.get("/firefox/whatsnew/")
req.locale = "en-CA"
self.view(req, version="135.0")
template = render_mock.call_args[0][1]
assert template == ["firefox/whatsnew/whatsnew-fx135-na.html"]

# end 135 na whatsnew tests

@override_settings(DEV=True)
def test_rv_prefix(self, render_mock):
"""Prefixed oldversion shouldn't impact version sniffing."""
Expand Down
6 changes: 6 additions & 0 deletions bedrock/firefox/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,7 @@ class WhatsnewView(L10nTemplateView):
"firefox/whatsnew/whatsnew-fx134-gb.html": ["firefox/whatsnew/whatsnew"],
"firefox/whatsnew/whatsnew-fx134-de.html": ["firefox/whatsnew/whatsnew"],
"firefox/whatsnew/whatsnew-fx134-fr.html": ["firefox/whatsnew/whatsnew"],
"firefox/whatsnew/whatsnew-fx135-na.html": ["firefox/whatsnew/whatsnew"],
}

# specific templates that should not be rendered in
Expand Down Expand Up @@ -616,6 +617,11 @@ def get_template_names(self):
template = "firefox/whatsnew/index.html"
else:
template = "firefox/whatsnew/index.html"
elif version.startswith("135."):
if locale == "en-US" or locale == "en-CA":
template = "firefox/whatsnew/whatsnew-fx135-na.html"
else:
template = "firefox/whatsnew/index.html"
elif version.startswith("134."):
if locale == "en-US":
template = "firefox/whatsnew/whatsnew-fx134-us.html"
Expand Down
90 changes: 90 additions & 0 deletions media/css/firefox/whatsnew/whatsnew-135-pdf.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@

// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

@import 'includes/base';
@import 'includes/dark-mode';
@import '~@mozilla-protocol/core/protocol/css/includes/lib';
@import '~@mozilla-protocol/core/protocol/css/components/notification-bar';

@keyframes loading {
0% {
background-position: 100% 50%;
}

100% {
background-position: 0 50%;
}
}

.wnp-editor,
.wnp-default {
&.show {
display: block;
}

&.hide {
display: none;
}
}

.wnp-content-main {
text-align: center;
}

.wnp-main-title {
margin: 0 auto $layout-md;
color: $color-black;
}

.wnp-main-tagline {
@include text-body-lg;
color: $color-black;
}

// Show a loading indicator until we can detect default browser
.wnp-loading {
animation: loading 1.2s ease-in-out infinite;
background: linear-gradient(100deg, $color-light-gray-10 30%, $color-light-gray-20 50%, $color-light-gray-10 70%);
background-size: 400%;
border-radius: $border-radius-sm;
height: 4em;
margin: $layout-lg auto;

&.hide {
display: none;
}
}

// Assuming JS is available, show no content until we can detect default browser
.js {
.wnp-default,
.wnp-editor {
display: none;

&.show {
display: block;
}
}
}

// Fall back to the editor content if JS fails
.no-js {
.wnp-loading,
.wnp-default {
display: none;
}

.wnp-editor {
display: block;
}
}

// Dark mode support
@media (prefers-color-scheme: dark) {
.wnp-main-title,
.wnp-main-tagline {
color: $color-white;
}
}
16 changes: 16 additions & 0 deletions media/img/firefox/whatsnew/whatsnew135-pdf/edit-pdfs-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions media/img/firefox/whatsnew/whatsnew135-pdf/edit-pdfs-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 0ea50b8

Please sign in to comment.