Skip to content

Commit

Permalink
Merge pull request #1369 from bolt/tweaking-a-bunch-of-small-things
Browse files Browse the repository at this point in the history
Tweaking a bunch of small things: Margins, paddings, minor UX thingies
  • Loading branch information
bobdenotter authored May 17, 2020
2 parents 36c9aea + c5e9462 commit 3a46e32
Show file tree
Hide file tree
Showing 19 changed files with 94 additions and 55 deletions.
10 changes: 9 additions & 1 deletion assets/scss/init/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,20 @@ code {
.card {
box-shadow: $card-box-shadow;
background: #fff;
border: 1px solid #e8e8e8 !important;
border: 1px solid var(--very-light-border) !important;

.card-header {
font-weight: $font-weight-bold;
padding: 0.8125rem 1.25rem;
}

.card-body {
padding: $spacer $spacer*1.5;
}

.form-group {
margin-bottom: 1rem;
}
}

.custom-select {
Expand Down
7 changes: 6 additions & 1 deletion assets/scss/init/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ $component-active-bg: var(--primary);
$input-focus-border-color: var(--primary-400);
$custom-control-indicator-active-bg: var(--primary-400);
$custom-range-thumb-active-bg: var(--primary-400);
$form-group-margin-bottom: 2rem;

$input-disabled-bg: #f0f3f6;
$input-disabled-color: #777;
Expand All @@ -61,6 +62,8 @@ $card-bg: var(--foreground);
$card-box-shadow: 0 7.5px 15px -5px rgba(0, 0, 0, 0.08);

// Buttons
$btn-border-radius: 0.2rem;
$btn-border-radius-sm: 0.2rem;
$btn-font-weight: 500;
$btn-font-size-lg: 16px;
$btn-font-size: 14px;
Expand Down Expand Up @@ -98,7 +101,7 @@ $grid-breakpoints: (
$yiq-contrasted-threshold: 150;

:root {
--background: #f3f5f7;
--background: #fbfaf9;
--foreground: #fff;
--foreground-border: #e8e8e8;
--primary: #255687;
Expand All @@ -116,6 +119,8 @@ $yiq-contrasted-threshold: 150;
--admin-toolbar: #4c6e91;
--admin-toolbar-text-light: #fff;
--admin-toolbar-text-dark: #0c223b;
--very-light-border: #f0f0f0;
--light-border: #e0e0e0;

@each $bp, $value in $grid-breakpoints {
--breakpoint-#{$bp}: #{$value};
Expand Down
4 changes: 0 additions & 4 deletions assets/scss/layout/_admin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,3 @@ body {
.fab {
margin-right: 0.25em;
}

.card-body {
padding: $spacer $spacer*1.5;
}
4 changes: 2 additions & 2 deletions assets/scss/modules/admin/_header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@
}

@include media-breakpoint-up(wd) {
padding: $spacer*1.25 $spacer*2 1rem $spacer*3; //do not just change this as it's tied to the main grid and other paddings/gutters
padding: $spacer*1.25 $spacer*2 0 $spacer*3; //do not just change this as it's tied to the main grid and other paddings/gutters
}

@include media-breakpoint-up(xw) {
padding: $spacer*1.25 $spacer*3 1rem $spacer*4; //do not just change this as it's tied to the main grid and other paddings/gutters
padding: $spacer*1.25 $spacer*3 0 $spacer*4; //do not just change this as it's tied to the main grid and other paddings/gutters
}
}

Expand Down
5 changes: 3 additions & 2 deletions assets/scss/modules/admin/_sidebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
font-size: $small-font-size;
letter-spacing: $letter-spacing;

@include media-breakpoint-up(lg) {
margin-top: $spacer*2.25;
@include media-breakpoint-up(wd) {
margin: $spacer*2.25 0 0 $spacer;
}
}

Expand All @@ -47,6 +47,7 @@

@include media-breakpoint-up(wd) {
font-size: 0.9375rem;
padding: $spacer/1.75 $spacer*1.5 $spacer/1.75 $spacer*2;
}

&:hover {
Expand Down
12 changes: 11 additions & 1 deletion assets/scss/modules/editor/_forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,30 @@
.form-group {
display: flex;
flex-wrap: wrap;
margin-bottom: 0.25rem;
margin-bottom: 0.5rem;
}
}

.summary-fields {
padding-left: 1rem;

li {
margin: 0.5rem 0;
}
}

.form-collection {
border-left: 0.35rem solid #ddd;
padding-left: 1rem;
padding-bottom: 1rem;
}

.form-set {
border-left: 0.25rem solid #d8d8d8;
padding-left: 1rem;
padding-bottom: 0.1rem;
}

.form-control {
border: 1px solid var(--light-border);
}
2 changes: 2 additions & 0 deletions assets/scss/modules/listing/row/_container.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
position: relative;
display: flex;
width: 100%;
border: 1px solid var(--very-light-border);
margin-bottom: 4px;

&.sortable-ghost {
opacity: 0.1;
Expand Down
1 change: 0 additions & 1 deletion assets/scss/modules/listing/row/row.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ $checkbox-row-width: 32px;
box-shadow: $card-box-shadow;
background: var(--foreground);
border-radius: $border-radius;
margin-bottom: 2px;
display: flex;
flex-wrap: wrap;
position: relative;
Expand Down
6 changes: 4 additions & 2 deletions templates/_macro/_macro.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@
{% set label = label|trans %}
{% set icon = icon|replace({'fa-': ''}) %}
{% set class = class|replace({'btn-': ''}) %}
{% set mb = 'mb-' in class ? '' : 'mb-3' %}
{% set attr = attr %}

<button class="btn btn-{{ class }} mb-3"
<button class="btn btn-{{ class }} {{ mb }}"
{% for key,value in attr %} {{ key }}="{{value}}"{% endfor %}>
<i class="fas fa-fw fa-{{ icon }} mr-2"></i>
{{- label -}}
Expand All @@ -27,9 +28,10 @@
{% endif %}
{% set icon = icon|replace({'fa-': ''}) %}
{% set class = class|replace({'btn-': ''}) %}
{% set mb = 'mb-' in class ? '' : 'mb-3' %}
{% set attr = attr %}

<a href="{{ link }}" class="btn btn-{{ class|split(' ')|join(' btn-') }} mb-3 text-nowrap"
<a href="{{ link }}" class="btn btn-{{ class|split(' ')|join(' btn-') }} text-nowrap {{ mb }}"
{% for key,value in attr %} {{ key }}="{{value}}"{% endfor %}>
<i class="fas fa-fw fa-{{ icon }} mr-1"></i>
{{- label -}}
Expand Down
2 changes: 1 addition & 1 deletion templates/_partials/fields/_collection_buttons.html.twig
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% if in_collection is defined %}
<div class="float-right" role="group" aria-label="Collection buttons" style="margin-top: -0.25rem; margin-bottom: 0.75rem;">
<div class="float-right" role="group" aria-label="Collection buttons" style="margin-top: -0.25rem">
<input type="hidden" name="collections[{{ collection_name }}][order][]" value="{{ hash }}" />

<button class='action-move-up-collection-item btn btn-secondary btn-sm' {% if is_first is defined and is_first %} disabled {% endif %}>
Expand Down
13 changes: 5 additions & 8 deletions templates/_partials/fields/date.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,11 @@
:errormessage='{{ errormessage|json_encode }}'
></editor-date>
{% else %}
<span
:id='{{ id|json_encode }}'
:name='{{ name|json_encode }}'
class=""
{% if required == 1 %}
required
{% endif %}
>{{ value|date(format='F d, Y - g:ia')}}</span>
<br>
{{ value|localedatetime('%B %e, %Y - %k:%M<small>%p</small>') }}
<small>(<abbr class="datetime-relative" title="{{ value|localedatetime('%A %B %e, %Y - %k:%M%p') }}">
{{- value|date('c') -}}
</abbr>)</small>
{% endif %}

{% endblock %}
Expand Down
22 changes: 17 additions & 5 deletions templates/content/_buttons.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,26 @@
{% if status|default() %}
<p>
<strong>{{ __('label.current_status') }}:</strong>
<span class="status mx-1 is-{{ record.status}}"></span>{{ __('status.' ~ record.status) }}
<span class="status mx-1 is-{{ record.status}}"></span>{{ __('status.' ~ record.status) }}<br>
{% if record.status == 'published' %}
<small>
({{ 'field.modifiedAt'|trans }}:
<abbr class="datetime-relative" title="{{ record.modifiedAt|localedatetime('%A %B %e, %Y - %k:%M%p') }}">
{{- record.modifiedAt|date('c') -}}
</abbr>)
</small>
{% endif %}
</p>
{% endif %}

<hr>
<div class="form-fieldsgroup__summary-fields">
{% if record.status == "published" and record.definition.viewless != true %}
<div class="form-fieldsgroup__summary-fields">
<a href="{{ record|link(true) }}" class="btn btn-tertiary" target="_blank">{{ macro.icon('fa-sign-out-alt') }} {{ __('action.view_saved') }}</a>
</div>
<a href="{{ record|link(true) }}" class="btn btn-tertiary btn-sm" target="_blank">{{ macro.icon('fa-sign-out-alt') }} {{ __('action.view_saved') }}</a>
{% endif %}
<a href="{{ record.extras.deleteLink }}" class='action-remove-collection-item btn btn-sm btn-hidden-danger' data-confirmation="{{ 'action.confirm_delete'|trans }}">
{{ macro.icon('trash') }}{{ 'action.delete'|trans }}
</a>
</div>
{% endif %}

{% endif %}
Expand Down
1 change: 1 addition & 0 deletions templates/content/_fields_aside_summary.html.twig
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<hr>
<div class="form-fieldsgroup form-fieldsgroup__summary-fields">
<ul class="summary-fields">
<li>
Expand Down
5 changes: 3 additions & 2 deletions templates/content/_localeswitcher.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,19 @@
{% if record.id and currentlocale %}
<div class="card mb-3">
<div class="card-header">
{{ macro.icon('language') }}
{{ 'field.current_locale'|trans }}:
{{ flag(currentlocale) }}<b>{{ currentlocale }}</b>
</div>
<div class="card-body">

<general-language
label="{{ 'field.switch_to_locale'|trans }}"
label="{{ 'field.switch_to_locale'|trans }}:"
current="{{ currentlocale }}"
:locales="{{ locales(locales) }}"
></general-language>

{{ macro.buttonlink('localeswitcher.button_info', path('bolt_content_edit_locales', {'id': record.id}), 'language', 'tertiary') }}
{{ macro.buttonlink('localeswitcher.button_info', path('bolt_content_edit_locales', {'id': record.id}), 'info-circle', 'tertiary btn-sm') }}

</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions templates/content/edit.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@

<div class="card mb-3">
<div class="card-header">
{{ 'title.save_changes'|trans }}
{{ macro.icon('star') }} {{ 'title.primary_actions'|trans }}
</div>
<div class="card-body">
{% include '@bolt/content/_buttons.html.twig' with {'status': true} %}
Expand All @@ -81,7 +81,7 @@

<div class="card">
<div class="card-header">
{{ 'title.options'|trans }}
{{ macro.icon('sliders-h') }} {{ 'title.options'|trans }}
</div>
<div class="card-body">
{% include '@bolt/content/_fields_aside.html.twig' %}
Expand Down
11 changes: 5 additions & 6 deletions templates/content/listing.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@

<div class="card mb-3">
<div class="card-header">
{{ 'title.contentlisting'|trans }} » {{ contentType.name }}
{{ macro.icon('star') }} {{ 'title.contentlisting'|trans }} » {{ contentType.name }}
</div>
<div class="card-body">
<p>
Expand Down Expand Up @@ -113,20 +113,19 @@
placeholder="{{ 'listing.placeholder_filter'|trans }}"/>
</p>
</div>
<div class="form-group">
{{ macro.button('listing.button_filter', 'filter', 'tertiary', {'type': 'submit'}) }}

{{ macro.button('listing.button_filter', 'filter', 'tertiary mb-0', {'type': 'submit'}) }}

{% if sortBy is not empty or filterValue is not empty %}
{{ macro.buttonlink('listing.button_clear', path('bolt_content_overview', {'contentType': contentType.slug}), 'times', 'tertiary') }}
{{ macro.buttonlink('listing.button_clear', path('bolt_content_overview', {'contentType': contentType.slug}), 'times', 'tertiary mb-0') }}
{% endif %}
</div>
</form>
</div>
</div>

<div class="card">
<div class="card-header">
{{ 'title.contentType'|trans }} {{ contentType.name }}
{{ macro.icon(contentType.icon_one) }} {{ 'title.contentType'|trans }} {{ contentType.name }}
</div>
<div class="card-body">

Expand Down
6 changes: 3 additions & 3 deletions translations/messages.de.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,10 @@
<target>Ansehen</target>
</segment>
</unit>
<unit id="SDVQEir" name="title.save_changes">
<unit id="SDVQEir" name="title.primary_actions">
<segment>
<source>title.save_changes</source>
<target>Änderungen speichern</target>
<source>title.primary_actions</source>
<target>Primäre Aktionen</target>
</segment>
</unit>
<unit id="dQIY7_J" name="action.preview">
Expand Down
14 changes: 7 additions & 7 deletions translations/messages.en.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -1044,7 +1044,7 @@
<unit id="ok6YulQ" name="action.view_saved">
<segment>
<source>action.view_saved</source>
<target>View (saved version) on site</target>
<target>View saved version</target>
</segment>
</unit>
<unit id="SeTqePC" name="label.display_name">
Expand Down Expand Up @@ -1929,10 +1929,10 @@
<target>Select Field to sort by…</target>
</segment>
</unit>
<unit id="SDVQEir" name="title.save_changes">
<unit id="SDVQEir" name="title.primary_actions">
<segment>
<source>title.save_changes</source>
<target>Save Changes</target>
<source>title.primary_actions</source>
<target>Primary Actions</target>
</segment>
</unit>
<unit id="7616Os4" name="title.options">
Expand Down Expand Up @@ -2283,19 +2283,19 @@
<target>Published</target>
</segment>
</unit>
<unit id="utGAKaW" name="status.draft">
<unit id="HJbHjee" name="status.draft">
<segment>
<source>status.draft</source>
<target>Draft</target>
</segment>
</unit>
<unit id="utGAKaE" name="status.timed">
<unit id="h7dP3WY" name="status.timed">
<segment>
<source>status.timed</source>
<target>Timed</target>
</segment>
</unit>
<unit id="utGAKaR" name="status.held">
<unit id="oxqDDuK" name="status.held">
<segment>
<source>status.held</source>
<target>Held</target>
Expand Down
Loading

0 comments on commit 3a46e32

Please sign in to comment.