Skip to content

Commit

Permalink
use thumb and zoom screenshot openrightsgroup/Blocking-Middleware#115
Browse files Browse the repository at this point in the history
  • Loading branch information
dantheta committed Aug 10, 2021
1 parent 39daac1 commit 35a86ec
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
3 changes: 3 additions & 0 deletions BlockedFrontend/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,9 @@ def get_report_categories(self, category_type):
def get_screenshot_url(self):
return "https://www.blocked.org.uk/screenshots/{0}.png".format(self['hash'])

def get_screenshot_thumb_url(self):
return "https://www.blocked.org.uk/screenshots/{0}_thumb.png".format(self['hash'])

def get_screenshot_date(self):
try:
import requests
Expand Down
20 changes: 19 additions & 1 deletion BlockedFrontend/templates/admin/ispreports_email.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
return false;
});

$('a.screenshot-modal').click(function(){
$('#screenshot-modal').modal('toggle')
return false;
});

});
{% endblock %}
Expand Down Expand Up @@ -94,7 +98,7 @@ <h3>Site details</h3>
</div>

<div style="">
<img src="{{ urlobj.get_screenshot_url() }}" style="max-height: 16em" class="img-responsive" title="{{ url }} screenshot {{ urlobj.get_screenshot_date() }}"/>
<a href="" class="screenshot-modal"><img src="{{ urlobj.get_screenshot_thumb_url() }}" style="max-height: 16em" class="img-responsive" title="{{ url }} screenshot {{ urlobj.get_screenshot_date() }}"/></a>
</div>

</div>
Expand Down Expand Up @@ -514,6 +518,20 @@ <h4>Review notes</h4>
</div> <!-- /#block -->

</div> <!-- /.tab-content -->

<div class="modal" id="screenshot-modal" style="" >
<div class="modal-dialog modal-lg" role="document" style="">
<div class="modal-content" >

<div class="modal-body" style="">
<img src="{{ urlobj.get_screenshot_url() }}" style="" class="img-responsive" title="{{ url }} screenshot {{ urlobj.get_screenshot_date() }}"/>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div>
{% endblock body %}

{% macro policy_match_help(value) %}
Expand Down

0 comments on commit 35a86ec

Please sign in to comment.