Moved frontend, templates and lang to resources

main
Igor Scheller 6 years ago
parent 4bf3a68f43
commit c1a1180d1f

@ -5,7 +5,7 @@ RUN composer --no-ansi dump-autoload --optimize
FROM node:8-alpine as themes
WORKDIR /app
COPY frontend/ /app/frontend
COPY resources/assets/ /app/resources/assets
COPY .babelrc package.json webpack.config.js /app/
RUN apk add --no-cache yarn
RUN yarn install
@ -17,10 +17,9 @@ COPY bin/ /app/bin
COPY config/ /app/config
COPY db/ /app/db
COPY includes/ /app/includes
COPY locale/ /app/locale
COPY public/ /app/public
COPY resources/ /app/resources
COPY src/ /app/src
COPY templates/ /app/templates
COPY composer.json LICENSE package.json README.md /app/

@ -16,7 +16,7 @@ require __DIR__ . '/includes.php';
* Check for maintenance
*/
if ($app->get('config')->get('maintenance')) {
echo file_get_contents(__DIR__ . '/../templates/layouts/maintenance.html');
echo file_get_contents(__DIR__ . '/../resources/views/layouts/maintenance.html');
die();
}

@ -13,5 +13,5 @@ function credits_title()
*/
function guest_credits()
{
return view(__DIR__ . '/../../templates/pages/credits.html');
return view(__DIR__ . '/../../resources/views/pages/credits.html');
}

@ -224,7 +224,7 @@ function view_user_shifts()
return page([
div('col-md-12', [
msg(),
view(__DIR__ . '/../../templates/pages/user-shifts.html', [
view(__DIR__ . '/../../resources/views/pages/user-shifts.html', [
'title' => shifts_title(),
'room_select' => make_select($rooms, $shiftsFilter->getRooms(), 'rooms', _('Rooms')),
'start_select' => html_select_key(

@ -1,5 +1,7 @@
<?php
use Engelsystem\Renderer\Twig\Extensions\Assets;
/**
* Render a stat for dashborad (big number with label).
* If no style given, style is danger if number > 0, and success if number == 0.
@ -450,26 +452,39 @@ function table_body($array)
*/
function ReplaceSmilies($msg)
{
$msg = str_replace(';o))', '<img src="pic/smiles/icon_redface.gif">', $msg);
$msg = str_replace(':-))', '<img src="pic/smiles/icon_redface.gif">', $msg);
$msg = str_replace(';o)', '<img src="pic/smiles/icon_wind.gif">', $msg);
$msg = str_replace(':)', '<img src="pic/smiles/icon_smile.gif">', $msg);
$msg = str_replace(':-)', '<img src="pic/smiles/icon_smile.gif">', $msg);
$msg = str_replace(':(', '<img src="pic/smiles/icon_sad.gif">', $msg);
$msg = str_replace(':-(', '<img src="pic/smiles/icon_sad.gif">', $msg);
$msg = str_replace(':o(', '<img src="pic/smiles/icon_sad.gif">', $msg);
$msg = str_replace(':o)', '<img src="pic/smiles/icon_lol.gif">', $msg);
$msg = str_replace(';o(', '<img src="pic/smiles/icon_cry.gif">', $msg);
$msg = str_replace(';(', '<img src="pic/smiles/icon_cry.gif">', $msg);
$msg = str_replace(';-(', '<img src="pic/smiles/icon_cry.gif">', $msg);
$msg = str_replace('8)', '<img src="pic/smiles/icon_rolleyes.gif">', $msg);
$msg = str_replace('8o)', '<img src="pic/smiles/icon_rolleyes.gif">', $msg);
$msg = str_replace(':P', '<img src="pic/smiles/icon_evil.gif">', $msg);
$msg = str_replace(':-P', '<img src="pic/smiles/icon_evil.gif">', $msg);
$msg = str_replace(':oP', '<img src="pic/smiles/icon_evil.gif">', $msg);
$msg = str_replace(';P', '<img src="pic/smiles/icon_mad.gif">', $msg);
$msg = str_replace(';oP', '<img src="pic/smiles/icon_mad.gif">', $msg);
$msg = str_replace('?)', '<img src="pic/smiles/icon_question.gif">', $msg);
/** @var Assets $assets */
$assets = app('twig.extension.assets');
foreach (
[
';o))' => 'redface',
':-))' => 'redface',
';o)' => 'wind',
':)' => 'smile',
':-)' => 'smile',
':(' => 'sad',
':-(' => 'sad',
':o(' => 'sad',
':o)' => 'lol',
':D' => 'lol',
';o(' => 'cry',
';(' => 'cry',
';-(' => 'cry',
'8)' => 'rolleyes',
'8o)' => 'rolleyes',
':P' => 'evil',
':-P' => 'evil',
':oP' => 'evil',
';P' => 'mad',
';oP' => 'mad',
'?)' => 'question',
] as $search => $replace
) {
$msg = str_ireplace($search, sprintf(
'<img src="%s">',
sprintf($assets->getAsset('emojis/%s.gif'), $replace)
), $msg);
}
return $msg;
}

Before

Width:  |  Height:  |  Size: 498 B

After

Width:  |  Height:  |  Size: 498 B

Before

Width:  |  Height:  |  Size: 236 B

After

Width:  |  Height:  |  Size: 236 B

Before

Width:  |  Height:  |  Size: 336 B

After

Width:  |  Height:  |  Size: 336 B

Before

Width:  |  Height:  |  Size: 174 B

After

Width:  |  Height:  |  Size: 174 B

Before

Width:  |  Height:  |  Size: 248 B

After

Width:  |  Height:  |  Size: 248 B

Before

Width:  |  Height:  |  Size: 650 B

After

Width:  |  Height:  |  Size: 650 B

Before

Width:  |  Height:  |  Size: 485 B

After

Width:  |  Height:  |  Size: 485 B

Before

Width:  |  Height:  |  Size: 171 B

After

Width:  |  Height:  |  Size: 171 B

Before

Width:  |  Height:  |  Size: 174 B

After

Width:  |  Height:  |  Size: 174 B

Before

Width:  |  Height:  |  Size: 170 B

After

Width:  |  Height:  |  Size: 170 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 561 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 933 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 954 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 951 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 956 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 904 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 933 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 961 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 977 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 980 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 939 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 170 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 172 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 171 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 172 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 170 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 236 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 176 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 349 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 171 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 176 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 171 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 174 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 238 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 937 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1009 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 531 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 971 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 915 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 940 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1005 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 994 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 972 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 929 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 980 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 945 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 951 B

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

@ -1,4 +1,4 @@
@import "../../node_modules/bootstrap/less/bootstrap";
@import "../../../node_modules/bootstrap/less/bootstrap";
@import "../angelFont/angelFont.css";
body {

@ -1,4 +1,4 @@
@import "../../node_modules/bootstrap/less/variables";
@import "../../../node_modules/bootstrap/less/variables";
/*
The MIT License (MIT)

@ -1,4 +1,4 @@
@import "../../node_modules/bootstrap/less/variables";
@import "../../../node_modules/bootstrap/less/variables";
@brand-primary: #758499;
@brand-success: #7b9c41;

@ -1,4 +1,4 @@
@import "../../node_modules/bootstrap/less/variables";
@import "../../../node_modules/bootstrap/less/variables";
@brand-primary: #f19224;
@brand-success: #39AB50;

@ -1,4 +1,4 @@
@import "../../node_modules/bootstrap/less/variables";
@import "../../../node_modules/bootstrap/less/variables";
/*
The MIT License (MIT)

@ -1,4 +1,4 @@
@import "../../node_modules/bootstrap/less/variables";
@import "../../../node_modules/bootstrap/less/variables";
@brand-primary: rgb(164, 28, 49);
@brand-success: rgb(153, 204, 0);

@ -1,4 +1,4 @@
@import "../../node_modules/bootstrap/less/variables";
@import "../../../node_modules/bootstrap/less/variables";
/*
The MIT License (MIT)

@ -106,8 +106,10 @@ class Application extends Container
$this->instance('path', $appPath);
$this->instance('path.config', $appPath . DIRECTORY_SEPARATOR . 'config');
$this->instance('path.lang', $appPath . DIRECTORY_SEPARATOR . 'locale');
$this->instance('path.views', $appPath . DIRECTORY_SEPARATOR . 'templates');
$this->instance('path.resources', $appPath . DIRECTORY_SEPARATOR . 'resources');
$this->instance('path.assets', $this->get('path.resources') . DIRECTORY_SEPARATOR . 'assets');
$this->instance('path.views', $this->get('path.resources') . DIRECTORY_SEPARATOR . 'views');
$this->instance('path.lang', $this->get('path.resources') . DIRECTORY_SEPARATOR . 'lang');
}
/**

@ -46,8 +46,10 @@ class ApplicationTest extends TestCase
$app->setAppPath('.');
$this->assertTrue($app->has('path'));
$this->assertTrue($app->has('path.assets'));
$this->assertTrue($app->has('path.config'));
$this->assertTrue($app->has('path.lang'));
$this->assertTrue($app->has('path.resources'));
$this->assertTrue($app->has('path.views'));
$this->assertEquals(realpath('.'), $app->path());

@ -20,7 +20,7 @@ const plugins = [
const themeEntries = {};
for (let i = 0; i < 7; i++) {
themeEntries[`theme${i}`] = `./frontend/themes/theme${i}.less`;
themeEntries[`theme${i}`] = `./resources/assets/themes/theme${i}.less`;
}
module.exports = {
@ -30,7 +30,7 @@ module.exports = {
},
entry: {
...themeEntries,
vendor: './frontend/js/vendor.js',
vendor: './resources/assets/js/vendor.js',
},
output: {
path: path.resolve('public/assets'),

Loading…
Cancel
Save