feat(settings): add sponsorship popup toggle and corresponding database migration
This commit is contained in:
@@ -68,6 +68,9 @@ class Index extends Component
|
||||
#[Validate('boolean')]
|
||||
public bool $disable_two_step_confirmation;
|
||||
|
||||
#[Validate('boolean')]
|
||||
public bool $is_sponsorship_popup_enabled;
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.settings.index');
|
||||
@@ -96,6 +99,7 @@ class Index extends Component
|
||||
$this->update_check_frequency = $this->settings->update_check_frequency;
|
||||
$this->instance_timezone = $this->settings->instance_timezone;
|
||||
$this->disable_two_step_confirmation = $this->settings->disable_two_step_confirmation;
|
||||
$this->is_sponsorship_popup_enabled = $this->settings->is_sponsorship_popup_enabled;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,6 +138,7 @@ class Index extends Component
|
||||
$this->settings->update_check_frequency = $this->update_check_frequency;
|
||||
$this->settings->disable_two_step_confirmation = $this->disable_two_step_confirmation;
|
||||
$this->settings->instance_timezone = $this->instance_timezone;
|
||||
$this->settings->is_sponsorship_popup_enabled = $this->is_sponsorship_popup_enabled;
|
||||
if ($isSave) {
|
||||
$this->settings->save();
|
||||
$this->dispatch('success', 'Settings updated!');
|
||||
|
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('instance_settings', function (Blueprint $table) {
|
||||
$table->boolean('is_sponsorship_popup_enabled')->default(true);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('instance_settings', function (Blueprint $table) {
|
||||
$table->dropColumn('is_sponsorship_popup_enabled');
|
||||
});
|
||||
}
|
||||
};
|
@@ -87,38 +87,42 @@
|
||||
@endif
|
||||
</span>
|
||||
@endauth
|
||||
<span x-show="popups.sponsorship">
|
||||
<x-popup>
|
||||
<x-slot:title>
|
||||
Would you like to help us to make more cool things?
|
||||
</x-slot:title>
|
||||
<x-slot:icon>
|
||||
<img src="{{ asset('heart.png') }}" class="w-8 h-8 sm:w-12 sm:h-12 lg:w-16 lg:h-16">
|
||||
</x-slot:icon>
|
||||
<x-slot:description>
|
||||
<div class="text-md dark:text-white">
|
||||
<span>We are already profitable, but we would like to scale even further.</span>
|
||||
<br><span>Please
|
||||
consider donating on one (or both) of the following platforms.<br /><br /> <a
|
||||
href="https://github.com/sponsors/coollabsio"
|
||||
class="underline text-lg font-bold dark:text-white">GitHub
|
||||
Sponsors</a> (registration required) <br /><br />
|
||||
<a href="https://opencollective.com/coollabsio/donate?interval=month&amount=10&name=&legalName=&email="
|
||||
class="underline text-lg font-bold dark:text-white">OpenCollective</a> (no registration
|
||||
required).</span>
|
||||
</div>
|
||||
</x-slot:description>
|
||||
<x-slot:button-text @click="disableSponsorship()">
|
||||
Disable This Popup
|
||||
</x-slot:button-text>
|
||||
</x-popup>
|
||||
</span>
|
||||
@if (instanceSettings()->is_sponsorship_popup_enabled)
|
||||
<span x-show="popups.sponsorship">
|
||||
<x-popup>
|
||||
<x-slot:title>
|
||||
Would you like to help us to make more cool things?
|
||||
</x-slot:title>
|
||||
<x-slot:icon>
|
||||
<img src="{{ asset('heart.png') }}" class="w-8 h-8 sm:w-12 sm:h-12 lg:w-16 lg:h-16">
|
||||
</x-slot:icon>
|
||||
<x-slot:description>
|
||||
<div class="text-md dark:text-white">
|
||||
<span>We are already profitable, but we would like to scale even further.</span>
|
||||
<br><span>Please
|
||||
consider donating on one (or both) of the following platforms.<br /><br /> <a
|
||||
href="https://github.com/sponsors/coollabsio"
|
||||
class="underline text-lg font-bold dark:text-white">GitHub
|
||||
Sponsors</a> (registration required) <br /><br />
|
||||
<a href="https://opencollective.com/coollabsio/donate?interval=month&amount=10&name=&legalName=&email="
|
||||
class="underline text-lg font-bold dark:text-white">OpenCollective</a> (no registration
|
||||
required).</span>
|
||||
</div>
|
||||
</x-slot:description>
|
||||
<x-slot:button-text @click="disableSponsorship()">
|
||||
Disable This Popup
|
||||
</x-slot:button-text>
|
||||
</x-popup>
|
||||
</span>
|
||||
@endif
|
||||
@if (currentTeam()->subscriptionPastOverDue())
|
||||
<x-banner :closable=false>
|
||||
<div><span class="font-bold text-red-500">WARNING:</span> Your subscription is in over-due. If your latest
|
||||
<div><span class="font-bold text-red-500">WARNING:</span> Your subscription is in over-due. If your
|
||||
latest
|
||||
payment is not paid within a week, all automations <span class="font-bold text-red-500">will
|
||||
be deactivated</span>. Visit <a href="{{ route('subscription.show') }}"
|
||||
class="underline dark:text-white">/subscription</a> to check your subscription status or pay your
|
||||
class="underline dark:text-white">/subscription</a> to check your subscription status or pay
|
||||
your
|
||||
invoice (or check your email for the invoice).
|
||||
</div>
|
||||
</x-banner>
|
||||
|
@@ -97,7 +97,7 @@
|
||||
helper="Allowed IP lists for the API. A comma separated list of IPs. Empty means you allow from everywhere."
|
||||
placeholder="1.1.1.1,8.8.8.8" />
|
||||
<h4 class="pt-6">Update</h4>
|
||||
<div class="text-right md:w-96">
|
||||
<div class="text-right md:w-96 pb-4">
|
||||
@if (!is_null(config('constants.coolify.autoupdate', null)))
|
||||
<div class="text-right md:w-96">
|
||||
<x-forms.checkbox instantSave helper="AUTOUPDATE is set in .env file, you need to modify it there."
|
||||
@@ -128,6 +128,10 @@
|
||||
</div>
|
||||
|
||||
<h4 class="py-4">Confirmation Settings</h4>
|
||||
<div class="md:w-96 ">
|
||||
<x-forms.checkbox instantSave id="is_sponsorship_popup_enabled" label="Show Sponsorship Popup"
|
||||
helper="When enabled, sponsorship popups will be shown monthly to users. When disabled, the sponsorship popup will be permanently hidden for all users." />
|
||||
</div>
|
||||
|
||||
@if ($disable_two_step_confirmation)
|
||||
<div class="md:w-96 pb-4" wire:key="two-step-confirmation-enabled">
|
||||
|
Reference in New Issue
Block a user