├── .gitignore ├── Gruntfile.js ├── LICENSE ├── Procfile ├── README.md ├── app ├── .htaccess ├── AppCache.php ├── AppKernel.php ├── BootCampKernel.php ├── DoctrineMigrations │ ├── Version20140731100000.php │ ├── Version20140731135018.php │ ├── Version20140731150213.php │ ├── Version20140731151542.php │ ├── Version20140731153316.php │ ├── Version20140731155704.php │ ├── Version20141129182419.php │ ├── Version20150311093354.php │ └── Version20150314111201.php ├── Resources │ └── views │ │ ├── base.html.twig │ │ └── forms.html.twig ├── SymfonyRequirements.php ├── autoload.php ├── check.php ├── config │ ├── config.yml │ ├── config_bootcamp.yml │ ├── config_dev.yml │ ├── config_prod.yml │ ├── config_test.yml │ ├── defaults │ │ ├── data.environment.dist.yml │ │ └── data.parameters.dist.yml │ ├── environment.yml │ ├── parameters.yml │ ├── routing.yml │ ├── routing_dev.yml │ └── security.yml ├── console ├── logs │ └── .gitkeep └── phpunit.xml.dist ├── bower.json ├── composer.json ├── composer.lock ├── data └── .gitkeep ├── docker ├── Dockerfile ├── README.md ├── baikal.conf └── docker-compose.yml ├── package.json ├── scalingo.json ├── src ├── .htaccess ├── Baikal │ ├── AdminBundle │ │ ├── BaikalAdminBundle.php │ │ ├── Controller │ │ │ ├── Addressbook │ │ │ │ ├── FormController.php │ │ │ │ ├── ListController.php │ │ │ │ └── ViewController.php │ │ │ ├── Application │ │ │ │ ├── FormController.php │ │ │ │ └── ListController.php │ │ │ ├── AuthController.php │ │ │ ├── Calendar │ │ │ │ ├── FormController.php │ │ │ │ ├── InstructionsController.php │ │ │ │ ├── ListController.php │ │ │ │ └── ViewController.php │ │ │ ├── DashboardController.php │ │ │ ├── SettingsController.php │ │ │ └── User │ │ │ │ ├── FormController.php │ │ │ │ ├── InfoController.php │ │ │ │ └── ListController.php │ │ ├── DependencyInjection │ │ │ ├── Configuration.php │ │ │ └── NetgustoBaikalAdminExtension.php │ │ ├── Menu │ │ │ └── Builder.php │ │ ├── Resources │ │ │ ├── config │ │ │ │ ├── config.yml │ │ │ │ ├── routing.yml │ │ │ │ └── services.yml │ │ │ ├── doc │ │ │ │ └── index.rst │ │ │ ├── sources │ │ │ │ └── less │ │ │ │ │ └── style.less │ │ │ ├── translations │ │ │ │ └── messages.fr.xlf │ │ │ └── views │ │ │ │ ├── Addressbook │ │ │ │ ├── form.html.twig │ │ │ │ ├── list.html.twig │ │ │ │ └── view.html.twig │ │ │ │ ├── Application │ │ │ │ ├── form.html.twig │ │ │ │ └── list.html.twig │ │ │ │ ├── Auth │ │ │ │ └── loginform.html.twig │ │ │ │ ├── Calendar │ │ │ │ ├── form.html.twig │ │ │ │ ├── instructions.html.twig │ │ │ │ ├── list.html.twig │ │ │ │ └── view.html.twig │ │ │ │ ├── Dashboard │ │ │ │ └── index.html.twig │ │ │ │ ├── Layouts │ │ │ │ ├── fullscreen.html.twig │ │ │ │ ├── partials │ │ │ │ │ ├── _footer.html.twig │ │ │ │ │ └── _header.html.twig │ │ │ │ └── standard.html.twig │ │ │ │ ├── Settings │ │ │ │ └── index.html.twig │ │ │ │ └── User │ │ │ │ ├── form.html.twig │ │ │ │ ├── info.html.twig │ │ │ │ └── list.html.twig │ │ └── Service │ │ │ └── AccessDeniedHandler.php │ ├── BootCampBundle │ │ ├── BaikalBootCampBundle.php │ │ ├── DependencyInjection │ │ │ ├── BaikalBootCampExtension.php │ │ │ └── Configuration.php │ │ ├── InitHandler │ │ │ ├── ConfigInitHandler.php │ │ │ └── UserInitHandler.php │ │ └── Resources │ │ │ └── config │ │ │ └── services.yml │ ├── FrontendBundle │ │ ├── BaikalFrontendBundle.php │ │ ├── Controller │ │ │ ├── Addressbook │ │ │ │ ├── FormController.php │ │ │ │ ├── ListController.php │ │ │ │ └── ViewController.php │ │ │ ├── AuthController.php │ │ │ ├── Calendar │ │ │ │ ├── FormController.php │ │ │ │ ├── InstructionsController.php │ │ │ │ ├── ListController.php │ │ │ │ └── ViewController.php │ │ │ ├── DashboardController.php │ │ │ └── ProfileController.php │ │ ├── DependencyInjection │ │ │ ├── Configuration.php │ │ │ └── NetgustoBaikalFrontendExtension.php │ │ ├── Form │ │ │ └── Type │ │ │ │ ├── Calendar │ │ │ │ └── CalendarType.php │ │ │ │ └── User │ │ │ │ └── EditUserType.php │ │ ├── Menu │ │ │ └── Builder.php │ │ ├── Resources │ │ │ ├── config │ │ │ │ ├── config.yml │ │ │ │ ├── routing.yml │ │ │ │ └── services.yml │ │ │ ├── doc │ │ │ │ └── index.rst │ │ │ ├── public │ │ │ │ └── css │ │ │ │ │ └── style.css │ │ │ ├── translations │ │ │ │ └── messages.fr.xlf │ │ │ └── views │ │ │ │ ├── Addressbook │ │ │ │ ├── form.html.twig │ │ │ │ ├── list.html.twig │ │ │ │ └── view.html.twig │ │ │ │ ├── Auth │ │ │ │ ├── loginform.html.twig │ │ │ │ └── oauthloginform.html.twig │ │ │ │ ├── Calendar │ │ │ │ ├── form.html.twig │ │ │ │ ├── instructions.html.twig │ │ │ │ ├── list.html.twig │ │ │ │ └── view.html.twig │ │ │ │ ├── Dashboard │ │ │ │ └── index.html.twig │ │ │ │ ├── Layouts │ │ │ │ ├── fullscreen.html.twig │ │ │ │ ├── partials │ │ │ │ │ ├── _footer.html.twig │ │ │ │ │ └── _header.html.twig │ │ │ │ └── standard.html.twig │ │ │ │ └── Profile │ │ │ │ └── index.html.twig │ │ └── Service │ │ │ ├── AccessDeniedHandler.php │ │ │ └── OAuthPreLoginRedirectFormAuthenticationEntryPoint.php │ ├── SystemBundle │ │ ├── BaikalSystemBundle.php │ │ ├── Controller │ │ │ └── SecurityController.php │ │ ├── DependencyInjection │ │ │ ├── BaikalSystemExtension.php │ │ │ └── Configuration.php │ │ ├── Entity │ │ │ └── User.php │ │ ├── Resources │ │ │ ├── config │ │ │ │ ├── config.yml │ │ │ │ ├── doctrine │ │ │ │ │ └── User.orm.yml │ │ │ │ └── services.yml │ │ │ ├── public │ │ │ │ └── img │ │ │ │ │ ├── baikal-logo.svg │ │ │ │ │ └── matriochka.svg │ │ │ └── views │ │ │ │ └── Security │ │ │ │ └── accessDenied.html.twig │ │ └── Services │ │ │ ├── AbstractConfigService.php │ │ │ ├── ConfigLoader │ │ │ ├── AbstractConfigLoaderService.php │ │ │ ├── DbBackedConfigLoaderService.php │ │ │ └── FileBackedConfigLoaderService.php │ │ │ └── MainConfigService.php │ └── ViewComponentsBundle │ │ ├── BaikalViewComponentsBundle.php │ │ ├── DependencyInjection │ │ ├── BaikalViewComponentsExtension.php │ │ └── Configuration.php │ │ ├── Resources │ │ ├── config │ │ │ └── services.yml │ │ ├── public │ │ │ └── img │ │ │ │ ├── baikal-logo.svg │ │ │ │ └── matriochka.svg │ │ └── views │ │ │ ├── Components │ │ │ ├── Addressbook │ │ │ │ ├── form.html.twig │ │ │ │ └── list.html.twig │ │ │ ├── Calendar │ │ │ │ ├── form.html.twig │ │ │ │ ├── form.scripts.html.twig │ │ │ │ ├── instructions.html.twig │ │ │ │ └── list.html.twig │ │ │ ├── Dashboard │ │ │ │ └── license.html.twig │ │ │ ├── SPA │ │ │ │ ├── calclient.html.twig │ │ │ │ └── cardclient.html.twig │ │ │ ├── User │ │ │ │ └── list.html.twig │ │ │ ├── addbutton.html.twig │ │ │ ├── avatar.textsize.html.twig │ │ │ ├── calendarpill.html.twig │ │ │ ├── flash.notice.html.twig │ │ │ ├── list.html.twig │ │ │ ├── list.scripts.html.twig │ │ │ ├── loginform.html.twig │ │ │ ├── modal.html.twig │ │ │ ├── nothinghere.html.twig │ │ │ └── pageheader.html.twig │ │ │ ├── Layouts │ │ │ ├── fullpage.html.twig │ │ │ └── standard.html.twig │ │ │ └── Menu │ │ │ └── topmenu.html.twig │ │ ├── Services │ │ └── FormHandler │ │ │ ├── AddressbookFormHandler.php │ │ │ ├── ApplicationFormHandler.php │ │ │ └── CalendarFormHandler.php │ │ └── Twig │ │ ├── BaikalExtension.php │ │ └── MenuExtension.php └── Netgusto │ └── PortalBundle │ ├── DependencyInjection │ ├── Configuration.php │ └── NetgustoPortalExtension.php │ ├── NetgustoPortalBundle.php │ ├── Resources │ └── config │ │ └── services.yml │ └── Twig │ └── PortalExtension.php └── web ├── .htaccess ├── app.php ├── app_dev.php ├── apple-touch-icon.png ├── apps └── calclient-month │ ├── .bowerrc │ ├── .editorconfig │ ├── .ember-cli │ ├── .jshintrc │ ├── .travis.yml │ ├── .yo-rc.json │ ├── Brocfile.js │ ├── README.md │ ├── app │ ├── app.js │ ├── components │ │ └── event-form.coffee │ ├── controllers │ │ ├── .gitkeep │ │ └── index.js │ ├── index.html │ ├── initializers │ │ └── config.js │ ├── router.js │ ├── styles │ │ ├── .gitkeep │ │ └── app.css │ └── templates │ │ ├── .gitkeep │ │ ├── application.hbs │ │ ├── components │ │ └── event-form.hbs │ │ └── index.hbs │ ├── bower.json │ ├── config │ └── environment.js │ ├── dist │ ├── .gitkeep │ ├── assets │ │ ├── ember-cli-cal-demoapp.css │ │ ├── ember-cli-cal-demoapp.js │ │ ├── failed.png │ │ ├── passed.png │ │ ├── test-loader.js │ │ ├── test-support.css │ │ ├── test-support.js │ │ ├── vendor.css │ │ └── vendor.js │ ├── crossdomain.xml │ ├── index.html │ ├── robots.txt │ ├── testem.js │ └── tests │ │ └── index.html │ ├── package.json │ ├── public │ ├── .gitkeep │ ├── crossdomain.xml │ └── robots.txt │ ├── testem.json │ ├── tests │ ├── .jshintrc │ ├── helpers │ │ ├── resolver.js │ │ └── start-app.js │ ├── index.html │ ├── test-helper.js │ └── unit │ │ ├── .gitkeep │ │ └── controllers │ │ └── index-test.js │ └── vendor │ └── .gitkeep ├── assets ├── css │ ├── bootstrap.css │ ├── bundled.css │ ├── bundled.min.css │ ├── font-awesome.css │ └── jquery.minicolors.css ├── dist │ ├── buddies.min.js │ ├── buddies.min.js.gz │ ├── bundled.css │ ├── bundled.js │ ├── bundled.min.css │ ├── bundled.min.css.gz │ ├── bundled.min.js │ ├── bundled.min.js.gz │ ├── pulpy.min.js │ └── pulpy.min.js.gz ├── fonts │ ├── FontAwesome.otf │ ├── fontawesome-webfont.eot │ ├── fontawesome-webfont.svg │ ├── fontawesome-webfont.ttf │ ├── fontawesome-webfont.woff │ └── fontawesome-webfont.woff2 ├── images │ ├── baikal-logo.svg │ └── matriochka.svg └── js │ ├── bootstrap.js │ ├── bundled.js │ ├── bundled.min.js │ ├── jquery.js │ └── jquery.minicolors.min.js ├── config.php ├── favicon.ico └── robots.txt /.gitignore: -------------------------------------------------------------------------------- 1 | /web/bundles/ 2 | /web/vendor/ 3 | /web/css/ 4 | /web/js/ 5 | /app/bootstrap.php.cache 6 | /app/cache/* 7 | /app/logs/* 8 | !app/cache/.gitkeep 9 | !app/logs/.gitkeep 10 | /data/* 11 | !data/.gitkeep 12 | /build/ 13 | /vendor/ 14 | /bin/ 15 | /composer.phar 16 | 17 | /web/apps/* 18 | 19 | /node_modules 20 | /bower_components 21 | /npm-debug.log 22 | -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | web: bin/heroku-php-apache2 web/ -------------------------------------------------------------------------------- /app/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | Require all denied 3 | 4 | 5 | Order deny,allow 6 | Deny from all 7 | 8 | -------------------------------------------------------------------------------- /app/AppCache.php: -------------------------------------------------------------------------------- 1 | getEnvironment(), array('dev', 'test'))) { 47 | $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle(); 48 | $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle(); 49 | #$bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle(); 50 | } 51 | 52 | return $bundles; 53 | } 54 | 55 | public function registerContainerConfiguration(LoaderInterface $loader) 56 | { 57 | $loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml'); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /app/BootCampKernel.php: -------------------------------------------------------------------------------- 1 | createTable('BootCampStatus'); 17 | 18 | $bootcampstatus->addColumn('id', 'integer')->setAutoincrement(true); 19 | 20 | $bootcampstatus->addColumn('configuredversion', 'string', array( 21 | 'length' => 32, 22 | )); 23 | 24 | $bootcampstatus->setPrimaryKey(array('id')); 25 | } 26 | 27 | public function down(Schema $schema) { 28 | 29 | } 30 | } -------------------------------------------------------------------------------- /app/DoctrineMigrations/Version20140731150213.php: -------------------------------------------------------------------------------- 1 | createTable('locks'); 17 | 18 | $locks->addColumn('id', 'integer')->setAutoincrement(true); 19 | 20 | $locks->addColumn('owner', 'string', array( 21 | 'length' => 100, 22 | 'notnull' => false, 23 | )); 24 | 25 | $locks->addColumn('timeout', 'integer', array( 26 | 'notnull' => false, 27 | )); 28 | 29 | $locks->addColumn('created', 'integer', array( 30 | 'notnull' => false, 31 | )); 32 | 33 | $locks->addColumn('token', 'string', array( 34 | 'length' => 100, 35 | 'notnull' => false, 36 | )); 37 | 38 | $locks->addColumn('scope', 'integer', array( 39 | 'notnull' => false, 40 | )); 41 | 42 | $locks->addColumn('depth', 'integer', array( 43 | 'notnull' => false, 44 | )); 45 | 46 | $locks->addColumn('uri', 'string', array( 47 | 'length' => 1000, 48 | 'notnull' => false, 49 | )); 50 | 51 | $locks->setPrimaryKey(array('id')); 52 | 53 | $locks->addIndex(array('token')); 54 | 55 | ####################################################################### 56 | # Baikal\DavServicesBundle\Entity\PropertyStorage 57 | ####################################################################### 58 | 59 | $propertystorage = $schema->createTable('propertystorage'); 60 | 61 | $propertystorage->addColumn('id', 'integer')->setAutoincrement(true); 62 | 63 | $propertystorage->addColumn('path', 'string', array( 64 | 'length' => 1024, 65 | )); 66 | 67 | $propertystorage->addColumn('name', 'string', array( 68 | 'length' => 100, 69 | )); 70 | 71 | $propertystorage->addColumn('value', 'blob'); 72 | 73 | $propertystorage->setPrimaryKey(array('id')); 74 | } 75 | 76 | public function down(Schema $schema) { 77 | $schema->dropTable('locks'); 78 | $schema->dropTable('groupmembers'); 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /app/DoctrineMigrations/Version20140731155704.php: -------------------------------------------------------------------------------- 1 | createTable('ConfigContainer'); 17 | 18 | $configcontainer->addColumn('id', 'integer')->setAutoincrement(true); 19 | 20 | $configcontainer->addColumn('name', 'string', array( 21 | 'length' => 255, 22 | )); 23 | 24 | $configcontainer->addColumn('config', 'json_array'); 25 | 26 | $configcontainer->setPrimaryKey(array('id')); 27 | } 28 | 29 | public function down(Schema $schema) { 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /app/DoctrineMigrations/Version20150311093354.php: -------------------------------------------------------------------------------- 1 | getTable('calendarobjects'); 21 | $calendarobjects->addColumn('uid', 'string', array( 22 | 'notnull' => false, 23 | )); 24 | 25 | $schedulingobjects = $schema->createTable('schedulingobjects'); 26 | $schedulingobjects->addColumn('id', 'integer')->setAutoincrement(true); 27 | 28 | $schedulingobjects->addColumn('principaluri', 'string', array( 29 | 'length' => 255, 30 | 'notnull' => false, 31 | )); 32 | 33 | $schedulingobjects->addColumn('calendardata', 'text', array( 34 | 'notnull' => false, 35 | )); 36 | 37 | $schedulingobjects->addColumn('uri', 'string', array( 38 | 'length' => 200, 39 | 'notnull' => false, 40 | )); 41 | 42 | $schedulingobjects->addColumn('lastmodified', 'integer', array( 43 | 'notnull' => false, 44 | )); 45 | 46 | $schedulingobjects->addColumn('etag', 'string', array( 47 | 'length' => 255, 48 | 'notnull' => false, 49 | )); 50 | 51 | $schedulingobjects->addColumn('size', 'integer', array( 52 | 'notnull' => false, 53 | )); 54 | 55 | $schedulingobjects->setPrimaryKey(array('id')); 56 | 57 | } 58 | 59 | /** 60 | * @param Schema $schema 61 | */ 62 | public function down(Schema $schema) 63 | { 64 | // this down() migration is auto-generated, please modify it to your needs 65 | 66 | $calendarobjects = $schema->getTable('calendarobjects'); 67 | $calendarobjects->removeColumn('uid'); 68 | 69 | $schema->dropTable('schedulingobjects'); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /app/Resources/views/base.html.twig: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {% block title %}Welcome!{% endblock %} 6 | {% block stylesheets %}{% endblock %} 7 | 8 | 9 | 10 | {% block body %}{% endblock %} 11 | {% block javascripts %}{% endblock %} 12 | 13 | 14 | -------------------------------------------------------------------------------- /app/autoload.php: -------------------------------------------------------------------------------- 1 | getParameterOption(array('--env', '-e'), getenv('SYMFONY_ENV') ?: 'dev'); 19 | $debug = getenv('SYMFONY_DEBUG') !== '0' && !$input->hasParameterOption(array('--no-debug', '')) && $env !== 'prod'; 20 | 21 | if ($debug) { 22 | Debug::enable(); 23 | } 24 | 25 | $kernel = new AppKernel($env, $debug); 26 | $application = new Application($kernel); 27 | $application->run($input); 28 | -------------------------------------------------------------------------------- /app/logs/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sabre-io/Baikal2/b5142938b8e5dde693f31ff52e061f2d2810aee2/app/logs/.gitkeep -------------------------------------------------------------------------------- /app/phpunit.xml.dist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | ../src/*/*Bundle/Tests 13 | ../src/*/Bundle/*Bundle/Tests 14 | 15 | 16 | 17 | 22 | 23 | 24 | 25 | ../src 26 | 27 | ../src/*/*Bundle/Resources 28 | ../src/*/*Bundle/Tests 29 | ../src/*/Bundle/*Bundle/Resources 30 | ../src/*/Bundle/*Bundle/Tests 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "netgusto-baikal", 3 | "dependencies": { 4 | "jquery": "1.11.*", 5 | "bootstrap": "3.3.*", 6 | "font-awesome": "4.3.*", 7 | "jquery-minicolors": "2.1.*", 8 | "pulpy": "0.0.3-dev", 9 | "buddies": "0.0.2-dev" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /data/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sabre-io/Baikal2/b5142938b8e5dde693f31ff52e061f2d2810aee2/data/.gitkeep -------------------------------------------------------------------------------- /docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:14.04 2 | 3 | # Requirements 4 | RUN apt-get update && apt-get install -y php5 php5-curl php5-sqlite curl git apache2 5 | 6 | # Set up baikal 7 | WORKDIR /var/www 8 | RUN git clone -b branch-2 https://github.com/netgusto/Baikal.git baikal 9 | RUN chown -R www-data:www-data baikal 10 | RUN chmod -R 775 baikal 11 | 12 | WORKDIR /var/www/baikal 13 | RUN cp app/config/defaults/data.parameters.dist.yml data/parameters.yml 14 | RUN cp app/config/defaults/data.environment.dist.yml data/environment.yml 15 | RUN curl -sS https://getcomposer.org/installer | php 16 | RUN php composer.phar install --optimize-autoloader 17 | 18 | WORKDIR /var/www/baikal/app/cache 19 | RUN mkdir prod 20 | 21 | WORKDIR /var/www 22 | RUN chown -R www-data:www-data baikal 23 | RUN chmod -R 775 baikal 24 | 25 | # apache2 conf 26 | RUN rm /etc/apache2/sites-enabled/000-default.conf 27 | COPY baikal.conf /etc/apache2/sites-available/ 28 | RUN ln -s /etc/apache2/sites-available/baikal.conf /etc/apache2/sites-enabled/baikal.conf 29 | RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf 30 | 31 | EXPOSE 8000 32 | CMD ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"] 33 | -------------------------------------------------------------------------------- /docker/README.md: -------------------------------------------------------------------------------- 1 | # Baikal & Docker 2 | 3 | ## Build the image : 4 | Clone Baikal go to the Docker folder and execute : 5 | 6 | `docker build -t mySuperImageName .` 7 | 8 | When done, run the images by doing : 9 | 10 | `docker run -ti -p 8000:80 mySuperImageName` 11 | 12 | Or start it as a daemon with : 13 | 14 | `docker run -d -p 8000:80 mySuperImageName` 15 | 16 | Then go to [YourDockerIP:8000]() -------------------------------------------------------------------------------- /docker/baikal.conf: -------------------------------------------------------------------------------- 1 | 2 | 3 | DocumentRoot /var/www/baikal/web 4 | 5 | 6 | # enable the .htaccess rewrites 7 | AllowOverride All 8 | Order allow,deny 9 | Allow from All 10 | 11 | 12 | ErrorLog /var/log/apache2/baikal_error.log 13 | CustomLog /var/log/apache2/baikal_access.log combined 14 | 15 | 16 | -------------------------------------------------------------------------------- /docker/docker-compose.yml: -------------------------------------------------------------------------------- 1 | baikal: 2 | build: . 3 | ports: 4 | - "8000:80" -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Baikal", 3 | "version": "2.0.0-alpha3", 4 | "description": "CalDAV + CardDAV server and web client", 5 | "scripts": { 6 | "test": "echo \"Error: no test specified\" && exit 1", 7 | "unpack": "bower install && npm install && grunt && cd web/apps/pulpy && npm install && cd ../buddies && npm install", 8 | "dev": "php app/console server:run 0.0.0.0:8000 --verbose --env=dev & cd web/apps/pulpy && grunt serve & cd web/apps/buddies && grunt serve & wait", 9 | "build": "php app/console cache:clear --env=prod && cd web/apps/pulpy && grunt build && cd ../buddies && grunt build && cd ../../.. && grunt", 10 | "prod": "npm start", 11 | "start": "php app/console server:run 0.0.0.0:8000 --verbose --env=prod" 12 | }, 13 | "repository": { 14 | "type": "git", 15 | "url": "https://github.com/netgusto/Baikal.git" 16 | }, 17 | "author": "Net Gusto / Jérôme Schneider", 18 | "license": "GNU GPL", 19 | "bugs": { 20 | "url": "https://github.com/netgusto/Baikal/issues" 21 | }, 22 | "homepage": "https://github.com/netgusto/Baikal", 23 | "devDependencies": { 24 | "grunt": "^0.4.5", 25 | "grunt-bowercopy": "^1.2.0", 26 | "grunt-contrib-clean": "^0.6.0", 27 | "grunt-contrib-compress": "^0.13.0", 28 | "grunt-contrib-concat": "^0.5.1", 29 | "grunt-contrib-copy": "^0.8.0", 30 | "grunt-contrib-cssmin": "^0.12.2", 31 | "grunt-contrib-uglify": "^0.8.0", 32 | "grunt-contrib-watch": "^0.6.1" 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /scalingo.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Baikal", 3 | "repository": "https://github.com/netgusto/Baikal", 4 | "description": "Baïkal 2 is a Calendar+Contacts server + web client", 5 | "logo": "https://cdn.rawgit.com/netgusto/Baikal/branch-2/web/assets/images/baikal-logo.svg", 6 | "addons": ["scalingo-mysql"] 7 | } 8 | -------------------------------------------------------------------------------- /src/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | Require all denied 3 | 4 | 5 | Order deny,allow 6 | Deny from all 7 | 8 | -------------------------------------------------------------------------------- /src/Baikal/AdminBundle/BaikalAdminBundle.php: -------------------------------------------------------------------------------- 1 | action($request, $user); 16 | } 17 | 18 | public function editAction(Request $request, User $user, Addressbook $addressbook) { 19 | if(!$this->get('security.context')->isGranted('dav.read', $addressbook)) { 20 | throw new HttpException(401, 'Unauthorized access.'); 21 | } 22 | 23 | return $this->action($request, $user, $addressbook); 24 | } 25 | 26 | protected function action(Request $request, User $user, Addressbook $addressbook = null) { 27 | $that = $this; 28 | 29 | return $this->get('baikal.formhandler.addressbook')->handle( 30 | $this->getSuccessFunction($user), 31 | $this->getFailureFunction($user), 32 | $request, 33 | $user, 34 | $addressbook # if null, creation 35 | ); 36 | } 37 | 38 | protected function getSuccessFunction(User $user) { 39 | $that = $this; 40 | 41 | return function($form, Addressbook $addressbook, $isNew) use($user, $that) { 42 | $that->get('session')->getFlashBag()->add('notice', 'Addressbook ' . htmlspecialchars($addressbook->getDisplayname()) . ' has been ' . ($isNew ? 'created' : 'updated') . '.'); 43 | return $that->redirect($this->generateUrl('baikal_admin_user_addressbook_list', array('id' => $user->getId()))); 44 | }; 45 | } 46 | 47 | protected function getFailureFunction(User $user) { 48 | $that = $this; 49 | 50 | return function($form, Addressbook $addressbook, $isNew) use ($user, $that) { 51 | return $this->render('BaikalAdminBundle:Addressbook:form.html.twig', array( 52 | 'form' => $form->createView(), 53 | 'user' => $user, 54 | 'addressbook' => $addressbook 55 | )); 56 | }; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/Baikal/AdminBundle/Controller/Addressbook/ListController.php: -------------------------------------------------------------------------------- 1 | get('baikal.repository.addressbook')->findByUser($user); 15 | 16 | $that = $this; 17 | 18 | return $this->render('BaikalAdminBundle:Addressbook:list.html.twig', array( 19 | 'user' => $user, 20 | 'addressbooks' => $addressbooks, 21 | 'urls' => array( 22 | 'view' => function($user, $addressbook) use (&$that) { 23 | return $that->generateUrl('baikal_admin_addressbook_view', array('user' => $user->getId(), 'addressbook' => $addressbook->getId())); 24 | }, 25 | 'edit' => function($user, $addressbook) use (&$that) { 26 | return $that->generateUrl('baikal_admin_addressbook_form_edit', array('user' => $user->getId(), 'addressbook' => $addressbook->getId())); 27 | }, 28 | 'delete' => function($user, $addressbook) use (&$that) { 29 | return $that->generateUrl('baikal_admin_addressbook_list_delete', array('user' => $user->getId(), 'addressbook' => $addressbook->getId())); 30 | } 31 | ), 32 | )); 33 | } 34 | 35 | public function deleteAction(User $user, Addressbook $addressbook) { 36 | 37 | $em = $this->getDoctrine()->getManager(); 38 | $em->remove($addressbook); 39 | $em->flush(); 40 | 41 | $this->get('session')->getFlashBag()->add('notice', 'Addressbook ' . htmlspecialchars($addressbook->getDisplayname()) . ' has been deleted.'); 42 | return $this->redirect($this->generateUrl('baikal_admin_user_addressbook_list', array('id' => $user->getId()))); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/Baikal/AdminBundle/Controller/Addressbook/ViewController.php: -------------------------------------------------------------------------------- 1 | render('BaikalAdminBundle:Addressbook:view.html.twig', array( 15 | 'user' => $user, 16 | 'addressbook' => $addressbook, 17 | )); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Baikal/AdminBundle/Controller/Application/FormController.php: -------------------------------------------------------------------------------- 1 | action($request); 14 | } 15 | 16 | public function editAction(Request $request, Application $application) { 17 | return $this->action($request, $application); 18 | } 19 | 20 | protected function action(Request $request, Application $application = null) { 21 | $that = $this; 22 | 23 | return $this->get('baikal.formhandler.application')->handle( 24 | $this->getSuccessFunction(), 25 | $this->getViewFunction(), 26 | $request, 27 | $application # if null, creation 28 | ); 29 | } 30 | 31 | protected function getSuccessFunction() { 32 | $that = $this; 33 | 34 | return function($form, Application $application, $isNew) use($that) { 35 | $that->get('session')->getFlashBag()->add('notice', 'Application ' . htmlspecialchars($application->getName()) . ' has been ' . ($isNew ? 'created' : 'updated') . '.'); 36 | return $that->redirect($this->generateUrl('baikal_admin_application_form_edit', array('application' => $application->getId()))); 37 | }; 38 | } 39 | 40 | protected function getViewFunction() { 41 | $that = $this; 42 | 43 | return function($form, Application $application, $isNew) use ($that) { 44 | $nbusers = $this->get('baikal.repository.oauthaccesstoken')->countForClient($application); 45 | 46 | return $this->render('BaikalAdminBundle:Application:form.html.twig', array( 47 | 'form' => $form->createView(), 48 | 'application' => $application, 49 | 'nbusers' => $nbusers 50 | )); 51 | }; 52 | } 53 | } -------------------------------------------------------------------------------- /src/Baikal/AdminBundle/Controller/Application/ListController.php: -------------------------------------------------------------------------------- 1 | get('baikal.repository.oauthclient')->findAll(); 18 | return $this->render('BaikalAdminBundle:Application:list.html.twig', array( 19 | 'apps' => $apps, 20 | 'urls' => array( 21 | 'edit' => function(Application $application) use (&$that) { 22 | return $that->generateUrl('baikal_admin_application_form_edit', array('application' => $application->getId())); 23 | }, 24 | 'delete' => function(Application $application) use (&$that) { 25 | return $that->generateUrl('baikal_admin_application_list_delete', array('application' => $application->getId())); 26 | } 27 | ), 28 | )); 29 | } 30 | 31 | public function deleteAction(Application $application) { 32 | 33 | $em = $this->getDoctrine()->getManager(); 34 | $em->remove($application); 35 | $em->flush(); 36 | 37 | $this->get('session')->getFlashBag()->add('notice', 'Application ' . htmlspecialchars($application->getName()) . ' has been deleted.'); 38 | return $this->redirect($this->generateUrl('baikal_admin_application_list')); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/Baikal/AdminBundle/Controller/AuthController.php: -------------------------------------------------------------------------------- 1 | get('security.context')->isGranted('IS_AUTHENTICATED_FULLY')) { 17 | throw new \Exception("Error Processing Request", 1); 18 | // redirect authenticated users to homepage 19 | return $this->redirect($this->generateUrl('baikal_admin_homepage')); 20 | } 21 | 22 | if($this->get('security.context')->isGranted('IS_AUTHENTICATED_REMEMBERED')) { 23 | throw new \Exception("Error Processing Request", 1); 24 | // redirect authenticated users to homepage 25 | return $this->redirect($this->generateUrl('baikal_admin_homepage')); 26 | } 27 | 28 | $request = $this->getRequest(); 29 | $session = $request->getSession(); 30 | 31 | // get the login error if there is one 32 | if ($request->attributes->has(SecurityContext::AUTHENTICATION_ERROR)) { 33 | $error = $request->attributes->get(SecurityContext::AUTHENTICATION_ERROR); 34 | } else { 35 | $error = $session->get(SecurityContext::AUTHENTICATION_ERROR); 36 | $session->remove(SecurityContext::AUTHENTICATION_ERROR); 37 | } 38 | 39 | return $this->render('BaikalAdminBundle:Auth:loginform.html.twig', array( 40 | // last username entered by the user 41 | 'last_username' => $session->get(SecurityContext::LAST_USERNAME), 42 | 'error' => $error, 43 | )); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/Baikal/AdminBundle/Controller/Calendar/FormController.php: -------------------------------------------------------------------------------- 1 | action($request, $user); 17 | } 18 | 19 | public function editAction(Request $request, User $user, Calendar $calendar) { 20 | if(!$this->get('security.context')->isGranted('dav.read', $calendar)) { 21 | throw new HttpException(401, 'Unauthorized access.'); 22 | } 23 | 24 | return $this->action($request, $user, $calendar); 25 | } 26 | 27 | protected function action(Request $request, User $user, Calendar $calendar = null) { 28 | $that = $this; 29 | 30 | return $this->get('baikal.formhandler.calendar')->handle( 31 | $this->getSuccessFunction($user), 32 | $this->getFailureFunction($user), 33 | $request, 34 | $user, 35 | $calendar # if null, creation 36 | ); 37 | } 38 | 39 | protected function getSuccessFunction(User $user) { 40 | $that = $this; 41 | 42 | return function($form, Calendar $calendar, $isNew) use($user, $that) { 43 | $that->get('session')->getFlashBag()->add('notice', 'Calendar ' . htmlspecialchars($calendar->getDisplayname()) . ' has been ' . ($isNew ? 'created' : 'updated') . '.'); 44 | return $that->redirect($this->generateUrl('baikal_admin_user_calendar_list', array('id' => $user->getId()))); 45 | }; 46 | } 47 | 48 | protected function getFailureFunction(User $user) { 49 | $that = $this; 50 | 51 | return function($form, Calendar $calendar, $isNew) use ($user, $that) { 52 | return $this->render('BaikalAdminBundle:Calendar:form.html.twig', array( 53 | 'form' => $form->createView(), 54 | 'user' => $user, 55 | 'calendar' => $calendar 56 | )); 57 | }; 58 | } 59 | } -------------------------------------------------------------------------------- /src/Baikal/AdminBundle/Controller/Calendar/InstructionsController.php: -------------------------------------------------------------------------------- 1 | get('security.context')->isGranted('dav.read', $calendar)) { 17 | throw new HttpException(401, 'Unauthorized access.'); 18 | } 19 | 20 | return $this->render('BaikalAdminBundle:Calendar:instructions.html.twig', array( 21 | 'user' => $user, 22 | 'calendar' => $calendar, 23 | )); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/Baikal/AdminBundle/Controller/Calendar/ListController.php: -------------------------------------------------------------------------------- 1 | get('baikal.repository.calendar')->findByUser($user); 15 | 16 | $that = $this; 17 | 18 | return $this->render('BaikalAdminBundle:Calendar:list.html.twig', array( 19 | 'user' => $user, 20 | 'calendars' => $calendars, 21 | 'urls' => array( 22 | 'view' => function($user, $calendar) use (&$that) { 23 | return $that->generateUrl('baikal_admin_calendar_view', array('user' => $user->getId(), 'calendar' => $calendar->getId())); 24 | }, 25 | 'edit' => function($user, $calendar) use (&$that) { 26 | return $that->generateUrl('baikal_admin_calendar_form_edit', array('user' => $user->getId(), 'calendar' => $calendar->getId())); 27 | }, 28 | 'delete' => function($user, $calendar) use (&$that) { 29 | return $that->generateUrl('baikal_admin_calendar_list_delete', array('user' => $user->getId(), 'calendar' => $calendar->getId())); 30 | }, 31 | 'instructions' => function($user, $calendar) use (&$that) { 32 | return $that->generateUrl('baikal_admin_calendar_instructions', array('user' => $user->getId(), 'calendar' => $calendar->getId())); 33 | }, 34 | ) 35 | )); 36 | } 37 | 38 | public function deleteAction(User $user, Calendar $calendar) { 39 | 40 | $em = $this->getDoctrine()->getManager(); 41 | $em->remove($calendar); 42 | $em->flush(); 43 | 44 | $this->get('session')->getFlashBag()->add('notice', 'Calendar ' . htmlspecialchars($calendar->getDisplayname()) . ' has been deleted.'); 45 | return $this->redirect($this->generateUrl('baikal_admin_user_calendar_list', array('id' => $user->getId()))); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/Baikal/AdminBundle/Controller/Calendar/ViewController.php: -------------------------------------------------------------------------------- 1 | get('security.context')->isGranted('dav.read', $calendar)) { 17 | throw new HttpException(401, 'Unauthorized access.'); 18 | } 19 | 20 | return $this->render('BaikalAdminBundle:Calendar:view.html.twig', array( 21 | 'user' => $user, 22 | 'calendar' => $calendar, 23 | )); 24 | } 25 | 26 | public function fullscreenAction(Request $request, User $user, Calendar $calendar) { 27 | 28 | if(!$this->get('security.context')->isGranted('dav.read', $calendar)) { 29 | throw new HttpException(401, 'Unauthorized access.'); 30 | } 31 | 32 | return $this->render('BaikalAdminBundle:Calendar:view.fullscreen.html.twig', array( 33 | 'user' => $user, 34 | 'calendar' => $calendar, 35 | )); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/Baikal/AdminBundle/Controller/DashboardController.php: -------------------------------------------------------------------------------- 1 | getDoctrine()->getManager()->getRepository('\Baikal\SystemBundle\Entity\User')->countAll(); 12 | 13 | $nbcalendars = $this->get('baikal.repository.calendar')->countAll(); 14 | $nbevents = $this->get('baikal.repository.event')->countAll(); 15 | 16 | $nbaddressbooks = $this->get('baikal.repository.addressbook')->countAll(); 17 | $nbaddressbookcontacts = $this->getDoctrine()->getManager()->getRepository('\Baikal\ModelBundle\Entity\AddressbookContact')->countAll(); 18 | 19 | return $this->render('BaikalAdminBundle:Dashboard:index.html.twig', array( 20 | 'nbusers' => $nbusers, 21 | 'nbcalendars' => $nbcalendars, 22 | 'nbevents' => $nbevents, 23 | 'nbaddressbooks' => $nbaddressbooks, 24 | 'nbaddressbookcontacts' => $nbaddressbookcontacts, 25 | )); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Baikal/AdminBundle/Controller/User/InfoController.php: -------------------------------------------------------------------------------- 1 | render('BaikalAdminBundle:User:info.html.twig', array( 16 | 'nbcalendars' => count($user->getCalendars()), 17 | 'nbbooks' => count($user->getAddressbooks()), 18 | 'user' => $user, 19 | )); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Baikal/AdminBundle/Controller/User/ListController.php: -------------------------------------------------------------------------------- 1 | getDoctrine()->getManager()->getRepository('\Baikal\SystemBundle\Entity\User')->findAll(); 14 | 15 | return $this->render('BaikalAdminBundle:User:list.html.twig', array( 16 | 'users' => $users, 17 | )); 18 | } 19 | 20 | public function deleteAction(User $user) 21 | { 22 | $em = $this->getDoctrine()->getManager(); 23 | $em->remove($user); 24 | $em->flush(); 25 | 26 | $this->get('session')->getFlashBag()->add('notice', 'User ' . htmlspecialchars($user->getUsername()) . ' has been deleted.'); 27 | return $this->redirect($this->generateUrl('baikal_admin_user_list')); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Baikal/AdminBundle/DependencyInjection/Configuration.php: -------------------------------------------------------------------------------- 1 | root('baikal_admin'); 22 | 23 | // Here you should define the parameters that are allowed to 24 | // configure your bundle. See the documentation linked above for 25 | // more information on that topic. 26 | 27 | return $treeBuilder; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Baikal/AdminBundle/DependencyInjection/NetgustoBaikalAdminExtension.php: -------------------------------------------------------------------------------- 1 | processConfiguration($configuration, $configs); 24 | 25 | $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); 26 | $loader->load('services.yml'); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/Baikal/AdminBundle/Menu/Builder.php: -------------------------------------------------------------------------------- 1 | createItem('root', array('childrenAttributes' => array('class' => 'nav navbar-nav'))); 16 | 17 | $menu->addChild('Users+Data', array('route' => 'baikal_admin_user_list')); 18 | $menu->addChild('Applications', array('route' => 'baikal_admin_application_list')); 19 | $menu->addChild('Settings', array('route' => 'baikal_admin_settings')); 20 | 21 | $currentpath = $this->container->get('request')->getPathInfo(); 22 | 23 | foreach($menu as $item) { 24 | $item->setCurrent((bool)preg_match('%^' . preg_quote($item->getUri()) . '%', $currentpath)); 25 | } 26 | 27 | return $menu; 28 | } 29 | } -------------------------------------------------------------------------------- /src/Baikal/AdminBundle/Resources/config/config.yml: -------------------------------------------------------------------------------- 1 | imports: 2 | # - { resource: assets.yml } -------------------------------------------------------------------------------- /src/Baikal/AdminBundle/Resources/config/services.yml: -------------------------------------------------------------------------------- 1 | services: 2 | baikal_admin.access_denied_handler: 3 | class: Baikal\AdminBundle\Service\AccessDeniedHandler 4 | arguments: [@http_kernel, @security.context, @router] 5 | tags: 6 | - { name: kernel.event_listener, event: security.kernel_response, method: handle } 7 | 8 | -------------------------------------------------------------------------------- /src/Baikal/AdminBundle/Resources/doc/index.rst: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sabre-io/Baikal2/b5142938b8e5dde693f31ff52e061f2d2810aee2/src/Baikal/AdminBundle/Resources/doc/index.rst -------------------------------------------------------------------------------- /src/Baikal/AdminBundle/Resources/sources/less/style.less: -------------------------------------------------------------------------------- 1 | /* rien */ -------------------------------------------------------------------------------- /src/Baikal/AdminBundle/Resources/translations/messages.fr.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Symfony2 is great 7 | J'aime Symfony2 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/Baikal/AdminBundle/Resources/views/Addressbook/form.html.twig: -------------------------------------------------------------------------------- 1 | {% extends "BaikalAdminBundle:Layouts:standard.html.twig" %} 2 | 3 | {% block content %} 4 | 5 | {% set new = not (addressbook is defined and addressbook.id) %} 6 | 7 | {% embed "BaikalViewComponentsBundle:Components:pageheader.html.twig" %} 8 | {% set icon = "book" %} 9 | {% set header = 'Addressbook for ' ~ user.uiLabel() %} 10 | {% block header %} 11 | Users 12 | 13 | 14 | 15 | {% include "BaikalViewComponentsBundle:Components:avatar.textsize.html.twig" with { email: user.email } %} {{ user.uiLabel() }} 16 | 17 | 18 | 19 | Contact books 20 | 21 | 22 | 23 | {% if not new %} 24 | {{ addressbook.displayName() }} 25 | 26 | 27 | 28 | Edit 29 | {% else %} 30 | New 31 | {% endif %} 32 | 33 | {% endblock %} 34 | {% endembed %} 35 | 36 | {% embed "BaikalViewComponentsBundle:Components:Addressbook/form.html.twig" with { 37 | new: new, 38 | url_cancel: path('baikal_admin_user_addressbook_list', { id: user.id }) 39 | } %}{% endembed %} 40 | 41 | {% endblock %} -------------------------------------------------------------------------------- /src/Baikal/AdminBundle/Resources/views/Addressbook/list.html.twig: -------------------------------------------------------------------------------- 1 | {% extends "BaikalAdminBundle:Layouts:standard.html.twig" %} 2 | 3 | {% set pagetitle = "Addressbooks for " ~ user.getUsername() %} 4 | 5 | {% block content %} 6 | 7 | {% embed "BaikalViewComponentsBundle:Components:pageheader.html.twig" %} 8 | {% set icon = "group" %} 9 | {% block header %} 10 | Users 11 | 12 | 13 | 14 | {{ user.uiLabel() }} 15 | 16 | 17 | 18 | Contact books 19 | {% endblock %} 20 | {% endembed %} 21 | 22 | {% if addressbooks|length %} 23 | {% embed "BaikalViewComponentsBundle:Components:addbutton.html.twig" %} 24 | {% set button_url = path('baikal_admin_addressbook_form_new', { 'user': user.id }) %} 25 | {% set button_text = ' Add book' %} 26 | {% endembed %} 27 | 28 | {% embed "BaikalViewComponentsBundle:Components:Addressbook/list.html.twig" with { 29 | 'items': addressbooks, 30 | 'user': user 31 | } %}{% endembed %} 32 | {% else %} 33 | {% embed "BaikalViewComponentsBundle:Components:nothinghere.html.twig" with { 34 | itemname: 'addressbook', 35 | actionurl: path('baikal_admin_addressbook_form_new', { user: user.id }), 36 | calltoaction: 'Create one now' 37 | } %}{% endembed %} 38 | {% endif %} 39 | 40 | {% endblock %} 41 | 42 | {% block scripts %} 43 | {% embed "BaikalViewComponentsBundle:Components:list.scripts.html.twig" %}{% endembed %} 44 | {% endblock %} -------------------------------------------------------------------------------- /src/Baikal/AdminBundle/Resources/views/Addressbook/view.html.twig: -------------------------------------------------------------------------------- 1 | {% extends "BaikalAdminBundle:Layouts:standard.html.twig" %} 2 | 3 | {% set pagetitle = "Addressbook " ~ addressbook.getDisplayname() ~ " of " ~ user.uiLabel() %} 4 | 5 | {% block content %} 6 | 7 | {% embed "BaikalViewComponentsBundle:Components:pageheader.html.twig" %} 8 | {% set icon = "group" %} 9 | {% block header %} 10 | Users 11 | 12 | 13 | 14 | {{ user.uiLabel() }} 15 | 16 | 17 | 18 | Contact books 19 | 20 | 21 | 22 | {{ addressbook.getDisplayname() }} 23 | {% endblock %} 24 | {% endembed %} 25 | 26 | {% embed "BaikalViewComponentsBundle:Components:SPA/cardclient.html.twig" with { 27 | addressbook: addressbook, 28 | user: user 29 | } %}{% endembed %} 30 | 31 | {% endblock %} -------------------------------------------------------------------------------- /src/Baikal/AdminBundle/Resources/views/Application/list.html.twig: -------------------------------------------------------------------------------- 1 | {% extends "BaikalAdminBundle:Layouts:standard.html.twig" %} 2 | 3 | {% set pagetitle = "Registered applications" %} 4 | 5 | {% block content %} 6 | 7 | {% embed "BaikalViewComponentsBundle:Components:pageheader.html.twig" %} 8 | {% set icon = "cubes" %} 9 | {% block header %}Applications (OAuth){% endblock %} 10 | {% endembed %} 11 | 12 | {% if apps|length %} 13 | 14 | {% embed "BaikalViewComponentsBundle:Components:addbutton.html.twig" %} 15 | {% set button_url = path('baikal_admin_application_form_new') %} 16 | {% set button_text = ' Add Application' %} 17 | {% endembed %} 18 | 19 | {% embed "BaikalViewComponentsBundle:Components:list.html.twig" with { items: apps } %} 20 | {% block payload %} 21 | 22 |

23 | {{ item.name }} 24 |

25 |

{{ item.description }}

26 | 27 | {% endblock %} 28 | {% block actions %} 29 | 30 |
31 | 32 | Edit 33 | 34 | 35 | Delete 36 | 37 |
38 |
39 | {% endblock %} 40 | {% block deletemodal %} 41 | {% embed "BaikalViewComponentsBundle:Components:modal.html.twig" %} 42 | 43 | {% block title %}Delete application Application name{% endblock %} 44 | {% block body %} 45 |

You are about to delete Application name and all it's data.

46 |

Careful ! This operation is destructive, and cannot be undone.

47 | {% endblock %} 48 | 49 | {% endembed %} 50 | {% endblock %} 51 | {% endembed %} 52 | 53 | {% else %} 54 | {% embed "BaikalViewComponentsBundle:Components:nothinghere.html.twig" with { 55 | itemname: 'application', 56 | actionurl: path('baikal_admin_application_form_new'), 57 | calltoaction: 'Create one now' 58 | } %}{% endembed %} 59 | {% endif %} 60 | 61 | {% endblock %} -------------------------------------------------------------------------------- /src/Baikal/AdminBundle/Resources/views/Auth/loginform.html.twig: -------------------------------------------------------------------------------- 1 | {% extends "BaikalAdminBundle:Layouts:standard.html.twig" %} 2 | 3 | {% set pagetitle = "Auth" %} 4 | 5 | {% block content %} 6 | 7 | {% embed "BaikalViewComponentsBundle:Components:loginform.html.twig" with { 8 | logincheckurl: path('baikal_admin_login_check'), 9 | redirecturl: path('baikal_admin_homepage') 10 | } %}{% endembed %} 11 | {% endblock %} -------------------------------------------------------------------------------- /src/Baikal/AdminBundle/Resources/views/Calendar/form.html.twig: -------------------------------------------------------------------------------- 1 | {% extends "BaikalAdminBundle:Layouts:standard.html.twig" %} 2 | 3 | {% block content %} 4 | 5 | {% set new = not (calendar is defined and calendar.id) %} 6 | 7 | {% embed "BaikalViewComponentsBundle:Components:pageheader.html.twig" %} 8 | {% set icon = "group" %} 9 | {% block header %} 10 | Users 11 | 12 | 13 | 14 | {{ user.uiLabel() }} 15 | 16 | 17 | 18 | Calendars 19 | 20 | 21 | 22 | {% if new %} 23 | New calendar 24 | {% else %} 25 | Editing {% include "BaikalViewComponentsBundle:Components:calendarpill.html.twig" with { calendar: calendar } %} {{ calendar.displayName() }} 26 | {% endif %} 27 | 28 | {% endblock %} 29 | {% endembed %} 30 | 31 | {% embed "BaikalViewComponentsBundle:Components:Calendar/form.html.twig" with { 32 | new: new, 33 | url_cancel: path('baikal_admin_user_calendar_list', { 'id' : user.id }) 34 | } %}{% endembed %} 35 | 36 | {% endblock %} 37 | 38 | {% block scripts %} 39 | {% embed "BaikalViewComponentsBundle:Components:Calendar/form.scripts.html.twig" %}{% endembed %} 40 | {% endblock %} -------------------------------------------------------------------------------- /src/Baikal/AdminBundle/Resources/views/Calendar/instructions.html.twig: -------------------------------------------------------------------------------- 1 | {% extends "BaikalAdminBundle:Layouts:standard.html.twig" %} 2 | 3 | {% set pagetitle = "Calendar " ~ calendar.getDisplayname() ~ " of " ~ user.uiLabel() %} 4 | 5 | {% block content %} 6 | 7 | {% embed "BaikalViewComponentsBundle:Components:pageheader.html.twig" %} 8 | {% set icon = "group" %} 9 | {% block header %} 10 | Users 11 | 12 | 13 | 14 | {{ user.uiLabel() }} 15 | 16 | 17 | 18 | Calendars 19 | 20 | 21 | 22 | {% include "BaikalViewComponentsBundle:Components:calendarpill.html.twig" with { calendar: calendar } %} {{ calendar.getDisplayname() }} 23 | 24 | 25 | 26 | Connect 27 | 28 | {% endblock %} 29 | {% endembed %} 30 | 31 | {% embed "BaikalViewComponentsBundle:Components:Calendar/instructions.html.twig" with { 32 | user: user, 33 | calendar: calendar 34 | } %}{% endembed %} 35 | 36 | {% endblock %} -------------------------------------------------------------------------------- /src/Baikal/AdminBundle/Resources/views/Calendar/list.html.twig: -------------------------------------------------------------------------------- 1 | {% extends "BaikalAdminBundle:Layouts:standard.html.twig" %} 2 | 3 | {% set pagetitle = "Calendars for " ~ user.uiLabel() %} 4 | 5 | {% block content %} 6 | 7 | {% embed "BaikalViewComponentsBundle:Components:pageheader.html.twig" %} 8 | {% set icon = "group" %} 9 | {% block header %} 10 | Users 11 | 12 | 13 | 14 | {{ user.uiLabel() }} 15 | 16 | 17 | 18 | Calendars 19 | {% endblock %} 20 | {% endembed %} 21 | 22 | {% if calendars|length %} 23 | {% embed "BaikalViewComponentsBundle:Components:addbutton.html.twig" %} 24 | {% set button_url = path('baikal_admin_calendar_form_new', { 'user': user.id }) %} 25 | {% set button_text = ' Add calendar' %} 26 | {% endembed %} 27 | 28 | {% embed "BaikalViewComponentsBundle:Components:Calendar/list.html.twig" with { 29 | 'user' : user, 30 | 'items' : calendars, 31 | 'urls': urls 32 | } %}{% endembed %} 33 | {% else %} 34 | {% embed "BaikalViewComponentsBundle:Components:nothinghere.html.twig" with { 35 | itemname: 'calendar', 36 | actionurl: path('baikal_admin_calendar_form_new', { user: user.id }), 37 | calltoaction: 'Create one now' 38 | } %}{% endembed %} 39 | {% endif %} 40 | 41 | {% endblock %} 42 | 43 | {% block scripts %} 44 | {% embed "BaikalViewComponentsBundle:Components:list.scripts.html.twig" %}{% endembed %} 45 | {% endblock %} -------------------------------------------------------------------------------- /src/Baikal/AdminBundle/Resources/views/Calendar/view.html.twig: -------------------------------------------------------------------------------- 1 | {% extends "BaikalAdminBundle:Layouts:fullscreen.html.twig" %} 2 | 3 | {% set pagetitle = "Calendar " ~ calendar.getDisplayname() ~ " of " ~ user.uiLabel() %} 4 | 5 | {% block bodyclass %}calendar-fullscreen{% endblock %} 6 | 7 | {% set calview = application('pulpy', { 8 | rootElement: '#app-calclient', 9 | parameters: { 10 | apiendpoint: '/webapi/v1', 11 | calendarsEnabledAtStart: [calendar.getId()], 12 | calendarFocusedAtStart: calendar.getId(), 13 | starttime: 0, 14 | endtime: 23, 15 | businessstarttime: 7, 16 | businessendtime: 20, 17 | hourbarwidth: 30, 18 | hourheight: 60, 19 | allowMovingToAdjacentWeeks: true, 20 | windowed: true, 21 | cosmetic: { 22 | gutterwidth: 16, 23 | event: { 24 | marginLeft: 2, 25 | marginTop: 2, 26 | marginBottom: 3 27 | }, 28 | popup: { 29 | width: 300, 30 | height: 200 31 | } 32 | } 33 | } 34 | }) %} 35 | 36 | {% block content %} 37 |
38 | {{ calview.html|raw }} 39 | {% endblock %} 40 | 41 | {% block scripts %} 42 | {{ calview.assets|raw }} 43 | {% endblock %} -------------------------------------------------------------------------------- /src/Baikal/AdminBundle/Resources/views/Layouts/partials/_footer.html.twig: -------------------------------------------------------------------------------- 1 | {% extends "BaikalFrontendBundle:Layouts:partials/_footer.html.twig" %} -------------------------------------------------------------------------------- /src/Baikal/AdminBundle/Resources/views/Layouts/standard.html.twig: -------------------------------------------------------------------------------- 1 | {% extends "BaikalViewComponentsBundle:Layouts:standard.html.twig" %} 2 | 3 | {% block body %} 4 | 5 | {% include 'BaikalAdminBundle:Layouts:partials/_header.html.twig' %} 6 | 7 | {% block content %} 8 |

Content here

9 | {% endblock %} 10 | 11 | {% include 'BaikalAdminBundle:Layouts:partials/_footer.html.twig' %} 12 | 13 | {% endblock body %} -------------------------------------------------------------------------------- /src/Baikal/AdminBundle/Resources/views/Settings/index.html.twig: -------------------------------------------------------------------------------- 1 | {% extends "BaikalAdminBundle:Layouts:standard.html.twig" %} 2 | 3 | {% set pagetitle = "Settings" %} 4 | 5 | {% block content %} 6 | 7 | {% embed "BaikalViewComponentsBundle:Components:pageheader.html.twig" %} 8 | {% set icon = "cogs" %} 9 | {% set header = "Settings" %} 10 | {% endembed %} 11 | 12 |
13 | 14 | {% include "BaikalViewComponentsBundle:Components:flash.notice.html.twig" %} 15 | 16 |
17 |
18 | 19 | {% import '::forms.html.twig' as forms %} 20 | 21 | {{ forms.text(form.server_timezone) }} 22 | 23 | {{ forms.checkbox(form.enable_caldav) }} 24 | 25 | {{ forms.checkbox(form.enable_carddav) }} 26 | 27 | {{ forms.checkbox(form.enable_versioncheck) }} 28 | 29 | {{ form_rest(form) }} 30 | 31 |
32 | 33 |
34 | 35 |
36 |
37 | 38 |
39 |
40 |
41 | {% endblock %} -------------------------------------------------------------------------------- /src/Baikal/AdminBundle/Resources/views/User/form.html.twig: -------------------------------------------------------------------------------- 1 | {% extends "BaikalAdminBundle:Layouts:standard.html.twig" %} 2 | 3 | {% if user is defined %} 4 | {% set pagetitle = "Editing user '" ~ user.uiLabel() ~ "'" %} 5 | {% else %} 6 | {% set pagetitle = "New user" %} 7 | {% endif %} 8 | 9 | {% block content %} 10 | 11 | 12 | {% embed "BaikalViewComponentsBundle:Components:pageheader.html.twig" %} 13 | {% set icon = "group" %} 14 | 15 | {% block header %} 16 | 17 | Users 18 | 19 | 20 | 21 | {% if user is defined %} 22 | {% include "BaikalViewComponentsBundle:Components:avatar.textsize.html.twig" with { email: user.email } %} {{ user.uiLabel() }} 23 | 24 | 25 | 26 | Edit 27 | {% else %} 28 | New user 29 | {% endif %} 30 | 31 | {% endblock header %} 32 | {% endembed %} 33 | 34 |
35 |
36 | 37 |
38 | 39 | {% import '::forms.html.twig' as forms %} 40 | 41 | {% if user is defined %} 42 | {{ forms.syntheticreadonly(user.username(), 'Username') }} 43 | {% else %} 44 | {{ forms.text(form.username) }} 45 | {% endif %} 46 | 47 | {{ forms.text(form.displayname) }} 48 | 49 | {{ forms.text(form.email) }} 50 | 51 | {{ forms.checkboxes(form.roles) }} 52 | 53 | {{ forms.confirmedpassword(form.password, user is defined) }} 54 | 55 | {{ form_rest(form) }} 56 | 57 |
58 |
59 | Cancel 60 |
61 | 62 |
63 | {% if user is defined %} 64 | 65 | {% else %} 66 | 67 | {% endif %} 68 |
69 |
70 |
71 |
72 |
73 | 74 | {% endblock %} -------------------------------------------------------------------------------- /src/Baikal/AdminBundle/Resources/views/User/info.html.twig: -------------------------------------------------------------------------------- 1 | {% extends "BaikalAdminBundle:Layouts:standard.html.twig" %} 2 | 3 | {% set pagetitle = "Users" %} 4 | 5 | {% block content %} 6 | 7 | {% embed "BaikalViewComponentsBundle:Components:pageheader.html.twig" %} 8 | {% set icon = "group" %} 9 | 10 | {% block header %} 11 | 12 | Users 13 | 14 | 15 | 16 | {{ user.uiLabel() }} 17 | 18 | {% endblock header %} 19 | {% endembed %} 20 | 21 |
22 | 23 | {% include "BaikalViewComponentsBundle:Components:flash.notice.html.twig" %} 24 | 25 |

{{user.uiLabel()}}

26 | 27 |

{{nbcalendars}} {{ accord('calendar', nbcalendars)}}

28 | 29 |

{{nbbooks}} {{ accord('contact book', nbbooks)}}

30 | 31 |
32 | 33 | {% endblock %} -------------------------------------------------------------------------------- /src/Baikal/AdminBundle/Resources/views/User/list.html.twig: -------------------------------------------------------------------------------- 1 | {% extends "BaikalAdminBundle:Layouts:standard.html.twig" %} 2 | 3 | {% set pagetitle = "Users" %} 4 | 5 | {% block content %} 6 | 7 | {% embed "BaikalViewComponentsBundle:Components:pageheader.html.twig" %} 8 | {% set icon = "group" %} 9 | {% set header = "Users" %} 10 | {% endembed %} 11 | 12 | {% embed "BaikalViewComponentsBundle:Components:addbutton.html.twig" %} 13 | {% set button_url = path('baikal_admin_user_form_new') %} 14 | {% set button_text = ' Add user' %} 15 | {% endembed %} 16 | 17 | {% embed "BaikalViewComponentsBundle:Components:User/list.html.twig" with { 18 | 'items' : users 19 | } %}{% endembed %} 20 | 21 | {% endblock %} -------------------------------------------------------------------------------- /src/Baikal/AdminBundle/Service/AccessDeniedHandler.php: -------------------------------------------------------------------------------- 1 | kernel = $http_kernel; 24 | $this->securityContext = $securityContext; 25 | $this->router = $router; 26 | } 27 | 28 | /** 29 | * Handles an access denied failure. 30 | * 31 | * @param Request $request 32 | * @param AccessDeniedException $accessDeniedException 33 | * 34 | * @return Response may return null 35 | */ 36 | public function handle(Request $request, AccessDeniedException $accessDeniedException) { 37 | 38 | # First we check if user has an access granted to the frontend 39 | if($this->securityContext->isGranted('ROLE_FRONTEND_USER')) { 40 | return new RedirectResponse($this->router->generate('baikal_frontend_homepage')); 41 | } 42 | 43 | # If not, we display an "Access denied" message 44 | $attributes = array( 45 | '_controller' => 'BaikalCoreBundle:Security:accessDenied', 46 | 'exception' => $accessDeniedException, 47 | ); 48 | 49 | $subRequest = $request->duplicate(array(), null, $attributes); 50 | return $this->kernel->handle($subRequest, HttpKernelInterface::SUB_REQUEST); 51 | } 52 | } -------------------------------------------------------------------------------- /src/Baikal/BootCampBundle/BaikalBootCampBundle.php: -------------------------------------------------------------------------------- 1 | processConfiguration($configuration, $configs); 24 | 25 | $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); 26 | $loader->load('services.yml'); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/Baikal/BootCampBundle/DependencyInjection/Configuration.php: -------------------------------------------------------------------------------- 1 | root('baikal_boot_camp'); 22 | 23 | // Here you should define the parameters that are allowed to 24 | // configure your bundle. See the documentation linked above for 25 | // more information on that topic. 26 | 27 | return $treeBuilder; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Baikal/BootCampBundle/InitHandler/ConfigInitHandler.php: -------------------------------------------------------------------------------- 1 | entityManager = $entityManager; 18 | } 19 | 20 | public function createAndPersistConfig() { 21 | 22 | $siteconfig = new ConfigContainer(); 23 | $siteconfig->setName('main'); 24 | $siteconfig->setConfig(array( 25 | 'server_timezone' => 'Europe/Paris', 26 | 'enable_caldav' => true, 27 | 'enable_carddav' => true, 28 | 'enable_versioncheck' => true, 29 | )); 30 | 31 | $this->entityManager->persist($siteconfig); 32 | $this->entityManager->flush(); 33 | } 34 | } -------------------------------------------------------------------------------- /src/Baikal/BootCampBundle/InitHandler/UserInitHandler.php: -------------------------------------------------------------------------------- 1 | entityManager = $entityManager; 22 | $this->passwordencoder = $passwordencoder; 23 | } 24 | 25 | public function createAndPersistUser($username, $password) { 26 | 27 | # Persisting identity principal 28 | $principalidentity = new UserPrincipal(); 29 | $principalidentity->setDisplayname(ucwords($username)); 30 | $principalidentity->setUri('principals/' . $username); 31 | $principalidentity->setEmail('admin@example.com'); 32 | 33 | $this->entityManager->persist($principalidentity); 34 | 35 | # Persisting user 36 | $user = new User(); 37 | $user->setUsername($username); # Not setting salt; handled by the user entity 38 | $user->setPassword( 39 | $this->passwordencoder->encodePassword( 40 | $password, 41 | $user->getSalt() 42 | ) 43 | ); 44 | 45 | $user->addRole('ROLE_ADMIN'); 46 | $user->addRole('ROLE_FRONTEND_USER'); 47 | 48 | $this->entityManager->persist($user); 49 | $this->entityManager->flush(); 50 | 51 | return $user; 52 | } 53 | } -------------------------------------------------------------------------------- /src/Baikal/BootCampBundle/Resources/config/services.yml: -------------------------------------------------------------------------------- 1 | # These services will be available only during composer install 2 | 3 | imports: 4 | - { resource: ../../../../../app/config/parameters.yml } 5 | 6 | services: 7 | 8 | baikal.bootcamp.userinithandler: 9 | class: Baikal\BootCampBundle\InitHandler\UserInitHandler 10 | arguments: 11 | - @doctrine.orm.entity_manager 12 | - @baikal.model.sabredav_password_encoder 13 | 14 | baikal.bootcamp.configinithandler: 15 | class: Baikal\BootCampBundle\InitHandler\ConfigInitHandler 16 | arguments: 17 | - @doctrine.orm.entity_manager -------------------------------------------------------------------------------- /src/Baikal/FrontendBundle/BaikalFrontendBundle.php: -------------------------------------------------------------------------------- 1 | action($request); 16 | } 17 | 18 | public function editAction(Request $request, Addressbook $addressbook) { 19 | if(!$this->get('security.context')->isGranted('dav.read', $addressbook)) { 20 | throw new HttpException(401, 'Unauthorized access.'); 21 | } 22 | 23 | return $this->action($request, $addressbook); 24 | } 25 | 26 | protected function action(Request $request, Addressbook $addressbook = null) { 27 | $that = $this; 28 | $user = $this->get('security.context')->getToken()->getUser(); 29 | 30 | return $this->get('baikal.formhandler.addressbook')->handle( 31 | $this->getSuccessFunction($user), 32 | $this->getFailureFunction($user), 33 | $request, 34 | $user, 35 | $addressbook # if null, creation 36 | ); 37 | } 38 | 39 | protected function getSuccessFunction(User $user) { 40 | $that = $this; 41 | 42 | return function($form, Addressbook $addressbook, $isNew) use($user, $that) { 43 | $that->get('session')->getFlashBag()->add('notice', 'Addressbook ' . htmlspecialchars($addressbook->getDisplayname()) . ' has been ' . ($isNew ? 'created' : 'updated') . '.'); 44 | return $that->redirect($that->generateUrl('baikal_frontend_addressbook_list')); 45 | }; 46 | } 47 | 48 | protected function getFailureFunction(User $user) { 49 | $that = $this; 50 | 51 | return function($form, Addressbook $addressbook, $isNew) use ($user, $that) { 52 | return $this->render('BaikalFrontendBundle:Addressbook:form.html.twig', array( 53 | 'form' => $form->createView(), 54 | 'user' => $user, 55 | 'addressbook' => $addressbook 56 | )); 57 | }; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/Baikal/FrontendBundle/Controller/Addressbook/ListController.php: -------------------------------------------------------------------------------- 1 | get('security.context')->getToken()->getUser(); 13 | $books = $this->get('baikal.repository.addressbook')->findByUser($user); 14 | 15 | $that = $this; 16 | 17 | return $this->render('BaikalFrontendBundle:Addressbook:list.html.twig', array( 18 | 'user' => $user, 19 | 'addressbooks' => $books, 20 | 'urls' => array( 21 | 'view' => function($user, $addressbook) use (&$that) { 22 | return $that->generateUrl('baikal_frontend_addressbook_view', array('addressbook' => $addressbook->getId())); 23 | }, 24 | 'edit' => function($user, $addressbook) use (&$that) { 25 | return $that->generateUrl('baikal_frontend_addressbook_form_edit', array('addressbook' => $addressbook->getId())); 26 | }, 27 | 'delete' => function($user, $addressbook) use (&$that) { 28 | return $that->generateUrl('baikal_frontend_addressbook_list_delete', array('addressbook' => $addressbook->getId())); 29 | } 30 | ), 31 | )); 32 | } 33 | 34 | public function deleteAction(Entity\Addressbook $addressbook) { 35 | 36 | $em = $this->getDoctrine()->getManager(); 37 | $em->remove($addressbook); 38 | $em->flush(); 39 | 40 | $this->get('session')->getFlashBag()->add('notice', 'Addressbook ' . htmlspecialchars($addressbook->getDisplayname()) . ' has been deleted.'); 41 | return $this->redirect($this->generateUrl('baikal_frontend_addressbook_list')); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/Baikal/FrontendBundle/Controller/Addressbook/ViewController.php: -------------------------------------------------------------------------------- 1 | get('security.context')->isGranted('dav.read', $addressbook)) { 17 | throw new HttpException(401, 'Unauthorized access.'); 18 | } 19 | 20 | $user = $this->get('security.context')->getToken()->getUser(); 21 | return $this->render('BaikalFrontendBundle:Addressbook:view.html.twig', array( 22 | 'user' => $user, 23 | 'addressbook' => $addressbook, 24 | )); 25 | } 26 | } -------------------------------------------------------------------------------- /src/Baikal/FrontendBundle/Controller/AuthController.php: -------------------------------------------------------------------------------- 1 | authenticate( 15 | $request, 16 | 'BaikalFrontendBundle:Auth:loginform.html.twig' 17 | ); 18 | } 19 | 20 | public function oauthloginformAction(Request $request) { 21 | return $this->authenticate( 22 | $request, 23 | 'BaikalFrontendBundle:Auth:oauthloginform.html.twig' 24 | ); 25 | } 26 | 27 | protected function authenticate(Request $request, $templatepath) { 28 | 29 | if($this->get('security.context')->isGranted('IS_AUTHENTICATED_FULLY')) { 30 | throw new \Exception("Error Processing Request", 1); 31 | } 32 | 33 | if($this->get('security.context')->isGranted('IS_AUTHENTICATED_REMEMBERED')) { 34 | throw new \Exception("Error Processing Request", 1); 35 | } 36 | 37 | $session = $request->getSession(); 38 | 39 | # get the login error if there is one 40 | if ($request->attributes->has(SecurityContext::AUTHENTICATION_ERROR)) { 41 | $error = $request->attributes->get(SecurityContext::AUTHENTICATION_ERROR); 42 | } else { 43 | $error = $session->get(SecurityContext::AUTHENTICATION_ERROR); 44 | $session->remove(SecurityContext::AUTHENTICATION_ERROR); 45 | } 46 | 47 | return $this->render($templatepath, array( 48 | 'last_username' => $session->get(SecurityContext::LAST_USERNAME), # last username entered by the user 49 | 'error' => $error, 50 | )); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/Baikal/FrontendBundle/Controller/Calendar/FormController.php: -------------------------------------------------------------------------------- 1 | action($request); 16 | } 17 | 18 | public function editAction(Request $request, Calendar $calendar) { 19 | if(!$this->get('security.context')->isGranted('dav.read', $calendar)) { 20 | throw new HttpException(401, 'Unauthorized access.'); 21 | } 22 | 23 | return $this->action($request, $calendar); 24 | } 25 | 26 | protected function action(Request $request, Calendar $calendar = null) { 27 | $that = $this; 28 | $user = $this->get('security.context')->getToken()->getUser(); 29 | 30 | return $this->get('baikal.formhandler.calendar')->handle( 31 | $this->getSuccessFunction($user), 32 | $this->getFailureFunction($user), 33 | $request, 34 | $user, 35 | $calendar # if null, creation 36 | ); 37 | } 38 | 39 | protected function getSuccessFunction(User $user) { 40 | $that = $this; 41 | 42 | return function($form, Calendar $calendar, $isNew) use($user, $that) { 43 | $that->get('session')->getFlashBag()->add('notice', 'Calendar ' . htmlspecialchars($calendar->getDisplayname()) . ' has been ' . ($isNew ? 'created' : 'updated') . '.'); 44 | return $that->redirect($that->generateUrl('baikal_frontend_calendar_list')); 45 | }; 46 | } 47 | 48 | protected function getFailureFunction(User $user) { 49 | $that = $this; 50 | 51 | return function($form, Calendar $calendar, $isNew) use ($user, $that) { 52 | return $this->render('BaikalFrontendBundle:Calendar:form.html.twig', array( 53 | 'form' => $form->createView(), 54 | 'user' => $user, 55 | 'calendar' => $calendar 56 | )); 57 | }; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/Baikal/FrontendBundle/Controller/Calendar/InstructionsController.php: -------------------------------------------------------------------------------- 1 | get('security.context')->isGranted('dav.read', $calendar)) { 17 | throw new HttpException(401, 'Unauthorized access.'); 18 | } 19 | 20 | $user = $this->get('security.context')->getToken()->getUser(); 21 | 22 | return $this->render('BaikalFrontendBundle:Calendar:instructions.html.twig', array( 23 | 'user' => $user, 24 | 'calendar' => $calendar, 25 | )); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Baikal/FrontendBundle/Controller/Calendar/ListController.php: -------------------------------------------------------------------------------- 1 | get('security.context')->getToken()->getUser(); 15 | $calendars = $this->get('baikal.repository.calendar')->findByUser($user); 16 | 17 | return $this->render('BaikalFrontendBundle:Calendar:list.html.twig', array( 18 | 'user' => $user, 19 | 'calendars' => $calendars, 20 | 'urls' => array( 21 | 'view' => function($user, $calendar) use (&$that) { 22 | return $that->generateUrl('baikal_frontend_calendar_view', array('calendar' => $calendar->getId())); 23 | }, 24 | 'edit' => function($user, $calendar) use (&$that) { 25 | return $that->generateUrl('baikal_frontend_calendar_form_edit', array('calendar' => $calendar->getId())); 26 | }, 27 | 'delete' => function($user, $calendar) use (&$that) { 28 | return $that->generateUrl('baikal_frontend_calendar_list_delete', array('calendar' => $calendar->getId())); 29 | }, 30 | 'instructions' => function($user, $calendar) use (&$that) { 31 | return $that->generateUrl('baikal_frontend_calendar_instructions', array('calendar' => $calendar->getId())); 32 | }, 33 | ) 34 | )); 35 | } 36 | 37 | public function deleteAction(Calendar $calendar) { 38 | 39 | $em = $this->getDoctrine()->getManager(); 40 | $em->remove($calendar); 41 | $em->flush(); 42 | 43 | $this->get('session')->getFlashBag()->add('notice', 'Calendar ' . htmlspecialchars($calendar->getDisplayname()) . ' has been deleted.'); 44 | return $this->redirect($this->generateUrl('baikal_frontend_calendar_list')); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/Baikal/FrontendBundle/Controller/Calendar/ViewController.php: -------------------------------------------------------------------------------- 1 | get('security.context')->isGranted('dav.read', $calendar)) { 17 | throw new HttpException(401, 'Unauthorized access.'); 18 | } 19 | 20 | $user = $this->get('security.context')->getToken()->getUser(); 21 | 22 | return $this->render('BaikalFrontendBundle:Calendar:view.html.twig', array( 23 | 'user' => $user, 24 | 'calendar' => $calendar, 25 | )); 26 | } 27 | 28 | public function fullscreenAction(Request $request, Calendar $calendar) { 29 | $user = $this->get('security.context')->getToken()->getUser(); 30 | return $this->render('BaikalFrontendBundle:Calendar:view.fullscreen.html.twig', array( 31 | 'user' => $user, 32 | 'calendar' => $calendar, 33 | )); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/Baikal/FrontendBundle/Controller/DashboardController.php: -------------------------------------------------------------------------------- 1 | render('BaikalFrontendBundle:Dashboard:index.html.twig', array( 13 | 'user' => $this->get('security.context')->getToken()->getUser(), 14 | )); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/Baikal/FrontendBundle/Controller/ProfileController.php: -------------------------------------------------------------------------------- 1 | get('security.context')->getToken()->getUser(); 16 | $principalidentity = $user->getIdentityPrincipal(); 17 | 18 | $data = array( 19 | 'displayname' => $principalidentity->getDisplayname(), 20 | 'email' => $principalidentity->getEmail(), 21 | 'roles' => $user->getRoles(), 22 | ); 23 | 24 | $form = $this->get('form.factory')->create(new FormType\User\EditUserType()); 25 | 26 | $form->setData($data); 27 | $form->handleRequest($request); 28 | 29 | if($form->isValid()) { 30 | $data = $form->getData(); 31 | $em = $this->getDoctrine()->getManager(); 32 | 33 | # Persisting identity principal 34 | $principalidentity->setDisplayname($data['displayname']); 35 | $principalidentity->setEmail($data['email']); 36 | 37 | $em->persist($principalidentity); 38 | 39 | # Persisting user if password changed 40 | if(!is_null($data['password'])) { 41 | $password = $data['password']; 42 | 43 | $user->setPassword( 44 | $this->get('security.encoder_factory') 45 | ->getEncoder($user) 46 | ->encodePassword( 47 | $password, 48 | $user->getSalt() 49 | ) 50 | ); 51 | } 52 | 53 | # Persisting user roles 54 | $user->setRoles($data['roles']); 55 | 56 | $em->persist($user); 57 | $em->flush(); 58 | 59 | $this->get('session')->getFlashBag()->add('notice', 'User ' . htmlspecialchars($user->getUsername()) . ' has been updated.'); 60 | return $this->redirect($this->generateUrl('baikal_admin_user_list')); 61 | } 62 | 63 | return $this->render('BaikalFrontendBundle:Profile:index.html.twig', array( 64 | 'user' => $user, 65 | 'form' => $form->createView(), 66 | )); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /src/Baikal/FrontendBundle/DependencyInjection/Configuration.php: -------------------------------------------------------------------------------- 1 | root('baikal_frontend'); 22 | 23 | // Here you should define the parameters that are allowed to 24 | // configure your bundle. See the documentation linked above for 25 | // more information on that topic. 26 | 27 | return $treeBuilder; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Baikal/FrontendBundle/DependencyInjection/NetgustoBaikalFrontendExtension.php: -------------------------------------------------------------------------------- 1 | processConfiguration($configuration, $configs); 24 | 25 | $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); 26 | $loader->load('services.yml'); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/Baikal/FrontendBundle/Form/Type/Calendar/CalendarType.php: -------------------------------------------------------------------------------- 1 | remove('roles'); 14 | } 15 | 16 | public function getName() { 17 | return 'user_edit_frontend'; 18 | } 19 | } -------------------------------------------------------------------------------- /src/Baikal/FrontendBundle/Menu/Builder.php: -------------------------------------------------------------------------------- 1 | container->get('security.context'); 13 | $user = $securityContext->getToken()->getUser(); 14 | 15 | $menu = $factory->createItem('root', array('childrenAttributes' => array('class' => 'nav navbar-nav'))); 16 | 17 | if($securityContext->isGranted('ROLE_FRONTEND_USER')) { 18 | $menu->addChild('Calendars', array('route' => 'baikal_frontend_calendar_list')); 19 | $menu->addChild('Contacts', array('route' => 'baikal_frontend_addressbook_list')); 20 | $menu->addChild('My profile', array('route' => 'baikal_frontend_profile')); 21 | } 22 | 23 | $currentpath = $this->container->get('request')->getPathInfo(); 24 | 25 | foreach($menu as $item) { 26 | $item->setCurrent((bool)preg_match('%^' . preg_quote($item->getUri()) . '%', $currentpath)); 27 | } 28 | 29 | return $menu; 30 | } 31 | } -------------------------------------------------------------------------------- /src/Baikal/FrontendBundle/Resources/config/config.yml: -------------------------------------------------------------------------------- 1 | imports: 2 | # - { resource: assets.yml } -------------------------------------------------------------------------------- /src/Baikal/FrontendBundle/Resources/config/services.yml: -------------------------------------------------------------------------------- 1 | services: 2 | baikal_frontend.access_denied_handler: 3 | class: Baikal\FrontendBundle\Service\AccessDeniedHandler 4 | arguments: 5 | - @http_kernel 6 | - @security.context 7 | - @router 8 | tags: 9 | - { name: kernel.event_listener, event: security.kernel_response, method: handle } 10 | 11 | 12 | baikal_frontend.oauth_preloginredirect_formauthenticationentrypoint: 13 | class: Baikal\FrontendBundle\Service\OAuthPreLoginRedirectFormAuthenticationEntryPoint 14 | arguments: 15 | - @http_kernel 16 | - @security.http_utils 17 | - 'hello' 18 | - false -------------------------------------------------------------------------------- /src/Baikal/FrontendBundle/Resources/doc/index.rst: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sabre-io/Baikal2/b5142938b8e5dde693f31ff52e061f2d2810aee2/src/Baikal/FrontendBundle/Resources/doc/index.rst -------------------------------------------------------------------------------- /src/Baikal/FrontendBundle/Resources/translations/messages.fr.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Symfony2 is great 7 | J'aime Symfony2 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/Baikal/FrontendBundle/Resources/views/Addressbook/form.html.twig: -------------------------------------------------------------------------------- 1 | {% extends "BaikalFrontendBundle:Layouts:standard.html.twig" %} 2 | 3 | {% block content %} 4 | 5 | {% set new = not (addressbook is defined and addressbook.id) %} 6 | 7 | {% embed "BaikalViewComponentsBundle:Components:pageheader.html.twig" %} 8 | {% set icon = "book" %} 9 | {% block header %} 10 | Addressbooks 11 | 12 | 13 | 14 | {% if new %} 15 | New 16 | {% else %} 17 | {{ addressbook.displayName() }} 18 | 19 | 20 | 21 | Edit 22 | {% endif %} 23 | 24 | {% endblock %} 25 | {% endembed %} 26 | 27 | {% embed "BaikalViewComponentsBundle:Components:Addressbook/form.html.twig" with { 28 | new: new, 29 | url_cancel: path('baikal_frontend_addressbook_list') 30 | } %}{% endembed %} 31 | 32 | {% endblock %} -------------------------------------------------------------------------------- /src/Baikal/FrontendBundle/Resources/views/Addressbook/list.html.twig: -------------------------------------------------------------------------------- 1 | {% extends "BaikalFrontendBundle:Layouts:standard.html.twig" %} 2 | 3 | {% set pagetitle = "Contacts" %} 4 | 5 | {% block content %} 6 | 7 | {% embed "BaikalViewComponentsBundle:Components:pageheader.html.twig" %} 8 | {% set icon = "book" %} 9 | {% block header %}Addressbooks{% endblock %} 10 | {% endembed %} 11 | 12 | {% if addressbooks|length %} 13 | {% embed "BaikalViewComponentsBundle:Components:addbutton.html.twig" %} 14 | {% set button_url = path('baikal_frontend_addressbook_form_new') %} 15 | {% set button_text = ' Add book' %} 16 | {% endembed %} 17 | 18 | {% embed "BaikalViewComponentsBundle:Components:Addressbook/list.html.twig" with { 19 | 'items': addressbooks, 20 | 'user': user, 21 | 'urls': urls 22 | } %}{% endembed %} 23 | {% else %} 24 | {% embed "BaikalViewComponentsBundle:Components:nothinghere.html.twig" with { 25 | itemname: 'addressbook', 26 | actionurl: path('baikal_frontend_addressbook_form_new'), 27 | calltoaction: 'Create one now' 28 | } %}{% endembed %} 29 | {% endif %} 30 | 31 | {% endblock %} 32 | 33 | {% block scripts %} 34 | {% embed "BaikalViewComponentsBundle:Components:list.scripts.html.twig" %}{% endembed %} 35 | {% endblock %} -------------------------------------------------------------------------------- /src/Baikal/FrontendBundle/Resources/views/Addressbook/view.html.twig: -------------------------------------------------------------------------------- 1 | {% extends "BaikalFrontendBundle:Layouts:standard.html.twig" %} 2 | 3 | {% set pagetitle = "Addressbook " ~ addressbook.getDisplayname() ~ " of " ~ user.uiLabel() %} 4 | 5 | {% block content %} 6 | 7 | {% embed "BaikalViewComponentsBundle:Components:pageheader.html.twig" %} 8 | {% set icon = "book" %} 9 | {% block header %} 10 | 11 | Addressbooks 12 | 13 | 14 | 15 | {{ addressbook.getDisplayname() }} 16 | 17 | {% endblock %} 18 | {% endembed %} 19 | 20 | {% embed "BaikalViewComponentsBundle:Components:SPA/cardclient.html.twig" with { addressbook: addressbook } %}{% endembed %} 21 | 22 | {% endblock %} -------------------------------------------------------------------------------- /src/Baikal/FrontendBundle/Resources/views/Auth/loginform.html.twig: -------------------------------------------------------------------------------- 1 | {% extends "BaikalFrontendBundle:Layouts:standard.html.twig" %} 2 | 3 | {% set pagetitle = "Frontend auth" %} 4 | 5 | {% block content %} 6 | 7 |
8 | {% embed "BaikalViewComponentsBundle:Components:pageheader.html.twig" with { container: false, header: "Please sign in", icon: "lock" } %}{% endembed %} 9 |
10 | 11 |

 

12 | 13 | {% embed "BaikalViewComponentsBundle:Components:loginform.html.twig" with { 14 | logincheckurl: path('baikal_frontend_login_check'), 15 | redirecturl: path('baikal_frontend_homepage') 16 | } %}{% endembed %} 17 | 18 | {% endblock %} -------------------------------------------------------------------------------- /src/Baikal/FrontendBundle/Resources/views/Auth/oauthloginform.html.twig: -------------------------------------------------------------------------------- 1 | {% extends "BaikalFrontendBundle:Layouts:standard.html.twig" %} 2 | 3 | {% set pagetitle = "OAuth authentication" %} 4 | 5 | {% block content %} 6 | 7 |
8 | {% embed "BaikalViewComponentsBundle:Components:pageheader.html.twig" with { container: false, header: "Please sign in to proceed", icon: "lock" } %}{% endembed %} 9 |

A third party application has requested access to your Baïkal account. Please, sign in to proceed with the application authorization.

10 |
11 | 12 |

 

13 | 14 | {% embed "BaikalViewComponentsBundle:Components:loginform.html.twig" with { 15 | logincheckurl: path('baikal_frontend_oauth_login_check') 16 | } %}{% endembed %} 17 | 18 | {% endblock %} -------------------------------------------------------------------------------- /src/Baikal/FrontendBundle/Resources/views/Calendar/form.html.twig: -------------------------------------------------------------------------------- 1 | {% extends "BaikalFrontendBundle:Layouts:standard.html.twig" %} 2 | 3 | {% block content %} 4 | 5 | {% set new = not (calendar is defined and calendar.id) %} 6 | 7 | {% embed "BaikalViewComponentsBundle:Components:pageheader.html.twig" %} 8 | {% set icon = "calendar" %} 9 | {% block header %} 10 | Calendars 11 | 12 | 13 | 14 | {% if new %} 15 | New 16 | {% else %} 17 | {% include "BaikalViewComponentsBundle:Components:calendarpill.html.twig" with { calendar: calendar } %} {{ calendar.displayName() }} 18 | 19 | 20 | 21 | Edit 22 | {% endif %} 23 | 24 | {% endblock %} 25 | {% endembed %} 26 | 27 | {% embed "BaikalViewComponentsBundle:Components:Calendar/form.html.twig" with { 28 | new: new, 29 | url_cancel: path('baikal_frontend_calendar_list') 30 | } %}{% endembed %} 31 | 32 | {% endblock %} 33 | 34 | {% block scripts %} 35 | {% embed "BaikalViewComponentsBundle:Components:Calendar/form.scripts.html.twig" %}{% endembed %} 36 | {% endblock %} -------------------------------------------------------------------------------- /src/Baikal/FrontendBundle/Resources/views/Calendar/instructions.html.twig: -------------------------------------------------------------------------------- 1 | {% extends "BaikalFrontendBundle:Layouts:standard.html.twig" %} 2 | 3 | {% set pagetitle = "Calendar " ~ calendar.getDisplayname() %} 4 | 5 | {% block content %} 6 | 7 | {% embed "BaikalViewComponentsBundle:Components:pageheader.html.twig" %} 8 | {% block header %} 9 | 10 | Calendars 11 | 12 | 13 | 14 | {% include "BaikalViewComponentsBundle:Components:calendarpill.html.twig" with { calendar: calendar } %} {{ calendar.getDisplayname() }} 15 | 16 | 17 | 18 | Connect 19 | 20 | {% endblock %} 21 | {% endembed %} 22 | 23 | {% embed "BaikalViewComponentsBundle:Components:Calendar/instructions.html.twig" with { 24 | user: user, 25 | calendar: calendar 26 | } %}{% endembed %} 27 | 28 | {% endblock %} -------------------------------------------------------------------------------- /src/Baikal/FrontendBundle/Resources/views/Calendar/list.html.twig: -------------------------------------------------------------------------------- 1 | {% extends "BaikalFrontendBundle:Layouts:standard.html.twig" %} 2 | 3 | {% set pagetitle = "Calendars" %} 4 | 5 | {% block content %} 6 | {% embed "BaikalViewComponentsBundle:Components:pageheader.html.twig" %} 7 | {% set icon = "calendar" %} 8 | {% block header %}Calendars{% endblock %} 9 | {% endembed %} 10 | 11 | {% if calendars|length %} 12 | {% embed "BaikalViewComponentsBundle:Components:addbutton.html.twig" %} 13 | {% set button_url = path('baikal_frontend_calendar_form_new') %} 14 | {% set button_text = ' Add calendar' %} 15 | {% endembed %} 16 | 17 | {% embed "BaikalViewComponentsBundle:Components:Calendar/list.html.twig" with { 18 | 'user' : user, 19 | 'items' : calendars, 20 | 'urls': urls 21 | } %}{% endembed %} 22 | {% else %} 23 | {% embed "BaikalViewComponentsBundle:Components:nothinghere.html.twig" with { 24 | itemname: 'calendar', 25 | actionurl: path('baikal_frontend_calendar_form_new'), 26 | calltoaction: 'Create one now' 27 | } %}{% endembed %} 28 | {% endif %} 29 | 30 | {% endblock %} 31 | 32 | {% block scripts %} 33 | {% embed "BaikalViewComponentsBundle:Components:list.scripts.html.twig" %}{% endembed %} 34 | {% endblock %} -------------------------------------------------------------------------------- /src/Baikal/FrontendBundle/Resources/views/Calendar/view.html.twig: -------------------------------------------------------------------------------- 1 | {% extends "BaikalFrontendBundle:Layouts:fullscreen.html.twig" %} 2 | 3 | {% set pagetitle = "Calendar " ~ calendar.getDisplayname() %} 4 | 5 | {% block bodyclass %}calendar-fullscreen{% endblock %} 6 | 7 | {% set calview = application('pulpy', { 8 | rootElement: '#app-calclient', 9 | parameters: { 10 | apiendpoint: '/webapi/v1', 11 | calendarsEnabledAtStart: [calendar.getId()], 12 | calendarFocusedAtStart: calendar.getId(), 13 | starttime: 0, 14 | endtime: 23, 15 | businessstarttime: 7, 16 | businessendtime: 20, 17 | hourbarwidth: 30, 18 | hourheight: 60, 19 | allowMovingToAdjacentWeeks: true, 20 | windowed: true, 21 | cosmetic: { 22 | gutterwidth: 16, 23 | event: { 24 | marginLeft: 2, 25 | marginTop: 2, 26 | marginBottom: 3 27 | }, 28 | popup: { 29 | width: 300, 30 | height: 200 31 | } 32 | } 33 | } 34 | }) %} 35 | 36 | {% block content %} 37 |
38 | {{ calview.html|raw }} 39 | {% endblock %} 40 | 41 | {% block scripts %} 42 | {{ calview.assets|raw }} 43 | {% endblock %} -------------------------------------------------------------------------------- /src/Baikal/FrontendBundle/Resources/views/Dashboard/index.html.twig: -------------------------------------------------------------------------------- 1 | {% extends "BaikalFrontendBundle:Layouts:standard.html.twig" %} 2 | 3 | {% set pagetitle = "Welcome" %} 4 | 5 | {% block content %} 6 | 7 | 8 | {% embed "BaikalViewComponentsBundle:Components:pageheader.html.twig" %} 9 | {% block header %} 10 | 11 | {{ user.uiLabel() }}, Welcome ! 12 | 13 | {% endblock %} 14 | {% endembed %} 15 | 16 |
17 | 18 |
19 |
20 |
21 |

About me

22 |

TODO:
Here, information about my account, some of my next calendar events, and my upcoming todos.

23 |
24 |
25 |

License and credits

26 | {% embed "BaikalViewComponentsBundle:Components:Dashboard/license.html.twig" %}{% endembed %} 27 |
28 |
29 |
30 |
31 | 32 | {% endblock %} -------------------------------------------------------------------------------- /src/Baikal/FrontendBundle/Resources/views/Layouts/fullscreen.html.twig: -------------------------------------------------------------------------------- 1 | {% extends "BaikalViewComponentsBundle:Layouts:standard.html.twig" %} 2 | 3 | {% block body %} 4 | 5 | 35 | 36 |
37 | 64 |
65 | 66 | {% block content %} 67 |

Content here

68 | {% endblock %} 69 | 70 | {% endblock body %} -------------------------------------------------------------------------------- /src/Baikal/FrontendBundle/Resources/views/Layouts/partials/_footer.html.twig: -------------------------------------------------------------------------------- 1 | 7 |
8 |
9 | 13 |
14 |
-------------------------------------------------------------------------------- /src/Baikal/FrontendBundle/Resources/views/Layouts/standard.html.twig: -------------------------------------------------------------------------------- 1 | {% extends "BaikalViewComponentsBundle:Layouts:standard.html.twig" %} 2 | 3 | {% block body %} 4 | 5 | {% include 'BaikalFrontendBundle:Layouts:partials/_header.html.twig' %} 6 | 7 | {% block content %} 8 |

Content here

9 | {% endblock %} 10 | 11 | {% include 'BaikalFrontendBundle:Layouts:partials/_footer.html.twig' %} 12 | 13 | {% endblock body %} -------------------------------------------------------------------------------- /src/Baikal/FrontendBundle/Resources/views/Profile/index.html.twig: -------------------------------------------------------------------------------- 1 | {% extends "BaikalFrontendBundle:Layouts:standard.html.twig" %} 2 | 3 | {% set pagetitle = "User profile" %} 4 | 5 | {% block content %} 6 | 7 | {% embed "BaikalViewComponentsBundle:Components:pageheader.html.twig" %} 8 | 9 | {% block header %} 10 | 11 | {% include "BaikalViewComponentsBundle:Components:avatar.textsize.html.twig" with { email: user.email } %} My profile 12 | 13 | {% endblock header %} 14 | {% endembed %} 15 | 16 |
17 | 18 |
19 | 20 |
21 | 22 | {% import '::forms.html.twig' as forms %} 23 | 24 | 25 | {{ forms.syntheticreadonly(user.username(), 'Username') }} 26 | 27 | {{ forms.text(form.displayname) }} 28 | 29 | {{ forms.text(form.email) }} 30 | 31 | {{ forms.confirmedpassword(form.password, user is defined) }} 32 | 33 | {{ form_rest(form) }} 34 | 35 |
36 |
37 | 38 |
39 |
40 |
41 |
42 |
43 | 44 | {% endblock %} -------------------------------------------------------------------------------- /src/Baikal/FrontendBundle/Service/AccessDeniedHandler.php: -------------------------------------------------------------------------------- 1 | kernel = $http_kernel; 24 | $this->securityContext = $securityContext; 25 | $this->router = $router; 26 | } 27 | 28 | /** 29 | * Handles an access denied failure. 30 | * 31 | * @param Request $request 32 | * @param AccessDeniedException $accessDeniedException 33 | * 34 | * @return Response may return null 35 | */ 36 | public function handle(Request $request, AccessDeniedException $accessDeniedException) { 37 | 38 | # First we check if user has an access granted to the admin 39 | if($this->securityContext->isGranted('ROLE_ADMIN') || $this->securityContext->isGranted('ROLE_STATIC_ADMIN')) { 40 | return new RedirectResponse($this->router->generate('baikal_admin_homepage')); 41 | } 42 | 43 | # If not, we display an "Access denied" message 44 | $attributes = array( 45 | '_controller' => 'BaikalCoreBundle:Security:accessDenied', 46 | 'exception' => $accessDeniedException, 47 | ); 48 | 49 | $subRequest = $request->duplicate(array(), null, $attributes); 50 | return $this->kernel->handle($subRequest, HttpKernelInterface::SUB_REQUEST); 51 | } 52 | } -------------------------------------------------------------------------------- /src/Baikal/FrontendBundle/Service/OAuthPreLoginRedirectFormAuthenticationEntryPoint.php: -------------------------------------------------------------------------------- 1 | render('BaikalSystemBundle:Security:accessDenied.html.twig'); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Baikal/SystemBundle/DependencyInjection/BaikalSystemExtension.php: -------------------------------------------------------------------------------- 1 | processConfiguration($configuration, $configs); 24 | 25 | $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); 26 | $loader->load('services.yml'); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/Baikal/SystemBundle/DependencyInjection/Configuration.php: -------------------------------------------------------------------------------- 1 | root('baikal_system'); 22 | 23 | // Here you should define the parameters that are allowed to 24 | // configure your bundle. See the documentation linked above for 25 | // more information on that topic. 26 | 27 | return $treeBuilder; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Baikal/SystemBundle/Entity/User.php: -------------------------------------------------------------------------------- 1 | 2 | Baïkal - Access denied 3 | 4 |

Baïkal - Access to this resource is denied.

5 | 6 | -------------------------------------------------------------------------------- /src/Baikal/SystemBundle/Services/AbstractConfigService.php: -------------------------------------------------------------------------------- 1 | entityManager = $entityManager; 14 | } 15 | 16 | public function initialize($config) { 17 | $this->config = $config; 18 | } 19 | 20 | public function __call($name, $arguments) { 21 | 22 | if(preg_match('/^get.+$/', $name)) { 23 | $prop = lcfirst(substr($name, 3)); 24 | return $this->config->get($prop); 25 | } 26 | 27 | if(preg_match('/^set.+$/', $name)) { 28 | $prop = lcfirst(substr($name, 3)); 29 | $this->config->set($prop, $arguments[0]); 30 | $this->entityManager->persist($this->config); 31 | $this->entityManager->flush(); 32 | return $this; 33 | } 34 | 35 | if(preg_match('/^has.+$/', $name)) { 36 | $prop = lcfirst(substr($name, 3)); 37 | return $this->config->has($prop); 38 | } 39 | 40 | throw new \RuntimeException(get_class($this) . ': Call to undefined method ' . $name); 41 | } 42 | } -------------------------------------------------------------------------------- /src/Baikal/SystemBundle/Services/ConfigLoader/AbstractConfigLoaderService.php: -------------------------------------------------------------------------------- 1 | parameters) { 24 | return $value; 25 | } 26 | 27 | if(is_array($value)) { 28 | $keys = array_keys($value); 29 | 30 | foreach($keys as $key) { 31 | $value[$key] = $this->doReplacements($value[$key]); 32 | } 33 | 34 | return $value; 35 | } 36 | 37 | if(is_string($value)) { 38 | return strtr($value, $this->parameters); 39 | } 40 | 41 | return $value; 42 | } 43 | } -------------------------------------------------------------------------------- /src/Baikal/SystemBundle/Services/ConfigLoader/DbBackedConfigLoaderService.php: -------------------------------------------------------------------------------- 1 | em = $em; 15 | $this->configcontainerclass = $configcontainerclass; 16 | } 17 | 18 | public function load($configname) { 19 | 20 | $configEntity = $this->em->getRepository($this->configcontainerclass)->findOneByName($configname); 21 | 22 | if(!$configEntity) { 23 | return null; 24 | } 25 | 26 | return $configEntity; 27 | } 28 | } -------------------------------------------------------------------------------- /src/Baikal/SystemBundle/Services/ConfigLoader/FileBackedConfigLoaderService.php: -------------------------------------------------------------------------------- 1 | parameters = $this->prepareParameters($parameters); 13 | } 14 | 15 | public function load($filename) { 16 | $config = Yaml::parse($filename) ?: array(); 17 | 18 | $keys = array_keys($config); 19 | foreach($keys as $key) { 20 | $config[$key] = $this->doReplacements($config[$key]); 21 | } 22 | 23 | return $config; 24 | } 25 | } -------------------------------------------------------------------------------- /src/Baikal/SystemBundle/Services/MainConfigService.php: -------------------------------------------------------------------------------- 1 | config->get('server_timezone')); 10 | } 11 | 12 | public function getEnable_api() { 13 | return TRUE; 14 | } 15 | } -------------------------------------------------------------------------------- /src/Baikal/ViewComponentsBundle/BaikalViewComponentsBundle.php: -------------------------------------------------------------------------------- 1 | processConfiguration($configuration, $configs); 24 | 25 | $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); 26 | $loader->load('services.yml'); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/Baikal/ViewComponentsBundle/DependencyInjection/Configuration.php: -------------------------------------------------------------------------------- 1 | root('baikal_view_components'); 22 | 23 | // Here you should define the parameters that are allowed to 24 | // configure your bundle. See the documentation linked above for 25 | // more information on that topic. 26 | 27 | return $treeBuilder; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Baikal/ViewComponentsBundle/Resources/config/services.yml: -------------------------------------------------------------------------------- 1 | services: 2 | 3 | baikal.twigextension: 4 | class: Baikal\ViewComponentsBundle\Twig\BaikalExtension 5 | arguments: 6 | # Inject service container to lazyload dependencies 7 | - @service_container 8 | tags: 9 | - { name: twig.extension } 10 | 11 | baikal.twigmenuextension: 12 | class: Baikal\ViewComponentsBundle\Twig\MenuExtension 13 | arguments: 14 | helper: @knp_menu.helper 15 | tags: 16 | - { name: twig.extension } 17 | 18 | baikal.formhandler.calendar: 19 | class: Baikal\ViewComponentsBundle\Services\FormHandler\CalendarFormHandler 20 | arguments: 21 | - @doctrine.orm.entity_manager 22 | - @form.factory 23 | 24 | baikal.formhandler.addressbook: 25 | class: Baikal\ViewComponentsBundle\Services\FormHandler\AddressbookFormHandler 26 | arguments: 27 | - @doctrine.orm.entity_manager 28 | - @form.factory 29 | 30 | baikal.formhandler.application: 31 | class: Baikal\ViewComponentsBundle\Services\FormHandler\ApplicationFormHandler 32 | arguments: 33 | - @doctrine.orm.entity_manager 34 | - @form.factory -------------------------------------------------------------------------------- /src/Baikal/ViewComponentsBundle/Resources/views/Components/Addressbook/form.html.twig: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 |
5 | 6 | {% import '::forms.html.twig' as forms %} 7 | 8 | {{ forms.text(form.displayname) }} 9 | 10 | {{ forms.text(form.description) }} 11 | 12 | {{ form_rest(form) }} 13 | 14 |
15 |
16 | Cancel 17 |
18 | 19 |
20 | {% if new %} 21 | 22 | {% else %} 23 | 24 | {% endif %} 25 |
26 |
27 |
28 |
29 |
-------------------------------------------------------------------------------- /src/Baikal/ViewComponentsBundle/Resources/views/Components/Addressbook/list.html.twig: -------------------------------------------------------------------------------- 1 | {% embed "BaikalViewComponentsBundle:Components:list.html.twig" %} 2 | {% block payload %} 3 | {% set contacts = item.getContacts() %} 4 | {% set contactscount = contacts.count() %} 5 |

6 | {{ item.getDisplayname() }} 7 |

8 |

9 | {% if item.getDescription() %} {{ item.getDescription() }} - {% endif %} 10 | 11 | {% if contactscount == 0 %} 12 | No contact yet 13 | {% elseif contactscount == 1 %} 14 | Only one contact 15 | {% else %} 16 | {{ contactscount }} contacts 17 | {% endif %} 18 |

19 | {% endblock %} 20 | {% block actions %} 21 | 22 |
23 | View 24 | Edit 25 | Delete 26 |
27 |
28 | {% endblock %} 29 | {% block deletemodal %} 30 | {% embed "BaikalViewComponentsBundle:Components:modal.html.twig" %} 31 | 32 | {% block title %}Delete book Contact book name{% endblock %} 33 | 34 | {% block body %} 35 |

You are about to delete Addressbook name and all related data.

36 |

Careful ! This operation is destructive, and cannot be undone.

37 | {% endblock %} 38 | 39 | {% endembed %} 40 | {% endblock %} 41 | {% endembed %} -------------------------------------------------------------------------------- /src/Baikal/ViewComponentsBundle/Resources/views/Components/Calendar/form.html.twig: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 |
6 | 7 |
8 | 9 | {% import '::forms.html.twig' as forms %} 10 | 11 | {{ forms.text(form.displayname) }} 12 | 13 | {{ forms.text(form.description) }} 14 | 15 |
16 | {{ form_label(form.calendarcolor, label|default(null), { 'label_attr': { 'class': 'col-sm-4 col-lg-2 control-label' } }) }} 17 |
18 | 19 | {{ form_widget(form.calendarcolor, { 'attr': { 'class': 'form-control colorpicker' } }) }} 20 | {% if not form.calendarcolor.vars.valid %}{{ form.calendarcolor.vars.errors[0].getMessage() }}{% endif %} 21 |
22 |
23 | 24 | {{ form_rest(form) }} 25 | 26 |
27 |
28 | Cancel 29 |
30 | 31 |
32 | {% if new %} 33 | 34 | {% else %} 35 | 36 | {% endif %} 37 |
38 |
39 |
40 |
41 | 42 |
-------------------------------------------------------------------------------- /src/Baikal/ViewComponentsBundle/Resources/views/Components/Calendar/form.scripts.html.twig: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/Baikal/ViewComponentsBundle/Resources/views/Components/Calendar/instructions.html.twig: -------------------------------------------------------------------------------- 1 |
Here, you'll find instructions on how to setup your calendar client to connect to this calendar.
-------------------------------------------------------------------------------- /src/Baikal/ViewComponentsBundle/Resources/views/Components/Calendar/list.html.twig: -------------------------------------------------------------------------------- 1 | {% embed "BaikalViewComponentsBundle:Components:list.html.twig" %} 2 | {% block payload %} 3 | {% set eventcount = eventcountforcalendar(item) %} 4 |

5 | {% include "BaikalViewComponentsBundle:Components:calendarpill.html.twig" with { calendar: item } %} {{ item.getDisplayname() }} 6 |

7 |

8 | {%if item.getDescription() %} {{ item.getDescription() }} - {% endif %} 9 | 10 | {% if eventcount == 0 %} 11 | No event in this calendar yet. 12 | {% else %} 13 | {% if eventcount == 1 %} 14 | Only one event in the calendar. 15 | {% else %} 16 | {{ eventcount }} events in the calendar. 17 | {% endif %} 18 | {% endif %} 19 |

20 | {% endblock %} 21 | {% block actions %} 22 | 23 |
24 | 25 | View 26 | 27 | 28 | Connect 29 | 30 | 31 | Edit 32 | 33 | 34 | Delete 35 | 36 |
37 |
38 | {% endblock %} 39 | {% block deletemodal %} 40 | {% embed "BaikalViewComponentsBundle:Components:modal.html.twig" %} 41 | 42 | {% block title %}Delete calendar Calendar name{% endblock %} 43 | {% block body %} 44 |

You are about to delete Calendar name and all it's data.

45 |

Careful ! This operation is destructive, and cannot be undone.

46 | {% endblock %} 47 | 48 | {% endembed %} 49 | {% endblock %} 50 | {% endembed %} -------------------------------------------------------------------------------- /src/Baikal/ViewComponentsBundle/Resources/views/Components/Dashboard/license.html.twig: -------------------------------------------------------------------------------- 1 |

Baïkal is open source software licensed under the terms of the GNU GPL v3.

2 |

3 | Baïkal is developed by Net Gusto. 4 | 5 | Follow @netgusto 6 |

7 |

Baïkal is based upon sabre/dav and other great open source projects.
Read the README.md file to learn about that, and to read the respective licenses of these open source projects.

-------------------------------------------------------------------------------- /src/Baikal/ViewComponentsBundle/Resources/views/Components/SPA/calclient.html.twig: -------------------------------------------------------------------------------- 1 |
2 | 3 | {% set calview = application('pulpy', { 4 | rootElement: '#app-calclient', 5 | parameters: { 6 | apiendpoint: '//' ~ (app.request.getHttpHost() ~ path('baikal.webapi.root'))|trim('/'), 7 | calendarsEnabledAtStart: [calendar.getId()], 8 | calendarFocusedAtStart: calendar.getId(), 9 | starttime: 0, 10 | endtime: 23, 11 | businessstarttime: 7, 12 | businessendtime: 20, 13 | hourbarwidth: 30, 14 | hourheight: 90, 15 | allowMovingToAdjacentWeeks: true, 16 | windowed: true, 17 | cosmetic: { 18 | gutterwidth: 16, 19 | event: { 20 | marginLeft: 2, 21 | marginTop: 2, 22 | marginBottom: 3 23 | }, 24 | popup: { 25 | width: 300, 26 | height: 200 27 | } 28 | } 29 | } 30 | }) %} 31 | 32 | {{ calview }} -------------------------------------------------------------------------------- /src/Baikal/ViewComponentsBundle/Resources/views/Components/SPA/cardclient.html.twig: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 | 6 | 7 | 8 | 9 | {{ 10 | application('buddies', { 11 | rootElement: '#app-cardclient', 12 | addressbookid: addressbook.id, 13 | urlapi: '//' ~ (app.request.getHttpHost() ~ path('baikal.webapi.root'))|trim('/') 14 | }) 15 | }} -------------------------------------------------------------------------------- /src/Baikal/ViewComponentsBundle/Resources/views/Components/addbutton.html.twig: -------------------------------------------------------------------------------- 1 | {% spaceless %} 2 | 3 | {% if button_url is not defined %} 4 | {% set button_url = false %} 5 | {% endif %} 6 | 7 | {% if button_text is not defined %} 8 | {% set button_text = false %} 9 | {% endif %} 10 | 11 | {% set button_url_bis = block('button_url')|raw %} 12 | {% set button_text_bis = block('button_text')|raw %} 13 | 14 | {% endspaceless %}
15 |
16 |
17 | {% if button_url and button_text %} 18 | 19 | {{ button_text_bis|raw }} 20 | {% endif %} 21 |
22 |
23 |
-------------------------------------------------------------------------------- /src/Baikal/ViewComponentsBundle/Resources/views/Components/avatar.textsize.html.twig: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/Baikal/ViewComponentsBundle/Resources/views/Components/calendarpill.html.twig: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/Baikal/ViewComponentsBundle/Resources/views/Components/flash.notice.html.twig: -------------------------------------------------------------------------------- 1 | {% for flashMessage in app.session.flashbag.get('notice') %} 2 |
3 | 4 | {{ flashMessage|raw }} 5 |
6 | {% endfor %} -------------------------------------------------------------------------------- /src/Baikal/ViewComponentsBundle/Resources/views/Components/list.html.twig: -------------------------------------------------------------------------------- 1 |
2 | 3 | {% include "BaikalViewComponentsBundle:Components:flash.notice.html.twig" %} 4 | 5 |
6 | 7 | {% for item in items %} 8 | 9 |
10 |
11 | {% block payload %}{% endblock %} 12 |
13 |
14 | {% block actions %}{% endblock %} 15 |
16 |
17 | 18 | {% endfor %} 19 | 20 |
21 | 22 |
23 | 24 | {{ block('deletemodal') }} -------------------------------------------------------------------------------- /src/Baikal/ViewComponentsBundle/Resources/views/Components/list.scripts.html.twig: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/Baikal/ViewComponentsBundle/Resources/views/Components/loginform.html.twig: -------------------------------------------------------------------------------- 1 | {% spaceless %} 2 | {% if header is not defined %} 3 | {% set header = "Please sign in" %} 4 | {% endif %} 5 | {% endspaceless %} 6 |
7 |
8 | 9 | 44 |
45 |
46 |
-------------------------------------------------------------------------------- /src/Baikal/ViewComponentsBundle/Resources/views/Components/modal.html.twig: -------------------------------------------------------------------------------- 1 | {% spaceless %} 2 | 3 | {% if title is not defined %} 4 | {% set title = 'Watch out !' %} 5 | {% endif %} 6 | 7 | {% if body is not defined %} 8 | {% set body = "

You are about to do something dangerous.

" %} 9 | {% endif %} 10 | 11 | {% if button_text is not defined %} 12 | {% set button_text = block('title') %} 13 | {% endif %} 14 | 15 | {% if button_class is not defined %} 16 | {% set button_class = 'danger' %} 17 | {% endif %} 18 | 19 | {% if id is not defined %} 20 | {% set id = 'modal-' ~ button_class %} 21 | {% endif %} 22 | 23 | {% endspaceless %} -------------------------------------------------------------------------------- /src/Baikal/ViewComponentsBundle/Resources/views/Components/nothinghere.html.twig: -------------------------------------------------------------------------------- 1 |
2 | {% include "BaikalViewComponentsBundle:Components:flash.notice.html.twig" %} 3 |
4 | 5 |
6 |

Nothing here !

7 |

8 | It seems that you don't have created any {{ singularize(itemname) }}. 9 | {{ calltoaction }} 10 |

11 |
-------------------------------------------------------------------------------- /src/Baikal/ViewComponentsBundle/Resources/views/Components/pageheader.html.twig: -------------------------------------------------------------------------------- 1 | {% spaceless %} 2 | {% if header is not defined %} 3 | {% set header = 'Welcome !' %} 4 | {% endif %} 5 | {% if container is not defined %} 6 | {% set container = true %} 7 | {% endif %} 8 | {% endspaceless %} 9 | {% if container %}
{% endif %} 10 |
11 |
12 | 15 |
16 |
17 | {% if container %}
{% endif %} -------------------------------------------------------------------------------- /src/Baikal/ViewComponentsBundle/Resources/views/Layouts/fullpage.html.twig: -------------------------------------------------------------------------------- 1 | {% spaceless %} 2 | 3 | {# Defining global variables #} 4 | 5 | {% if pagetitle is not defined %} 6 | {% set pagetitle = 'Baïkal' %} 7 | {% endif %} 8 | 9 | {% if 'Baïkal' not in pagetitle %} 10 | {% set pagetitle = pagetitle ~ ' | Baïkal' %} 11 | {% endif %} 12 | 13 | {% endspaceless %} 14 | 15 | 16 | 17 | {{ pagetitle }} 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | {% block body %} 29 | 30 | {% endblock %} 31 | 32 | 34 | 35 | 36 | 37 | {% block scripts %}{% endblock %} 38 | 41 | 42 | -------------------------------------------------------------------------------- /src/Baikal/ViewComponentsBundle/Resources/views/Layouts/standard.html.twig: -------------------------------------------------------------------------------- 1 | {% spaceless %} 2 | 3 | {# Defining global variables #} 4 | 5 | {% if pagetitle is not defined %} 6 | {% set pagetitle = 'Baïkal' %} 7 | {% endif %} 8 | 9 | {% if 'Baïkal' not in pagetitle %} 10 | {% set pagetitle = pagetitle ~ ' | Baïkal' %} 11 | {% endif %} 12 | 13 | {% endspaceless %} 14 | 15 | 16 | 17 | {{ pagetitle }} 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 33 | 34 | 35 | {% block body %} 36 | 37 | {% endblock %} 38 | 39 | 41 | 42 | 43 | 44 | {% block scripts %}{% endblock %} 45 | 48 | 49 | -------------------------------------------------------------------------------- /src/Baikal/ViewComponentsBundle/Resources/views/Menu/topmenu.html.twig: -------------------------------------------------------------------------------- 1 | {% extends 'knp_menu.html.twig' %} -------------------------------------------------------------------------------- /src/Baikal/ViewComponentsBundle/Services/FormHandler/AddressbookFormHandler.php: -------------------------------------------------------------------------------- 1 | em = $em; 20 | $this->formfactory = $formfactory; 21 | } 22 | 23 | public function handle($onSuccess, $onFailure, Request $request, User $user, Addressbook $addressbook = null) { 24 | 25 | $new = false; 26 | 27 | if(is_null($addressbook)) { 28 | $addressbook = new Addressbook(); 29 | $addressbook->setPrincipaluri($user->getIdentityPrincipal()->getUri()); 30 | $addressbook->setUri(UUIDUtil::getUUID()); 31 | $addressbook->setSynctoken('1'); 32 | $new = true; 33 | } 34 | 35 | $form = $this->formfactory->create( 36 | new AddressbookType(), 37 | $addressbook 38 | ); 39 | 40 | $form->handleRequest($request); 41 | 42 | if($form->isValid()) { 43 | $this->em->persist($addressbook); 44 | $this->em->flush(); 45 | 46 | return $onSuccess($form, $addressbook, $new); 47 | } 48 | 49 | return $onFailure($form, $addressbook, $new); 50 | } 51 | } -------------------------------------------------------------------------------- /src/Baikal/ViewComponentsBundle/Services/FormHandler/ApplicationFormHandler.php: -------------------------------------------------------------------------------- 1 | em = $em; 19 | $this->formfactory = $formfactory; 20 | } 21 | 22 | public function handle($onSuccess, $onFailure, Request $request, Application $app = null) { 23 | 24 | $new = false; 25 | 26 | if(is_null($app)) { 27 | $app = new Application(); 28 | $new = true; 29 | } 30 | 31 | $form = $this->formfactory->create( 32 | new ApplicationType(), 33 | $app 34 | ); 35 | 36 | $form->handleRequest($request); 37 | 38 | if($form->isValid()) { 39 | $this->em->persist($app); 40 | $this->em->flush(); 41 | 42 | return $onSuccess($form, $app, $new); 43 | } 44 | 45 | return $onFailure($form, $app, $new); 46 | } 47 | } -------------------------------------------------------------------------------- /src/Baikal/ViewComponentsBundle/Services/FormHandler/CalendarFormHandler.php: -------------------------------------------------------------------------------- 1 | em = $em; 20 | $this->formfactory = $formfactory; 21 | } 22 | 23 | public function handle($onSuccess, $onFailure, Request $request, User $user, Calendar $calendar = null) { 24 | 25 | $new = false; 26 | 27 | if(is_null($calendar)) { 28 | $calendar = new Calendar(); 29 | $calendar->setPrincipaluri($user->getIdentityPrincipal()->getUri()); 30 | $calendar->setUri(UUIDUtil::getUUID()); 31 | $new = true; 32 | } 33 | 34 | $form = $this->formfactory->create( 35 | new CalendarType(), 36 | $calendar 37 | ); 38 | 39 | $form->handleRequest($request); 40 | 41 | if($form->isValid()) { 42 | $this->em->persist($calendar); 43 | $this->em->flush(); 44 | 45 | return $onSuccess($form, $calendar, $new); 46 | } 47 | 48 | return $onFailure($form, $calendar, $new); 49 | } 50 | } -------------------------------------------------------------------------------- /src/Baikal/ViewComponentsBundle/Twig/MenuExtension.php: -------------------------------------------------------------------------------- 1 | new \Twig_Function_Method($this, 'navbarmenu', array('is_safe' => array('html'))), 16 | ); 17 | } 18 | 19 | public function navbarmenu($menu, array $options = array(), $renderer = null) 20 | { 21 | $options['class'] = 'navbar-nav'; 22 | $options['currentClass'] = 'active'; 23 | 24 | $options['template'] = 'BaikalViewComponentsBundle:Menu:topmenu.html.twig'; 25 | return parent::render($menu, $options, $renderer); 26 | } 27 | 28 | /** 29 | * @return string 30 | */ 31 | public function getName() 32 | { 33 | return 'baikal_menu'; 34 | } 35 | } -------------------------------------------------------------------------------- /src/Netgusto/PortalBundle/DependencyInjection/Configuration.php: -------------------------------------------------------------------------------- 1 | root('portal'); 22 | 23 | // Here you should define the parameters that are allowed to 24 | // configure your bundle. See the documentation linked above for 25 | // more information on that topic. 26 | 27 | $rootNode 28 | ->children() 29 | ->arrayNode('applications') 30 | ->prototype('array') 31 | ->children() 32 | ->scalarNode('name')->end() 33 | ->scalarNode('dist')->end() 34 | ->scalarNode('type')->end() 35 | ->scalarNode('port')->end() 36 | ->end() 37 | ->end() 38 | ->end() 39 | ->end(); 40 | 41 | return $treeBuilder; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/Netgusto/PortalBundle/DependencyInjection/NetgustoPortalExtension.php: -------------------------------------------------------------------------------- 1 | processConfiguration($configuration, $configs); 24 | 25 | $container->setParameter('portal_config', $config); 26 | 27 | $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); 28 | $loader->load('services.yml'); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/Netgusto/PortalBundle/NetgustoPortalBundle.php: -------------------------------------------------------------------------------- 1 | 9 | RewriteEngine On 10 | 11 | # Determine the RewriteBase automatically and set it as environment variable. 12 | # If you are using Apache aliases to do mass virtual hosting or installed the 13 | # project in a subdirectory, the base path will be prepended to allow proper 14 | # resolution of the app.php file and to redirect to the correct URI. It will 15 | # work in environments without path prefix as well, providing a safe, one-size 16 | # fits all solution. But as you do not need it in this case, you can comment 17 | # the following 2 lines to eliminate the overhead. 18 | RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$ 19 | RewriteRule ^(.*) - [E=BASE:%1] 20 | 21 | # Redirect to URI without front controller to prevent duplicate content 22 | # (with and without `/app.php`). Only do this redirect on the initial 23 | # rewrite by Apache and not on subsequent cycles. Otherwise we would get an 24 | # endless redirect loop (request -> rewrite to front controller -> 25 | # redirect -> request -> ...). 26 | # So in case you get a "too many redirects" error or you always get redirected 27 | # to the start page because your Apache does not expose the REDIRECT_STATUS 28 | # environment variable, you have 2 choices: 29 | # - disable this feature by commenting the following 2 lines or 30 | # - use Apache >= 2.3.9 and replace all L flags by END flags and remove the 31 | # following RewriteCond (best solution) 32 | RewriteCond %{ENV:REDIRECT_STATUS} ^$ 33 | RewriteRule ^app\.php(/(.*)|$) %{ENV:BASE}/$2 [R=301,L] 34 | 35 | # If the requested filename exists, simply serve it. 36 | # We only want to let Apache serve files and not directories. 37 | RewriteCond %{REQUEST_FILENAME} -f 38 | RewriteRule .? - [L] 39 | 40 | # Rewrite all other queries to the front controller. 41 | RewriteRule .? %{ENV:BASE}/app.php [L] 42 | 43 | 44 | 45 | 46 | # When mod_rewrite is not available, we instruct a temporary redirect of 47 | # the start page to the front controller explicitly so that the website 48 | # and the generated links can still be used. 49 | RedirectMatch 302 ^/$ /app.php/ 50 | # RedirectTemp cannot be used instead 51 | 52 | 53 | -------------------------------------------------------------------------------- /web/app.php: -------------------------------------------------------------------------------- 1 | unregister(); 14 | $apcLoader->register(true); 15 | */ 16 | 17 | require_once __DIR__.'/../app/AppKernel.php'; 18 | //require_once __DIR__.'/../app/AppCache.php'; 19 | 20 | $kernel = new AppKernel('prod', false); 21 | $kernel->loadClassCache(); 22 | //$kernel = new AppCache($kernel); 23 | 24 | // When using the HttpCache, you need to call the method in your front controller instead of relying on the configuration parameter 25 | //Request::enableHttpMethodParameterOverride(); 26 | $request = Request::createFromGlobals(); 27 | $response = $kernel->handle($request); 28 | $response->send(); 29 | $kernel->terminate($request, $response); 30 | -------------------------------------------------------------------------------- /web/app_dev.php: -------------------------------------------------------------------------------- 1 | loadClassCache(); 27 | $request = Request::createFromGlobals(); 28 | $response = $kernel->handle($request); 29 | $response->send(); 30 | $kernel->terminate($request, $response); 31 | -------------------------------------------------------------------------------- /web/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sabre-io/Baikal2/b5142938b8e5dde693f31ff52e061f2d2810aee2/web/apple-touch-icon.png -------------------------------------------------------------------------------- /web/apps/calclient-month/.bowerrc: -------------------------------------------------------------------------------- 1 | { 2 | "directory": "bower_components", 3 | "analytics": false 4 | } 5 | -------------------------------------------------------------------------------- /web/apps/calclient-month/.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig helps developers define and maintain consistent 2 | # coding styles between different editors and IDEs 3 | # editorconfig.org 4 | 5 | root = true 6 | 7 | 8 | [*] 9 | end_of_line = lf 10 | charset = utf-8 11 | trim_trailing_whitespace = true 12 | insert_final_newline = true 13 | indent_style = space 14 | indent_size = 2 15 | 16 | [*.js] 17 | indent_style = space 18 | indent_size = 2 19 | 20 | [*.hbs] 21 | indent_style = space 22 | indent_size = 2 23 | 24 | [*.css] 25 | indent_style = space 26 | indent_size = 2 27 | 28 | [*.html] 29 | indent_style = space 30 | indent_size = 2 31 | 32 | [*.md] 33 | trim_trailing_whitespace = false 34 | -------------------------------------------------------------------------------- /web/apps/calclient-month/.ember-cli: -------------------------------------------------------------------------------- 1 | { 2 | /** 3 | Ember CLI sends analytics information by default. The data is completely 4 | anonymous, but there are times when you might want to disable this behavior. 5 | 6 | Setting `disableAnalytics` to true will prevent any data from being sent. 7 | */ 8 | "disableAnalytics": false 9 | } 10 | -------------------------------------------------------------------------------- /web/apps/calclient-month/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "predef": { 3 | "document": true, 4 | "window": true, 5 | "-Promise": true 6 | }, 7 | "browser" : true, 8 | "boss" : true, 9 | "curly": true, 10 | "debug": false, 11 | "devel": true, 12 | "eqeqeq": true, 13 | "evil": true, 14 | "forin": false, 15 | "immed": false, 16 | "laxbreak": false, 17 | "newcap": true, 18 | "noarg": true, 19 | "noempty": false, 20 | "nonew": false, 21 | "nomen": false, 22 | "onevar": false, 23 | "plusplus": false, 24 | "regexp": false, 25 | "undef": true, 26 | "sub": true, 27 | "strict": false, 28 | "white": false, 29 | "eqnull": true, 30 | "esnext": true, 31 | "unused": true 32 | } 33 | -------------------------------------------------------------------------------- /web/apps/calclient-month/.travis.yml: -------------------------------------------------------------------------------- 1 | --- 2 | language: node_js 3 | 4 | sudo: false 5 | 6 | cache: 7 | directories: 8 | - node_modules 9 | 10 | install: 11 | - npm install -g bower 12 | - npm install 13 | - bower install 14 | 15 | script: 16 | - npm test 17 | -------------------------------------------------------------------------------- /web/apps/calclient-month/.yo-rc.json: -------------------------------------------------------------------------------- 1 | { 2 | "generator-mocha": {} 3 | } -------------------------------------------------------------------------------- /web/apps/calclient-month/Brocfile.js: -------------------------------------------------------------------------------- 1 | /* global require, module */ 2 | 3 | var EmberApp = require('ember-cli/lib/broccoli/ember-app'); 4 | 5 | var app = new EmberApp(); 6 | 7 | // Use `app.import` to add additional libraries to the generated 8 | // output files. 9 | // 10 | // If you need to use different assets in different 11 | // environments, specify an object as the first parameter. That 12 | // object's keys should be the environment name and the values 13 | // should be the asset to use in that environment. 14 | // 15 | // If the library that you are including contains AMD or ES6 16 | // modules that you would like to import into your application 17 | // please specify an object with the list of modules as keys 18 | // along with the exports of each module as its value. 19 | 20 | module.exports = app.toTree(); 21 | -------------------------------------------------------------------------------- /web/apps/calclient-month/README.md: -------------------------------------------------------------------------------- 1 | # ember-cli-cal-demoapp 2 | 3 | Demo app for [ember-cli-cal](https://github.com/netgusto/ember-cli-cal), the calendar component for ember-cli. 4 | 5 | See for an online demo. 6 | 7 | ![](http://netgusto.com/images/ember-cal.png) 8 | 9 | 10 | ## Installation 11 | 12 | * `git clone` this repository 13 | * `npm install` 14 | * `bower install` 15 | 16 | ## Running 17 | 18 | * `ember server` 19 | * Visit your app at http://localhost:4200. 20 | 21 | ## Building 22 | 23 | * `ember build` 24 | 25 | For more information on using ember-cli, visit [http://www.ember-cli.com/](http://www.ember-cli.com/). 26 | -------------------------------------------------------------------------------- /web/apps/calclient-month/app/app.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import Resolver from 'ember/resolver'; 3 | import loadInitializers from 'ember/load-initializers'; 4 | import config from './config/environment'; 5 | 6 | Ember.MODEL_FACTORY_INJECTIONS = true; 7 | 8 | var App = Ember.Application.extend({ 9 | modulePrefix: config.modulePrefix, 10 | podModulePrefix: config.podModulePrefix, 11 | Resolver: Resolver, 12 | rootElement: config.rootElement, 13 | parameters: config.parameters 14 | }); 15 | 16 | loadInitializers(App, config.modulePrefix); 17 | 18 | export default App; 19 | -------------------------------------------------------------------------------- /web/apps/calclient-month/app/components/event-form.coffee: -------------------------------------------------------------------------------- 1 | `import Ember from 'ember'` 2 | 3 | component = Ember.Component.extend 4 | 5 | event: null 6 | 7 | fromToLabel: (-> 8 | 9 | utcStart = @get('event.start').clone().utc() 10 | utcEnd = @get('event.end').clone().utc() 11 | 12 | startIsMidnight = utcStart.isSame(utcStart.clone().startOf('day')) 13 | endIsMidnight = utcEnd.isSame(utcEnd.toString(), utcEnd.clone().subtract('1', 'second').endOf('day').add('1', 'second').toString()) 14 | 15 | handleTimedRange = (utcStart, utcEnd) -> 16 | 17 | if utcStart.clone().startOf("day").isSame(utcEnd, "day") 18 | return utcStart.format("MMM Do YYYY, HH:mm") + " to " + utcEnd.clone().format("HH:mm") 19 | else 20 | if utcStart.isSame(utcEnd, "month") 21 | return utcStart.format("MMMM Do HH:mm") + " to " + utcEnd.clone().format("MMM Do HH:mm, YYYY") 22 | else 23 | if utcStart.isSame(utcEnd, "year") 24 | return utcStart.format("MMMM Do HH:mm") + " to " + utcEnd.clone().format("MMMM Do HH:mm, YYYY") 25 | else 26 | return utcStart.format("MMMM Do HH:mm, YYYY") + " to " + utcEnd.clone().format("MMMM Do HH:mm, YYYY") 27 | 28 | if startIsMidnight and endIsMidnight 29 | 30 | utcEnd.subtract "1", "second" 31 | 32 | if utcStart.clone().startOf("day").isSame(utcEnd, "day") 33 | return utcStart.format("dddd, MMMM Do YYYY") 34 | else 35 | if utcStart.isSame(utcEnd, "month") 36 | return utcStart.format("MMMM Do") + " to " + utcEnd.clone().format("Do, YYYY") 37 | else 38 | if utcStart.isSame(utcEnd, "year") 39 | return utcStart.format("MMMM Do") + " to " + utcEnd.clone().format("MMMM Do, YYYY") 40 | else 41 | return utcStart.format("MMMM Do, YYYY") + " to " + utcEnd.clone().format("MMMM Do, YYYY") 42 | 43 | return handleTimedRange(utcStart, utcEnd) 44 | 45 | ).property('event.start', 'event.end') 46 | 47 | `export default component` -------------------------------------------------------------------------------- /web/apps/calclient-month/app/controllers/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sabre-io/Baikal2/b5142938b8e5dde693f31ff52e061f2d2810aee2/web/apps/calclient-month/app/controllers/.gitkeep -------------------------------------------------------------------------------- /web/apps/calclient-month/app/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ember-cli-cal - A Better #Calendar #Component for #EmberJS and ember-cli by @netgusto 7 | 8 | 9 | 10 | {{content-for 'head'}} 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /web/apps/calclient-month/app/initializers/config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | name: 'config', 3 | after: 'store', 4 | 5 | initialize: function(container, application) { 6 | 7 | application.register('config:main', { 8 | get: function(name) { 9 | return name ? application.parameters[name] : application.parameters; 10 | } 11 | }, { 12 | instantiate: false, 13 | singleton: true 14 | }); 15 | 16 | container.typeInjection('controller', 'config', 'config:main'); 17 | container.typeInjection('route', 'config', 'config:main'); 18 | container.typeInjection('component', 'config', 'config:main'); 19 | } 20 | }; -------------------------------------------------------------------------------- /web/apps/calclient-month/app/router.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import config from './config/environment'; 3 | 4 | var Router = Ember.Router.extend({ 5 | location: config.locationType 6 | }); 7 | 8 | Router.map(function() { 9 | }); 10 | 11 | export default Router; 12 | -------------------------------------------------------------------------------- /web/apps/calclient-month/app/styles/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sabre-io/Baikal2/b5142938b8e5dde693f31ff52e061f2d2810aee2/web/apps/calclient-month/app/styles/.gitkeep -------------------------------------------------------------------------------- /web/apps/calclient-month/app/styles/app.css: -------------------------------------------------------------------------------- 1 | /* fullscreen layout: remove bootstrap gutters */ 2 | 3 | .calendar-fullscreen .calendarspace > .col-sm-12, 4 | .calendar-fullscreen .calendarspace > .col-sm-9, 5 | .calendar-fullscreen .calendarspace > .col-sm-3 { 6 | padding: 0; 7 | } 8 | 9 | .calendar-fullscreen .calendarspace > .calendarevent { 10 | padding-left: 15px; 11 | } 12 | 13 | .calendar-regular .cal-header:after { 14 | border-bottom: none; 15 | } 16 | 17 | .fullscreenlink a { 18 | color: #3F3F3F; 19 | } -------------------------------------------------------------------------------- /web/apps/calclient-month/app/templates/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sabre-io/Baikal2/b5142938b8e5dde693f31ff52e061f2d2810aee2/web/apps/calclient-month/app/templates/.gitkeep -------------------------------------------------------------------------------- /web/apps/calclient-month/app/templates/application.hbs: -------------------------------------------------------------------------------- 1 | {{outlet}} -------------------------------------------------------------------------------- /web/apps/calclient-month/app/templates/components/event-form.hbs: -------------------------------------------------------------------------------- 1 |

{{event.label}}

2 | 3 |

{{fromToLabel}}

4 | 5 | {{!-- 6 | {{#if event.payload.recurrence_freq}} 7 |

Recurrence: {{event.payload.recurrence_freq}}

8 | {{/if}} 9 | --}} -------------------------------------------------------------------------------- /web/apps/calclient-month/app/templates/index.hbs: -------------------------------------------------------------------------------- 1 | {{{calendarStyleTag}}} 2 |
3 | 4 | 12 | 13 |
14 |
15 | {{ember-cal 16 | component=calendar 17 | events=calendarevents 18 | color=eventcolor 19 | textcolor=textcolor 20 | viewChanged='viewChanged' 21 | eventSelected='eventSelected' 22 | eventUnselected='eventUnselected'}} 23 |
24 | 25 | {{#if selectedEvent}} 26 |
27 | {{event-form 28 | event=selectedEvent}} 29 | 30 |
31 |
32 | {{/if}} 33 |
34 |
-------------------------------------------------------------------------------- /web/apps/calclient-month/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ember-cli-cal-demoapp", 3 | "version": "0.1.3", 4 | "dependencies": { 5 | "handlebars": "~1.3.0", 6 | "jquery": "^1.11.1", 7 | "ember": "1.7.0", 8 | "ember-data": "1.0.0-beta.10", 9 | "ember-resolver": "~0.1.7", 10 | "loader.js": "stefanpenner/loader.js#1.0.1", 11 | "ember-cli-shims": "stefanpenner/ember-cli-shims#0.0.3", 12 | "ember-cli-test-loader": "rwjblue/ember-cli-test-loader#0.0.4", 13 | "ember-load-initializers": "stefanpenner/ember-load-initializers#0.0.2", 14 | "ember-qunit": "0.1.8", 15 | "ember-qunit-notifications": "0.0.4", 16 | "qunit": "~1.15.0", 17 | "momentjs": "~2.8.3", 18 | "lodash": "~2.4.1" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /web/apps/calclient-month/config/environment.js: -------------------------------------------------------------------------------- 1 | /* jshint node: true */ 2 | 3 | module.exports = function(environment) { 4 | var ENV = { 5 | modulePrefix: 'ember-cli-cal-demoapp', 6 | environment: environment, 7 | baseURL: '/', 8 | locationType: 'hash', 9 | parameters: [], 10 | EmberENV: { 11 | FEATURES: { 12 | // Here you can enable experimental features on an ember canary build 13 | // e.g. 'with-controller': true 14 | } 15 | }, 16 | 17 | APP: { 18 | // Here you can pass flags/options to your application instance 19 | // when it is created 20 | } 21 | }; 22 | 23 | if (environment === 'development') { 24 | // ENV.APP.LOG_RESOLVER = true; 25 | ENV.APP.LOG_ACTIVE_GENERATION = true; 26 | // ENV.APP.LOG_TRANSITIONS = true; 27 | // ENV.APP.LOG_TRANSITIONS_INTERNAL = true; 28 | ENV.APP.LOG_VIEW_LOOKUPS = true; 29 | } 30 | 31 | if (environment === 'test') { 32 | // Testem prefers this... 33 | ENV.baseURL = '/'; 34 | ENV.locationType = 'auto'; 35 | 36 | // keep test console output quieter 37 | ENV.APP.LOG_ACTIVE_GENERATION = false; 38 | ENV.APP.LOG_VIEW_LOOKUPS = false; 39 | 40 | ENV.APP.rootElement = '#ember-testing'; 41 | } 42 | 43 | if (environment === 'production') { 44 | 45 | } 46 | 47 | return ENV; 48 | }; 49 | -------------------------------------------------------------------------------- /web/apps/calclient-month/dist/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sabre-io/Baikal2/b5142938b8e5dde693f31ff52e061f2d2810aee2/web/apps/calclient-month/dist/.gitkeep -------------------------------------------------------------------------------- /web/apps/calclient-month/dist/assets/ember-cli-cal-demoapp.css: -------------------------------------------------------------------------------- 1 | /* fullscreen layout: remove bootstrap gutters */ 2 | 3 | .calendar-fullscreen .calendarspace > .col-sm-12, 4 | .calendar-fullscreen .calendarspace > .col-sm-9, 5 | .calendar-fullscreen .calendarspace > .col-sm-3 { 6 | padding: 0; 7 | } 8 | 9 | .calendar-fullscreen .calendarspace > .calendarevent { 10 | padding-left: 15px; 11 | } 12 | 13 | .calendar-regular .cal-header:after { 14 | border-bottom: none; 15 | } 16 | 17 | .fullscreenlink a { 18 | color: #3F3F3F; 19 | } -------------------------------------------------------------------------------- /web/apps/calclient-month/dist/assets/failed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sabre-io/Baikal2/b5142938b8e5dde693f31ff52e061f2d2810aee2/web/apps/calclient-month/dist/assets/failed.png -------------------------------------------------------------------------------- /web/apps/calclient-month/dist/assets/passed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sabre-io/Baikal2/b5142938b8e5dde693f31ff52e061f2d2810aee2/web/apps/calclient-month/dist/assets/passed.png -------------------------------------------------------------------------------- /web/apps/calclient-month/dist/assets/test-loader.js: -------------------------------------------------------------------------------- 1 | /* globals requirejs, require */ 2 | 3 | var moduleName, shouldLoad; 4 | 5 | QUnit.config.urlConfig.push({ id: 'nojshint', label: 'Disable JSHint'}); 6 | 7 | // TODO: load based on params 8 | for (moduleName in requirejs.entries) { 9 | shouldLoad = false; 10 | 11 | if (moduleName.match(/[-_]test$/)) { shouldLoad = true; } 12 | if (!QUnit.urlParams.nojshint && moduleName.match(/\.jshint$/)) { shouldLoad = true; } 13 | 14 | if (shouldLoad) { require(moduleName); } 15 | } 16 | 17 | if (QUnit.notifications) { 18 | QUnit.notifications({ 19 | icons: { 20 | passed: '/assets/passed.png', 21 | failed: '/assets/failed.png' 22 | } 23 | }); 24 | } 25 | -------------------------------------------------------------------------------- /web/apps/calclient-month/dist/crossdomain.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 15 | 16 | -------------------------------------------------------------------------------- /web/apps/calclient-month/dist/robots.txt: -------------------------------------------------------------------------------- 1 | # robotstxt.org/ 2 | 3 | User-agent: * 4 | -------------------------------------------------------------------------------- /web/apps/calclient-month/dist/testem.js: -------------------------------------------------------------------------------- 1 | /** 2 | * This is dummy file that exists for the sole purpose 3 | * of allowing tests to run directly in the browser as 4 | * well as by Testem. 5 | * 6 | * Testem is configured to run tests directly against 7 | * the test build of index.html, which requires a 8 | * snippet to load the testem.js file: 9 | * 10 | * This has to go after the qunit framework and app 11 | * tests are loaded. 12 | * 13 | * Testem internally supplies this file. However, if you 14 | * run the tests directly in the browser (localhost:8000/tests), 15 | * this file does not exist. 16 | * 17 | * Hence the purpose of this fake file. This file is served 18 | * directly from the express server to satisify the script load. 19 | */ 20 | -------------------------------------------------------------------------------- /web/apps/calclient-month/dist/tests/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | EmberCalConsume Tests 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 33 | 34 | 35 |
36 |
37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /web/apps/calclient-month/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ember-cli-cal-demoapp", 3 | "version": "0.1.3", 4 | "directories": { 5 | "doc": "doc", 6 | "test": "tests" 7 | }, 8 | "scripts": { 9 | "start": "ember server", 10 | "build": "ember build", 11 | "test": "ember test" 12 | }, 13 | "repository": "https://github.com/netgusto/ember-cli-cal-demoapp", 14 | "engines": { 15 | "node": ">= 0.10.0" 16 | }, 17 | "author": "Net Gusto / Jérôme Schneider", 18 | "license": "MIT", 19 | "devDependencies": { 20 | "body-parser": "^1.2.0", 21 | "broccoli-asset-rev": "0.3.0", 22 | "broccoli-ember-hbs-template-compiler": "^1.6.1", 23 | "ember-cli": "0.1.1", 24 | "ember-cli-content-security-policy": "0.2.0", 25 | "ember-cli-ic-ajax": "0.1.1", 26 | "ember-cli-inject-live-reload": "^1.2.2", 27 | "ember-cli-qunit": "0.1.0", 28 | "ember-data": "1.0.0-beta.10", 29 | "express": "^4.8.5", 30 | "glob": "^4.0.5", 31 | "ember-cli-cal": "0.1.5", 32 | "ember-cli-coffeescript": "^0.2.0" 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /web/apps/calclient-month/public/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sabre-io/Baikal2/b5142938b8e5dde693f31ff52e061f2d2810aee2/web/apps/calclient-month/public/.gitkeep -------------------------------------------------------------------------------- /web/apps/calclient-month/public/crossdomain.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 15 | 16 | -------------------------------------------------------------------------------- /web/apps/calclient-month/public/robots.txt: -------------------------------------------------------------------------------- 1 | # robotstxt.org/ 2 | 3 | User-agent: * 4 | -------------------------------------------------------------------------------- /web/apps/calclient-month/testem.json: -------------------------------------------------------------------------------- 1 | { 2 | "framework": "qunit", 3 | "test_page": "tests/index.html", 4 | "launch_in_ci": [ 5 | "PhantomJS" 6 | ], 7 | "launch_in_dev": [ 8 | "PhantomJS", 9 | "Chrome" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /web/apps/calclient-month/tests/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "predef": [ 3 | "document", 4 | "window", 5 | "location", 6 | "setTimeout", 7 | "$", 8 | "-Promise", 9 | "QUnit", 10 | "define", 11 | "console", 12 | "equal", 13 | "notEqual", 14 | "notStrictEqual", 15 | "test", 16 | "asyncTest", 17 | "testBoth", 18 | "testWithDefault", 19 | "raises", 20 | "throws", 21 | "deepEqual", 22 | "start", 23 | "stop", 24 | "ok", 25 | "strictEqual", 26 | "module", 27 | "moduleFor", 28 | "moduleForComponent", 29 | "moduleForModel", 30 | "process", 31 | "expect", 32 | "visit", 33 | "exists", 34 | "fillIn", 35 | "click", 36 | "keyEvent", 37 | "triggerEvent", 38 | "find", 39 | "findWithAssert", 40 | "wait", 41 | "DS", 42 | "isolatedContainer", 43 | "startApp", 44 | "andThen", 45 | "currentURL", 46 | "currentPath", 47 | "currentRouteName" 48 | ], 49 | "node": false, 50 | "browser": false, 51 | "boss": true, 52 | "curly": false, 53 | "debug": false, 54 | "devel": false, 55 | "eqeqeq": true, 56 | "evil": true, 57 | "forin": false, 58 | "immed": false, 59 | "laxbreak": false, 60 | "newcap": true, 61 | "noarg": true, 62 | "noempty": false, 63 | "nonew": false, 64 | "nomen": false, 65 | "onevar": false, 66 | "plusplus": false, 67 | "regexp": false, 68 | "undef": true, 69 | "sub": true, 70 | "strict": false, 71 | "white": false, 72 | "eqnull": true, 73 | "esnext": true 74 | } 75 | -------------------------------------------------------------------------------- /web/apps/calclient-month/tests/helpers/resolver.js: -------------------------------------------------------------------------------- 1 | import Resolver from 'ember/resolver'; 2 | import config from '../../config/environment'; 3 | 4 | var resolver = Resolver.create(); 5 | 6 | resolver.namespace = { 7 | modulePrefix: config.modulePrefix, 8 | podModulePrefix: config.podModulePrefix 9 | }; 10 | 11 | export default resolver; 12 | -------------------------------------------------------------------------------- /web/apps/calclient-month/tests/helpers/start-app.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import Application from '../../app'; 3 | import Router from '../../router'; 4 | import config from '../../config/environment'; 5 | 6 | export default function startApp(attrs) { 7 | var App; 8 | 9 | var attributes = Ember.merge({}, config.APP); 10 | attributes = Ember.merge(attributes, attrs); // use defaults, but you can override; 11 | 12 | Router.reopen({ 13 | location: 'none' 14 | }); 15 | 16 | Ember.run(function() { 17 | App = Application.create(attributes); 18 | App.setupForTesting(); 19 | App.injectTestHelpers(); 20 | }); 21 | 22 | App.reset(); // this shouldn't be needed, i want to be able to "start an app at a specific URL" 23 | 24 | return App; 25 | } 26 | -------------------------------------------------------------------------------- /web/apps/calclient-month/tests/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | EmberCalConsume Tests 7 | 8 | 9 | 10 | {{content-for 'head'}} 11 | 12 | 13 | 14 | 15 | 31 | 32 | 33 |
34 |
35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /web/apps/calclient-month/tests/test-helper.js: -------------------------------------------------------------------------------- 1 | import resolver from './helpers/resolver'; 2 | import { 3 | setResolver 4 | } from 'ember-qunit'; 5 | 6 | setResolver(resolver); 7 | 8 | document.write('
'); 9 | 10 | QUnit.config.urlConfig.push({ id: 'nocontainer', label: 'Hide container'}); 11 | var containerVisibility = QUnit.urlParams.nocontainer ? 'hidden' : 'visible'; 12 | document.getElementById('ember-testing-container').style.visibility = containerVisibility; 13 | -------------------------------------------------------------------------------- /web/apps/calclient-month/tests/unit/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sabre-io/Baikal2/b5142938b8e5dde693f31ff52e061f2d2810aee2/web/apps/calclient-month/tests/unit/.gitkeep -------------------------------------------------------------------------------- /web/apps/calclient-month/tests/unit/controllers/index-test.js: -------------------------------------------------------------------------------- 1 | import { 2 | moduleFor, 3 | test 4 | } from 'ember-qunit'; 5 | 6 | moduleFor('controller:index', 'IndexController', { 7 | // Specify the other units that are required for this test. 8 | // needs: ['controller:foo'] 9 | }); 10 | 11 | // Replace this with your real tests. 12 | test('it exists', function() { 13 | var controller = this.subject(); 14 | ok(controller); 15 | }); 16 | -------------------------------------------------------------------------------- /web/apps/calclient-month/vendor/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sabre-io/Baikal2/b5142938b8e5dde693f31ff52e061f2d2810aee2/web/apps/calclient-month/vendor/.gitkeep -------------------------------------------------------------------------------- /web/assets/dist/buddies.min.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sabre-io/Baikal2/b5142938b8e5dde693f31ff52e061f2d2810aee2/web/assets/dist/buddies.min.js.gz -------------------------------------------------------------------------------- /web/assets/dist/bundled.min.css.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sabre-io/Baikal2/b5142938b8e5dde693f31ff52e061f2d2810aee2/web/assets/dist/bundled.min.css.gz -------------------------------------------------------------------------------- /web/assets/dist/bundled.min.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sabre-io/Baikal2/b5142938b8e5dde693f31ff52e061f2d2810aee2/web/assets/dist/bundled.min.js.gz -------------------------------------------------------------------------------- /web/assets/dist/pulpy.min.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sabre-io/Baikal2/b5142938b8e5dde693f31ff52e061f2d2810aee2/web/assets/dist/pulpy.min.js.gz -------------------------------------------------------------------------------- /web/assets/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sabre-io/Baikal2/b5142938b8e5dde693f31ff52e061f2d2810aee2/web/assets/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /web/assets/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sabre-io/Baikal2/b5142938b8e5dde693f31ff52e061f2d2810aee2/web/assets/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /web/assets/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sabre-io/Baikal2/b5142938b8e5dde693f31ff52e061f2d2810aee2/web/assets/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /web/assets/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sabre-io/Baikal2/b5142938b8e5dde693f31ff52e061f2d2810aee2/web/assets/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /web/assets/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sabre-io/Baikal2/b5142938b8e5dde693f31ff52e061f2d2810aee2/web/assets/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /web/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sabre-io/Baikal2/b5142938b8e5dde693f31ff52e061f2d2810aee2/web/favicon.ico -------------------------------------------------------------------------------- /web/robots.txt: -------------------------------------------------------------------------------- 1 | # www.robotstxt.org/ 2 | # www.google.com/support/webmasters/bin/answer.py?hl=en&answer=156449 3 | 4 | User-agent: * 5 | Disallow: / 6 | --------------------------------------------------------------------------------