Fixed profile page
This commit is contained in:
parent
35a130f1a1
commit
d73b63d85d
@ -3,25 +3,25 @@
|
|||||||
{% block content %}
|
{% block content %}
|
||||||
{% if current_user.is_authenticated %}
|
{% if current_user.is_authenticated %}
|
||||||
<div>
|
<div>
|
||||||
<h1>Welcome {{ current_user.username }}</h1>
|
<h1>Welcome {{ current_user.name }}</h1>
|
||||||
<a href="{{ url_for('UploadView:index') }}" class="btn btn-primary">Upload</a>
|
<a href="{{ url_for('UploadView:index') }}" class="btn btn-secondary">Upload</a>
|
||||||
</div>
|
</div>
|
||||||
<br>
|
<br>
|
||||||
{% if images %}
|
{% if current_user.uploads %}
|
||||||
<div class="row mx-2">
|
<div class="row mx-2">
|
||||||
{% for image in images %}
|
{% for item in current_user.uploads %}
|
||||||
<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) }}">
|
|
||||||
<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) }}"><img
|
||||||
|
src="{{ url_for('ContentView:preview', id_=item.id) }}"
|
||||||
|
class="img-fluid" alt="{{ item.name }}"
|
||||||
|
/></a>
|
||||||
<p class="card-text">
|
<p class="card-text">
|
||||||
{{image.caption}}
|
{{ item.name }}
|
||||||
</p>
|
</p>
|
||||||
<a href="{{ url_for('ItemView:download', id=image.id) }}" class="btn btn-primary" target="_blank">Download</a>
|
<a href="{{ url_for('ContentView:caff', id_=item.id) }}"
|
||||||
<a href="{{ url_for('ItemView:delete', id=image.id) }}" class="btn btn-primary" target="_blank">Delete</a>
|
class="btn btn-primary" target="_blank">Download</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -21,7 +21,5 @@ class ProfileView(FlaskView):
|
|||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
def index(self):
|
def index(self):
|
||||||
|
|
||||||
useritems = Item.query.filter_by(uploader_id=current_user.id)
|
useritems = Item.query.filter_by(uploader_id=current_user.id)
|
||||||
|
|
||||||
return render_template('profile.html', images=useritems)
|
return render_template('profile.html', images=useritems)
|
||||||
|
Loading…
Reference in New Issue
Block a user