Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] add span to backpack button text #5343

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/resources/views/crud/buttons/create.blade.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@if ($crud->hasAccess('create'))
<a href="{{ url($crud->route.'/create') }}" class="btn btn-primary" data-style="zoom-in">
<span><i class="la la-plus"></i> {{ trans('backpack::crud.add') }} {{ $crud->entity_name }}</span>
<span><i class="la la-plus"></i> <span class="create-button-text-span">{{ trans('backpack::crud.add') }} {{ $crud->entity_name }}</span></span>
</a>
Comment on lines 2 to 4
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about we add bp-button="create" to the anchor? That way you can style the button itself too, if needed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And it'd be similar to our other CSS hooks, bp-section

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@endif
2 changes: 1 addition & 1 deletion src/resources/views/crud/buttons/delete.blade.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@if ($crud->hasAccess('delete'))
<a href="javascript:void(0)" onclick="deleteEntry(this)" data-route="{{ url($crud->route.'/'.$entry->getKey()) }}" class="btn btn-sm btn-link" data-button-type="delete">
<span><i class="la la-trash"></i> {{ trans('backpack::crud.delete') }}</span>
<span><i class="la la-trash"></i> <span class="delete-button-text-span">{{ trans('backpack::crud.delete') }}</span></span>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need two spans? One for the entire button content, one for the text? Cause if we only need one for the text, it should be as easy as moving the span start after the icon. No class needed:

Suggested change
<span><i class="la la-trash"></i> <span class="delete-button-text-span">{{ trans('backpack::crud.delete') }}</span></span>
<i class="la la-trash"></i> <span>{{ trans('backpack::crud.delete') }}</span>

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sma-sexiest-man-alive-gif-by-maytag

</a>
@endif

Expand Down
2 changes: 1 addition & 1 deletion src/resources/views/crud/buttons/quick.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@
@endforeach
>
@if ($icon) <i class="{{ $icon }}"></i> @endif
{{ $label }}
<span class="{{$button->name}}-button-text-span">{{ $label }}</span>
</{{ $wrapper['element'] }}>
@endif
2 changes: 1 addition & 1 deletion src/resources/views/crud/buttons/reorder.blade.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@if ($crud->get('reorder.enabled') && $crud->hasAccess('reorder'))
<a href="{{ url($crud->route.'/reorder') }}" class="btn btn-outline-primary" data-style="zoom-in">
<span><i class="la la-arrows"></i> {{ trans('backpack::crud.reorder') }} {{ $crud->entity_name_plural }}</span>
<span><i class="la la-arrows"></i> <span class="reorder-button-text-span">{{ trans('backpack::crud.reorder') }} {{ $crud->entity_name_plural }}</span></span>
</a>
@endif
2 changes: 1 addition & 1 deletion src/resources/views/crud/buttons/show.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

{{-- Single edit button --}}
<a href="{{ url($crud->route.'/'.$entry->getKey().'/show') }}" class="btn btn-sm btn-link">
<span><i class="la la-eye"></i> {{ trans('backpack::crud.preview') }}</span>
<span><i class="la la-eye"></i> <span class="show-button-text-span">{{ trans('backpack::crud.preview') }}</span></span>
</a>

@else
Expand Down
2 changes: 1 addition & 1 deletion src/resources/views/crud/buttons/update.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

{{-- Single edit button --}}
<a href="{{ url($crud->route.'/'.$entry->getKey().'/edit') }}" class="btn btn-sm btn-link">
<span><i class="la la-edit"></i> {{ trans('backpack::crud.edit') }}</span>
<span><i class="la la-edit"></i> <span class="update-button-text-span">{{ trans('backpack::crud.edit') }}</span></span>
</a>

@else
Expand Down