Add UI link button to shelves

pull/674/head
otapi 6 years ago committed by GitHub
parent e0229c917c
commit c6d3613e57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -2,9 +2,13 @@
{% block body %}
<div class="discover">
<h2>{{title}}</h2>
{% if g.user.role_download() %}
<a id="shelf_down" href="{{ url_for('show_shelf_down', shelf_id=shelf.id) }}" class="btn btn-primary">{{ _('Download') }} </a>
{% endif %}
{% if g.user.is_authenticated %}
{% if (g.user.role_edit_shelfs() and shelf.is_public ) or not shelf.is_public %}
<div id="delete_shelf" data-toggle="modal" data-target="#DeleteShelfDialog" class="btn btn-danger">{{ _('Delete this Shelf') }} </div>
<div id="delete_shelf" data-toggle="modal" data-target="#DeleteShelfDialog" class="btn btn-danger">{{ _('Delete this Shelf') }} </div>
<a id="edit_shelf" href="{{ url_for('edit_shelf', shelf_id=shelf.id) }}" class="btn btn-primary">{{ _('Edit Shelf') }} </a>
<a id="order_shelf" href="{{ url_for('order_shelf', shelf_id=shelf.id) }}" class="btn btn-primary">{{ _('Change order') }} </a>
{% endif %}

@ -2677,7 +2677,6 @@ def show_shelf(shelf_id):
@app.route("/shelfdown/<int:shelf_id>")
@login_required_if_no_ano
def show_shelf_down(shelf_id):
if current_user.is_anonymous:
shelf = ub.session.query(ub.Shelf).filter(ub.Shelf.is_public == 1, ub.Shelf.id == shelf_id).first()

Loading…
Cancel
Save