ui: hide create/open pad buttons on index page (#3974)

if requireSession or editOnly is set these buttons always fail
This commit is contained in:
ssendev 2020-06-01 19:28:13 +02:00 committed by GitHub
parent bfca481b0b
commit 0b7ace83d5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 6 deletions

View file

@ -1,6 +1,7 @@
{
"index.newPad": "New Pad",
"index.createOpenPad": "or create/open a Pad with the name:",
"index.openPad": "open an existing Pad with the name:",
"pad.toolbar.bold.title": "Bold (Ctrl+B)",
"pad.toolbar.italic.title": "Italic (Ctrl+I)",

View file

@ -161,12 +161,18 @@
<div id="wrapper">
<% e.begin_block("indexWrapper"); %>
<div id="inner">
<button id="button" onclick="go2Random()" data-l10n-id="index.newPad"></button>
<label id="label" for="padname" data-l10n-id="index.createOpenPad"></label>
<form action="#" onsubmit="go2Name();return false;">
<input type="text" id="padname" maxlength="50" autofocus x-webkit-speech>
<button type="submit">OK</button>
</form>
<% if (!settings.requireSession) { %>
<% if (settings.editOnly) { %>
<label id="label" for="padname" data-l10n-id="index.openPad"></label>
<% } else {%>
<button id="button" onclick="go2Random()" data-l10n-id="index.newPad"></button>
<label id="label" for="padname" data-l10n-id="index.createOpenPad"></label>
<% } %>
<form action="#" onsubmit="go2Name();return false;">
<input type="text" id="padname" maxlength="50" autofocus x-webkit-speech>
<button type="submit">OK</button>
</form>
<% } %>
</div>
<% e.end_block(); %>
</div>