From fbb1a781cca2d8d2570fa456d8cd5b7c0b6cc646 Mon Sep 17 00:00:00 2001 From: HolgerHatGarKeineNode Date: Sat, 11 Feb 2023 17:06:28 +0100 Subject: [PATCH] tweet confirmation added --- resources/lang/de.json | 3 +- resources/lang/en.json | 3 +- resources/lang/es.json | 3 +- resources/lang/fr.json | 3 +- resources/lang/hr.json | 3 +- resources/lang/it.json | 3 +- resources/lang/mk.json | 3 +- resources/lang/pl.json | 3 +- resources/lang/pt.json | 3 +- resources/lang/sv.json | 3 +- resources/lang/tr.json | 3 +- .../livewire/news/article-overview.blade.php | 29 ++++++++++++++----- 12 files changed, 44 insertions(+), 18 deletions(-) diff --git a/resources/lang/de.json b/resources/lang/de.json index 2f06f6af..fa6d1521 100644 --- a/resources/lang/de.json +++ b/resources/lang/de.json @@ -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." } diff --git a/resources/lang/en.json b/resources/lang/en.json index 49b1b7be..a31d8182 100644 --- a/resources/lang/en.json +++ b/resources/lang/en.json @@ -753,5 +753,6 @@ "Article not approved yet": "", "Article tweeted": "", "Error tweeting article": "", - "Tweet": "" + "Tweet": "", + "Are you sure you want to tweet this article?": "" } \ No newline at end of file diff --git a/resources/lang/es.json b/resources/lang/es.json index 178c949a..91e1b8ad 100644 --- a/resources/lang/es.json +++ b/resources/lang/es.json @@ -753,5 +753,6 @@ "Article not approved yet": "", "Article tweeted": "", "Error tweeting article": "", - "Tweet": "" + "Tweet": "", + "Are you sure you want to tweet this article?": "" } \ No newline at end of file diff --git a/resources/lang/fr.json b/resources/lang/fr.json index b2f16d94..f6ec74ca 100644 --- a/resources/lang/fr.json +++ b/resources/lang/fr.json @@ -754,5 +754,6 @@ "Article not approved yet": "", "Article tweeted": "", "Error tweeting article": "", - "Tweet": "" + "Tweet": "", + "Are you sure you want to tweet this article?": "" } \ No newline at end of file diff --git a/resources/lang/hr.json b/resources/lang/hr.json index 234db7eb..8cb1db50 100644 --- a/resources/lang/hr.json +++ b/resources/lang/hr.json @@ -754,5 +754,6 @@ "Article not approved yet": "", "Article tweeted": "", "Error tweeting article": "", - "Tweet": "" + "Tweet": "", + "Are you sure you want to tweet this article?": "" } \ No newline at end of file diff --git a/resources/lang/it.json b/resources/lang/it.json index fa9d1603..99c654fe 100644 --- a/resources/lang/it.json +++ b/resources/lang/it.json @@ -754,5 +754,6 @@ "Article not approved yet": "", "Article tweeted": "", "Error tweeting article": "", - "Tweet": "" + "Tweet": "", + "Are you sure you want to tweet this article?": "" } \ No newline at end of file diff --git a/resources/lang/mk.json b/resources/lang/mk.json index cf980997..aa38a33c 100644 --- a/resources/lang/mk.json +++ b/resources/lang/mk.json @@ -754,5 +754,6 @@ "Article not approved yet": "", "Article tweeted": "", "Error tweeting article": "", - "Tweet": "" + "Tweet": "", + "Are you sure you want to tweet this article?": "" } \ No newline at end of file diff --git a/resources/lang/pl.json b/resources/lang/pl.json index 2f81e7c8..76fbad0b 100644 --- a/resources/lang/pl.json +++ b/resources/lang/pl.json @@ -754,5 +754,6 @@ "Article not approved yet": "", "Article tweeted": "", "Error tweeting article": "", - "Tweet": "" + "Tweet": "", + "Are you sure you want to tweet this article?": "" } \ No newline at end of file diff --git a/resources/lang/pt.json b/resources/lang/pt.json index 59d73100..bb8da6ad 100644 --- a/resources/lang/pt.json +++ b/resources/lang/pt.json @@ -754,5 +754,6 @@ "Article not approved yet": "", "Article tweeted": "", "Error tweeting article": "", - "Tweet": "" + "Tweet": "", + "Are you sure you want to tweet this article?": "" } \ No newline at end of file diff --git a/resources/lang/sv.json b/resources/lang/sv.json index 29deb994..786a7ff6 100644 --- a/resources/lang/sv.json +++ b/resources/lang/sv.json @@ -716,5 +716,6 @@ "Article not approved yet": "", "Article tweeted": "", "Error tweeting article": "", - "Tweet": "" + "Tweet": "", + "Are you sure you want to tweet this article?": "" } \ No newline at end of file diff --git a/resources/lang/tr.json b/resources/lang/tr.json index 5f4c298a..b3c95d6a 100644 --- a/resources/lang/tr.json +++ b/resources/lang/tr.json @@ -728,5 +728,6 @@ "Article not approved yet": "", "Article tweeted": "", "Error tweeting article": "", - "Tweet": "" + "Tweet": "", + "Are you sure you want to tweet this article?": "" } \ No newline at end of file diff --git a/resources/views/livewire/news/article-overview.blade.php b/resources/views/livewire/news/article-overview.blade.php index 58505aad..0d60bb48 100644 --- a/resources/views/livewire/news/article-overview.blade.php +++ b/resources/views/livewire/news/article-overview.blade.php @@ -68,20 +68,35 @@ @endif
+ 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'))
@if($libraryItem->approved) - {{ __('approved') }} - @if(auth()->user()?->hasRole('news-editor') && !$libraryItem->tweet) +
+ {{ __('approved') }} +
+ @else +
+ {{ __('not approved') }} +
+ @endif +
+
+ @if($libraryItem->approved && auth()->user()?->hasRole('news-editor') && !$libraryItem->tweet) +
+ 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') }}'}, + })" + > {{ __('Tweet') }} - @endif - @else - {{ __('not approved') }} +
@endif