DEVELOPMENT ENVIRONMENT

~liljamo/tixe

ba663aeafccca79502e72cc44d192be3bdce138c — Jonni Liljamo 1 year, 1 month ago b76c914
feat: remove login divider, add config option for oidc visual in login
4 files changed, 21 insertions(+), 21 deletions(-)

M config/config.go
M handlers/login.go
M static/styles.css
M template/templates/login.tmpl
M config/config.go => config/config.go +4 -0
@@ 26,6 26,8 @@ type Config struct {
	OidcDomain   string
	OidcClientID string
	OidcSecret   string
	// What is written on the login button
	OidcLoginVisual string
}

func ParseConfig() {


@@ 46,5 48,7 @@ func ParseConfig() {
		OidcDomain: util.LoadVar("TIXE_OIDC_DOMAIN", ""),
		OidcClientID: util.LoadVar("TIXE_OIDC_CLIENTID", ""),
		OidcSecret: util.LoadVar("TIXE_OIDC_SECRET", ""),

		OidcLoginVisual: util.LoadVar("TIXE_OIDC_LOGIN_VISUAL", "oidc"),
	}
}

M handlers/login.go => handlers/login.go +2 -1
@@ 2,12 2,13 @@ package handlers

import (
	"net/http"
	"tixe/config"
	"tixe/template"

	"github.com/gin-gonic/gin"
)

func Login(c *gin.Context) {
	html := template.TmplEngine.Render("login.tmpl", map[string]interface{}{"notauthed": true})
	html := template.TmplEngine.Render("login.tmpl", map[string]interface{}{"notauthed": true, "oidcloginvisual": config.TixeConfig.OidcLoginVisual})
	c.Data(http.StatusOK, "text/html", html)
}

M static/styles.css => static/styles.css +14 -14
@@ 549,14 549,14 @@ video {
  min-width: max-content;
}

.max-w-4xl {
  max-width: 56rem;
}

.max-w-3xl {
  max-width: 48rem;
}

.max-w-4xl {
  max-width: 56rem;
}

.grow {
  flex-grow: 1;
}


@@ 618,18 618,18 @@ video {
  background-image: linear-gradient(to right, var(--tw-gradient-stops));
}

.from-slate-600 {
  --tw-gradient-from: #475569 var(--tw-gradient-from-position);
  --tw-gradient-to: rgb(71 85 105 / 0) var(--tw-gradient-to-position);
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}

.from-neutral-500 {
  --tw-gradient-from: #737373 var(--tw-gradient-from-position);
  --tw-gradient-to: rgb(115 115 115 / 0) var(--tw-gradient-to-position);
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}

.from-slate-600 {
  --tw-gradient-from: #475569 var(--tw-gradient-from-position);
  --tw-gradient-to: rgb(71 85 105 / 0) var(--tw-gradient-to-position);
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}

.from-transparent {
  --tw-gradient-from: transparent var(--tw-gradient-from-position);
  --tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);


@@ 641,14 641,14 @@ video {
  --tw-gradient-stops: var(--tw-gradient-from), #60a5fa var(--tw-gradient-via-position), var(--tw-gradient-to);
}

.to-rose-500 {
  --tw-gradient-to: #f43f5e var(--tw-gradient-to-position);
}

.to-neutral-500 {
  --tw-gradient-to: #737373 var(--tw-gradient-to-position);
}

.to-rose-500 {
  --tw-gradient-to: #f43f5e var(--tw-gradient-to-position);
}

.to-transparent {
  --tw-gradient-to: transparent var(--tw-gradient-to-position);
}

M template/templates/login.tmpl => template/templates/login.tmpl +1 -6
@@ 4,11 4,6 @@
		rounded-md drop-shadow-md
		bg-slate-50 hover:bg-slate-200 transition-colors"
	href="/auth/login">
	Liljamo Auth
	{{ .oidcloginvisual }}
</a>
<div class="max-w-3xl w-full flex items-center gap-4">
	<div class="grow my-12 h-px border-t-0 bg-transparent bg-gradient-to-r from-transparent to-neutral-500 opacity-75 dark:opacity-100"></div>
  <div class="grow-0">OR</div>
  <div class="grow my-12 h-px border-t-0 bg-transparent bg-gradient-to-r from-neutral-500 to-transparent opacity-75 dark:opacity-100"></div>
</div>
{{ end }}