Translations & keep our public folder
Diff
.gitignore | 1 +-
app/Http/Controllers/Admin/RequestLineBanController.php | 2 +-
app/Http/Controllers/Auth/AuthController.php | 7 +-
app/Http/Controllers/DJ/DJSaysController.php | 6 +-
app/Http/Controllers/DJ/RequestController.php | 4 +-
app/Http/Controllers/DJ/TimetableController.php | 14 ++--
app/Http/Controllers/Event/TimetableController.php | 14 ++--
app/Http/Controllers/StatsController.php | 5 +--
app/Http/Middleware/Authenticate.php | 2 +-
app/Models/Event.php | 1 +-
public/.gitignore | 4 +-
public/.htaccess | 20 ++++++-
public/favicon.ico | 0
public/index.php | 58 ++++++++++++++++++-
public/robots.txt | 2 +-
public/web.config | 23 +++++++-
resources/assets/js/push-notifications.js | 6 ++-
17 files changed, 140 insertions(+), 29 deletions(-)
@@ -2,7 +2,6 @@
/node_modules
/public/storage
/storage
/public
Homestead.yaml
Homestead.json
.env
@@ -47,7 +47,7 @@ class RequestLineBanController extends Controller {
return redirect()->route('dashboard::admin::request-ban')->with('msg', [
'type' => 'success',
'msg' => 'Successfully banned IP address from the request line.'
'msg' => _('Successfully banned IP address from the request line.')
]);
}
@@ -43,16 +43,17 @@ class AuthController extends Controller
case 'private-dj':
// trying to subscribe to DJ push notifications. ensure they're a DJ.
if (!auth()->user()->is(Group::RADIO_DJ, Group::GUEST_DJ)) {
abort(403, 'Unauthorized.');
abort(403, _('Unauthorized.'));
}
break;
default:
// they're trying to subscribe to a channel we don't know about. don't let them do it.
abort(403, 'Unauthorized.');
abort(403, _('Unauthorized.'));
break;
}
return Pusher::connection()->socket_auth($request->get('channel_name'), $request->get('socket_id'));
return response(Pusher::connection()->socket_auth($request->get('channel_name'), $request->get('socket_id')))
->header('Content-Type', 'application/json');
}
}
@@ -21,7 +21,7 @@ class DJSaysController extends Controller
public function getForm()
{
$says = DJSays::remember(5)->orderBy('id', 'desc')->take(1)->first();
return view('dj.dj-says', ['current' => $says ? e($says->msg) : 'Currently unset.']);
return view('dj.dj-says', ['current' => $says ? e($says->msg) : _('Currently unset.')]);
}
/**
@@ -34,7 +34,7 @@ class DJSaysController extends Controller
{
$this->validate($request, [
'msg' => 'required|string|max:200'
], [], ['msg' => 'DJ Says']);
], [], ['msg' => _('DJ Says')]);
$says = new DJSays;
$says->dj = auth()->user()->userid;
@@ -59,7 +59,7 @@ class DJSaysController extends Controller
if ($says) {
return ['dj' => User::remember(30)->find($says->dj)->username, 'msg' => e($says->msg)];
} else {
return ['dj' => 'Unavailable', 'msg' => 'Currently unset.'];
return ['dj' => _('Unavailable'), 'msg' => _('Currently unset.')];
}
}
}
@@ -34,7 +34,7 @@ class RequestController extends Controller
public function deleteRequest(int $id)
{
Request::findOrFail($id)->delete();
return redirect()->back()->with('msg', ['type' => 'success', 'msg' => 'Successfully deleted request.']);
return redirect()->back()->with('msg', ['type' => 'success', 'msg' => _('Successfully deleted request.')]);
}
/**
@@ -50,7 +50,7 @@ class RequestController extends Controller
'request' => 'required|string|max:500'
]);
if (RequestBan::where('ip', $request->ip())->count()) {
if (RequestBan::where('ip_address', $request->ip())->count()) {
// This IP is banned from the request line.
abort(403);
}
@@ -138,13 +138,13 @@ class TimetableController extends Controller
$week = Timetable::where('week', Carbon::now()->weekOfYear)->where('year', Carbon::now()->year)->get();
$timetable = [
0 => ['name' => 'Monday'],
1 => ['name' => 'Tuesday'],
2 => ['name' => 'Wednesday'],
3 => ['name' => 'Thursday'],
4 => ['name' => 'Friday'],
5 => ['name' => 'Saturday'],
6 => ['name' => 'Sunday']
0 => ['name' => _('Monday')],
1 => ['name' => _('Tuesday')],
2 => ['name' => _('Wednesday')],
3 => ['name' => _('Thursday')],
4 => ['name' => _('Friday')],
5 => ['name' => _('Saturday')],
6 => ['name' => _('Sunday')]
];
foreach ($week as $slot) {
@@ -191,13 +191,13 @@ class TimetableController extends Controller
->get();
$timetable = [
0 => ['name' => 'Monday'],
1 => ['name' => 'Tuesday'],
2 => ['name' => 'Wednesday'],
3 => ['name' => 'Thursday'],
4 => ['name' => 'Friday'],
5 => ['name' => 'Saturday'],
6 => ['name' => 'Sunday']
0 => ['name' => _('Monday')],
1 => ['name' => _('Tuesday')],
2 => ['name' => _('Wednesday')],
3 => ['name' => _('Thursday')],
4 => ['name' => _('Friday')],
5 => ['name' => _('Saturday')],
6 => ['name' => _('Sunday')]
];
foreach ($week as $slot) {
@@ -55,10 +55,7 @@ class StatsController extends Controller
file_put_contents(storage_path('stats.json'), json_encode($ret));
}
return [
'dj' => $stats->dj,
'song' => $stats->song
];
return $ret;
} else {
return json_decode(file_get_contents(storage_path('stats.json')), true);
}
@@ -20,7 +20,7 @@ class Authenticate
{
if (Auth::guard($guard)->guest()) {
if ($request->ajax() || $request->wantsJson()) {
return response('Unauthorized.', $request->is('auth/pusher') ? 403 : 401);
return response(_('Unauthorized.'), $request->is('auth/pusher') ? 403 : 401);
} else {
return redirect()->guest(route('auth::login'));
}
@@ -20,6 +20,7 @@ use Illuminate\Database\Query\Builder;
* @property integer $hour
* @property integer $event_type_id
* @property integer $room_id
* @property boolean $approved
* @property Carbon $created_at
* @property Carbon $updated_at
* @property string $deleted_at
@@ -0,0 +1,4 @@
build/
css/
fonts/
js/
@@ -0,0 +1,20 @@
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>
@@ -0,0 +1,58 @@
<?php
/**
* Laravel - A PHP Framework For Web Artisans
*
* @package Laravel
* @author Taylor Otwell <taylorotwell@gmail.com>
*/
/*
|--------------------------------------------------------------------------
| Register The Auto Loader
|--------------------------------------------------------------------------
|
| Composer provides a convenient, automatically generated class loader for
| our application. We just need to utilize it! We'll simply require it
| into the script here so that we don't have to worry about manual
| loading any of our classes later on. It feels nice to relax.
|
*/
require __DIR__.'/../bootstrap/autoload.php';
/*
|--------------------------------------------------------------------------
| Turn On The Lights
|--------------------------------------------------------------------------
|
| We need to illuminate PHP development, so let us turn on the lights.
| This bootstraps the framework and gets it ready for use, then it
| will load up this application so that we can run it and send
| the responses back to the browser and delight our users.
|
*/
$app = require_once __DIR__.'/../bootstrap/app.php';
/*
|--------------------------------------------------------------------------
| Run The Application
|--------------------------------------------------------------------------
|
| Once we have the application, we can handle the incoming request
| through the kernel, and send the associated response back to
| the client's browser allowing them to enjoy the creative
| and wonderful application we have prepared for them.
|
*/
$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);
$response = $kernel->handle(
$request = Illuminate\Http\Request::capture()
);
$response->send();
$kernel->terminate($request, $response);
@@ -0,0 +1,2 @@
User-agent: *
Disallow:
@@ -0,0 +1,23 @@
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Imported Rule 1" stopProcessing="true">
<match url="^(.*)/$" ignoreCase="false" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
</conditions>
<action type="Redirect" redirectType="Permanent" url="/{R:1}" />
</rule>
<rule name="Imported Rule 2" stopProcessing="true">
<match url="^" ignoreCase="false" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
</conditions>
<action type="Rewrite" url="index.php" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
@@ -1,5 +1,11 @@
import Pusher from 'pusher-websocket-iso';
Pusher.log = function (message) {
if (window.console && window.console.log) {
window.console.log(message);
}
};
const bindPusher = () => {
if (IS_DJ) {
const pusher = new Pusher(PUSHER_APP_KEY, {