added splash image to art categories
This commit is contained in:
parent
3b2815c87e
commit
a5e9e16b49
@ -14,8 +14,8 @@ art_print = Blueprint('art', __name__, template_folder='templates')
|
|||||||
@art_print.route('/')
|
@art_print.route('/')
|
||||||
def root():
|
def root():
|
||||||
tags = getTagDicts()
|
tags = getTagDicts()
|
||||||
print(tags)
|
#print(tags)
|
||||||
return render_template('art/index.html', tags = tags, urlprefix = urlprefix)
|
return render_template('art/index.html', tags = tags, staticroot = staticbucketurl, urlprefix = urlprefix)
|
||||||
|
|
||||||
@art_print.route('/<tag>')
|
@art_print.route('/<tag>')
|
||||||
def tag_view(tag):
|
def tag_view(tag):
|
||||||
|
@ -17,6 +17,9 @@ def getTagDicts():
|
|||||||
for tag in tags:
|
for tag in tags:
|
||||||
dicts.append(tag.to_dict())
|
dicts.append(tag.to_dict())
|
||||||
|
|
||||||
|
for artdict in dicts:
|
||||||
|
artdict['splash'] = artdict['splash'].get().to_dict()
|
||||||
|
|
||||||
return dicts
|
return dicts
|
||||||
|
|
||||||
def getPopulatedTagDict(name):
|
def getPopulatedTagDict(name):
|
||||||
|
@ -3,12 +3,14 @@
|
|||||||
{% block title %}dev{% endblock %}
|
{% block title %}dev{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{% for row in tags|batch(2) %}
|
{% for row in tags|batch(4) %}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
{% for tag in row %}
|
{% for tag in row %}
|
||||||
<div class="col-pad-6 card">
|
<div class="col-pad-3 card">
|
||||||
<h1>{{ tag.name }}</h1>
|
<h1>{{ tag.name }}</h1>
|
||||||
<p>{{ tag.description }}</p>
|
<img src="{{ staticroot }}art/{{ tag.splash.file_name }}.jpg" alt="{{ tag.splash.file_name }}">
|
||||||
|
|
||||||
|
<p>{{ tag.description }}{{ tag.image }}</p>
|
||||||
<a href="/{{ urlprefix }}/{{ tag.doc_name }}" style="width:100%;" class="button">view</a>
|
<a href="/{{ urlprefix }}/{{ tag.doc_name }}" style="width:100%;" class="button">view</a>
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
Loading…
Reference in New Issue
Block a user