[PLUGINS][Favourite][CSS] Favourite label now shows whether it's favourited or not already.

This commit is contained in:
Eliseu Amaro 2021-09-06 22:39:01 +01:00 committed by Hugo Sales
parent 0cecc67376
commit 681144b380
Signed by: someonewithpc
GPG Key ID: 7D0C7EAFC9D835A0
3 changed files with 7 additions and 2 deletions

View File

@ -36,6 +36,7 @@ use App\Util\Nickname;
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\HttpFoundation\Request;
use function App\Core\I18n\_m;
class Favourite extends NoteHandlerPlugin
{
@ -65,7 +66,7 @@ class Favourite extends NoteHandlerPlugin
$form_fav = Form::create([
['submit_favourite', SubmitType::class,
[
'label' => ' ',
'label' => $is_set ? _m('Note already favourite!.') : _m('Favourite this note.'),
'attr' => [
'class' => $is_set ? 'note-actions-set' : 'note-actions-unset',
],

View File

@ -320,6 +320,9 @@ summary:hover .icon-details-open {
}
.favourite-button-container button {
text-indent: -9999em;
text-transform: uppercase;
-webkit-mask-image: url("../icons/heart.svg") !important;
-o-mask-image: url("../icons/heart.svg") !important;
-moz-mask-image: url("../icons/heart.svg") !important;

View File

@ -22,7 +22,8 @@
{% for current_action in get_note_actions(note) %}
{{ form_start(current_action) }}
{% if current_action.submit_favourite is defined %}
<span title="Favourite this note." class="button-container favourite-button-container">
<span title="Favourite this note." class="button-container favourite-button-container"
{% if current_action.submit_favourite is defined %}{% endif %}>
{{ form_widget(current_action.submit_favourite) }}
</span>
{% endif %}