Skip to content

Commit 59eb839

Browse files
committed
Merge branch 'master' of github.com:dgtlmoon/changedetection.io
2 parents d4928e3 + 8bcc277 commit 59eb839

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

backend/__init__.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -584,6 +584,7 @@ def diff_history_page(uuid):
584584
previous=previous_version_file_contents,
585585
extra_stylesheets=extra_stylesheets,
586586
versions=dates[1:],
587+
uuid=uuid,
587588
newest_version_timestamp=dates[0],
588589
current_previous_version=str(previous_version),
589590
current_diff_url=watch['url'])
@@ -606,11 +607,15 @@ def preview_page(uuid):
606607
flash("No history found for the specified link, bad link?", "error")
607608
return redirect(url_for('index'))
608609

609-
print(watch)
610-
with open(list(watch['history'].values())[-1], 'r') as f:
610+
newest = list(watch['history'].keys())[-1]
611+
with open(watch['history'][newest], 'r') as f:
611612
content = f.readlines()
612613

613-
output = render_template("preview.html", content=content, extra_stylesheets=extra_stylesheets)
614+
output = render_template("preview.html",
615+
content=content,
616+
extra_stylesheets=extra_stylesheets,
617+
current_diff_url=watch['url'],
618+
uuid=uuid)
614619
return output
615620

616621

backend/templates/base.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333

3434
<ul class="pure-menu-list">
3535
{% if current_user.is_authenticated or not has_password %}
36+
{% if not current_diff_url %}
3637
<li class="pure-menu-item">
3738
<a href="/backup" class="pure-menu-link">BACKUP</a>
3839
</li>
@@ -42,6 +43,11 @@
4243
<li class="pure-menu-item">
4344
<a href="/settings" class="pure-menu-link">SETTINGS</a>
4445
</li>
46+
{% else %}
47+
<li class="pure-menu-item">
48+
<a href="{{ url_for('edit_page', uuid=uuid) }}" class="pure-menu-link">EDIT</a>
49+
</li>
50+
{% endif %}
4551
{% else %}
4652
<li class="pure-menu-item">
4753
<a class="pure-menu-link" href="https://github.com/dgtlmoon/changedetection.io">Website Change Detection and Notification.</a>

backend/templates/diff.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ <h1>Differences</h1>
3030
</form>
3131
<del>Removed text</del>
3232
<ins>Inserted Text</ins>
33+
<a href="{{ url_for('preview_page', uuid=uuid) }}">Show current snapshot</a>
3334
</div>
3435

3536
<div id="diff-jump">

0 commit comments

Comments
 (0)