Closed scottydelta closed 8 years ago
You can always override head_css
block and get rid of the base CSS file.
{% extends 'admin/base.html' %}
{% block head_css %}
{{ super() }}
{% set bootswatch_theme = 'lumen' %}
{% set bootswatch_version = '3.3.6' %}
<link href="//bootswatch.com/{{ bootswatch_theme }}/bootstrap.min.css" rel="stylesheet" >
{% endblock %}
^ doesnt solve the issue, is there any thing that I need to use explicitly to override the block?
Remove super()
statement- it makes your block inherit contents of original head_css
.
{% block head_css %}
{% set bootswatch_theme = 'lumen' %}
{% set bootswatch_version = '3.3.6' %}
<link href="//bootswatch.com/{{ bootswatch_theme }}/bootstrap.min.css" rel="stylesheet" >
<link href="{{ admin_static.url(filename='admin/css/bootstrap3/admin.css', v='1.1.1') }}" rel="stylesheet">
<style>
body {
padding-top: 4px;
}
</style>
{% endblock %}
It worked nicely, thank you @mrjoes
As per suggestion from comment: https://github.com/flask-admin/flask-admin/pull/1016#issuecomment-134437376, I made the changes but the theme doesnt get applied properly:
admin = Admin(name='Tweet Tracker',base_template='custom_admin.html', template_mode='bootstrap3' ,url='/', index_view=ProjectView(Project, db.session, url='/admin'))
Deleting this line admin/base.html solves the issue.