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:
parent
bfca481b0b
commit
0b7ace83d5
2 changed files with 13 additions and 6 deletions
|
@ -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)",
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue