Skip to content

Commit

Permalink
fix login buttons style
Browse files Browse the repository at this point in the history
  • Loading branch information
ubaldus committed Sep 7, 2024
1 parent 473a37e commit 36bdffb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion sys/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
package sys

const Name = "Tibula"
const Version = "17.9.6"
const Version = "17.9.7"

var Options TypeConfig
var Commands TypeCommand
4 changes: 1 addition & 3 deletions web/assets/static/js/tibula.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,13 @@ document.getElementById('ejaForm').addEventListener('submit', function(event) {

window.onload = function() {
if (document.getElementsByName('ejaGoogleSsoId').length > 0) {
document.body.innerHTML+='<div id="google" style="width:225px;margin:0 auto;"></div>';
google.accounts.id.initialize({
client_id: document.getElementsByName('ejaGoogleSsoId')[0].value,
callback: function(e) {
document.getElementsByName('ejaValues[googleSsoToken]')[0].value=e.credential
document.getElementById('ejaForm').submit()
}
})
google.accounts.id.renderButton(document.getElementById("google"),{ theme: "outline", size: "large", width: document.getElementById('google').style.width })
document.getElementsByName('ejaAction')[0].style.width=document.getElementById('google').style.width
google.accounts.id.renderButton(document.getElementById("google"),{ width: document.getElementsByName('ejaAction')[0].offsetWidth })
}
}
5 changes: 3 additions & 2 deletions web/assets/templates/Login.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@ <h2 class="text-center mt-2">Tibula</h2>
<label for="username" class="form-label">Username</label>
<input type="text" id="username" name="ejaValues[username]" class="form-control" required>
</div>
<div class="mb-3">
<div class="mb-4">
<label for="password" class="form-label">Password</label>
<input type="password" id="password" name="ejaValues[password]" class="form-control" required>
</div>
<div class="mb-3 text-center">
<div class="mb-3 d-grid col-6 mx-auto gap-2">
<button type="submit" name="ejaAction" value="login" class="btn btn-primary">Login</button>
{{if .GoogleSsoId }}
<input type="hidden" name="ejaGoogleSsoId" value="{{.GoogleSsoId}}">
<input type="hidden" name="ejaValues[googleSsoToken]" value="">
<div id="google"><div>
{{end}}
</div>
</div>
Expand Down

0 comments on commit 36bdffb

Please sign in to comment.