Skip to content

Commit

Permalink
Adding USWDS and full front page implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-gade committed Jan 21, 2025
1 parent abe773b commit e197cbc
Show file tree
Hide file tree
Showing 2,773 changed files with 27,219 additions and 55 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ WORKDIR /code
COPY requirements.txt /code/
RUN pip install -r requirements.txt
COPY . /code/
RUN apt update
RUN apt install gettext -y
4 changes: 2 additions & 2 deletions Dockerfile.uswds
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ENV NODE_EXTRA_CA_CERTS=/etc/ssl/certs/zscaler-root.pem
RUN mkdir /app
WORKDIR /app

ADD ./weather.gov/web/themes/new_weather_theme/package.json .
ADD ./weather.gov/web/themes/new_weather_theme/package-lock.json .
ADD ./weathergov/frontend/package.json .
ADD ./weathergov/frontend/package-lock.json .

RUN npm ci
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ services:
context: ./
dockerfile: Dockerfile.uswds
volumes:
- ./weather.gov/web/themes/new_weather_theme/:/app
- ./weathergov/frontend/:/app
- /app/node_modules
profiles: ["utility"]

Expand Down
Binary file modified locale/en/LC_MESSAGES/django.mo
Binary file not shown.
62 changes: 31 additions & 31 deletions locale/en/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ msgid "afd.label.forecast-office.01"
msgstr "Forecast office:"

msgid "afd.label.versions.01"
msgstr "Versions for @wfo_name:"
msgstr "Versions for {wfo_name}:"

msgid "afd.table-header.chance-precip.01"
msgstr "Chance of precipitation"
Expand Down Expand Up @@ -95,19 +95,19 @@ msgid "alerts.table-header.alert-type.01"
msgstr "Type"

msgid "alerts.text.counties-in.01"
msgstr "Counties in @area"
msgstr "Counties in {area}"

msgid "alerts.text.in-effect-from.01"
msgstr "In effect from @start"
msgstr "In effect from {start}"

msgid "alerts.text.in-effect-from-until.01"
msgstr "In effect from @start – @end"
msgstr "In effect from {start}{end}"

msgid "alerts.text.including-cities.01"
msgstr "Including these cities"

msgid "alerts.text.issued-by.01"
msgstr "Issued by @sender"
msgstr "Issued by {sender}"

msgid "backend.banner.under-development.01"
msgstr "Under development"
Expand All @@ -125,16 +125,16 @@ msgid "backend.login.sso-login-path.01"
msgstr "SSO Login Path"

msgid "daily-forecast.aria.condition.01"
msgstr "Condition: @description"
msgstr "Condition: {description}"

msgid "daily-forecast.aria.high-not-applicable.01"
msgstr "High temperature not applicable"

msgid "daily-forecast.aria.high-of.01"
msgstr "High of @degrees℉"
msgstr "High of {degrees}℉"

msgid "daily-forecast.aria.low-of.01"
msgstr "Low of @degrees℉"
msgstr "Low of {degrees}℉"

msgid "daily-forecast.heading.hourly-forecast.01"
msgstr "Hourly forecast"
Expand Down Expand Up @@ -176,7 +176,7 @@ msgid "daily-forecast.table-header.low.01"
msgstr "Low"

msgid "daily-forecast.text.chance-precip.02"
msgstr "@percent% chance of precipitation"
msgstr "{percent}% chance of precipitation"

msgid "daily-forecast.button.details-toggle-charts.01"
msgstr "Charts"
Expand All @@ -200,10 +200,10 @@ msgid "footer.text.usa-gov-site-alt.01"
msgstr "An official website of the United States government"

msgid "forecast.aria.current-conditions-feels-like.01"
msgstr "It feels like @temperature ℉."
msgstr "It feels like {temperature} ℉."

msgid "forecast.aria.current-conditions-narrative.01"
msgstr "Weather as of @time. The weather in @place is @conditions. Temperature is @temperature ℉."
msgstr "Weather as of {time}. The weather in {place} is {conditions}. Temperature is {temperature} ℉."

msgid "forecast.current.feels-like.01"
msgstr "Feels like"
Expand Down Expand Up @@ -305,10 +305,10 @@ msgid "frontpage.text.is-coming-2-graf.01"
msgstr "As you explore, you may notice that we’re missing features you’re accustomed to seeing on weather.gov. This site is updated every two weeks with new features. Continue to check back to watch the site expand!"

msgid "frontpage.text.is-coming-3-graf.01"
msgstr "Because it’s a work in progress, this site has a long way to go before replacing weather.gov. In the meantime, you can still <a href='@url' class='usa-link'>access weather.gov</a> and all the tools it offers. You should continue to rely on weather.gov as the authoritative source for weather information."
msgstr "Because it’s a work in progress, this site has a long way to go before replacing weather.gov. In the meantime, you can still <a href='{url}' class='usa-link'>access weather.gov</a> and all the tools it offers. You should continue to rely on weather.gov as the authoritative source for weather information."

msgid "frontpage.text.touchpoints-1-graf.01"
msgstr "<a href='@url' class='usa-link'>Tell us what you think</a> about how beta.weather.gov looks and functions."
msgstr "<a href='{url}' class='usa-link'>Tell us what you think</a> about how beta.weather.gov looks and functions."

msgid "hourly-charts.heading.chance-precip.01"
msgstr "Chance of precipitation"
Expand Down Expand Up @@ -347,7 +347,7 @@ msgid "hourly-table.aria.scroll-right.01"
msgstr "scroll right"

msgid "hourly-table.aria.table-description.01"
msgstr "Detailed hourly weather data for @month/@day. The rows are weather variables, the columns are hours."
msgstr "Detailed hourly weather data for {month}/{day}. The rows are weather variables, the columns are hours."

msgid "hourly-table.labels.condition.01"
msgstr "Condition"
Expand All @@ -371,7 +371,7 @@ msgid "hourly-table.table-header.chance-precip.01"
msgstr "Chance of precipitation"

msgid "hourly-table.text.gusting.01"
msgstr "with gusts up to @gustSpeed mph"
msgstr "with gusts up to {gustSpeed} mph"

msgid "loader.loading-text.01"
msgstr "Loading the forecast"
Expand Down Expand Up @@ -449,16 +449,16 @@ msgid "satellite.heading.satellite.01"
msgstr "Satellite"

msgid "theme.text.submitted-by.01"
msgstr "Submitted by @author_name on @month/@day"
msgstr "Submitted by {author_name} on {month}/{day}"

msgid "units.dbz.01"
msgstr "dBz"

msgid "units.inches.01"
msgstr "@inches\""
msgstr "{inches}\""

msgid "units.mercury-inches.01"
msgstr "@mercury_inches in (@mbar&nbsp;mb)"
msgstr "{mercury_inches} in ({mbar}&nbsp;mb)"

msgid "units.miles.01"
msgstr "miles"
Expand All @@ -467,7 +467,7 @@ msgid "units.feet.01"
msgstr "feet"

msgid "units.mph.02"
msgstr "@speed mph"
msgstr "{speed} mph"

msgid "uswds-banner.gov.description_html.01"
msgstr "A <strong>.gov</strong> website belongs to an official government organization in the United States."
Expand Down Expand Up @@ -497,10 +497,10 @@ msgid "uswds-banner.skip-to-content.01"
msgstr "Skip to main content"

msgid "wfo-info.caption.coverage-area-map.01"
msgstr "Coverage area for @wfo WFO"
msgstr "Coverage area for {wfo} WFO"

msgid "wfo-info.caption+aria.coverage-area-map.01"
msgstr "This includes @counties"
msgstr "This includes {counties}"

msgid "wfo-info.heading.contact-us.01"
msgstr "Contact us"
Expand All @@ -515,7 +515,7 @@ msgid "wfo-info.labels.about.01"
msgstr "About"

msgid "wfo-info.labels.wfo.01"
msgstr "@wfoName (@wfoCode) National Weather Service Office"
msgstr "{wfoName} ({wfoCode}) National Weather Service Office"

msgid "wfo-info.link.area-forecast-discussion"
msgstr "Current Area Forecast Discussion"
Expand Down Expand Up @@ -545,31 +545,31 @@ msgid "weather-story.link.area-forecast-discussion.01"
msgstr "Area Forecast Discussion"

msgid "weather-story.text.created-by.03"
msgstr "<strong class='text-base-dark'>Created: @date</strong> by the <a class='usa-link' href='@wfo_url'>@wfo_name WFO</a>"
msgstr "<strong class='text-base-dark'>Created: {date}</strong> by the <a class='usa-link' href='{wfo_url}'>{wfo_name} WFO</a>"

msgid "wind.labels.calm.01"
msgstr "calm"

msgid "wind.labels.speed-from-north.01"
msgstr "@speed mph from the north"
msgstr "{speed} mph from the north"

msgid "wind.labels.speed-from-northeast.01"
msgstr "@speed mph from the northeast"
msgstr "{speed} mph from the northeast"

msgid "wind.labels.speed-from-east.01"
msgstr "@speed mph from the east"
msgstr "{speed} mph from the east"

msgid "wind.labels.speed-from-southeast.01"
msgstr "@speed mph from the southeast"
msgstr "{speed} mph from the southeast"

msgid "wind.labels.speed-from-south.01"
msgstr "@speed mph from the south"
msgstr "{speed} mph from the south"

msgid "wind.labels.speed-from-southwest.01"
msgstr "@speed mph from the southwest"
msgstr "{speed} mph from the southwest"

msgid "wind.labels.speed-from-west.01"
msgstr "@speed mph from the west"
msgstr "{speed} mph from the west"

msgid "wind.labels.speed-from-northwest.01"
msgstr "@speed mph from the northwest"
msgstr "{speed} mph from the northwest"
9 changes: 9 additions & 0 deletions weather/context_processors.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from django.conf import settings

def route_info(request):
return {
'path_name': request.resolver_match.view_name,
'site_name': settings.SITE_NAME,
'site_slogan': settings.SITE_SLOGAN,
'site_logo': settings.SITE_LOGO
}
4 changes: 2 additions & 2 deletions weather/templates/weather/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
{% block head_js %}{% endblock %}
</head>
<body>
<script src="/assets/js/uswds.min.js"></script>
<a href="#main-content" class="visually-hidden focusable skip-link">
<a href="#main-content" class="usa-sr-only focusable skip-link">
{% translate 'uswds-banner.skip-to-content.01' %}
</a>
{% include "weather/partials/gov-banner.html" %}
{% block page_top %}{% endblock %}
{% block page %}{% endblock %}
{% block page_bottom %}{% endblock %}
<script src="/assets/js/uswds.min.js"></script>
</body>
</html>
114 changes: 114 additions & 0 deletions weather/templates/weather/footer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
{% load i18n %}
{% load weather_i18n %}
<footer role="contentinfo" class="margin-top-0 padding-bottom-3">
<div class="usa-identifier">
<nav class="usa-identifier__section usa-identifier__section--required-links" aria-label="Important links,">
<div class="grid-container">
<div class="grid-row">
<div class="desktop:grid-col-4">
<a href="/" rel="home" class="site-logo display-block">
<img class="height-9" src="/assets/logo-noaa.svg" alt="{{ 'footer.aria.noaa-logo.01'|t }}"/>
</a>
<span class="text-italic display-block">{{ 'footer.noaa-motto.01'| t }}</span>
</div>
<div class="desktop:grid-col-8"> <div class="region region-primary-footer">
<nav role="navigation" aria-labelledby="block-new-weather-theme-footerprimarylinks-menu" id="block-new-weather-theme-footerprimarylinks" class="contextual-region block block-menu navigation menu--footer">

<nav class="usa-identifier__section usa-identifier__section--required-links">
<div class="usa-identifier__container padding-0">
<ul class="usa-identifier__required-links-list">
<li class="usa-identifier__required-links-item">
<a href="/about" class="usa-identifier__required-link usa-link">
About Us
</a>
</li>
<li class="usa-identifier__required-links-item">
<a href="https://www.noaa.gov/NOAA-Communications" class="usa-identifier__required-link usa-link">
Media inquiries
</a>
</li>
<li class="usa-identifier__required-links-item">
<a href="" class="usa-identifier__required-link usa-link">
Website Acknowledgements
</a>
</li>
<li class="usa-identifier__required-links-item">
<a href="/site-index" class="usa-identifier__required-link usa-link">
Site Index
</a>
</li>
<li class="usa-identifier__required-links-item">
<a href="/disclaimer" class="usa-identifier__required-link usa-link">
Disclaimer
</a>
</li>
<li class="usa-identifier__required-links-item">
<a href="https://www.noaa.gov/information-technology/foia" class="usa-identifier__required-link usa-link">
Freedom of Information Act
</a>
</li>
<li class="usa-identifier__required-links-item">
<a href="/node/4" class="usa-identifier__required-link usa-link">
Accessibility
</a>
</li>
<li class="usa-identifier__required-links-item">
<a href="https://www.noaa.gov/organization/information-technology/policy-oversight/information-quality" class="usa-identifier__required-link usa-link">
Information Quality
</a>
</li>
<li class="usa-identifier__required-links-item">
<a href="/privacy-policy" class="usa-identifier__required-link usa-link">
Privacy policy
</a>
</li>
<li class="usa-identifier__required-links-item">
<a href="https://usa.gov" class="usa-identifier__required-link usa-link">
USA.gov
</a>
</li>
</ul>
</div>
</nav>

</nav>

</div>
</div>
</div>
</div>
</nav>
<!--
TODO: Make these links configurable.
These were taken verbatim from a rendering
of the Drupal beta site. In drupal, the links are
configured as menu items
-->
<div class="region region-footer">
<nav role="navigation" aria-labelledby="block-new-weather-theme-agencyidentificationlinks-menu" id="block-new-weather-theme-agencyidentificationlinks" class="contextual-region block block-menu navigation menu--agency-identification-links">
<section class="usa-identifier__section usa-identifier__section--usagov" aria-label="U.S. government information and services,">
<div class="usa-identifier__container">
<ul class="usa-list--unstyled desktop:display-flex flex-row flex-justify">
<li>
<a class="usa-link text-bold" href="https://www.commerce.gov/">Department of Commerce</a>
</li>
<li>
<a class="usa-link text-bold" href="https://www.noaa.gov/">National Oceanic and Atmospheric Administration (NOAA)</a>
</li>
<li>
<a class="usa-link text-bold" href="/">National Weather Service</a>
</li>
</ul>
</div>
</section>

</nav>

</div>
</div>

<a href="https://touchpoints.app.cloud.gov/touchpoints/22acf675/submit"
class="touchpoints-button usa-button position-fixed bottom-0 z-top">
{{ "footer.link.touchpoints.01" | t }}
</a>
</footer>
Loading

0 comments on commit e197cbc

Please sign in to comment.