From 058e72ef509991505b3324d46b5ac4087a7271d1 Mon Sep 17 00:00:00 2001 From: "m.nabokikh" Date: Wed, 30 Oct 2019 03:33:52 +0400 Subject: [PATCH] Pick icons on login screen by connector type instead of ID Signed-off-by: m.nabokikh --- server/handlers.go | 7 +++---- server/templates.go | 1 + web/static/main.css | 4 ++-- web/templates/login.html | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/server/handlers.go b/server/handlers.go index 0f5b0d23..0449c891 100644 --- a/server/handlers.go +++ b/server/handlers.go @@ -259,16 +259,15 @@ func (s *Server) handleAuthorization(w http.ResponseWriter, r *http.Request) { } connectorInfos := make([]connectorInfo, len(connectors)) - i := 0 - for _, conn := range connectors { - connectorInfos[i] = connectorInfo{ + for index, conn := range connectors { + connectorInfos[index] = connectorInfo{ ID: conn.ID, Name: conn.Name, + Type: conn.Type, // TODO(ericchiang): Make this pass on r.URL.RawQuery and let something latter // on create the auth request. URL: s.absPath("/auth", conn.ID) + "?req=" + authReq.ID, } - i++ } if err := s.templates.login(r, w, connectorInfos, r.URL.Path); err != nil { diff --git a/server/templates.go b/server/templates.go index 88aeace0..37ce60a4 100644 --- a/server/templates.go +++ b/server/templates.go @@ -246,6 +246,7 @@ type connectorInfo struct { ID string Name string URL string + Type string } type byName []connectorInfo diff --git a/web/static/main.css b/web/static/main.css index 552479ad..2e6ce338 100644 --- a/web/static/main.css +++ b/web/static/main.css @@ -68,12 +68,12 @@ body { background-size: contain; } -.dex-btn-icon--bitbucket { +.dex-btn-icon--bitbucket-cloud { background-color: #205081; background-image: url(../static/img/bitbucket-icon.svg); } -.dex-btn-icon--ldap, .dex-btn-icon--tectonic-ldap { +.dex-btn-icon--ldap { background-color: #84B6EF; background-image: url(../static/img/ldap-icon.svg); } diff --git a/web/templates/login.html b/web/templates/login.html index 56151a78..f432dd00 100644 --- a/web/templates/login.html +++ b/web/templates/login.html @@ -7,7 +7,7 @@