don't show upload button for users

pull/8/head
Cervinko Cera 9 years ago
parent bda3055a19
commit 4e0621479a

@ -63,6 +63,7 @@
</ul> </ul>
<ul class="nav navbar-nav navbar-right" id="main-nav"> <ul class="nav navbar-nav navbar-right" id="main-nav">
{% if g.user.is_authenticated() %} {% if g.user.is_authenticated() %}
{% if g.user.role %}
<li> <li>
<form id="form-upload" class="navbar-form" action="{{ url_for('upload') }}" method="post" enctype="multipart/form-data"> <form id="form-upload" class="navbar-form" action="{{ url_for('upload') }}" method="post" enctype="multipart/form-data">
<div class="form-group"> <div class="form-group">
@ -70,6 +71,7 @@
</div> </div>
</form> </form>
</li> </li>
{% endif %}
{% if g.user.role %} {% if g.user.role %}
<li><a href="{{url_for('user_list')}}"><span class="glyphicon glyphicon-dashboard"></span> Admin</a></li> <li><a href="{{url_for('user_list')}}"><span class="glyphicon glyphicon-dashboard"></span> Admin</a></li>
{% endif %} {% endif %}

@ -749,6 +749,7 @@ def edit_book(book_id):
@app.route("/upload", methods = ["GET", "POST"]) @app.route("/upload", methods = ["GET", "POST"])
@login_required @login_required
@admin_required
def upload(): def upload():
## create the function for sorting... ## create the function for sorting...
db.session.connection().connection.connection.create_function("title_sort",1,db.title_sort) db.session.connection().connection.connection.create_function("title_sort",1,db.title_sort)

Loading…
Cancel
Save