diff --git a/ui/dev_server/server.go b/ui/dev_server/server.go index 437913a8..8486775f 100644 --- a/ui/dev_server/server.go +++ b/ui/dev_server/server.go @@ -32,7 +32,6 @@ func main() { http.Handle("/", fs) // Serve static files http.Handle("/geonetheader", http.HandlerFunc(testUIhandler)) http.Handle("/geonetfooter", http.HandlerFunc(testUIhandler)) - http.Handle(footer.ReturnFooterAssetPattern(), footer.ReturnFooterAssetServer()) http.Handle("/geonetheaderbasic", http.HandlerFunc(testUIhandler)) log.Println("starting server") @@ -63,6 +62,7 @@ func testUIhandler(w http.ResponseWriter, req *http.Request) { { URL: "https://www.rcet.science", LogoURL: "/example_extra_logo.png", + Alt: "RCET logo", }, }, } diff --git a/ui/geonet_footer/footer.css b/ui/geonet_footer/footer.css index bb587d75..cd5c8731 100644 --- a/ui/geonet_footer/footer.css +++ b/ui/geonet_footer/footer.css @@ -1,15 +1,7 @@ /* Projects that import the GeoNet header must contain the following CSS in -the HTML files that use it. These are CSS for some image/s, and extra styles on top of the standard +the HTML files that use it. These are extra styles on top of the standard GeoNet Bootstrap.css file (which also needs to be present) */ -.esi-logo { - object-fit: contain; - max-width: 180px; - max-height: 68.7px; - width: 100%; - height: 100% -} - /* Bootstrap overrides - this should be changed in the main Bootstrap file at some point*/ #footer .row { width: auto !important; @@ -18,4 +10,4 @@ GeoNet Bootstrap.css file (which also needs to be present) */ margin-top: 20px; padding: 20px 0 20px; border-top: 1px solid #e5e5e5; -} \ No newline at end of file +} diff --git a/ui/geonet_footer/footer.go b/ui/geonet_footer/footer.go index 5e58edef..8d9dd81b 100644 --- a/ui/geonet_footer/footer.go +++ b/ui/geonet_footer/footer.go @@ -2,10 +2,8 @@ package geonet_footer import ( "bytes" - "embed" + _ "embed" "html/template" - "net/http" - "path" ) //go:embed footer.html @@ -21,10 +19,11 @@ var nhcLogo template.HTML //go:embed images/toka_tu_ake_nhc_logo_stacked.svg var nhcLogoStacked template.HTML -//go:embed images/footer_pngs/* -var FooterAssetServer embed.FS +//go:embed images/esnz_logo.svg +var esnzLogo template.HTML -const FOOTER_ASSET_DIR = "/images/footer_pngs/" +//go:embed images/esnz_logo_stacked.svg +var esnzLogoStacked template.HTML type FooterConfig struct { // Whether to use relative links in footer. If false, uses www.geonet.org.nz. @@ -32,11 +31,12 @@ type FooterConfig struct { // The origin to be used at the beginning of GeoNet links in the footer. // Cannot be changed. Origin string - // The GeoNet, ESI, and NHC logos are fixed and cannot be changed. - GeoNetLogo template.HTML - EsiLogo string - NhcLogo template.HTML - NhcLogoStacked template.HTML + // The GeoNet, ESNZ, and NHC logos are fixed and cannot be changed. + GeoNetLogo template.HTML + EsnzLogo template.HTML + EsnzLogoStacked template.HTML + NhcLogo template.HTML + NhcLogoStacked template.HTML // URLs for extra logos to be added to the footer can be passed in. ExtraLogos []FooterLogo // Set whether footer is a stripped down, basic version. @@ -49,6 +49,8 @@ type FooterLogo struct { URL string // The URL to the logo image. LogoURL string + // The alt text to add to the logo image. + Alt string } // ReturnGeoNetFooter returns HTML for the main GeoNet footer that @@ -58,7 +60,8 @@ func ReturnGeoNetFooter(config FooterConfig) (template.HTML, error) { var contents template.HTML config.GeoNetLogo = geonetLogo - config.EsiLogo = path.Join(FOOTER_ASSET_DIR, "esi_logo_cropped_downsized.png") + config.EsnzLogo = esnzLogo + config.EsnzLogoStacked = esnzLogoStacked config.NhcLogo = nhcLogo config.NhcLogoStacked = nhcLogoStacked @@ -72,13 +75,3 @@ func ReturnGeoNetFooter(config FooterConfig) (template.HTML, error) { } return template.HTML(b.String()), nil // nolint: gosec // The source is our HTML file. } - -// ReturnFooterAssetServer returns a handler for serving embedded PNGs for the footer. -func ReturnFooterAssetServer() http.Handler { - return http.FileServer(http.FS(FooterAssetServer)) -} - -// ReturnFooterAssetPattern returns the path pattern for the footer asset server. -func ReturnFooterAssetPattern() string { - return FOOTER_ASSET_DIR -} diff --git a/ui/geonet_footer/footer.html b/ui/geonet_footer/footer.html index b7943cec..1c89714b 100644 --- a/ui/geonet_footer/footer.html +++ b/ui/geonet_footer/footer.html @@ -30,7 +30,7 @@
- + {{.EsnzLogo}}
@@ -45,7 +45,7 @@
- + {{$logo.Alt}}
@@ -67,8 +67,11 @@
@@ -84,7 +87,7 @@ diff --git a/ui/geonet_footer/images/esnz_logo.svg b/ui/geonet_footer/images/esnz_logo.svg new file mode 100644 index 00000000..20bbd703 --- /dev/null +++ b/ui/geonet_footer/images/esnz_logo.svg @@ -0,0 +1,39 @@ + + + Earth Sciences New Zealand logo + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ui/geonet_footer/images/esnz_logo_stacked.svg b/ui/geonet_footer/images/esnz_logo_stacked.svg new file mode 100644 index 00000000..465d3a20 --- /dev/null +++ b/ui/geonet_footer/images/esnz_logo_stacked.svg @@ -0,0 +1,38 @@ + + + Earth Sciences New Zealand logo + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ui/geonet_footer/images/footer_pngs/esi_logo.png b/ui/geonet_footer/images/footer_pngs/esi_logo.png deleted file mode 100644 index 146857f2..00000000 Binary files a/ui/geonet_footer/images/footer_pngs/esi_logo.png and /dev/null differ diff --git a/ui/geonet_footer/images/footer_pngs/esi_logo_cropped.png b/ui/geonet_footer/images/footer_pngs/esi_logo_cropped.png deleted file mode 100644 index ea7df4a8..00000000 Binary files a/ui/geonet_footer/images/footer_pngs/esi_logo_cropped.png and /dev/null differ diff --git a/ui/geonet_footer/images/footer_pngs/esi_logo_cropped_downsized.png b/ui/geonet_footer/images/footer_pngs/esi_logo_cropped_downsized.png deleted file mode 100644 index c604a08d..00000000 Binary files a/ui/geonet_footer/images/footer_pngs/esi_logo_cropped_downsized.png and /dev/null differ diff --git a/ui/geonet_footer/images/geonet_logo.svg b/ui/geonet_footer/images/geonet_logo.svg index 5b23d0f7..89927a85 100644 --- a/ui/geonet_footer/images/geonet_logo.svg +++ b/ui/geonet_footer/images/geonet_logo.svg @@ -1 +1 @@ - \ No newline at end of file +GeoNet logo diff --git a/ui/geonet_footer/images/geonet_logo_dark_blue.svg b/ui/geonet_footer/images/geonet_logo_dark_blue.svg deleted file mode 100644 index 756a1e75..00000000 --- a/ui/geonet_footer/images/geonet_logo_dark_blue.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/ui/geonet_footer/images/geonet_logo_red.svg b/ui/geonet_footer/images/geonet_logo_red.svg deleted file mode 100644 index 78b10b79..00000000 --- a/ui/geonet_footer/images/geonet_logo_red.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/ui/geonet_footer/images/geonet_logo_white.svg b/ui/geonet_footer/images/geonet_logo_white.svg deleted file mode 100644 index ed97fe61..00000000 --- a/ui/geonet_footer/images/geonet_logo_white.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/ui/geonet_footer/images/gns_logo.svg b/ui/geonet_footer/images/gns_logo.svg deleted file mode 100644 index 39033258..00000000 --- a/ui/geonet_footer/images/gns_logo.svg +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ui/geonet_footer/images/toka_tu_ake_nhc_logo.svg b/ui/geonet_footer/images/toka_tu_ake_nhc_logo.svg index 31aa3542..fc643ea1 100644 --- a/ui/geonet_footer/images/toka_tu_ake_nhc_logo.svg +++ b/ui/geonet_footer/images/toka_tu_ake_nhc_logo.svg @@ -1 +1 @@ - \ No newline at end of file +Natural Hazards Commission Toka Tū Ake logo diff --git a/ui/geonet_footer/images/toka_tu_ake_nhc_logo_stacked.svg b/ui/geonet_footer/images/toka_tu_ake_nhc_logo_stacked.svg index 967afd3a..e36e07a2 100644 --- a/ui/geonet_footer/images/toka_tu_ake_nhc_logo_stacked.svg +++ b/ui/geonet_footer/images/toka_tu_ake_nhc_logo_stacked.svg @@ -1 +1 @@ - \ No newline at end of file +Natural Hazards Commission Toka Tū Ake logo diff --git a/ui/geonet_header/images/geonet_logo_white.svg b/ui/geonet_header/images/geonet_logo_white.svg index faa47af3..ca8422a6 100644 --- a/ui/geonet_header/images/geonet_logo_white.svg +++ b/ui/geonet_header/images/geonet_logo_white.svg @@ -1 +1 @@ - \ No newline at end of file +GeoNet logo