Commit ebd19283 authored by Davide Silvestri's avatar Davide Silvestri

migration from bootstrap v2.3.1 to v3.0.2

parent cd1763ba
...@@ -17,29 +17,51 @@ form.icon button { ...@@ -17,29 +17,51 @@ form.icon button {
line-height: normal; line-height: normal;
} }
a.icon { a.icon, button span.glyphicon {
text-decoration: none; text-decoration: none;
margin-left: 10px;
color: black; color: black;
} }
/* Model search form */ /* Model search form */
form.search-form { form.navbar-form {
margin: 4px 0 0 0; margin: 1px 0 0 0;
} }
form.search-form a.clear i { form.navbar-form a.clear span {
margin: 2px 0 0 0; margin-top: 8px;
margin-left: -20px;
}
form.navbar-form div.input-append {
display: inline-flex;
} }
/* Filters */ /* Filters */
table.filters { table.filters {
border-collapse: none; border-collapse: none;
border-spacing: 4px; border-spacing: 4px;
margin: 12px 0;
} }
.filters input
{ table.filters tr td {
margin-bottom: 0; padding-right: 20px;
padding-bottom: 3px;
}
table.flters tr td:nth-child(2){
width: 60%;
}
.filters input, .filters div.select2-container {
margin-bottom: 0px;
margin-left: 10px;
}
.filters div.select2-container {
width: 100% !important;
} }
.filters a.remove-filter { .filters a.remove-filter {
...@@ -78,21 +100,23 @@ table.filters { ...@@ -78,21 +100,23 @@ table.filters {
float: right; float: right;
} }
/* Image thumbnails */ .inline-field .inline-form {
.image-thumbnail img { border-left: 1px solid #eeeeee;
max-width: 100px; padding-left: 8px;
max-height: 100px; margin-bottom: 4px;
} }
/* Forms */ .fa-inline-field-control .glyphicon-remove {
.form-horizontal .control-label { margin-left: -30px;
width: 100px;
text-align: left;
margin-left: 4px;
} }
.form-horizontal .controls { .panel {
margin-left: 110px; padding-top: 25px;
padding-left: 30px;
}
.fa-inline-field {
margin-bottom: 5px;
} }
/* Inline forms */ /* Inline forms */
...@@ -102,7 +126,46 @@ table.filters { ...@@ -102,7 +126,46 @@ table.filters {
margin-bottom: 4px; margin-bottom: 4px;
} }
/* Image thumbnails */
.image-thumbnail img {
max-width: 100px;
max-height: 100px;
}
/* Forms */
.form-horizontal {
margin-top: 35px;
}
/* Patch Select2 */ /* Patch Select2 */
.select2-results li { .select2-results li {
min-height: 24px !important; min-height: 24px !important;
} }
.select2-container.form-control {
height: auto !important;
padding: 0px;
border-width: 0px;
}
form .select2-choice {
height: 30px !important;
}
.select2-search-choice {
height: 24px !important;
margin-top: 4px !important;
}
/* link style */
a.btn-cancel {
border-radius: 4px;
border-color: #a08c8c;
color: #333;
background-color: #f0b8b8;
}
a.btn-link {
border-radius: 4px;
border-color: #95bee2;
}
...@@ -29,7 +29,7 @@ var AdminFilters = function(element, filters_element, operations, options, types ...@@ -29,7 +29,7 @@ var AdminFilters = function(element, filters_element, operations, options, types
// Filter list // Filter list
$el.append( $el.append(
$('<td/>').append( $('<td/>').append(
$('<a href="#" class="btn remove-filter" />') $('<a href="#" class="btn btn-link remove-filter" />')
.append($('<span class="close-icon">&times;</span>')) .append($('<span class="close-icon">&times;</span>'))
.append('&nbsp;') .append('&nbsp;')
.append(name) .append(name)
...@@ -69,7 +69,7 @@ var AdminFilters = function(element, filters_element, operations, options, types ...@@ -69,7 +69,7 @@ var AdminFilters = function(element, filters_element, operations, options, types
$field.select2({width: 'resolve'}); $field.select2({width: 'resolve'});
} else } else
{ {
$field = $('<input type="text" class="filter-val" />') $field = $('<input type="text" class="filter-val form-control" />')
.attr('name', 'flt' + lastCount + '_' + optId); .attr('name', 'flt' + lastCount + '_' + optId);
$el.append($('<td/>').append($field)); $el.append($('<td/>').append($field));
} }
......
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
...@@ -10,8 +10,8 @@ ...@@ -10,8 +10,8 @@
<meta name="author" content=""> <meta name="author" content="">
{% endblock %} {% endblock %}
{% block head_css %} {% block head_css %}
<link href="{{ admin_static.url(filename='bootstrap/css/bootstrap.css') }}" rel="stylesheet"> <link href="{{ admin_static.url(filename='bootstrap/css/bootstrap.min.css') }}" rel="stylesheet">
<link href="{{ admin_static.url(filename='bootstrap/css/bootstrap-responsive.css') }}" rel="stylesheet"> <link href="{{ admin_static.url(filename='bootstrap/css/bootstrap-theme.min.css') }}" rel="stylesheet">
<link href="{{ admin_static.url(filename='admin/css/admin.css') }}" rel="stylesheet"> <link href="{{ admin_static.url(filename='admin/css/admin.css') }}" rel="stylesheet">
{% endblock %} {% endblock %}
{% block head %} {% block head %}
...@@ -22,25 +22,36 @@ ...@@ -22,25 +22,36 @@
<body> <body>
{% block page_body %} {% block page_body %}
<div class="container"> <div class="container">
<div class="navbar"> <nav class="navbar navbar-default" role="navigation">
<div class="navbar-inner"> <!-- Brand and toggle get grouped for better mobile display -->
{% block brand %} <div class="navbar-header">
<span class="brand">{{ admin_view.admin.name }}</span> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#admin-navbar-collapse">
{% endblock %} <span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
{% block brand %}
<a class="navbar-brand" href="#">{{ admin_view.admin.name }}</a>
{% endblock %}
</div>
<!-- navbar content -->
<div class="collapse navbar-collapse" id="#admin-navbar-collapse">
{% block main_menu %} {% block main_menu %}
<ul class="nav"> <ul class="nav navbar-nav">
{{ layout.menu() }} {{ layout.menu() }}
</ul> </ul>
{% endblock %} {% endblock %}
{% block menu_links %} {% block menu_links %}
<ul class="nav pull-right"> <ul class="nav navbar-right">
{{ layout.menu_links() }} {{ layout.menu_links() }}
</ul> </ul>
{% endblock %} {% endblock %}
{% block access_control %} {% block access_control %}
{% endblock %} {% endblock %}
</div> </div>
</div> </nav>
{% block messages %} {% block messages %}
{{ layout.messages() }} {{ layout.messages() }}
...@@ -53,7 +64,7 @@ ...@@ -53,7 +64,7 @@
{% endblock %} {% endblock %}
{% block tail_js %} {% block tail_js %}
<script src="{{ admin_static.url(filename='vendor/jquery-1.8.3.min.js') }}" type="text/javascript"></script> <script src="{{ admin_static.url(filename='vendor/jquery-2.0.3.min.js') }}" type="text/javascript"></script>
<script src="{{ admin_static.url(filename='bootstrap/js/bootstrap.min.js') }}" type="text/javascript"></script> <script src="{{ admin_static.url(filename='bootstrap/js/bootstrap.min.js') }}" type="text/javascript"></script>
<script src="{{ admin_static.url(filename='select2/select2.min.js') }}" type="text/javascript"></script> <script src="{{ admin_static.url(filename='select2/select2.min.js') }}" type="text/javascript"></script>
{% endblock %} {% endblock %}
......
...@@ -39,11 +39,11 @@ ...@@ -39,11 +39,11 @@
{% if messages %} {% if messages %}
{% for category, m in messages %} {% for category, m in messages %}
{% if category %} {% if category %}
<div class="alert alert-{{ category }}"> <div class="alert alert-{{ category }} alert-dismissable">
{% else %} {% else %}
<div class="alert"> <div class="alert alert-dismissable">
{% endif %} {% endif %}
<a href="javascript:void(0)" class="close" data-dismiss="alert">x</a> <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
{{ m }} {{ m }}
</div> </div>
{% endfor %} {% endfor %}
......
...@@ -77,22 +77,20 @@ ...@@ -77,22 +77,20 @@
{# ---------------------- Forms -------------------------- #} {# ---------------------- Forms -------------------------- #}
{% macro render_field(form, field, kwargs={}) %} {% macro render_field(form, field, kwargs={}) %}
{% set direct_error = h.is_field_error(field.errors) %} {% set direct_error = h.is_field_error(field.errors) %}
<div class="control-group{{ ' error' if direct_error else '' }}"> <div class="form-group{{ ' error' if direct_error else '' }}">
<div class="control-label"> <label for="{{ field.id }}" class="col-sm-2 control-label">{{ field.label.text }}
{{ field.label.text }}
{% if h.is_required_form_field(field) %} {% if h.is_required_form_field(field) %}
<strong style="color: red">&#42;</strong> <strong style="color: red">&#42;</strong>
{% else %} {% else %}
&nbsp; &nbsp;
{% endif %} {% endif %}
</label>
<div class="col-sm-8">
{{ field(class="form-control", **kwargs)|safe }}
{% if field.description %}
<p class="help-block">{{ field.description }}</p>
{% endif %}
</div> </div>
<div class="controls">
<div>
{{ field(**kwargs)|safe }}
</div>
{% if field.description %}
<p class="help-block">{{ field.description }}</p>
{% endif %}
{% if direct_error %} {% if direct_error %}
<ul{% if direct_error %} class="input-errors"{% endif %}> <ul{% if direct_error %} class="input-errors"{% endif %}>
{% for e in field.errors if e is string %} {% for e in field.errors if e is string %}
...@@ -100,7 +98,6 @@ ...@@ -100,7 +98,6 @@
{% endfor %} {% endfor %}
</ul> </ul>
{% endif %} {% endif %}
</div>
</div> </div>
{% endmacro %} {% endmacro %}
...@@ -137,23 +134,21 @@ ...@@ -137,23 +134,21 @@
{% endmacro %} {% endmacro %}
{% macro form_tag(form=None) %} {% macro form_tag(form=None) %}
<form action="" method="POST" class="form-horizontal" enctype="multipart/form-data"> <form action="" method="POST" role="form" class="form-horizontal" enctype="multipart/form-data">
<fieldset> {{ caller() }}
{{ caller() }}
</fieldset>
</form> </form>
{% endmacro %} {% endmacro %}
{% macro render_form_buttons(cancel_url, extra=None) %} {% macro render_form_buttons(cancel_url, extra=None) %}
<div class="control-group"> <div class="form-group">
<div class="controls"> <div class="col-sm-offset-2 col-sm-10">
<input type="submit" class="btn btn-primary btn-large" value="{{ _gettext('Submit') }}" /> <input type="submit" class="btn btn-primary" value="{{ _gettext('Submit') }}" />
{% if extra %} {% if extra %}
{{ extra }} {{ extra }}
{% endif %} {% endif %}
{% if cancel_url %} {% if cancel_url %}
<a href="{{ cancel_url }}" class="btn btn-large">{{ _gettext('Cancel') }}</a> <a href="{{ cancel_url }}" class="btn btn-cancel" role="button">{{ _gettext('Cancel') }}</a>
{% endif %} {% endif %}
</div> </div>
</div> </div>
{% endmacro %} {% endmacro %}
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
{% import 'admin/static.html' as admin_static with context %} {% import 'admin/static.html' as admin_static with context %}
{% macro extra() %} {% macro extra() %}
<input name="_continue_editing" type="submit" class="btn btn-large" value="{{ _gettext('Save and Continue') }}" /> <input name="_continue_editing" type="submit" class="btn" value="{{ _gettext('Save and Continue') }}" />
{% endmacro %} {% endmacro %}
{% block head %} {% block head %}
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div class="inline-field"> <div class="inline-field">
<div id="{{ field.id }}-fields"> <div id="{{ field.id }}-fields">
{% for subfield in field %} {% for subfield in field %}
<div id="{{ subfield.id }}" class="fa-inline-field"> <div id="{{ subfield.id }}" class="fa-inline-field well">
{%- if not check or check(subfield) %} {%- if not check or check(subfield) %}
<div class="fa-inline-field-control"> <div class="fa-inline-field-control">
<input type="checkbox" name="del-{{ subfield.id }}" id="del-{{ subfield.id }}" /> <input type="checkbox" name="del-{{ subfield.id }}" id="del-{{ subfield.id }}" />
...@@ -16,14 +16,14 @@ ...@@ -16,14 +16,14 @@
</div> </div>
<div id="{{ field.id }}-template" class="hide"> <div id="{{ field.id }}-template" class="hide">
{% filter forceescape %} {% filter forceescape %}
<div class="fa-inline-field"> <div class="fa-inline-field panel panel-info">
<div class="fa-inline-field-control"> <div class="fa-inline-field-control">
<a href="javascript:void(0)" class="fa-remove-field"><i class="icon-remove"></i></a> <a href="javascript:void(0)" class="fa-remove-field"><span class="glyphicon glyphicon-remove"></span></a>
</div> </div>
{{ render(template) }} {{ render(template) }}
</div> </div>
{% endfilter %} {% endfilter %}
</div> </div>
<a id="{{ field.id }}-button" href="javascript:void(0)" class="btn" onclick="faForm.addInlineField('{{ field.id }}', '#{{ field.id }}-fields', '#{{ field.id }}-template');">{{ _gettext('Add') }} {{ field.label.text }}</a> <a id="{{ field.id }}-button" href="javascript:void(0)" class="btn btn-default col-xs-offset-10" onclick="faForm.addInlineField('{{ field.id }}', '#{{ field.id }}-fields', '#{{ field.id }}-template');">{{ _gettext('Add') }} {{ field.label.text }}</a>
</div> </div>
{% endmacro %} {% endmacro %}
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<div class="pull-right"> <div class="pull-right">
<button type="submit" class="btn btn-primary" style="display: none">{{ _gettext('Apply') }}</button> <button type="submit" class="btn btn-primary" style="display: none">{{ _gettext('Apply') }}</button>
{% if active_filters %} {% if active_filters %}
<a href="{{ clear_search_url }}" class="btn">{{ _gettext('Reset Filters') }}</a> <a href="{{ clear_search_url }}" class="btn btn-link">{{ _gettext('Reset Filters') }}</a>
{% endif %} {% endif %}
</div> </div>
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<tr> <tr>
{% set filter = admin_view._filters[flt[0]] %} {% set filter = admin_view._filters[flt[0]] %}
<td> <td>
<a href="javascript:void(0)" class="btn remove-filter" title="{{ _gettext('Remove Filter') }}"> <a href="javascript:void(0)" class="btn btn-danger remove-filter" title="{{ _gettext('Remove Filter') }}">
<span class="close-icon">&times;</span>&nbsp;{{ filters[flt[0]] }} <span class="close-icon">&times;</span>&nbsp;{{ filters[flt[0]] }}
</a> </a>
</td> </td>
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
{%- endfor %} {%- endfor %}
</select> </select>
{%- else -%} {%- else -%}
<input name="flt{{ i }}_{{ flt[0] }}" type="text" value="{{ flt[1] or '' }}" class="filter-val"{% if flt[0] in filter_types %} data-role="{{ filter_types[flt[0]] }}"{% endif %}></input> <input name="flt{{ i }}_{{ flt[0] }}" type="text" value="{{ flt[1] or '' }}" class="filter-val form-control"{% if flt[0] in filter_types %} data-role="{{ filter_types[flt[0]] }}"{% endif %}></input>
{%- endif -%} {%- endif -%}
</td> </td>
</tr> </tr>
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
{% endmacro %} {% endmacro %}
{% macro search_form(input_class="span2") %} {% macro search_form(input_class="span2") %}
<form method="GET" action="{{ return_url }}" class="search-form"> <form method="GET" action="{{ return_url }}" class="navbar-form navbar-left" role="search">
{% if sort_column is not none %} {% if sort_column is not none %}
<input type="hidden" name="sort" value="{{ sort_column }}"></input> <input type="hidden" name="sort" value="{{ sort_column }}"></input>
{% endif %} {% endif %}
...@@ -64,15 +64,15 @@ ...@@ -64,15 +64,15 @@
<input type="hidden" name="desc" value="{{ sort_desc }}"></input> <input type="hidden" name="desc" value="{{ sort_desc }}"></input>
{% endif %} {% endif %}
{% if search %} {% if search %}
<div class="input-append"> <div class="input-append form-group">
<input type="text" name="search" value="{{ search }}" class="{{ input_class }}" placeholder="{{ _gettext('Search') }}"></input> <input type="text" name="search" value="{{ search }}" class="{{ input_class }} form-control" placeholder="{{ _gettext('Search') }}"></input>
<a href="{{ clear_search_url }}" class="clear add-on"> <a href="{{ clear_search_url }}" class="clear add-on">
<i class="icon-remove"></i> <span class="glyphicon glyphicon-remove"></span>
</a> </a>
</div> </div>
{% else %} {% else %}
<div> <div class="form-group">
<input type="text" name="search" value="" class="{{ input_class }}" placeholder="{{ _gettext('Search') }}"></input> <input type="text" name="search" value="" class="{{ input_class }} form-control" placeholder="{{ _gettext('Search') }}"></input>
</div> </div>
{% endif %} {% endif %}
</form> </form>
......
...@@ -68,9 +68,9 @@ ...@@ -68,9 +68,9 @@
<a href="{{ sort_url(column, True) }}"> <a href="{{ sort_url(column, True) }}">
{{ name }} {{ name }}
{% if sort_desc %} {% if sort_desc %}
<i class="icon-chevron-up"></i> <span class="glyphicon glyphicon-chevron-up"></span>
{% else %} {% else %}
<i class="icon-chevron-down"></i> <span class="glyphicon glyphicon-chevron-down"></span>
{% endif %} {% endif %}
</a> </a>
{% else %} {% else %}
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
{{ name }} {{ name }}
{% endif %} {% endif %}
{% if admin_view.column_descriptions.get(c) %} {% if admin_view.column_descriptions.get(c) %}
<a class="icon-question-sign" <a class="glyphicon glyphicon-question-sign"
title="{{ admin_view.column_descriptions[c] }}" title="{{ admin_view.column_descriptions[c] }}"
href="javascript:void(0)" data-role="tooltip" href="javascript:void(0)" data-role="tooltip"
></a> ></a>
...@@ -103,7 +103,7 @@ ...@@ -103,7 +103,7 @@
{% block list_row_actions scoped %} {% block list_row_actions scoped %}
{%- if admin_view.can_edit -%} {%- if admin_view.can_edit -%}
<a class="icon" href="{{ url_for('.edit_view', id=get_pk_value(row), url=return_url) }}"> <a class="icon" href="{{ url_for('.edit_view', id=get_pk_value(row), url=return_url) }}">
<i class="icon-pencil"></i> <span class="glyphicon glyphicon-pencil"></span>
</a> </a>
{%- endif -%} {%- endif -%}
{%- if admin_view.can_delete -%} {%- if admin_view.can_delete -%}
...@@ -112,7 +112,7 @@ ...@@ -112,7 +112,7 @@
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/> <input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
{% endif %} {% endif %}
<button onclick="return confirm('{{ _gettext('You sure you want to delete this item?') }}');"> <button onclick="return confirm('{{ _gettext('You sure you want to delete this item?') }}');">
<i class="icon-trash"></i> <span class="glyphicon glyphicon-trash"></span>
</button> </button>
</form> </form>
{%- endif -%} {%- endif -%}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment