guess im done?

This commit is contained in:
1Day 2021-12-13 11:47:35 +01:00
parent 6bc01d5ae6
commit 7ef8fdff4e
20 changed files with 126 additions and 75 deletions

View file

@ -52,7 +52,7 @@ class ApplicationApiController extends Controller
'memo' => $request->input('memo')
]);
return redirect()->route('admin.api.index')->with('success', 'api key created!');
return redirect()->route('admin.api.index')->with('success', __('api key created!'));
}
/**
@ -94,7 +94,7 @@ class ApplicationApiController extends Controller
$applicationApi->update($request->all());
return redirect()->route('admin.api.index')->with('success', 'api key updated!');
return redirect()->route('admin.api.index')->with('success', __('api key updated!'));
}
/**
@ -106,7 +106,7 @@ class ApplicationApiController extends Controller
public function destroy(ApplicationApi $applicationApi)
{
$applicationApi->delete();
return redirect()->back()->with('success', 'api key has been removed!');
return redirect()->back()->with('success', __('api key has been removed!'));
}
/**

View file

@ -92,7 +92,7 @@ class ConfigurationController extends Controller
$configuration->update($request->all());
return redirect()->route('admin.configurations.index')->with('success', 'configuration has been updated!');
return redirect()->route('admin.configurations.index')->with('success', __('configuration has been updated!'));
}
/**

View file

@ -93,7 +93,7 @@ class PaymentController extends Controller
'shipping_preference' => 'NO_SHIPPING'
]
];
@ -164,7 +164,7 @@ class PaymentController extends Controller
$user->update(['server_limit' => Configuration::getValueByKey('SERVER_LIMIT_AFTER_IRL_PURCHASE')]);
}
}
//update role
if ($user->role == 'member') {
$user->update(['role' => 'client']);
@ -192,7 +192,7 @@ class PaymentController extends Controller
event(new UserUpdateCreditsEvent($user));
//redirect back to home
return redirect()->route('home')->with('success', 'Your credit balance has been increased!');
return redirect()->route('home')->with('success', __('Your credit balance has been increased!'));
}
// If call returns body in response, you can get the deserialized version from the result attribute of the response
@ -220,7 +220,7 @@ class PaymentController extends Controller
*/
public function cancel(Request $request)
{
return redirect()->route('store.index')->with('success', 'Payment was Canceled');
return redirect()->route('store.index')->with('success', __('Payment was Canceled'));
}

View file

@ -62,7 +62,7 @@ class PaypalProductController extends Controller
$disabled = !is_null($request->input('disabled'));
PaypalProduct::create(array_merge($request->all(), ['disabled' => $disabled]));
return redirect()->route('admin.store.index')->with('success', 'Store item has been created!');
return redirect()->route('admin.store.index')->with('success', __('Store item has been created!'));
}
/**
@ -112,7 +112,7 @@ class PaypalProductController extends Controller
$disabled = !is_null($request->input('disabled'));
$paypalProduct->update(array_merge($request->all(), ['disabled' => $disabled]));
return redirect()->route('admin.store.index')->with('success', 'Store item has been updated!');
return redirect()->route('admin.store.index')->with('success', __('Store item has been updated!'));
}
/**
@ -124,7 +124,7 @@ class PaypalProductController extends Controller
{
$paypalProduct->update(['disabled' => !$paypalProduct->disabled]);
return redirect()->route('admin.store.index')->with('success', 'Product has been updated!');
return redirect()->route('admin.store.index')->with('success', __('Product has been updated!'));
}
/**
@ -136,7 +136,7 @@ class PaypalProductController extends Controller
public function destroy(PaypalProduct $paypalProduct)
{
$paypalProduct->delete();
return redirect()->back()->with('success', 'Store item has been removed!');
return redirect()->back()->with('success', __('Store item has been removed!'));
}

View file

@ -84,7 +84,7 @@ class ProductController extends Controller
$product->eggs()->attach($request->input('eggs'));
$product->nodes()->attach($request->input('nodes'));
return redirect()->route('admin.products.index')->with('success', 'Product has been created!');
return redirect()->route('admin.products.index')->with('success', __('Product has been created!'));
}
/**
@ -152,7 +152,7 @@ class ProductController extends Controller
$product->eggs()->attach($request->input('eggs'));
$product->nodes()->attach($request->input('nodes'));
return redirect()->route('admin.products.index')->with('success', 'Product has been updated!');
return redirect()->route('admin.products.index')->with('success', __('Product has been updated!'));
}
/**
@ -181,7 +181,7 @@ class ProductController extends Controller
}
$product->delete();
return redirect()->back()->with('success', 'Product has been removed!');
return redirect()->back()->with('success', __('Product has been removed!'));
}

View file

@ -92,9 +92,9 @@ class ServerController extends Controller
{
try {
$server->delete();
return redirect()->route('admin.servers.index')->with('success', 'Server removed');
return redirect()->route('admin.servers.index')->with('success', __('Server removed'));
} catch (Exception $e) {
return redirect()->route('admin.servers.index')->with('error', 'An exception has occurred while trying to remove a resource "' . $e->getMessage() . '"');
return redirect()->route('admin.servers.index')->with('error', __('An exception has occurred while trying to remove a resource "') . $e->getMessage() . '"');
}
}
@ -109,7 +109,7 @@ class ServerController extends Controller
return redirect()->back()->with('error', $exception->getMessage());
}
return redirect()->back()->with('success', 'Server has been updated!');
return redirect()->back()->with('success', __('Server has been updated!'));
}
/**

View file

@ -36,7 +36,7 @@ class SettingsController extends Controller
$request->file('favicon')->storeAs('public', 'favicon.ico');
}
return redirect()->route('admin.settings.index')->with('success', 'Icons updated!');
return redirect()->route('admin.settings.index')->with('success', __('Icons updated!'));
}
}

View file

@ -50,7 +50,7 @@ class UsefulLinkController extends Controller
]);
UsefulLink::create($request->all());
return redirect()->route('admin.usefullinks.index')->with('success', 'link has been created!');
return redirect()->route('admin.usefullinks.index')->with('success', __('link has been created!'));
}
/**
@ -94,7 +94,7 @@ class UsefulLinkController extends Controller
]);
$usefullink->update($request->all());
return redirect()->route('admin.usefullinks.index')->with('success', 'link has been updated!');
return redirect()->route('admin.usefullinks.index')->with('success', __('link has been updated!'));
}
/**
@ -106,7 +106,7 @@ class UsefulLinkController extends Controller
public function destroy(UsefulLink $usefullink)
{
$usefullink->delete();
return redirect()->back()->with('success', 'product has been removed!');
return redirect()->back()->with('success', __('product has been removed!'));
}
public function dataTable()

View file

@ -115,7 +115,7 @@ class UserController extends Controller
if (isset($this->pterodactyl->getUser($request->input('pterodactyl_id'))['errors'])) {
throw ValidationException::withMessages([
'pterodactyl_id' => ["User does not exists on pterodactyl's panel"]
'pterodactyl_id' => [__("User does not exists on pterodactyl's panel")]
]);
}
@ -145,7 +145,7 @@ class UserController extends Controller
public function destroy(User $user)
{
$user->delete();
return redirect()->back()->with('success', 'user has been removed!');
return redirect()->back()->with('success', __('user has been removed!'));
}
/**
@ -218,7 +218,7 @@ class UserController extends Controller
$all = $data["all"] ?? false;
$users = $all ? User::all() : User::whereIn("id", $data["users"])->get();
Notification::send($users, new DynamicNotification($data["via"], $database, $mail));
return redirect()->route('admin.users.notifications')->with('success', 'Notification sent!');
return redirect()->route('admin.users.notifications')->with('success', __('Notification sent!'));
}
/**
@ -232,7 +232,7 @@ class UserController extends Controller
return redirect()->back()->with('error', $exception->getMessage());
}
return redirect()->back()->with('success', 'User has been updated!');
return redirect()->back()->with('success', __('User has been updated!'));
}
/**

View file

@ -55,7 +55,7 @@ class VoucherController extends Controller
Voucher::create($request->except('_token'));
return redirect()->route('admin.vouchers.index')->with('success', 'voucher has been created!');
return redirect()->route('admin.vouchers.index')->with('success', __('voucher has been created!'));
}
/**
@ -101,7 +101,7 @@ class VoucherController extends Controller
$voucher->update($request->except('_token'));
return redirect()->route('admin.vouchers.index')->with('success', 'voucher has been updated!');
return redirect()->route('admin.vouchers.index')->with('success', __('voucher has been updated!'));
}
/**
@ -113,7 +113,7 @@ class VoucherController extends Controller
public function destroy(Voucher $voucher)
{
$voucher->delete();
return redirect()->back()->with('success', 'voucher has been removed!');
return redirect()->back()->with('success', __('voucher has been removed!'));
}
public function users(Voucher $voucher)
@ -140,19 +140,19 @@ class VoucherController extends Controller
#extra validations
if ($voucher->getStatus() == 'USES_LIMIT_REACHED') throw ValidationException::withMessages([
'code' => 'This voucher has reached the maximum amount of uses'
'code' => __('This voucher has reached the maximum amount of uses')
]);
if ($voucher->getStatus() == 'EXPIRED') throw ValidationException::withMessages([
'code' => 'This voucher has expired'
'code' => __('This voucher has expired')
]);
if (!$request->user()->vouchers()->where('id', '=', $voucher->id)->get()->isEmpty()) throw ValidationException::withMessages([
'code' => 'You already redeemed this voucher code'
'code' => __('You already redeemed this voucher code')
]);
if ($request->user()->credits + $voucher->credits >= 99999999) throw ValidationException::withMessages([
'code' => "You can't redeem this voucher because you would exceed the " . CREDITS_DISPLAY_NAME . " limit"
'code' => "You can't redeem this voucher because you would exceed the limit of " . CREDITS_DISPLAY_NAME
]);
#redeem voucher

View file

@ -15,7 +15,6 @@ class HomeController extends Controller
const TIME_LEFT_BG_SUCCESS = "bg-success";
const TIME_LEFT_BG_WARNING = "bg-warning";
const TIME_LEFT_BG_DANGER = "bg-danger";
const TIME_LEFT_OUT_OF_CREDITS_TEXT = "You ran out of Credits";
public function __construct()
{
@ -51,8 +50,8 @@ class HomeController extends Controller
*/
public function getTimeLeftBoxUnit(float $daysLeft, float $hoursLeft)
{
if ($daysLeft > 1) return 'days';
return $hoursLeft < 1 ? null : "hours";
if ($daysLeft > 1) return __('days');
return $hoursLeft < 1 ? null : __("hours");
}
/**
@ -66,7 +65,7 @@ class HomeController extends Controller
public function getTimeLeftBoxText(float $daysLeft, float $hoursLeft)
{
if ($daysLeft > 1) return strval(number_format($daysLeft, 0));
return ($hoursLeft < 1 ? $this::TIME_LEFT_OUT_OF_CREDITS_TEXT : strval($hoursLeft));
return ($hoursLeft < 1 ? __("You ran out of Credits") : strval($hoursLeft));
}
/** Show the application dashboard. */
@ -85,7 +84,7 @@ class HomeController extends Controller
$bg = $this->getTimeLeftBoxBackground($daysLeft);
$boxText = $this->getTimeLeftBoxText($daysLeft, $hoursLeft);
$unit = $daysLeft < 1 ? ($hoursLeft < 1 ? null : "hours") : "days";
$unit = $daysLeft < 1 ? ($hoursLeft < 1 ? null : __("hours")) : __("days");
}

View file

@ -86,6 +86,6 @@ class ProfileController extends Controller
'email' => $request->input('email'),
]);
return redirect()->route('profile.index')->with('success' , 'Profile updated');
return redirect()->route('profile.index')->with('success' , __('Profile updated'));
}
}

View file

@ -71,7 +71,7 @@ class ServerController extends Controller
{
//limit validation
if (Auth::user()->servers()->count() >= Auth::user()->server_limit) {
return redirect()->route('servers.index')->with('error', 'Server limit reached!');
return redirect()->route('servers.index')->with('error', __('Server limit reached!'));
}
// minimum credits
@ -89,12 +89,12 @@ class ServerController extends Controller
//Required Verification for creating an server
if (Configuration::getValueByKey('FORCE_EMAIL_VERIFICATION', 'false') === 'true' && !Auth::user()->hasVerifiedEmail()) {
return redirect()->route('profile.index')->with('error', "You are required to verify your email address before you can create a server.");
return redirect()->route('profile.index')->with('error', __("You are required to verify your email address before you can create a server."));
}
//Required Verification for creating an server
if (Configuration::getValueByKey('FORCE_DISCORD_VERIFICATION', 'false') === 'true' && !Auth::user()->discordUser) {
return redirect()->route('profile.index')->with('error', "You are required to link your discord account before you can create a server.");
return redirect()->route('profile.index')->with('error', __("You are required to link your discord account before you can create a server."));
}
return null;
@ -146,7 +146,7 @@ class ServerController extends Controller
}
}
return redirect()->route('servers.index')->with('success', 'Server created');
return redirect()->route('servers.index')->with('success', __('Server created'));
}
/**
@ -159,7 +159,7 @@ class ServerController extends Controller
$server->delete();
Auth::user()->notify(new ServerCreationError($server));
return redirect()->route('servers.index')->with('error', 'No allocations satisfying the requirements for automatic deployment on this node were found.');
return redirect()->route('servers.index')->with('error', __('No allocations satisfying the requirements for automatic deployment on this node were found.'));
}
/**
@ -180,9 +180,9 @@ class ServerController extends Controller
{
try {
$server->delete();
return redirect()->route('servers.index')->with('success', 'Server removed');
return redirect()->route('servers.index')->with('success', __('Server removed'));
} catch (Exception $e) {
return redirect()->route('servers.index')->with('error', 'An exception has occurred while trying to remove a resource "' . $e->getMessage() . '"');
return redirect()->route('servers.index')->with('error', __('An exception has occurred while trying to remove a resource "') . $e->getMessage() . '"');
}
}
}

View file

@ -18,12 +18,12 @@ class StoreController extends Controller
//Required Verification for creating an server
if (Configuration::getValueByKey('FORCE_EMAIL_VERIFICATION', false) === 'true' && !Auth::user()->hasVerifiedEmail()) {
return redirect()->route('profile.index')->with('error', "You are required to verify your email address before you can purchase credits.");
return redirect()->route('profile.index')->with('error', __("You are required to verify your email address before you can purchase credits."));
}
//Required Verification for creating an server
if (Configuration::getValueByKey('FORCE_DISCORD_VERIFICATION', false) === 'true' && !Auth::user()->discordUser) {
return redirect()->route('profile.index')->with('error', "You are required to link your discord account before you can purchase ".CREDITS_DISPLAY_NAME.".");
return redirect()->route('profile.index')->with('error', __("You are required to link your discord account before you can purchase Credits"));
}
return view('store.index')->with([

View file

@ -91,6 +91,9 @@
"Select panel icon": "Icon auswählen",
"Select panel favicon": "Favicon auswählen",
"Token": "Token",
"Last used": "Zuletzt benutzt",
"Store": "Laden",
"Currency code": "Währungscode",
"Checkout the paypal docs to select the appropriate code": "Siehe Paypal für die entsprechenden Codes",
@ -254,9 +257,56 @@
"By purchasing this product you agree and accept our terms of service": "Mit dem kauf akzeptierst du unsere TOS",
"There are no store products!": "Es gibt keine Produkte",
"The store is not correctly configured!": "Der Laden wurde nicht richtig konfiguriert",
"Out of Credits in": "Keine :credits mehr in"
"Out of Credits in": "Keine :credits mehr in",
"days": "Tage",
"hours": "Stunden",
"You ran out of Credits": "Keine Credits übrig!",
"Profile updated": "Profile updated",
"Server limit reached!": "Server limit erreicht",
"You are required to verify your email address before you can create a server.": "Du musst deine E-Mail verifizieren bevor du einen Server erstellen kannst",
"You are required to link your discord account before you can create a server.": "Du musst dein Discord verifizieren bevor du einen Server erstellen kannst",
"No allocations satisfying the requirements for automatic deployment on this node were found.": "Keine automatischen Portzuweisungen für dieses Node vorhanden",
"Server removed": "Server gelöscht",
"Server created": "Server erstellt!",
"An exception has occurred while trying to remove a resource \"": "Folgender Fehler ist aufgetreten: ",
"You are required to verify your email address before you can purchase credits.": "Vor dem Kauf musst du deine E-Mail verifizieren",
"You are required to link your discord account before you can purchase ": "Vor dem Kauf musst du dein Discord verlinken!",
"Warning!": "Warnung!",
"api key created!": "API Key erstellt",
"api key updated!": "API Key updated",
"api key has been removed!": "API Key gelöscht",
"configuration has been updated!": "Konfig updated",
"Pterodactyl synced": "Pterodactyl synced",
"Your credit balance has been increased!": "Dein Kontostand wurde updated",
"Payment was Canceled": "Zahlung abgebrochen",
"Store item has been created!": "Item wurde erstellt!",
"Store item has been updated!": "Item updated",
"Product has been updated!": "Product updated",
"Store item has been removed!":"Item gelöscht",
"Product has been created!": "Produkt erstellt",
"Product has been removed!": "Produkt gelöscht",
"Server has been updated!": "Server updated",
"Icons updated!": "Icons Updated",
"link has been created!": "Link erstellt!",
"link has been updated!": "Link updated!",
"user has been removed!": "User gelöscht",
"Notification sent!": "Nachricht gesendet",
"User has been updated!": "User updated!",
"User does not exists on pterodactyl's panel": "User existiert nicht in Pterodactyl",
"voucher has been created!": "Gutschein erstellt",
"voucher has been updated!": "Gutschein Updated",
"voucher has been removed!": "Gutschein gelöscht",
"This voucher has reached the maximum amount of uses": "Maximale Anzahl an Einlösungen erreicht",
"This voucher has expired": "Gutschein abgelaufen",
"You already redeemed this voucher code": "Du hast diesen Gutschein bereits eingelöst",
"You can't redeem this voucher because you would exceed the limit of ": "Du kannst diesen Gutschein nicht einlösen sonst hast du zu viele ",
" have been added to your balance!": "Wurden deinem Konto hinzugefügt"

View file

@ -6,13 +6,15 @@
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1>Application API</h1>
<h1>{{__('Application API')}}</h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="{{route('home')}}">Dashboard</a></li>
<li class="breadcrumb-item"><a href="{{route('admin.api.index')}}">Application API</a></li>
<li class="breadcrumb-item"><a class="text-muted" href="{{route('admin.api.create')}}">Create</a>
<li class="breadcrumb-item"><a href="{{route('home')}}">{{__('Dashboard')}}</a></li>
<li class="breadcrumb-item"><a href="{{route('admin.api.index')}}">{{__('Application API')}}</a>
</li>
<li class="breadcrumb-item"><a class="text-muted"
href="{{route('admin.api.create')}}">{{__('Create')}}</a>
</li>
</ol>
</div>
@ -33,7 +35,7 @@
@csrf
<div class="form-group">
<label for="memo">Memo</label>
<label for="memo">{{__('Memo')}}</label>
<input value="{{old('memo')}}" id="memo" name="memo" type="text"
class="form-control @error('memo') is-invalid @enderror">
@error('memo')
@ -45,7 +47,7 @@
<div class="form-group text-right">
<button type="submit" class="btn btn-primary">
Submit
{{__('Submit')}}
</button>
</div>
</form>

View file

@ -6,13 +6,15 @@
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1>Application API</h1>
<h1>{{__('Application API')}}</h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="{{route('home')}}">Dashboard</a></li>
<li class="breadcrumb-item"><a href="{{route('admin.api.index')}}">Application API</a></li>
<li class="breadcrumb-item"><a class="text-muted" href="{{route('admin.api.edit' , $applicationApi->token)}}">Edit</a>
<li class="breadcrumb-item"><a href="{{route('home')}}">{{__('Dashboard')}}</a></li>
<li class="breadcrumb-item"><a href="{{route('admin.api.index')}}">{{__('Application API')}}</a>
</li>
<li class="breadcrumb-item"><a class="text-muted"
href="{{route('admin.api.edit' , $applicationApi->token)}}">{{__('Edit')}}</a>
</li>
</ol>
</div>
@ -34,7 +36,7 @@
@method('PATCH')
<div class="form-group">
<label for="memo">Memo</label>
<label for="memo">{{__('Memo')}}</label>
<input value="{{$applicationApi->memo}}" id="memo" name="memo" type="text"
class="form-control @error('memo') is-invalid @enderror">
@error('memo')
@ -46,7 +48,7 @@
<div class="form-group text-right">
<button type="submit" class="btn btn-primary">
Submit
{{__('Submit')}}
</button>
</div>
</form>

View file

@ -6,12 +6,12 @@
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1>Application API</h1>
<h1>{{__('Application API')}}</h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="{{route('home')}}">Dashboard</a></li>
<li class="breadcrumb-item"><a class="text-muted" href="{{route('admin.api.index')}}">Application API</a></li>
<li class="breadcrumb-item"><a href="{{route('home')}}">{{__('Dashboard')}}</a></li>
<li class="breadcrumb-item"><a class="text-muted" href="{{route('admin.api.index')}}">{{__('Application API')}}</a></li>
</ol>
</div>
</div>
@ -27,9 +27,9 @@
<div class="card-header">
<div class="d-flex justify-content-between">
<h5 class="card-title"><i class="fa fa-gamepad mr-2"></i>Application API</h5>
<h5 class="card-title"><i class="fa fa-gamepad mr-2"></i>{{__('Application API')}}</h5>
<a href="{{route('admin.api.create')}}" class="btn btn-sm btn-primary"><i
class="fas fa-plus mr-1"></i>Create new</a>
class="fas fa-plus mr-1"></i>{{__('Create new')}}</a>
</div>
</div>
@ -38,9 +38,9 @@
<table id="datatable" class="table table-striped">
<thead>
<tr>
<th>Token</th>
<th>Memo</th>
<th>Last used</th>
<th>{{__('Token')}}</th>
<th>{{__('Memo')}}</th>
<th>{{__('Last used')}}</th>
<th></th>
</tr>
</thead>
@ -59,7 +59,7 @@
<script>
function submitResult() {
return confirm("Are you sure you wish to delete?") !== false;
return confirm("{{__('Are you sure you wish to delete?')}}") !== false;
}
document.addEventListener("DOMContentLoaded", function () {

View file

@ -328,9 +328,8 @@
@if(!Auth::user()->hasVerifiedEmail())
@if(Auth::user()->created_at->diffInHours(now(), false) > 1)
<div class="alert alert-warning p-2 m-2">
<h5><i class="icon fas fa-exclamation-circle"></i> Warning!</h5>
{{__('You have not yet verified your email address')}} <a class="text-primary" href="{{route('verification.send')}}">{{__('Click here to
resend verification email')}}</a> <br>
<h5><i class="icon fas fa-exclamation-circle"></i> {{__('Warning!')}}</h5>
{{__('You have not yet verified your email address')}} <a class="text-primary" href="{{route('verification.send')}}">{{__('Click here to resend verification email')}}</a> <br>
{{__('Please contact support If you didnt receive your verification email.')}}
</div>
@endif

View file

@ -30,8 +30,7 @@
<div class="alert alert-warning p-2 m-2">
<h5><i class="icon fas fa-exclamation-circle"></i>{{__('Required Email verification!')}}</h5>
{{__('You have not yet verified your email address')}}
<a class="text-primary" href="{{route('verification.send')}}">{{__('Click here to resend
verification email')}}</a> <br>
<a class="text-primary" href="{{route('verification.send')}}">{{__('Click here to resend verification email')}}</a> <br>
{{__('Please contact support If you didnt receive your verification email.')}}
</div>
@endif