Skip to content

Commit feb97b8

Browse files
authored
Merge pull request #200 from GeoNet/newnewlogo
New ESNZ logo
2 parents 93e1f03 + 2e59341 commit feb97b8

17 files changed

Lines changed: 107 additions & 68 deletions

ui/dev_server/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ func main() {
3232
http.Handle("/", fs) // Serve static files
3333
http.Handle("/geonetheader", http.HandlerFunc(testUIhandler))
3434
http.Handle("/geonetfooter", http.HandlerFunc(testUIhandler))
35-
http.Handle(footer.ReturnFooterAssetPattern(), footer.ReturnFooterAssetServer())
3635
http.Handle("/geonetheaderbasic", http.HandlerFunc(testUIhandler))
3736

3837
log.Println("starting server")
@@ -63,6 +62,7 @@ func testUIhandler(w http.ResponseWriter, req *http.Request) {
6362
{
6463
URL: "https://www.rcet.science",
6564
LogoURL: "/example_extra_logo.png",
65+
Alt: "RCET logo",
6666
},
6767
},
6868
}

ui/geonet_footer/footer.css

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,7 @@
11
/* Projects that import the GeoNet header must contain the following CSS in
2-
the HTML files that use it. These are CSS for some image/s, and extra styles on top of the standard
2+
the HTML files that use it. These are extra styles on top of the standard
33
GeoNet Bootstrap.css file (which also needs to be present) */
44

5-
.esi-logo {
6-
object-fit: contain;
7-
max-width: 180px;
8-
max-height: 68.7px;
9-
width: 100%;
10-
height: 100%
11-
}
12-
135
/* Bootstrap overrides - this should be changed in the main Bootstrap file at some point*/
146
#footer .row {
157
width: auto !important;
@@ -18,4 +10,4 @@ GeoNet Bootstrap.css file (which also needs to be present) */
1810
margin-top: 20px;
1911
padding: 20px 0 20px;
2012
border-top: 1px solid #e5e5e5;
21-
}
13+
}

ui/geonet_footer/footer.go

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@ package geonet_footer
22

33
import (
44
"bytes"
5-
"embed"
5+
_ "embed"
66
"html/template"
7-
"net/http"
8-
"path"
97
)
108

119
//go:embed footer.html
@@ -21,22 +19,24 @@ var nhcLogo template.HTML
2119
//go:embed images/toka_tu_ake_nhc_logo_stacked.svg
2220
var nhcLogoStacked template.HTML
2321

24-
//go:embed images/footer_pngs/*
25-
var FooterAssetServer embed.FS
22+
//go:embed images/esnz_logo.svg
23+
var esnzLogo template.HTML
2624

27-
const FOOTER_ASSET_DIR = "/images/footer_pngs/"
25+
//go:embed images/esnz_logo_stacked.svg
26+
var esnzLogoStacked template.HTML
2827

2928
type FooterConfig struct {
3029
// Whether to use relative links in footer. If false, uses www.geonet.org.nz.
3130
UseRelativeLinks bool
3231
// The origin to be used at the beginning of GeoNet links in the footer.
3332
// Cannot be changed.
3433
Origin string
35-
// The GeoNet, ESI, and NHC logos are fixed and cannot be changed.
36-
GeoNetLogo template.HTML
37-
EsiLogo string
38-
NhcLogo template.HTML
39-
NhcLogoStacked template.HTML
34+
// The GeoNet, ESNZ, and NHC logos are fixed and cannot be changed.
35+
GeoNetLogo template.HTML
36+
EsnzLogo template.HTML
37+
EsnzLogoStacked template.HTML
38+
NhcLogo template.HTML
39+
NhcLogoStacked template.HTML
4040
// URLs for extra logos to be added to the footer can be passed in.
4141
ExtraLogos []FooterLogo
4242
// Set whether footer is a stripped down, basic version.
@@ -49,6 +49,8 @@ type FooterLogo struct {
4949
URL string
5050
// The URL to the logo image.
5151
LogoURL string
52+
// The alt text to add to the logo image.
53+
Alt string
5254
}
5355

5456
// ReturnGeoNetFooter returns HTML for the main GeoNet footer that
@@ -58,7 +60,8 @@ func ReturnGeoNetFooter(config FooterConfig) (template.HTML, error) {
5860
var contents template.HTML
5961

6062
config.GeoNetLogo = geonetLogo
61-
config.EsiLogo = path.Join(FOOTER_ASSET_DIR, "esi_logo_cropped_downsized.png")
63+
config.EsnzLogo = esnzLogo
64+
config.EsnzLogoStacked = esnzLogoStacked
6265
config.NhcLogo = nhcLogo
6366
config.NhcLogoStacked = nhcLogoStacked
6467

@@ -72,13 +75,3 @@ func ReturnGeoNetFooter(config FooterConfig) (template.HTML, error) {
7275
}
7376
return template.HTML(b.String()), nil // nolint: gosec // The source is our HTML file.
7477
}
75-
76-
// ReturnFooterAssetServer returns a handler for serving embedded PNGs for the footer.
77-
func ReturnFooterAssetServer() http.Handler {
78-
return http.FileServer(http.FS(FooterAssetServer))
79-
}
80-
81-
// ReturnFooterAssetPattern returns the path pattern for the footer asset server.
82-
func ReturnFooterAssetPattern() string {
83-
return FOOTER_ASSET_DIR
84-
}

ui/geonet_footer/footer.html

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<div class="row">
3131
<div class="col-12 d-md-none pb-4">
3232
<a target="_blank" href="https://earthsciences.nz" rel="external noopener noreferrer">
33-
<img class="esi-logo" src={{.EsiLogo}} alt="Earth Sciences New Zealand logo">
33+
{{.EsnzLogo}}
3434
</a>
3535
</div>
3636
</div>
@@ -45,7 +45,7 @@
4545
<div class="row">
4646
<div class="col-12 d-md-none pb-4">
4747
<a target="_blank" href="{{$logo.URL}}" rel="external noopener noreferrer">
48-
<img src="{{$logo.LogoURL}}" width="150px">
48+
<img src="{{$logo.LogoURL}}" width="150px" alt="{{$logo.Alt}}">
4949
</a>
5050
</div>
5151
</div>
@@ -67,8 +67,11 @@
6767
<div class="col-md-3 d-none d-md-block">
6868
<div class="row d-flex align-items-center">
6969
<div class="col-xl-6 col-12">
70-
<a target="_blank" href="https://earthsciences.nz" rel="external noopener noreferrer">
71-
<img class="esi-logo" src={{.EsiLogo}} alt="Earth Sciences New Zealand logo">
70+
<a class="d-none d-xl-block pt-1" target="_blank" href="https://earthsciences.nz" rel="external noopener noreferrer">
71+
{{.EsnzLogoStacked}}
72+
</a>
73+
<a class="d-block d-xl-none" target="_blank" href="https://earthsciences.nz" rel="external noopener noreferrer">
74+
{{.EsnzLogo}}
7275
</a>
7376
</div>
7477
<div class="col-xl-6 col-12">
@@ -84,7 +87,7 @@
8487
<div class="row">
8588
<div class="col-12">
8689
<a target="_blank" href="{{$logo.URL}}" rel="external noopener noreferrer">
87-
<img src="{{$logo.LogoURL}}" class="pt-3" width="100%">
90+
<img src="{{$logo.LogoURL}}" class="pt-3" width="100%" alt="{{$logo.Alt}}">
8891
</a>
8992
</div>
9093
</div>

0 commit comments

Comments
 (0)