...
 
......@@ -420,6 +420,14 @@ class RoleView(ModelView):
# redirect to login page if user doesn't have access
return redirect(url_for('security.login', next=request.url))
class EventView(ModelView):
def is_accessible(self):
return current_user.has_role('admin')
def inaccessible_callback(self, name, **kwargs):
# redirect to login page if user doesn't have access
return redirect(url_for('security.login', next=request.url))
# APP RUN
......@@ -428,5 +436,5 @@ if __name__ == '__main__':
admin.add_view(UserView(User))
admin.add_view(RoleView(Role))
# admin.add_view(ModelView(Badge))
admin.add_view(ModelView(Events))
admin.add_view(EventView(Events))
app.run(host='0.0.0.0', debug=True)
@font-face {
font-family: "hershey";
src: url(fonts/hershey-futuram-webfont.woff2) format("woff2"), url(fonts/hershey-futuram-webfont.woff) format("woff");
src: url(fonts/Hershey-futuram-1-1.woff) format("woff"), url(fonts/Hershey-futuram-1-1.ttf) format("ttf");
font-weight: 400;
font-style: normal;
}
@font-face {
font-family: "hershey-light";
src: url(fonts/Hershey-futural.woff) format("woff"), url(fonts/Hershey-futural.ttf) format("ttf");
font-weight: 400;
font-style: normal;
}
@font-face {
font-family: "hershey-bold";
src: url(fonts/Hershey-futurab.woff) format("woff"), url(fonts/Hershey-futurab.ttf) format("ttf");
font-weight: 400;
font-style: normal;
}
......
// @font-face {
// font-family: "hershey";
// src: url(fonts/hershey-futuram-webfont.woff2) format("woff2"), url(fonts/hershey-futuram-webfont.woff) format("woff");
// font-weight: 400;
// font-style: normal;
// }
@font-face {
font-family: "hershey";
src: url(fonts/hershey-futuram-webfont.woff2) format("woff2"), url(fonts/hershey-futuram-webfont.woff) format("woff");
//Medium weithg
src: url(fonts/Hershey-futuram-1-1.woff) format("woff"), url(fonts/Hershey-futuram-1-1.ttf) format("ttf");
font-weight: 400;
font-style: normal;
}
@font-face {
font-family: "hershey-light";
src: url(fonts/Hershey-futural.woff) format("woff"), url(fonts/Hershey-futural.ttf) format("ttf");
font-weight: 400;
font-style: normal;
}
@font-face {
font-family: "hershey-bold";
src: url(fonts/Hershey-futurab.woff) format("woff"), url(fonts/Hershey-futurab.ttf) format("ttf");
font-weight: 400;
font-style: normal;
}
......
......@@ -55,4 +55,5 @@
{% endif %}
<li class="item"><a href="/language/fr">FR</a>/<a href="/language/nl">NL</a></li>
</ul>
{{current_user.first_name}}
</nav>