1
0
mirror of https://github.com/Tygs/0bin.git synced 2023-08-10 21:13:00 +03:00
0bin/zerobin/views/paste.tpl

175 lines
6.2 KiB
Smarty
Raw Normal View History

%if "burn_after_reading" in str(paste.expiration):
2020-08-11 12:55:29 +03:00
%if keep_alive:
2020-08-12 16:22:47 +03:00
<p class="alert alert-dismissible alert-primary">
2020-08-11 17:37:03 +03:00
<a class="close" data-dismiss="alert" href="#" @click.prevent="$event.target.parentNode.remove()">×</a>
2020-08-11 12:55:29 +03:00
<strong class="title">Ok!</strong>
<span class="message">
This paste will be deleted the next time it is read.
</span>
</p>
%else:
2020-08-12 16:22:47 +03:00
<p class="alert alert-warning alert-dismissible">
2020-08-11 17:37:03 +03:00
<a class="close" data-dismiss="alert" href="#" @click.prevent="$event.target.parentNode.remove()">×</a>
2020-08-11 12:55:29 +03:00
<strong class="title">Warning!</strong>
<span class="message">
This paste has self-destructed. If you close this window,
there is no way to recover it.
</span>
</p>
%end
%end
2012-04-28 22:18:05 +04:00
<div class="well paste-form">
2020-08-11 12:55:29 +03:00
<form action="/" method="get" accept-charset="utf-8">
2012-04-26 13:38:55 +04:00
2020-08-12 10:26:17 +03:00
<div class="d-flex justify-content-between">
2020-08-12 11:19:31 +03:00
<div class="btn-group" role="group">
2020-08-12 15:02:13 +03:00
<button v-if="support.clipboard && currentPaste.type === 'text'" @click.prevent="copyToClipboard()"
type="button" id="clip-button" class="btn btn-secondary">Copy to clipboard</button>
2020-08-12 11:19:31 +03:00
<button type="button" id="email-link" class="btn btn-secondary" @click="handleSendByEmail($event)">Email
this</button>
2020-08-12 10:26:17 +03:00
</div>
2020-08-11 12:55:29 +03:00
2020-08-12 11:19:31 +03:00
<div>
2020-08-12 10:26:17 +03:00
<span class="paste-option btn-group">
2020-08-12 11:19:31 +03:00
<button class="btn btn-clone btn-secondary" @click.prevent="handleClone()">Clone</button>
<a class="btn btn-secondary download-link" :href="currentPaste.downloadLink.url"
:download="currentPaste.downloadLink.name">Download</a>
2020-08-12 11:19:31 +03:00
<button class="btn btn-secondary">New Paste</button>
2020-08-12 10:26:17 +03:00
</span>
2020-08-12 11:19:31 +03:00
</div>
</div>
2020-08-12 10:26:17 +03:00
<div class="progress-container">
2020-08-12 12:15:01 +03:00
<div class="progress active" v-show="isLoading">
<div class="progress-bar progress-bar-striped" role="progressbar"></div>
2020-08-12 10:26:17 +03:00
</div>
2020-08-11 12:55:29 +03:00
</div>
%expiration = paste.humanized_expiration
%if expiration:
2020-08-12 11:19:31 +03:00
<span id="expiration-tag">Expire {{ expiration }}</span>
2020-08-11 12:55:29 +03:00
%end
2020-08-12 17:10:37 +03:00
2020-08-13 17:53:17 +03:00
<pre id="paste-content" class="prettyprint" v-if="!readerMode">
2020-08-13 16:25:19 +03:00
<code>
{{ paste.content }}
</code>
2020-08-13 17:53:17 +03:00
</pre>
2020-08-14 12:32:14 +03:00
<div>
<div id="readable-paste-content" v-if="readerMode">
{% currentPaste.content %}
</div>
2020-08-13 18:17:46 +03:00
</div>
2012-04-26 13:38:55 +04:00
2020-08-14 17:41:45 +03:00
<div class="btc-tip-address">
Tip in bitcoin: <a
href="bitcoin:{{ paste.btc_tip_address or settings.DEFAULT_BTC_TIP_ADDRESS }}">{{ paste.btc_tip_address or settings.DEFAULT_BTC_TIP_ADDRESS}}</a>
</div>
2020-08-12 11:11:51 +03:00
<div class="d-flex justify-content-between down">
2020-08-12 11:19:31 +03:00
<div v-if="currentPaste.ownerKey">
<button class="btn btn-clone btn-secondary" @click="handleDeletePaste()">Delete Paste</button>
</div>
<div>
2020-08-12 11:11:51 +03:00
<span class="paste-option btn-group">
2020-08-12 11:19:31 +03:00
<button class="btn btn-clone btn-secondary" @click.prevent="handleClone()">Clone</button>
<a class="btn btn-secondary download-link" :href="currentPaste.downloadLink.url"
:download="currentPaste.downloadLink.name"> Download</a>
2020-08-11 12:55:29 +03:00
2020-08-12 11:19:31 +03:00
<button class="btn btn-secondary">New Paste</button>
2020-08-12 11:11:51 +03:00
</span>
2020-08-12 11:19:31 +03:00
</div>
2020-08-12 10:26:17 +03:00
</div>
2012-04-26 13:38:55 +04:00
2020-08-11 12:55:29 +03:00
</form>
2012-04-28 12:26:36 +04:00
</div>
2012-04-28 21:55:00 +04:00
<!-- For cloning -->
<div class="submit-form clone">
2020-08-11 17:37:03 +03:00
<form class="well" method="post" action="/paste/create" @submit.prevent="encryptAndSendPaste()">
2020-08-12 10:26:17 +03:00
<div class="d-flex justify-content-between">
2020-08-12 11:19:31 +03:00
2020-08-12 10:26:17 +03:00
<div>
2020-08-12 11:19:31 +03:00
<div class="file-upload">
<button type="button" class="btn btn-danger" @click.prevent="handleCancelClone()">Cancel clone</button>
2020-08-12 10:26:17 +03:00
</div>
2020-08-12 11:19:31 +03:00
</div>
2020-08-12 10:26:17 +03:00
<div class="form-group select-date-clone paste-option">
2020-08-12 11:19:31 +03:00
<div class="input-group">
2020-08-12 11:11:51 +03:00
<select id="expiration" name="expiration" class="custom-select" v-model="newPaste.expiration">
2020-08-12 10:26:17 +03:00
<option value="burn_after_reading">Burn after reading</option>
2020-08-12 17:10:37 +03:00
<option selected value="1_day">Expire in 1 day</option>
<option value="1_month">Expire in 1 month</option>
<option value="never">Never expire</option>
2020-08-12 10:26:17 +03:00
</select>
2020-08-12 11:19:31 +03:00
<div class="input-group-append">
2020-08-12 10:26:17 +03:00
<button type="submit" class="btn btn-primary">Submit</button>
</div>
</div>
2020-08-12 10:26:17 +03:00
</div>
2020-08-12 11:19:31 +03:00
</div>
<div class="progress-container progress-clone">
2020-08-12 12:15:01 +03:00
<div class="progress active" v-show="isLoading">
<div class="progress-bar progress-bar-striped" role="progressbar"></div>
2020-08-11 12:55:29 +03:00
</div>
2013-01-24 13:59:25 +04:00
</div>
2020-08-11 12:55:29 +03:00
2020-08-12 11:19:31 +03:00
<div>
2020-08-12 15:14:13 +03:00
<textarea rows="10" style="width:100%;" class=" form-control" @keydown.ctrl.enter="encryptAndSendPaste()"
2020-08-12 11:19:31 +03:00
id="content" name="content"></textarea>
2020-08-14 17:41:45 +03:00
<p>
<input type="text" class="paste-excerpt" name="paste-excerpt"
placeholder="Optional paste title. This part is NOT encrypted: anything you type here will be visible by anyone"
v-model="newPaste.title" maxlength="60">
</p>
<p>
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon1">BTC tip</span>
</div>
<input type="text" class="form-control paste-btc-tip-address" name="paste-btc-tip-address"
placeholder="Put a BTC address to ask for a tip" v-model="newPaste.btcTipAddress" maxlength="50">
</div>
</p>
2013-01-24 13:59:25 +04:00
</div>
2020-08-12 11:11:51 +03:00
<div class="d-flex justify-content-between" v-if="displayBottomToolBar">>
2020-08-12 11:19:31 +03:00
2020-08-12 11:11:51 +03:00
<div>
<label class="col-form-label">&nbsp;</label>
2020-08-12 11:19:31 +03:00
<div class="file-upload">
<button type="button" class="btn btn-danger" @click.prevent="handleCancelClone()">Cancel clone</button>
2020-08-12 11:11:51 +03:00
</div>
2020-08-12 11:19:31 +03:00
</div>
2020-08-12 11:11:51 +03:00
<div class="form-group select-date-clone paste-option">
2020-08-12 11:19:31 +03:00
<div class="input-group">
2020-08-12 11:11:51 +03:00
<select id="expiration" name="expiration" class="custom-select" v-model="newPaste.expiration">
<option value="burn_after_reading">Burn after reading</option>
2020-08-12 17:10:37 +03:00
<option selected value="1_day">Expire in 1 day</option>
<option value="1_month">Expire in 1 month</option>
<option value="never">Never expire</option>
2020-08-12 11:11:51 +03:00
</select>
2020-08-12 11:19:31 +03:00
<div class="input-group-append">
2020-08-12 11:11:51 +03:00
<button type="submit" class="btn btn-primary">Submit</button>
</div>
</div>
</div>
2020-08-12 11:19:31 +03:00
</div>
</form>
</div>
2012-04-28 21:55:00 +04:00
2015-05-10 20:19:02 +03:00
% rebase("base", settings=settings, pastes_count=pastes_count)