[fix] wrap categories on small screens ++ some code formatting - closes #647

This commit is contained in:
Adam Tauber 2016-07-27 02:08:24 +02:00
parent 350a84520d
commit bf92aa3fdd
10 changed files with 58 additions and 47 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -2,6 +2,7 @@
display: none; display: none;
text-align: left; text-align: left;
margin-bottom: 1rem; margin-bottom: 1rem;
clear: both;
label, .input-group-addon { label, .input-group-addon {
font-size: 1.2rem; font-size: 1.2rem;
@ -11,9 +12,8 @@
border-right: none; border-right: none;
color: @dark-gray; color: @dark-gray;
padding-bottom: 0.4rem; padding-bottom: 0.4rem;
padding-top: 0.4rem; padding-right: 0.7rem;
padding-left: 0.5rem; padding-left: 0.7rem;
padding-right: 0.5rem;
} }
label:last-child, .input-group-addon:last-child { label:last-child, .input-group-addon:last-child {
@ -63,6 +63,7 @@ Ny0yNFQxMToxNTowMCswMjowMP7RDgQAAAAZdEVYdFNvZnR3YXJlAHd3dy5pbmtzY2FwZS5vcmeb
} }
.advanced { .advanced {
margin-top:1rem; padding: 0;
margin-top: 0.3rem;
text-align: right; text-align: right;
} }

View File

@ -1,8 +1,14 @@
.search_categories, #categories { .search_categories, #categories {
text-transform: capitalize; text-transform: capitalize;
margin-bottom: 0.5rem; margin-bottom: 0.5rem;
display: flex;
flex-wrap: wrap;
flex-flow: row wrap;
align-content: stretch;
label, .input-group-addon { label, .input-group-addon {
flex-grow: 1;
flex-basis: auto;
font-size: 1.2rem; font-size: 1.2rem;
font-weight: normal; font-weight: normal;
background-color: white; background-color: white;
@ -11,8 +17,7 @@
color: @dark-gray; color: @dark-gray;
padding-bottom: 0.4rem; padding-bottom: 0.4rem;
padding-top: 0.4rem; padding-top: 0.4rem;
padding-left: 0.5rem; text-align: center;
padding-right: 0.5rem;
} }
label:last-child, .input-group-addon:last-child { label:last-child, .input-group-addon:last-child {
border-right: @mild-gray 1px solid; border-right: @mild-gray 1px solid;

View File

@ -2,6 +2,7 @@
display: none; display: none;
text-align: center; text-align: center;
margin-bottom: 1rem; margin-bottom: 1rem;
clear: both;
label, .input-group-addon { label, .input-group-addon {
font-size: 1.3rem; font-size: 1.3rem;
@ -11,7 +12,6 @@
border-right: none; border-right: none;
color: #333; color: #333;
padding-bottom: 0.8rem; padding-bottom: 0.8rem;
padding-top: 0.8rem;
padding-left: 1.2rem; padding-left: 1.2rem;
padding-right: 1.2rem; padding-right: 1.2rem;
} }
@ -40,6 +40,7 @@
} }
.advanced { .advanced {
margin-top:1rem; padding: 0;
margin-top: 0.3rem;
text-align: right; text-align: right;
} }

View File

@ -2,8 +2,13 @@
text-transform: capitalize; text-transform: capitalize;
margin-bottom: 1.5rem; margin-bottom: 1.5rem;
margin-top: 1.5rem; margin-top: 1.5rem;
display: flex;
flex-wrap: wrap;
align-content: stretch;
label, .input-group-addon { label, .input-group-addon {
flex-grow: 1;
flex-basis: auto;
font-size: 1.3rem; font-size: 1.3rem;
font-weight: normal; font-weight: normal;
background-color: white; background-color: white;
@ -12,8 +17,7 @@
color: #333; color: #333;
padding-bottom: 0.8rem; padding-bottom: 0.8rem;
padding-top: 0.8rem; padding-top: 0.8rem;
padding-left: 1.2rem; text-align: center;
padding-right: 1.2rem;
} }
label:last-child, .input-group-addon:last-child { label:last-child, .input-group-addon:last-child {

View File

@ -1,4 +1,3 @@
<div class="input-group col-sm-12 advanced">
<input type="checkbox" name="advanced_search" id="check-advanced" {% if advanced_search %} checked="checked"{% endif %}> <input type="checkbox" name="advanced_search" id="check-advanced" {% if advanced_search %} checked="checked"{% endif %}>
<label for="check-advanced"> <label for="check-advanced">
<span class="glyphicon glyphicon-cog"></span> <span class="glyphicon glyphicon-cog"></span>
@ -8,4 +7,3 @@
{% include 'oscar/categories.html' %} {% include 'oscar/categories.html' %}
{% include 'oscar/time-range.html' %} {% include 'oscar/time-range.html' %}
</div> </div>
</div>

View File

@ -2,13 +2,13 @@
{% if rtl %} {% if rtl %}
{% for category in categories | reverse %} {% for category in categories | reverse %}
<input class="hidden" type="checkbox" id="checkbox_{{ category|replace(' ', '_') }}" name="category_{{ category }}" {% if category in selected_categories %}checked="checked"{% endif %} /> <input class="hidden" type="checkbox" id="checkbox_{{ category|replace(' ', '_') }}" name="category_{{ category }}" {% if category in selected_categories %}checked="checked"{% endif %} />
<label class="input-group-addon" for="checkbox_{{ category|replace(' ', '_') }}">{{ _(category) }}</label> <label for="checkbox_{{ category|replace(' ', '_') }}">{{ _(category) }}</label>
</label> </label>
{% endfor %} {% endfor %}
{% else %} {% else %}
{% for category in categories %} {% for category in categories %}
<input class="hidden" type="checkbox" id="checkbox_{{ category|replace(' ', '_') }}" name="category_{{ category }}" {% if category in selected_categories %}checked="checked"{% endif %} /> <input class="hidden" type="checkbox" id="checkbox_{{ category|replace(' ', '_') }}" name="category_{{ category }}" {% if category in selected_categories %}checked="checked"{% endif %} />
<label class="input-group-addon" for="checkbox_{{ category|replace(' ', '_') }}">{{ _(category) }}</label> <label for="checkbox_{{ category|replace(' ', '_') }}">{{ _(category) }}</label>
{% endfor %} {% endfor %}
{% endif %} {% endif %}
</div> </div>

View File

@ -6,5 +6,7 @@
<button type="submit" class="btn btn-default"><span class="hide_if_nojs">{{ icon('search') }}</span><span class="hidden active_if_nojs">{{ _('Start search') }}</span></button> <button type="submit" class="btn btn-default"><span class="hide_if_nojs">{{ icon('search') }}</span><span class="hidden active_if_nojs">{{ _('Start search') }}</span></button>
</span> </span>
</div> </div>
<div class="input-group col-sm-12 advanced">
{% include 'oscar/advanced.html' %} {% include 'oscar/advanced.html' %}
</div>
</form><!-- / #search_form_full --> </form><!-- / #search_form_full -->

View File

@ -11,7 +11,7 @@
<button type="submit" class="btn btn-default input-lg"><span class="hide_if_nojs">{{ icon('search') }}</span><span class="hidden active_if_nojs">{{ _('Start search') }}</span></button> <button type="submit" class="btn btn-default input-lg"><span class="hide_if_nojs">{{ icon('search') }}</span><span class="hidden active_if_nojs">{{ _('Start search') }}</span></button>
</span> </span>
</div> </div>
<div class="input-group col-md-8 col-md-offset-2"> <div class="col-md-8 col-md-offset-2 advanced">
{% include 'oscar/advanced.html' %} {% include 'oscar/advanced.html' %}
</div> </div>