File tree Expand file tree Collapse file tree 3 files changed +15
-3
lines changed
Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 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 >
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 >
Original file line number Diff line number Diff 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 ">
You can’t perform that action at this time.
0 commit comments