Hide filename input when force random is on

This commit is contained in:
Andrei Marcu 2019-01-26 02:12:49 -08:00
parent 8f3108148b
commit cde964ffe0
3 changed files with 11 additions and 10 deletions

View File

@ -131,14 +131,15 @@ func fileDisplayHandler(c web.C, w http.ResponseWriter, r *http.Request) {
} }
err = renderTemplate(tpl, pongo2.Context{ err = renderTemplate(tpl, pongo2.Context{
"mime": metadata.Mimetype, "mime": metadata.Mimetype,
"filename": fileName, "filename": fileName,
"size": sizeHuman, "size": sizeHuman,
"expiry": expiryHuman, "expiry": expiryHuman,
"expirylist": listExpirationTimes(), "expirylist": listExpirationTimes(),
"extra": extra, "extra": extra,
"lines": lines, "forcerandom": Config.forceRandomFilename,
"files": metadata.ArchiveFiles, "lines": lines,
"files": metadata.ArchiveFiles,
}, r, w) }, r, w)
if err != nil { if err != nil {

View File

@ -22,7 +22,7 @@
</select> </select>
</div> </div>
<input class="codebox" name='filename' id="filename" type='text' value="" placeholder="filename">.<input id="extension" class="codebox" name='extension' type='text' value="{{ extra.extension }}" placeholder="txt"> {% if not forcerandom %}<input class="codebox" name='filename' id="filename" type='text' value="" placeholder="filename">{% endif %}.<input id="extension" class="codebox" name='extension' type='text' value="{{ extra.extension }}" placeholder="txt">
<textarea name='content' id="newcontent" class="editor"></textarea> <textarea name='content' id="newcontent" class="editor"></textarea>
</form> </form>
</div> </div>

View File

@ -20,7 +20,7 @@
</select> </select>
</div> </div>
<input class="codebox" name='filename' id="filename" type='text' value="" placeholder="filename">.<input id="extension" class="codebox" name='extension' type='text' value="story" placeholder="txt"> {% if not forcerandom %}<input class="codebox" name='filename' id="filename" type='text' value="" placeholder="filename">{% endif %}.<input id="extension" class="codebox" name='extension' type='text' value="story" placeholder="txt">
<textarea name='content' id="newcontent" class="editor"></textarea> <textarea name='content' id="newcontent" class="editor"></textarea>
</form> </form>
</div> </div>