diff --git a/.vscode/launch.json b/.vscode/launch.json index 267b622c9..6d6aa6af6 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -5,10 +5,12 @@ "version": "0.2.0", "configurations": [ { - "type": "pwa-msedge", + "name": "Python: Current File (Integrated Terminal)", + "type": "python", "request": "launch", - "name": "Open index.html", - "file": "/home/ryon/projects/cal-itp-reports/templates/index.html" - } + "program": "${file}", + "console": "integratedTerminal", + "cwd": "${fileDirname}" + }, ] } diff --git a/templates/macros.html.jinja b/templates/macros.html.jinja index 717b93a1d..987c23b15 100644 --- a/templates/macros.html.jinja +++ b/templates/macros.html.jinja @@ -28,3 +28,25 @@ {% endfor %} {% endmacro %} + +{% macro render_dialog(id, title, class=" + backdrop:backdrop-blur-sm + bg-white border + md:min-w-[24rem] max-w-3xl + !my-8 p-8 + responsive-prose + rounded-xl shadow-xl + ") %} + +
+

{{ title }}

+
+ +
+
+ + {{ caller() }} +
+{% endmacro %} diff --git a/templates/report.html.jinja b/templates/report.html.jinja index fdda7f096..40bfab5c0 100644 --- a/templates/report.html.jinja +++ b/templates/report.html.jinja @@ -25,36 +25,34 @@ {%- endblock -%} {% block content %} - - -
- {{ macros.breadcrumbs([ +
+ {{ macros.breadcrumbs([ { 'url': '/', 'text': 'Home' }, { 'url': '/#directory', 'text': 'Directory' }, { 'url': '../', 'text': feed_info.date_month_year }, { 'text': feed_info.feed_publisher_name }, - ]) }} - -

- Monthly GTFS Quality Report -
- - {% if feed_info.feed_publisher_url %} - {{ feed_info.feed_publisher_name }} - {% else %} - {{ feed_info.feed_publisher_name }} - {% endif %} -  ·  - {{ feed_info.date_month_year }} - -

-

- This is a monthly report, generated by the California Integrated Travel Project - (Cal-ITP), summarizing issues discovered by MobilityData’s GTFS Validator. This report - is available for viewing by the general public to support continuous improvement of - GTFS data and the experience of transit passengers. -

-
+ ]) }} + +

+ Monthly GTFS Quality Report +
+ + {% if feed_info.feed_publisher_url %} + {{ feed_info.feed_publisher_name }} + {% else %} + {{ feed_info.feed_publisher_name }} + {% endif %} +  ·  + {{ feed_info.date_month_year }} + +

+

+ This is a monthly report, generated by the California Integrated Travel Project + (Cal-ITP), summarizing issues discovered by MobilityData’s GTFS Validator. This report + is available for viewing by the general public to support continuous improvement of + GTFS data and the experience of transit passengers. +

+

@@ -89,26 +87,43 @@ {% endif %} + - {% if speedmap_url %} -
+
+
+ + + {% if speedmap_url %} View Speedmap -
- {% endif %} + {% endif %} +
- {# Commented out until an ultimate resolution can be found for - https://github.com/cal-itp/reports/issues/44 -
- - - Download Feed - -
-#} + {% call macros.render_dialog('feed-info-modal', 'Source URLs') %} +
+ + +
+ +

+ Note: Links may lead directly to downloads and/or to resources that require authentication +

+
+
+ {% endcall %}
@@ -177,12 +192,13 @@
-

About the {{ feed_info.date_month }} Identifier Change Charts

- - +
- - - - - - + {% endblock %} diff --git a/tests/fixtures/index_report.json b/tests/fixtures/index_report.json index c465460fc..a9d6c7bd0 100644 --- a/tests/fixtures/index_report.json +++ b/tests/fixtures/index_report.json @@ -10,7 +10,13 @@ { "agency_name": "City of Delano", "itp_id": 91, - "report_path": "2022\/11\/91\/index.html" + "report_path": "2022\/11\/91\/index.html", + "feeds": [ + { + "gtfs_dataset_name": "Delano Schedule", + "string_url": "https:\/\/data.trilliumtransit.com\/gtfs\/delano-ca-us\/delano-ca-us.zip" + } + ] } ] } diff --git a/website/assets/scss/_animations.scss b/website/assets/scss/_animations.scss new file mode 100644 index 000000000..593df8a36 --- /dev/null +++ b/website/assets/scss/_animations.scss @@ -0,0 +1,12 @@ +@keyframes fade-in { + from { + opacity: 0; + } +} + +@keyframes gentle-scale-in { + from { + opacity: 0; + transform: scale(0.9); + } +} diff --git a/website/assets/scss/style.scss b/website/assets/scss/style.scss index 6920d6f95..b6c988284 100644 --- a/website/assets/scss/style.scss +++ b/website/assets/scss/style.scss @@ -1,4 +1,5 @@ -@import 'charts'; +@import "animations"; +@import "charts"; @tailwind base; @tailwind components; @@ -10,7 +11,7 @@ } } -$text-color: #323A45; +$text-color: #323a45; html { scroll-behavior: smooth; @@ -21,7 +22,10 @@ body { overflow-y: scroll; // prevent layout jumping when page height changes } -h1, h2, h3, h4 { +h1, +h2, +h3, +h4 { @apply font-serif; small { @@ -31,8 +35,7 @@ h1, h2, h3, h4 { .btn, a.btn { - @apply - border + @apply border border-itp-slate font-semibold inline-block @@ -49,35 +52,32 @@ a.btn { text-decoration: none !important; } -input, select { - @apply - border +input, +select { + @apply border bg-white px-4 py-2 rounded; } input { - @apply - shadow-inner; + @apply shadow-inner; } select { - @apply - appearance-none + @apply appearance-none pr-9 shadow; /*! icon from bootstrap | https://github.com/twbs/bootstrap/blob/8f11c52919fb9b7142ebf9b5797f9cc1538194d2/scss/_variables.scss#L930 */ background-image: url("data:image/svg+xml,"); - background-position: right .75rem center; + background-position: right 0.75rem center; background-repeat: no-repeat; - background-size: 1em .75em; + background-size: 1em 0.75em; } input[type="search"] { - @apply - rounded-full + @apply rounded-full pl-12; /*! icon from font awesome | https://fontawesome.com/v5.15/icons/search?style=solid */ @@ -100,24 +100,21 @@ input[type="search"] { } .text-muted { - @apply - text-itp-slate-bold + @apply text-itp-slate-bold text-opacity-60; } .list-group { - @apply - bg-white + @apply bg-white divide-solid divide-y overflow-hidden rounded-md; - &__link { - @apply - block + &__link { + @apply block hover:bg-itp-teal-light p-4; - } + } } .breadcrumbs { @@ -154,3 +151,11 @@ nav { @apply bg-itp-yellow-bold/30; } } + +dialog { + animation: gentle-scale-in 0.5s cubic-bezier(0.075, 0.82, 0.165, 1); + + &::backdrop { + animation: fade-in 250ms; + } +} diff --git a/website/generate.py b/website/generate.py index 5e79dbdf5..6d33d99ba 100644 --- a/website/generate.py +++ b/website/generate.py @@ -264,6 +264,7 @@ def fetch_report_data(report_dir): p_report_path = Path(entry["report_path"]) p_report_inputs = REPORT_OUTPUTS_DIR / p_report_path.parent report_data = fetch_report_data(p_report_inputs) + report_data["feeds"] = entry["feeds"] report_html = report_template.render({**global_data, **report_data}) pbar.update(1)