-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
84 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
{% set response = datastar.runAction('entries/save-entry', { | ||
entryId: signals.entryId, | ||
title: signals.title, | ||
}) %} | ||
|
||
{% if response.isSuccessful %} | ||
{% fragment %} | ||
{# https://daisyui.com/components/alert/#success-color #} | ||
<div id="alert" data-show="alert.value" role="alert" class="alert alert-success"> | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
class="h-6 w-6 shrink-0 stroke-current" | ||
fill="none" | ||
viewBox="0 0 24 24"> | ||
<path | ||
stroke-linecap="round" | ||
stroke-linejoin="round" | ||
stroke-width="2" | ||
d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"/> | ||
</svg> | ||
<span> | ||
Entry successfully saved! | ||
</span> | ||
</div> | ||
<div id="title-{{ signals.entryId }}"> | ||
{{ signals.title }} | ||
</div> | ||
<button id="edit-{{ signals.entryId }}" data-on-click="entryId.value = {{ signals.entryId }}; title..value = '{{ signals.title }}'" data-show="entryId.value != {{ signals.entryId }}" class="btn"> | ||
Edit | ||
</button> | ||
{% endfragment %} | ||
{% do signals.entryId(0) %} | ||
{% else %} | ||
{% fragment %} | ||
{# https://daisyui.com/components/alert/#error-color #} | ||
<div id="alert" data-show="alert.value" role="alert" class="alert alert-error"> | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
class="h-6 w-6 shrink-0 stroke-current" | ||
fill="none" | ||
viewBox="0 0 24 24"> | ||
<path | ||
stroke-linecap="round" | ||
stroke-linejoin="round" | ||
stroke-width="2" | ||
d="M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"/> | ||
</svg> | ||
<span> | ||
Error! | ||
{% for error in response.data.errors %} | ||
{{ error|first }} | ||
{% endfor %} | ||
</span> | ||
</div> | ||
{% endfragment %} | ||
{% endif %} | ||
|
||
{% do signals.alert(true) %} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters