Fixed homepage
This commit is contained in:
parent
ed6d23c536
commit
ea7ca747ef
@ -1,21 +1,23 @@
|
||||
{% extends 'base.html' %}
|
||||
{% block content %}
|
||||
{% if images %}
|
||||
{% if items %}
|
||||
<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="card">
|
||||
<a href="{{ url_for('ItemView:index', id=image.id) }}">
|
||||
<img src="{{image.preview}}" class="img-fluid" style="padding: 30px" alt="{{image.name}}">
|
||||
</a>
|
||||
<h5 class="card-header">{{ item.name }} by {{ item.uploader.name }}</h5>
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">{{image.creator}}</h5>
|
||||
<p class="card-text">
|
||||
{{image.name}}
|
||||
</p>
|
||||
<a href="{{ url_for('download', id=image.id) }}" class="btn btn-primary" target="_blank">Download Now</a>
|
||||
<a href="{{ url_for('ItemView:get', id_=item.id) }}">
|
||||
<img src="{{ url_for('ContentView:preview', id_=item.id) }}" class="img-fluid"
|
||||
alt="{{ item.name }}">
|
||||
</a>
|
||||
</div>
|
||||
<div class="card-footer text-muted">
|
||||
{{ item.upload_date }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
@ -20,4 +20,4 @@ class IndexView(FlaskView):
|
||||
|
||||
def index(self):
|
||||
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