tweet confirmation added

This commit is contained in:
HolgerHatGarKeineNode
2023-02-11 17:06:28 +01:00
parent 5ae2f9d498
commit fbb1a781cc
12 changed files with 44 additions and 18 deletions

View File

@@ -757,5 +757,6 @@
"Article not approved yet": "Artikel noch nicht genehmigt",
"Article tweeted": "Artikel getwittert",
"Error tweeting article": "Fehler beim Twittern des Artikels",
"Tweet": "Tweet"
"Tweet": "Tweet",
"Are you sure you want to tweet this article?": "Bitte bestätige, dass du diesen Artikel tweeten möchtest."
}

View File

@@ -753,5 +753,6 @@
"Article not approved yet": "",
"Article tweeted": "",
"Error tweeting article": "",
"Tweet": ""
"Tweet": "",
"Are you sure you want to tweet this article?": ""
}

View File

@@ -753,5 +753,6 @@
"Article not approved yet": "",
"Article tweeted": "",
"Error tweeting article": "",
"Tweet": ""
"Tweet": "",
"Are you sure you want to tweet this article?": ""
}

View File

@@ -754,5 +754,6 @@
"Article not approved yet": "",
"Article tweeted": "",
"Error tweeting article": "",
"Tweet": ""
"Tweet": "",
"Are you sure you want to tweet this article?": ""
}

View File

@@ -754,5 +754,6 @@
"Article not approved yet": "",
"Article tweeted": "",
"Error tweeting article": "",
"Tweet": ""
"Tweet": "",
"Are you sure you want to tweet this article?": ""
}

View File

@@ -754,5 +754,6 @@
"Article not approved yet": "",
"Article tweeted": "",
"Error tweeting article": "",
"Tweet": ""
"Tweet": "",
"Are you sure you want to tweet this article?": ""
}

View File

@@ -754,5 +754,6 @@
"Article not approved yet": "",
"Article tweeted": "",
"Error tweeting article": "",
"Tweet": ""
"Tweet": "",
"Are you sure you want to tweet this article?": ""
}

View File

@@ -754,5 +754,6 @@
"Article not approved yet": "",
"Article tweeted": "",
"Error tweeting article": "",
"Tweet": ""
"Tweet": "",
"Are you sure you want to tweet this article?": ""
}

View File

@@ -754,5 +754,6 @@
"Article not approved yet": "",
"Article tweeted": "",
"Error tweeting article": "",
"Tweet": ""
"Tweet": "",
"Are you sure you want to tweet this article?": ""
}

View File

@@ -716,5 +716,6 @@
"Article not approved yet": "",
"Article tweeted": "",
"Error tweeting article": "",
"Tweet": ""
"Tweet": "",
"Are you sure you want to tweet this article?": ""
}

View File

@@ -728,5 +728,6 @@
"Article not approved yet": "",
"Article tweeted": "",
"Error tweeting article": "",
"Tweet": ""
"Tweet": "",
"Are you sure you want to tweet this article?": ""
}

View File

@@ -68,20 +68,35 @@
@endif
</div>
<div
class="flex flex-wrap space-x-1 text-sm text-gray-500 justify-end items-end">
class="flex space-x-1 text-sm text-gray-500 justify-end items-end">
@if($libraryItem->created_by === auth()->id() || auth()->user()?->hasRole('news-editor'))
<div>
@if($libraryItem->approved)
<div>
<x-badge green>{{ __('approved') }}</x-badge>
@if(auth()->user()?->hasRole('news-editor') && !$libraryItem->tweet)
</div>
@else
<div>
<x-badge negative>{{ __('not approved') }}</x-badge>
</div>
@endif
</div>
<div>
@if($libraryItem->approved && auth()->user()?->hasRole('news-editor') && !$libraryItem->tweet)
<div x-data="{}">
<x-button xs
wire:click="tweet({{ $libraryItem->id }})">
x-on:click="$wireui.confirmDialog({
icon: 'question',
title: '{{ __('Are you sure you want to tweet this article?')}}',
accept: {label: '{{ __('Yes') }}',
execute: () => $wire.tweet({{ $libraryItem->id }})},
reject: {label: '{{ __('No, cancel') }}'},
})"
>
<i class="fa fa-brand fa-twitter"></i>
{{ __('Tweet') }}
</x-button>
@endif
@else
<x-badge negative>{{ __('not approved') }}</x-badge>
</div>
@endif
</div>
<div>