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 @@
@@ -45,7 +45,7 @@ @@ -67,8 +67,11 @@