fix: [UI tags] fix add tags template

pull/534/head
Terrtia 2020-08-21 10:50:03 +02:00
parent f71aef9f47
commit 0e8b4456ce
No known key found for this signature in database
GPG Key ID: 1E1B1F50D84613D0
2 changed files with 48 additions and 44 deletions

View File

@ -271,8 +271,10 @@ def update_tag_last_seen(tag, tag_first_seen, tag_last_seen):
if r_serv_tags.scard('{}:{}'.format(tag, tag_last_seen)) > 0:
r_serv_tags.hset('tag_metadata:{}'.format(tag), 'last_seen', tag_last_seen)
else:
tag_last_seen = Date.date_substract_day(tag_last_seen)
update_tag_last_seen(tag, tag_first_seen, tag_last_seen)
# # TODO: # FIXME:
#tag_last_seen = Date.date_substract_day(str(tag_last_seen))
#update_tag_last_seen(tag, tag_first_seen, tag_last_seen)
pass
def update_tag_metadata(tag, tag_date, object_type=None, add_tag=True):
'''

View File

@ -55,8 +55,8 @@
<div class="modal-body">
<div class="form-group input-group" >
<input id="ltags" style="width:850%;" type="text" name="ltags">
<div class="input-group" >
<input id="ltags" type="text" class="form-control" autocomplete="off" style="width: 760px" name="ltags">
</div>
<div class="btn-group btn-block">
@ -73,8 +73,8 @@
</div>
<br/><br/>
<div class="form-group input-group" >
<input id="ltagsgalaxies" style="width:850%;" type="text" name="ltagsgalaxies">
<div class="input-group">
<input id="ltagsgalaxies" type="text" class="form-control" autocomplete="off" style="width: 760px" name="ltagsgalaxies">
</div>
<div class="btn-group btn-block">
@ -529,20 +529,21 @@
{% endfor %}
</script>
<script>
var ctx = canvas.getContext('2d'), img = new Image();
{% if crawler_metadata['get_metadata'] %}
<script>
var ctx = canvas.getContext('2d'), img = new Image();
/// turn off image smoothing
ctx.webkitImageSmoothingEnabled = false;
ctx.imageSmoothingEnabled = false;
/// turn off image smoothing
ctx.webkitImageSmoothingEnabled = false;
ctx.imageSmoothingEnabled = false;
img.onload = pixelate;
img.addEventListener("error", img_error);
var draw_img = false;
img.onload = pixelate;
img.addEventListener("error", img_error);
var draw_img = false;
img.src = "{{ url_for('showsavedpastes.screenshot', filename=crawler_metadata['screenshot']) }}";
img.src = "{{ url_for('showsavedpastes.screenshot', filename=crawler_metadata['screenshot']) }}";
function pixelate() {
function pixelate() {
/// use slider value
if( blocks.value == 50 ){
@ -564,16 +565,17 @@ function pixelate() {
/// pixelated
ctx.drawImage(canvas, 0, 0, w, h, 0, 0, canvas.width, canvas.height);
}
}
function img_error() {
function img_error() {
img.onerror=null;
img.src="{{ url_for('static', filename='image/AIL.png') }}";
blocks.value = 50;
pixelate;
}
}
blocks.addEventListener('change', pixelate, false);
</script>
blocks.addEventListener('change', pixelate, false);
</script>
{% endif %}
</html>