Fixed homepage
This commit is contained in:
parent
ed6d23c536
commit
ea7ca747ef
@ -1,25 +1,27 @@
|
|||||||
{% extends 'base.html' %}
|
{% extends 'base.html' %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{% if images %}
|
{% if items %}
|
||||||
<div class="row mx-2">
|
<div class="row mx-2">
|
||||||
{% for image in images %}
|
{% for item in items %}
|
||||||
<div class="col-12 col-sm-6 col-md-4 px-2 mb-3">
|
<div class="col-12 col-sm-6 col-md-4 px-2 mb-3">
|
||||||
|
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<a href="{{ url_for('ItemView:index', id=image.id) }}">
|
<h5 class="card-header">{{ item.name }} by {{ item.uploader.name }}</h5>
|
||||||
<img src="{{image.preview}}" class="img-fluid" style="padding: 30px" alt="{{image.name}}">
|
|
||||||
</a>
|
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<h5 class="card-title">{{image.creator}}</h5>
|
<a href="{{ url_for('ItemView:get', id_=item.id) }}">
|
||||||
<p class="card-text">
|
<img src="{{ url_for('ContentView:preview', id_=item.id) }}" class="img-fluid"
|
||||||
{{image.name}}
|
alt="{{ item.name }}">
|
||||||
</p>
|
</a>
|
||||||
<a href="{{ url_for('download', id=image.id) }}" class="btn btn-primary" target="_blank">Download Now</a>
|
</div>
|
||||||
|
<div class="card-footer text-muted">
|
||||||
|
{{ item.upload_date }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
<p>No images available.</p>
|
<p>No images available.</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
@ -20,4 +20,4 @@ class IndexView(FlaskView):
|
|||||||
|
|
||||||
def index(self):
|
def index(self):
|
||||||
items = Item.query.all()
|
items = Item.query.all()
|
||||||
return render_template("index.html", images=items)
|
return render_template("index.html", items=items)
|
||||||
|
Loading…
Reference in New Issue
Block a user