[Favourite][Reply][Repeat] The respective svg for note actions is assigned. Repeat note handler needs work. "An exception has been thrown during the rendering of a template ("No value in table note matches the requested criteria")." exception thrown on repeat.

This commit is contained in:
Eliseu Amaro 2021-09-05 14:34:30 +01:00 committed by Hugo Sales
parent f9f4f179bb
commit f000532b7e
Signed by: someonewithpc
GPG Key ID: 7D0C7EAFC9D835A0
7 changed files with 56 additions and 21 deletions

View File

@ -67,7 +67,7 @@ class Favourite extends NoteHandlerPlugin
[
'label' => ' ',
'attr' => [
'class' => $is_set ? 'favourite-button-on' : 'favourite-button-off',
'class' => $is_set ? 'note-actions-set' : 'note-actions-unset',
],
],
],

View File

@ -50,9 +50,15 @@ class Repeat extends NoteHandlerPlugin
$is_set = false;
}
$form = Form::create([
['is_set', HiddenType::class, ['data' => $is_set ? '1' : '0']],
['note_id', HiddenType::class, ['data' => $note->getId()]],
['repeat', SubmitType::class, ['label' => ' ']],
['repeat', SubmitType::class,
[
'label' => ' ',
'attr' => [
'class' => $is_set ? 'note-actions-set' : 'note-actions-unset',
],
],
],
]);
// Handle form

View File

@ -60,7 +60,14 @@ class Reply extends NoteHandlerPlugin
['content', HiddenType::class, ['label' => ' ', 'required' => false]],
['attachments', HiddenType::class, ['label' => ' ', 'required' => false]],
['note_id', HiddenType::class, ['data' => $note->getId()]],
['reply', SubmitType::class, ['label' => ' ']],
['reply', SubmitType::class,
[
'label' => ' ',
'attr' => [
'class' => 'note-actions-unset',
],
],
],
]);
// Handle form

View File

@ -214,39 +214,51 @@ summary:focus {
display: flex;
vertical-align: middle;
}
.note-actions button {
margin-left: 5px;
}
.favourite-button-container {
.button-container {
width: 1em !important;
height: 1em !important;
}
.favourite-button-container button {
.button-container button {
all: unset;
border: none !important;
width: inherit !important;
height: inherit !important;
background-size: cover !important;
margin-left: 5px;
}
.button-container button:hover,
.button-container button:focus {
border: none !important;
background: var(--bg3) !important;
}
.favourite-button-container button {
-webkit-mask-image: url("../icons/heart.svg") !important;
-o-mask-image: url("../icons/heart.svg") !important;
-moz-mask-image: url("../icons/heart.svg") !important;
mask-image: url("../icons/heart.svg") !important;
}
.favourite-button-container button:hover,
.favourite-button-container button:focus {
border: none !important;
background: var(--bg3) !important;
.reply-button-container button {
-webkit-mask-image: url("../icons/reply.svg") !important;
-o-mask-image: url("../icons/reply.svg") !important;
-moz-mask-image: url("../icons/reply.svg") !important;
mask-image: url("../icons/reply.svg") !important;
}
.repeat-button-container button {
-webkit-mask-image: url("../icons/repeat.svg") !important;
-o-mask-image: url("../icons/repeat.svg") !important;
-moz-mask-image: url("../icons/repeat.svg") !important;
mask-image: url("../icons/repeat.svg") !important;
}
.favourite-button-off {
.note-actions-unset {
background: var(--bg2) !important;
}
.favourite-button-on {
.note-actions-set {
background: var(--white) !important;
}

View File

@ -1,5 +1,5 @@
<svg class="{{ iconClass|default('') }}" version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
<title>repeat</title>
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
<title>Recycle this note.</title>
<path d="M16.93 22.627c0.914-0.547 1.931-0.247 2.325 0.762l0.544 1.697 6.041 0.087c1.566 0.034 2.565-1.676 1.765-3.022l-1.661-2.793c-0.212-0.356-0.868-1.092-0.094-1.553l2.149-1.278c0.74-0.44 1.172 0.43 1.383 0.786l1.658 2.787c2.407 4.047-0.585 9.169-5.289 9.066l-6.075 0.337-0.691 1.568c-0.455 0.764-1.106 1.047-2.245 0.51l-4.627-3.773c-0.382-0.399-0.382-1.349 0.017-1.73z"></path>
<path d="M19.998 14.054c-0.935-0.511-1.191-1.54-0.52-2.391l1.187-1.328-2.984-5.253c-0.763-1.368-2.744-1.363-3.499 0.009l-1.567 2.846c-0.2 0.363-0.502 1.302-1.291 0.867l-2.19-1.206c-0.755-0.415-0.223-1.228-0.023-1.591l1.564-2.841c2.271-4.125 8.203-4.139 10.496-0.030l3.367 5.068 1.702-0.198c0.889 0.005 1.463 0.423 1.577 1.678l-0.91 5.9c-0.151 0.531-0.969 1.012-1.501 0.862z"></path>
<path d="M10.97 15.602c0.005 1.065-0.771 1.787-1.84 1.612l-1.737-0.396-3.153 5.154c-0.828 1.33 0.135 3.061 1.701 3.058l3.249-0.006c0.414-0.001 1.382-0.191 1.384 0.71l0.005 2.5c0.002 0.861-0.967 0.789-1.381 0.79l-3.243 0.006c-4.708 0.009-7.591-5.176-5.106-9.17l2.805-5.399-0.997-1.393c-0.426-0.78-0.337-1.485 0.705-2.192l5.604-2.059c0.538-0.125 1.355 0.358 1.48 0.896z"></path>

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -1,4 +1,4 @@
<svg class="{{ iconClass|default('') }}" version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
<title>reply</title>
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
<title>Reply!</title>
<path d="M0.958 15.559l5.203-10.197c0.499-1.17 1.745-3.012 3.015-0.799l0.933 1.625c10.329-3.208 17.723 1.178 19.613 6.884 1.208 3.645 0.922 8.871-1.711 13.899-0.663 0.954-1.522 0.315-1.375-0.532 3.126-11.733-6.743-17.108-11.882-10.468l0.81 1.99c0.518 1.271-0.64 1.541-2.779 1.161l-10.828-1.524c-0.884-0.232-1.358-1.197-0.999-2.039z"></path>
</svg>

Before

Width:  |  Height:  |  Size: 503 B

After

Width:  |  Height:  |  Size: 445 B

View File

@ -22,10 +22,20 @@
{% for current_action in get_note_actions(note) %}
{{ form_start(current_action) }}
{% if current_action.submit_fav is defined %}
<span title="Favourite this note." class="favourite-button-container">
<span title="Favourite this note." class="button-container favourite-button-container">
{{ form_widget(current_action.submit_fav) }}
</span>
{% endif %}
{% if current_action.repeat is defined %}
<span title="Repeat this note." class="button-container repeat-button-container">
{{ form_widget(current_action.repeat) }}
</span>
{% endif %}
{% if current_action.reply is defined %}
<span title="Reply to this note." class="button-container reply-button-container">
{{ form_widget(current_action.reply) }}
</span>
{% endif %}
{{ form_end(current_action) }}
{% endfor %}
{% endif %}