Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding last updated date #112

Merged
merged 1 commit into from
Mar 17, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -8,3 +8,4 @@ dist/
ioos_metrics/_version.py
website/deploy/gts_atn.html
website/deploy/gts_regional.html
.idea/
3 changes: 3 additions & 0 deletions website/create_asset_inventory_page.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# This script run once creates a catalog landing page based on the *_config.json file
# reference when called. E.g., python create_gts_regional_landing_page.py EcoSys_config.json
from jinja2 import Environment, FileSystemLoader
import datetime as dt
import json
import os
import pandas as pd
@@ -196,6 +197,8 @@ def main(org_config):
"year": gdf['Year'].unique()[0]
}

configs['today'] = dt.datetime.now().strftime("%Y-%m-%d")

write_templates(configs, org_config)


3 changes: 3 additions & 0 deletions website/create_gts_atn_landing_page.py
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@
# reference when called. E.g., python create_gts_regional_landing_page.py EcoSys_config.json

from bs4 import BeautifulSoup
import datetime as dt
from jinja2 import Environment, FileSystemLoader
import json
import os
@@ -148,6 +149,8 @@ def main(org_config):
"table": table,
"figure": fig,
}

configs['today'] = dt.datetime.now().strftime("%Y-%m-%d")

write_templates(configs, org_config)

5 changes: 4 additions & 1 deletion website/create_gts_regional_landing_page.py
Original file line number Diff line number Diff line change
@@ -176,7 +176,9 @@ def main(org_config):

configs = dict()

for date in pd.date_range(start_date, dt.datetime.now(), freq="QE"):
today = dt.datetime.now()

for date in pd.date_range(start_date, today, freq="QE"):
year = int(date.strftime("%Y"))
month = int(date.strftime("%m"))
day = int(date.strftime("%d"))
@@ -212,6 +214,7 @@ def main(org_config):

configs["figure1"] = fig1
configs["figure2"] = fig2
configs["today"] = today.strftime("%Y-%m-%d")

write_templates(configs, org_config)

1 change: 1 addition & 0 deletions website/templates/asset_inventory_page.html
Original file line number Diff line number Diff line change
@@ -53,6 +53,7 @@ <h1 class="header_title">NOAA Integrated Ocean Observing System Metrics</h1>
<div class="mywrap">
<h1 class="title">{{org_config.general_title}}</h1>
</div>
<a class = "longTitle">Last updated: {{configs.today}}</a>
<div>
<h3>A brief description of the IOOS asset inventory:</h3>
<ol type="1">
1 change: 1 addition & 0 deletions website/templates/gts_atn_landing_page.html
Original file line number Diff line number Diff line change
@@ -44,6 +44,7 @@ <h2 class="title">
{{org_config.general_title}}
</h2>
</div>
<a class = "longTitle">Last updated: {{configs.today}}</a>

{{configs.figure}}

15 changes: 9 additions & 6 deletions website/templates/gts_regional_landing_page.html
Original file line number Diff line number Diff line change
@@ -39,6 +39,7 @@ <h1 class ="header_title">NOAA Integrated Ocean Observing System Metrics</h1>
<div class ="mywrap">
<h2 class ="title">{{org_config.general_title}}</h2>
</div>
<a class = "longTitle">Last updated: {{configs.today}}</a>
<div class="mywrap">

<input class = "boxInput" type="text" id="myInput" onkeyup="simpleSearch()" placeholder="Search for metrics" title="Type in a year/quarter">
@@ -98,12 +99,14 @@ <h2 class ="title">{{org_config.general_title}}</h2>
<div class = "divider"></div>

<footer >
<img src="https://github.com/ioos/documentation-theme-jekyll/raw/main/images/IOOS_Emblem_Tertiary_B_RGB.png" alt="NOAA IOOS Logo" height="75">
<div class="mywrap_center">
<a class ="mylink line" href="https://www.commerce.gov/">U.S. Department of Commerce</a>
<a class ="mylink line" href="https://www.noaa.gov">National Oceanographic and Atmospheric Administration</a>
<a class ="mylink" href="https://www.ioos.noaa.gov/">NOAA IOOS</a>
</div>
<img src="https://github.com/ioos/documentation-theme-jekyll/raw/main/images/IOOS_Emblem_Tertiary_B_RGB.png" alt="NOAA IOOS Logo" height="75">
<div class="mywrap_center">

<a class ="mylink line" href="https://www.commerce.gov/">U.S. Department of Commerce</a>
<a class ="mylink line" href="https://www.noaa.gov">National Oceanographic and Atmospheric Administration</a>
<a class ="mylink" href="https://www.ioos.noaa.gov/">NOAA IOOS</a>
</div>

</footer>
</main>
<script>