Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions website/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,17 @@ def get_name(self):
def get_logo(self):
if self.logo:
return self.logo.url
else:
image_content = ContentFile(requests.get("https://logo.clearbit.com/"+self.name).content)
self.logo.save(self.name +".jpg", image_content)
return self.logo.url
image_request = requests.get("https://logo.clearbit.com/"+self.name)
try:
if image_request.status_code == 200:
image_content = ContentFile(image_request.content)
self.logo.save(self.name +".jpg", image_content)
return self.logo.url

except:
favicon_url = self.url + '/favicon.ico'
return favicon_url


@property
def get_color(self):
Expand Down
4 changes: 4 additions & 0 deletions website/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<style>
{% block style %}
{% endblock %}
</style>
</head>
<body>
<div id="wrapper">
Expand Down
11 changes: 10 additions & 1 deletion website/templates/domain.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@
{% load email_obfuscator %}
{% load socialaccount %}
{% providers_media_js %}
{% block style %}
.alt-img{
padding-top: 25px;
width: 75px;
filter: blur(2px);
-webkit-filter:blur(2px);
}
{% endblock %}
{% block content %}
<div class="row">
<div class="col-lg-3 col-md-3">
Expand All @@ -12,7 +20,8 @@
<div class="panel-heading">
<div class="row">
<div class="col-xs-3">
<img src="{{domain.get_logo}}" height="75">
<img src="{{domain.get_logo}}" height="75" onerror="this.onerror=null; this.style.display='none';this.parentNode.childNodes[3].style.display='block';">
<img src="{% static 'img/logo-small-transparent.png' %}" style="display:none;" class="alt-img">
</div>

<div class="col-xs-9 text-right">
Expand Down
11 changes: 10 additions & 1 deletion website/templates/issue.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@
{% block og_image %}{{object.screenshot.url}}{% endblock %}
{% block og_description %}{{object.description}}{% endblock %}
{% block description %}{{object.description}}{% endblock %}
{% block style %}
.alt-img{
padding-top: 25px;
width: 75px;
filter: blur(2px);
-webkit-filter:blur(2px);
}
{% endblock %}
{% block content %}
<div id="fb-root"></div>
<script>
Expand Down Expand Up @@ -56,7 +64,8 @@ <h2 class="page-header"> {{object.description}} <span class="pull-right"><i clas
<a href="/domain/{{object.domain_name}}">
<div class="row">
<div class="col-xs-3">
<img src="{{object.domain.get_logo}}" height="75" onerror="this.onerror=null; this.style.display ='none';">
<img src="{{object.domain.get_logo}}" height="75" onerror="this.onerror=null; this.style.display='none';this.parentNode.childNodes[3].style.display='block';">
<img src="{% static 'img/logo-small-transparent.png' %}" style="display:none;" class="alt-img">
</div>
<div class="col-xs-9 text-right">
<div class="huge">{{object.domain_title}}</div>
Expand Down