added webpack-encore for managing frontend assets #113 (#122)

* updated installation docu #113
* rewritten login page #113
* added icheck plugin #113
* changed to YesNoType in edit forms #113
* updated CONTRIBUTING.md #113
* added start of developer docu #113
* added compile scripts and compiled assets #113
This commit is contained in:
Kevin Papst
2018-02-01 22:26:19 +01:00
committed by GitHub
parent e35d73eab5
commit 7deaba8368
57 changed files with 9307 additions and 563 deletions

View File

@@ -1,123 +0,0 @@
<?php
/*
* This file is part of the Kimai package.
*
* (c) Kevin Papst <kevin@kevinpapst.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Command;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
/**
* Command used to execute all the basic application bootstrapping AFTER "composer install" was executed.
*
* @author Kevin Papst <kevin@kevinpapst.de>
*/
class InstallCommand extends Command
{
/**
* @var string
*/
protected $rootDir;
/**
* RunCodeSnifferCommand constructor.
* @param string $projectDirectory
*/
public function __construct($projectDirectory)
{
$this->rootDir = realpath($projectDirectory);
parent::__construct();
}
/**
* @inheritdoc
*/
protected function configure()
{
$this
->setName('kimai:install')
->setDescription('Execute all the basic installation tasks')
->setHelp('This command will bootstrap Kimai, copies asset installation by default')
->addOption('symlink', null, InputOption::VALUE_NONE, 'Symlinks the assets instead of copying it')
->addOption('relative', null, InputOption::VALUE_NONE, 'Make relative symlinks')
;
}
/**
* @inheritdoc
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$io = new SymfonyStyle($input, $output);
$arguments = [];
if ($input->getOption('relative')) {
$arguments = [
'--relative' => true,
];
} elseif ($input->getOption('symlink')) {
$arguments = [
'--symlink' => true,
];
}
try {
$command = $this->getApplication()->find('doctrine:database:create');
$command->run(new ArrayInput([]), $output);
} catch (\Exception $ex) {
$io->error('Failed to create database: ' . $ex->getMessage());
return 1;
}
try {
$command = $this->getApplication()->find('doctrine:schema:create');
$command->run(new ArrayInput([]), $output);
} catch (\Exception $ex) {
$io->error('Failed to create database schema ('.$ex->getCode().'): ' . $ex->getMessage());
return 2;
}
try {
$command = $this->getApplication()->find('avanzu:admin:fetch-vendor');
$command->run(new ArrayInput([]), $output);
} catch (\Exception $ex) {
$io->error('Failed to fetch vendors for avanzu-admin-theme: ' . $ex->getMessage());
return 3;
}
try {
$command = $this->getApplication()->find('avanzu:admin:initialize');
$command->run(
new ArrayInput(
array_merge([
'--web-dir' => $this->rootDir . '/public',
'--vendor-dir' => $this->rootDir . '/vendor',
], $arguments)
),
$output
);
} catch (\Exception $ex) {
$io->error('Failed to initialize avanzu-admin-theme: ' . $ex->getMessage());
return 4;
}
try {
$command = $this->getApplication()->find('assets:install');
$command->run(new ArrayInput($arguments), $output);
} catch (\Exception $ex) {
$io->error('Failed to install assets: ' . $ex->getMessage());
return 5;
}
}
}

View File

@@ -11,15 +11,15 @@
namespace App\Form;
use App\Form\Type\VisibilityType;
use App\Form\Type\YesNoType;
use App\Entity\Activity;
use App\Form\Type\ProjectType;
use App\Repository\ProjectRepository;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use App\Entity\Activity;
use App\Form\Type\ProjectType;
use App\Repository\ProjectRepository;
/**
* Defines the form used to manipulate Activities.
@@ -60,7 +60,7 @@ class ActivityEditForm extends AbstractType
},
])
// boolean
->add('visible', VisibilityType::class, [
->add('visible', YesNoType::class, [
'label' => 'label.visible',
])
;

View File

@@ -11,7 +11,8 @@
namespace App\Form;
use App\Form\Type\VisibilityType;
use App\Entity\Customer;
use App\Form\Type\YesNoType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CountryType;
use Symfony\Component\Form\Extension\Core\Type\CurrencyType;
@@ -23,7 +24,6 @@ use Symfony\Component\Form\Extension\Core\Type\TimezoneType;
use Symfony\Component\Form\Extension\Core\Type\UrlType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use App\Entity\Customer;
/**
* Defines the form used to edit Customer entities.
@@ -50,7 +50,7 @@ class CustomerEditForm extends AbstractType
'label' => 'label.comment',
'required' => false,
])
->add('visible', VisibilityType::class, [
->add('visible', YesNoType::class, [
'label' => 'label.visible',
])
->add('company', TextType::class, [

View File

@@ -11,17 +11,17 @@
namespace App\Form;
use App\Form\Type\VisibilityType;
use App\Entity\Customer;
use App\Entity\Project;
use App\Form\Type\CustomerType;
use App\Form\Type\YesNoType;
use App\Repository\CustomerRepository;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\MoneyType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use App\Entity\Customer;
use App\Entity\Project;
use App\Form\Type\CustomerType;
use App\Repository\CustomerRepository;
/**
* Defines the form used to edit Projects.
@@ -62,7 +62,7 @@ class ProjectEditForm extends AbstractType
return $repo->builderForEntityType($customer);
},
])
->add('visible', VisibilityType::class, [
->add('visible', YesNoType::class, [
'label' => 'label.visible',
])
->add('budget', MoneyType::class, [