Skip to content

Commit

Permalink
fixes art URL
Browse files Browse the repository at this point in the history
  • Loading branch information
owocki committed Oct 16, 2019
1 parent ab710fa commit 5c2b0e8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions app/quests/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,19 @@ def url(self):

@property
def art_url(self):
url = self.game_metadata['enemy']['art']
url = self.game_metadata.get('enemy', {}).get('art', '')
if "http" in url:
return url
return '/static/' + url

@property
def enemy_img_url(self):
return '/static/'+self.game_metadata.get('enemy', {}).get('art', '').replace('svg', 'png')
return self.art_url

@property
def enemy_img_url_png(self):
# warning: not supported for kudos uploaded quets
return self.art_url.replace('svg', 'png')

@property
def enemy_img_name(self):
Expand Down
2 changes: 1 addition & 1 deletion app/quests/templates/quests/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ <h1 class="mt-3" style="width: 100%;">Quests <span id="alpha">Alpha</span></h1>
<div id="{{difficulty_level}}" style="{% cycle 'background-color: #fafafa;' '' %}; width: 250px; display: block; float: left; border-radius: 10px; height: 490px; text-align: center;" class="{{quest.style}} m-3 p-2 quest-card {%if not unlocked%}locked{%elif beaten%}beaten{%else%}available{%endif%} {%if cooldown%}cooldown{%endif%}">
<div class="card_head">
<span class="boss">#boss</span>
<img class="card_img boss" src="/{{quest.art_url}}" title="{{quest.game_metadata.enemy.title}}">
<img class="card_img boss" src="{{quest.art_url}}" title="{{quest.game_metadata.enemy.title}}">
<span class="reward">#prize</span>
<img class="card_img reward" src="{{quest.kudos_reward.img_url}}" title="{{quest.kudos_reward.humanized_name}} Kudos">
</div>
Expand Down

0 comments on commit 5c2b0e8

Please sign in to comment.