2026-01-13 15:35:11 -05:00

98 lines
5.3 KiB
HTML

{if="empty($batch_mode)"}
<!DOCTYPE html>
<html{if="$language !== 'auto'"} lang="{$language}"{/if}>
<head>
{$pageName="editlink"}
{include="includes"}
</head>
<body {if="!empty($_GET['source']) && $_GET['source']=='bookmarklet'"}class="from-bookmarklet"{/if}>
{include="page.header"}
{else}
{ignore}Lil hack: when included in a loop in batch mode, `$value` is assigned by RainTPL with template vars.{/ignore}
{function="extract($value) ? '' : ''"}
{/if}
{$asyncLoadClass=$link_is_new && $async_metadata && empty($link.title) ? 'loading-wrapper' : ''}
{if="!isset($index)"}
{$index=""}
{/if}
<div id="editlinkform{$index}" class="editlinkform container page-edit">
<div class="row editlinkform-row">
<div class="col-md-6 col-md-offset-3 editlinkform-col">
<form method="post" name="linkform" class="card" action="{$base_path}/admin/shaare">
{if="isset($link.id)"}
<input type="hidden" name="lf_id" value="{$link.id}">
{/if}
<input type="hidden" name="token" value="{$token}">
<input type="hidden" name="source" value="{$source}">
{if="$http_referer"}
<input type="hidden" name="returnurl" value="{$http_referer}">
{/if}
<div class="card-header">
{if="!$link_is_new"}Edit Bookmark{else}New Bookmark{/if}
{if="!$link_is_new"}<span class="card-subheader" style="font-size:0.85rem; color:var(--text-muted); font-weight:normal;"> - {'created on'|t} {$link.created|format_date}</span>{/if}
</div>
<div class="card-body">
<div class="form-group">
<label class="form-label" for="lf_url{$index}">{'URL'|t}</label>
<input type="text" class="form-control" name="lf_url" id="lf_url{$index}" value="{$link.url}" placeholder="https://...">
</div>
<div class="form-group">
<label class="form-label" for="lf_title{$index}">{'Title'|t}</label>
<div class="{$asyncLoadClass}">
<input type="text" class="form-control" name="lf_title" id="lf_title{$index}" {if="empty($batch_mode) && $link.title==''"}class="autofocus form-control"{else}class="form-control"{/if} value="{$link.title}" placeholder="Page title">
</div>
</div>
<div class="form-group">
<label class="form-label" for="lf_description{$index}">{'Description'|t}</label>
<div class="{$asyncLoadClass}">
<textarea class="form-control" name="lf_description" id="lf_description{$index}" {if="empty($batch_mode) && $link.description==''"}class="autofocus form-control"{/if} placeholder="Add a description..." rows="5">{$link.description}</textarea>
</div>
{if="$formatter==='markdown'"}
<div class="sublabel">
{'Description will be rendered with'|t} <a href="http://daringfireball.net/projects/markdown/syntax" target="_blank" rel="noopener">{'Markdown syntax'|t}</a>.
</div>
{/if}
</div>
<div class="form-group">
<label class="form-label" for="lf_tags{$index}">{'Tags'|t}</label>
<div class="{$asyncLoadClass}">
<input type="text" class="form-control" id="lf_tags{$index}" name="lf_tags" {if="empty($batch_mode)"}class="autofocus form-control"{/if} value="{$link.tags}"
data-list="{loop="$tags"}{$key}, {/loop}" data-multiple autocomplete="off" placeholder="tags, separated, by, commas" />
</div>
</div>
{if="isset($edit_link_plugin)"}
{loop="$edit_link_plugin"}
<div class="form-group">
{$value}
</div>
{/loop}
{/if}
<div class="form-group checkbox-wrapper">
<input type="checkbox" {if="$link.private === true"}checked="checked"{/if} name="lf_private" id="lf_private{$index}" style="width:auto;"/>
<label for="lf_private{$index}" style="margin:0;">{'Private bookmark'|t}</label>
</div>
</div>
<div class="card-footer">
{if="!empty($batch_mode)"}
<button type="button" name="cancel-batch-link" class="btn btn-secondary">{'Cancel'|t}</button>
{/if}
{if="!$link_is_new"}
<a href="{$base_path}/admin/shaare/delete?id={$link.id}&amp;token={$token}"
onclick="return confirm('Delete this bookmark?');"
class="btn btn-danger">{'Delete'|t}</a>
{/if}
<button type="submit" name="save_edit" class="btn btn-primary">{'Save'|t}</button>
</div>
</form>
</div>
</div>
</div>
{if="empty($batch_mode)"}
{include="page.footer"}
{/if}
</body>
</html>