├── .buildpath ├── .gitignore ├── .htaccess_dist ├── .project ├── .settings └── org.eclipse.php.core.prefs ├── .travis.yml ├── LICENSE ├── README.md ├── UPGRADE-2.2.md ├── UPGRADE.md ├── app ├── .htaccess ├── AppCache.php ├── AppKernel.php ├── Resources │ ├── FOSOAuthServerBundle │ │ └── views │ │ │ └── Authorize │ │ │ ├── authorize.html.twig │ │ │ └── authorize_content.html.twig │ ├── FOSUserBundle │ │ └── views │ │ │ └── layout.html.twig │ └── views │ │ └── base.html.twig ├── SymfonyRequirements.php ├── autoload.php ├── check.php ├── config │ ├── .buildpath │ ├── .project │ ├── .settings │ │ └── org.eclipse.php.core.prefs │ ├── config.yml │ ├── config_dev.yml │ ├── config_prod.yml │ ├── config_test.yml │ ├── parameters.yml.dist │ ├── routing.yml │ ├── routing_dev.yml │ └── security.yml ├── console └── phpunit.xml.dist ├── composer.json ├── composer.lock ├── netrunnerdb-2013-10-16.sql.gz ├── netrunnerdb-2014-06-07.sql.gz ├── netrunnerdb_cards_2014-08-27.sql.gz ├── src ├── .buildpath ├── .htaccess ├── .project ├── .settings │ └── org.eclipse.php.core.prefs └── Netrunnerdb │ ├── .project │ ├── .settings │ └── org.eclipse.core.resources.prefs │ ├── BuilderBundle │ ├── .project │ ├── Command │ │ └── HighlightCommand.php │ ├── Controller │ │ ├── ApiController.php │ │ ├── BuilderController.php │ │ ├── SocialController.php │ │ ├── TagController.php │ │ └── ToolsController.php │ ├── DependencyInjection │ │ ├── Configuration.php │ │ └── NetrunnerdbBuilderExtension.php │ ├── Entity │ │ ├── Comment.php │ │ ├── CommentRepository.php │ │ ├── Deck.php │ │ ├── DeckRepository.php │ │ ├── Decklist.php │ │ ├── DecklistRepository.php │ │ ├── Decklistslot.php │ │ ├── DecklistslotRepository.php │ │ ├── Deckslot.php │ │ ├── DeckslotRepository.php │ │ └── Highlight.php │ ├── NetrunnerdbBuilderBundle.php │ ├── Resources │ │ ├── config │ │ │ ├── doctrine │ │ │ │ ├── Comment.orm.yml │ │ │ │ ├── Deck.orm.yml │ │ │ │ ├── Decklist.orm.yml │ │ │ │ ├── Decklistslot.orm.yml │ │ │ │ ├── Deckslot.orm.yml │ │ │ │ └── Highlight.orm.yml │ │ │ ├── routing.yml │ │ │ └── services.yml │ │ ├── doc │ │ │ └── index.rst │ │ ├── public │ │ │ ├── css │ │ │ │ ├── icons.css │ │ │ │ └── style.css │ │ │ ├── fonts │ │ │ │ ├── exo-light-webfont.eot │ │ │ │ ├── exo-light-webfont.svg │ │ │ │ ├── exo-light-webfont.ttf │ │ │ │ ├── exo-light-webfont.woff │ │ │ │ ├── exo-medium-webfont.eot │ │ │ │ ├── exo-medium-webfont.svg │ │ │ │ ├── exo-medium-webfont.ttf │ │ │ │ ├── exo-medium-webfont.woff │ │ │ │ ├── exo-regular-webfont.eot │ │ │ │ ├── exo-regular-webfont.svg │ │ │ │ ├── exo-regular-webfont.ttf │ │ │ │ ├── exo-regular-webfont.woff │ │ │ │ ├── exo-semibold-webfont.eot │ │ │ │ ├── exo-semibold-webfont.svg │ │ │ │ ├── exo-semibold-webfont.ttf │ │ │ │ ├── exo-semibold-webfont.woff │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ │ ├── netrunner.eot │ │ │ │ ├── netrunner.svg │ │ │ │ ├── netrunner.ttf │ │ │ │ ├── netrunner.woff │ │ │ │ ├── nrdb.eot │ │ │ │ ├── nrdb.svg │ │ │ │ ├── nrdb.ttf │ │ │ │ └── nrdb.woff │ │ │ ├── images │ │ │ │ ├── apple-touch-icon.png │ │ │ │ ├── factions │ │ │ │ │ ├── 16px │ │ │ │ │ │ ├── anarch.png │ │ │ │ │ │ ├── criminal.png │ │ │ │ │ │ ├── haas-bioroid.png │ │ │ │ │ │ ├── jinteki.png │ │ │ │ │ │ ├── nbn.png │ │ │ │ │ │ ├── neutral.png │ │ │ │ │ │ ├── shaper.png │ │ │ │ │ │ └── weyland-consortium.png │ │ │ │ │ └── 38px │ │ │ │ │ │ ├── anarch.png │ │ │ │ │ │ ├── criminal.png │ │ │ │ │ │ ├── haas-bioroid.png │ │ │ │ │ │ ├── jinteki.png │ │ │ │ │ │ ├── nbn.png │ │ │ │ │ │ ├── neutral.png │ │ │ │ │ │ ├── shaper.png │ │ │ │ │ │ └── weyland-consortium.png │ │ │ │ ├── favicon.png │ │ │ │ ├── flags.png │ │ │ │ ├── icon.png │ │ │ │ ├── search.jpg │ │ │ │ └── types │ │ │ │ │ ├── Agenda.png │ │ │ │ │ ├── Asset.png │ │ │ │ │ ├── Event.png │ │ │ │ │ ├── ICE.png │ │ │ │ │ ├── Identity.png │ │ │ │ │ ├── Operation.png │ │ │ │ │ ├── Program.png │ │ │ │ │ ├── Upgrade.png │ │ │ │ │ ├── agenda.png │ │ │ │ │ ├── asset.png │ │ │ │ │ ├── event.png │ │ │ │ │ ├── hardware.png │ │ │ │ │ ├── ice.png │ │ │ │ │ ├── identity.png │ │ │ │ │ ├── operation.png │ │ │ │ │ ├── program.png │ │ │ │ │ ├── resource.png │ │ │ │ │ └── upgrade.png │ │ │ ├── js │ │ │ │ ├── deck.js │ │ │ │ ├── decklist.js │ │ │ │ ├── decks.js │ │ │ │ ├── deckview.js │ │ │ │ ├── directimport.js │ │ │ │ ├── index.js │ │ │ │ ├── jquery.textcomplete.min.js │ │ │ │ ├── nrdb.card_modal.js │ │ │ │ ├── nrdb.data.js │ │ │ │ ├── nrdb.deck_browser.js │ │ │ │ ├── nrdb.deck_gallery.js │ │ │ │ ├── nrdb.draw_simulator.js │ │ │ │ ├── nrdb.format.js │ │ │ │ ├── nrdb.fuzzy_search.js │ │ │ │ ├── nrdb.js │ │ │ │ ├── nrdb.smart_filter.js │ │ │ │ ├── nrdb.tip.js │ │ │ │ ├── nrdb.user.js │ │ │ │ ├── search.js │ │ │ │ ├── string_score.min.js │ │ │ │ └── taffy.js │ │ │ └── libs │ │ │ │ ├── jquery │ │ │ │ └── 2.1.0 │ │ │ │ │ └── jquery.min.js │ │ │ │ └── qtip2 │ │ │ │ └── 2.1.1 │ │ │ │ ├── jquery.qtip.css │ │ │ │ └── jquery.qtip.js │ │ ├── translations │ │ │ └── messages.fr.xlf │ │ └── views │ │ │ ├── Builder │ │ │ ├── deck.html.twig │ │ │ ├── decks.html.twig │ │ │ ├── deckview.html.twig │ │ │ ├── directimport.html.twig │ │ │ └── initbuild.html.twig │ │ │ ├── Decklist │ │ │ ├── decklist.html.twig │ │ │ └── decklists.html.twig │ │ │ ├── Default │ │ │ ├── allcomments.html.twig │ │ │ ├── donators.html.twig │ │ │ ├── index.html.twig │ │ │ ├── profile.html.twig │ │ │ └── usercomments.html.twig │ │ │ ├── Emails │ │ │ ├── newcomment_author.html.twig │ │ │ ├── newcomment_commenter.html.twig │ │ │ └── newcomment_mentionned.html.twig │ │ │ ├── Search │ │ │ └── form.html.twig │ │ │ ├── Tools │ │ │ └── demo.html.twig │ │ │ ├── layout.html.twig │ │ │ └── octgn.xml.twig │ ├── Services │ │ ├── Decks.php │ │ └── Judge.php │ └── Tests │ │ └── Controller │ │ └── DefaultControllerTest.php │ ├── CardsBundle │ ├── .buildpath │ ├── .project │ ├── .settings │ │ ├── org.eclipse.core.resources.prefs │ │ └── org.eclipse.php.core.prefs │ ├── Controller │ │ ├── ApiController.php │ │ ├── CardController.php │ │ ├── CycleController.php │ │ ├── DefaultController.php │ │ ├── ExcelController.php │ │ ├── PackController.php │ │ ├── SearchController.php │ │ └── TypeController.php │ ├── DQL │ │ ├── BinaryFunction.php │ │ └── ReplaceFunction.php │ ├── DependencyInjection │ │ ├── Configuration.php │ │ └── NetrunnerdbCardsExtension.php │ ├── Entity │ │ ├── Card.php │ │ ├── Cycle.php │ │ ├── Faction.php │ │ ├── Pack.php │ │ ├── Side.php │ │ └── Type.php │ ├── Form │ │ ├── CardType.php │ │ ├── CycleType.php │ │ ├── PackType.php │ │ └── TypeType.php │ ├── NetrunnerdbCardsBundle.php │ ├── Resources │ │ ├── config │ │ │ ├── doctrine │ │ │ │ ├── Card.orm.yml │ │ │ │ ├── Cycle.orm.yml │ │ │ │ ├── Faction.orm.yml │ │ │ │ ├── Pack.orm.yml │ │ │ │ ├── Side.orm.yml │ │ │ │ └── Type.orm.yml │ │ │ ├── routing.yml │ │ │ ├── routing │ │ │ │ ├── card.yml │ │ │ │ ├── cards.yml │ │ │ │ ├── cycle.yml │ │ │ │ ├── pack.yml │ │ │ │ ├── rulings.yml │ │ │ │ ├── rxc.yml │ │ │ │ └── type.yml │ │ │ └── services.yml │ │ ├── doc │ │ │ └── index.rst │ │ ├── public │ │ │ ├── images │ │ │ │ ├── contact.png │ │ │ │ └── factions │ │ │ │ │ ├── 16px │ │ │ │ │ ├── Anarch.png │ │ │ │ │ ├── Criminal.png │ │ │ │ │ ├── Haas-Bioroid.png │ │ │ │ │ ├── Jinteki.png │ │ │ │ │ ├── NBN.png │ │ │ │ │ ├── Shaper.png │ │ │ │ │ └── Weyland Consortium.png │ │ │ │ │ ├── 64px-alpha │ │ │ │ │ ├── anarch.png │ │ │ │ │ ├── criminal.png │ │ │ │ │ ├── haas-bioroid.png │ │ │ │ │ ├── jinteki.png │ │ │ │ │ ├── nbn.png │ │ │ │ │ ├── shaper.png │ │ │ │ │ └── weyland-consortium.png │ │ │ │ │ └── 64px │ │ │ │ │ ├── Anarch.png │ │ │ │ │ ├── Criminal.png │ │ │ │ │ ├── Haas-Bioroid.png │ │ │ │ │ ├── Jinteki.png │ │ │ │ │ ├── NBN.png │ │ │ │ │ ├── Shaper.png │ │ │ │ │ └── Weyland Consortium.png │ │ │ └── js │ │ │ │ └── save-settings.js │ │ ├── translations │ │ │ ├── messages.de.yml │ │ │ ├── messages.de.yml~ │ │ │ ├── messages.es.yml │ │ │ ├── messages.es.yml~ │ │ │ ├── messages.fr.yml │ │ │ ├── messages.fr.yml~ │ │ │ └── messages.pl.yml │ │ └── views │ │ │ ├── Card │ │ │ ├── edit.html.twig │ │ │ ├── index.html.twig │ │ │ ├── new.html.twig │ │ │ └── show.html.twig │ │ │ ├── Cycle │ │ │ ├── edit.html.twig │ │ │ ├── index.html.twig │ │ │ ├── new.html.twig │ │ │ └── show.html.twig │ │ │ ├── Default │ │ │ ├── about.html.twig │ │ │ ├── allsets.html.twig │ │ │ ├── apidoc.html.twig │ │ │ ├── langs.html.twig │ │ │ ├── menu.html.twig │ │ │ ├── rules.html.twig │ │ │ ├── rulings.html.twig │ │ │ ├── searchoptions.html.twig │ │ │ └── sitemap.html.twig │ │ │ ├── Excel │ │ │ ├── confirm.html.twig │ │ │ └── form.html.twig │ │ │ ├── Pack │ │ │ ├── edit.html.twig │ │ │ ├── index.html.twig │ │ │ ├── new.html.twig │ │ │ └── show.html.twig │ │ │ ├── Search │ │ │ ├── cardlayouts.html.twig │ │ │ ├── display-card.html.twig │ │ │ ├── display-list.html.twig │ │ │ ├── display-scan.html.twig │ │ │ ├── display-short.html.twig │ │ │ ├── display-spoiler.html.twig │ │ │ ├── display.html.twig │ │ │ ├── pagination.html.twig │ │ │ ├── paginationitem.html.twig │ │ │ ├── searchbar.html.twig │ │ │ ├── searchform.html.twig │ │ │ └── setnavigation.html.twig │ │ │ ├── Type │ │ │ ├── edit.html.twig │ │ │ ├── index.html.twig │ │ │ ├── new.html.twig │ │ │ └── show.html.twig │ │ │ ├── apiset.xml.twig │ │ │ └── main.html.twig │ ├── Services │ │ └── CardsData.php │ └── Tests │ │ └── Controller │ │ ├── CardControllerTest.php │ │ ├── CardsControllerTest.php │ │ ├── CycleControllerTest.php │ │ ├── DefaultControllerTest.php │ │ ├── PackControllerTest.php │ │ ├── RulingsControllerTest.php │ │ ├── RxcControllerTest.php │ │ └── TypeControllerTest.php │ └── UserBundle │ ├── Command │ ├── CreateClientCommand.php │ └── DeleteInactiveCommand.php │ ├── Controller │ ├── DefaultController.php │ ├── RegistrationController.php │ └── SecurityController.php │ ├── DependencyInjection │ ├── Configuration.php │ └── NetrunnerdbUserExtension.php │ ├── Entity │ ├── AccessToken.php │ ├── AuthCode.php │ ├── Client.php │ ├── RefreshToken.php │ ├── User.php │ └── UserRepository.php │ ├── NetrunnerdbUserBundle.php │ ├── Provider │ └── UserProvider.php │ ├── Resources │ ├── config │ │ ├── doctrine │ │ │ ├── AccessToken.orm.yml │ │ │ ├── AuthCode.orm.yml │ │ │ ├── Client.orm.yml │ │ │ ├── RefreshToken.orm.yml │ │ │ └── User.orm.yml │ │ ├── routing.yml │ │ └── services.yml │ ├── doc │ │ └── index.rst │ ├── translations │ │ └── messages.fr.xlf │ └── views │ │ ├── Default │ │ └── profile.html.twig │ │ └── Security │ │ └── login.html.twig │ └── Tests │ └── Controller │ └── DefaultControllerTest.php └── web ├── app.php ├── app_dev.php ├── config.php └── robots.txt /.buildpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | web/bundles/ 2 | app/bootstrap.php.cache 3 | app/cache/* 4 | app/config/parameters.yml 5 | app/logs/* 6 | build/ 7 | vendor/ 8 | bin/ 9 | composer.phar 10 | src/Netrunnerdb/CardsBundle/Resources/public/images/cards 11 | .settings/ 12 | .buildpath 13 | .project 14 | .DS_Store 15 | .htaccess -------------------------------------------------------------------------------- /.htaccess_dist: -------------------------------------------------------------------------------- 1 | DirectoryIndex app.php 2 | 3 | RewriteEngine On 4 | 5 | RewriteCond %{ENV:REDIRECT_STATUS} ^$ 6 | RewriteRule ^app\.php(/(.*)|$) %{CONTEXT_PREFIX}/$2 [R=301,L] 7 | 8 | 9 | RewriteCond %{REQUEST_FILENAME} -f 10 | RewriteRule .? - [L] 11 | 12 | #RewriteRule assets/(.+) /src/Alsciende/NetrunnerBundle/Resources/public/$1 [L] 13 | RewriteRule assets/(.+) /web/bundles/netrunnerdbcards/$1 [L] 14 | 15 | 16 | RewriteRule ^(.*)$ /web/app_dev.php [QSA,L] 17 | 18 | ExpiresActive On 19 | ExpiresByType image/png "access plus 1 month" 20 | ExpiresByType text/css "access plus 1 month" 21 | ExpiresByType text/javascript "access plus 1 month" 22 | ExpiresByType application/javascript "access plus 1 month" 23 | ExpiresByType application/json "access plus 1 month" 24 | ExpiresByType application/x-font-woff "access plus 1 month" 25 | ExpiresByType application/vnd.ms-fontobject "access plus 1 month" 26 | ExpiresByType application/x-font-ttf "access plus 1 month" 27 | ExpiresByType image/svg+xml "access plus 1 month" 28 | 29 | 30 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | NRDB 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.wst.common.project.facet.core.builder 10 | 11 | 12 | 13 | 14 | org.eclipse.wst.validation.validationbuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.dltk.core.scriptbuilder 20 | 21 | 22 | 23 | 24 | 25 | org.eclipse.php.core.PHPNature 26 | org.eclipse.wst.common.project.facet.core.nature 27 | 28 | 29 | -------------------------------------------------------------------------------- /.settings/org.eclipse.php.core.prefs: -------------------------------------------------------------------------------- 1 | #Wed Aug 21 14:55:43 CEST 2013 2 | eclipse.preferences.version=1 3 | include_path=0;/NRDB 4 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: php 2 | 3 | php: 4 | - 5.3.3 5 | - 5.3 6 | - 5.4 7 | 8 | before_script: composer install -n 9 | 10 | script: phpunit -c app 11 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2004-2013 Fabien Potencier 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is furnished 8 | to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Quick notes for installation 2 | 3 | - Create a database in MySQL, in utf8_general_ci 4 | - Create a directory on your hard drive, we'll assume it's at $SYMFONY 5 | - Go in it `cd $SYMFONY` 6 | - Fork the repo and clone it in $SYMFONY: `git clone https://github.com/yourname/netrunnerdb` 7 | - This creates a directory named netrunnerdb in $SYMFONY. Let's say DOCROOT=$SYMFONY/netrunnerdb. 8 | - Go into it. 9 | - Install Composer: `curl -s http://getcomposer.org/installer | php` 10 | - Install the vendor libs: `php composer.phar install` ; at the end of the install, you'll be asked for your database information 11 | - Configure your local webserver with a DocumentRoot pointing to $DOCROOT (vhost probably) 12 | - Create the tables: `php app/console doctrine:schema:update --force` 13 | - If the above command fails, edit app/config/parameters.yml and try again 14 | - Import the data from the latest `netrunnerdb-*.sql.gz` into MySQL 15 | - Point your browser to `/web/app_dev.php` 16 | 17 | # Quick notes for update 18 | 19 | When you update your repository, run the following commands: 20 | 21 | - `php composer.phar self-update` 22 | - `php composer.phar update` 23 | - `php app/console doctrine:schema:update --force` 24 | - `php app/console cache:clear --env=dev` 25 | 26 | ## Deck of the Week 27 | 28 | To update the deck of the week on the front page: 29 | 30 | - `php app/console highlight` 31 | 32 | ## Add cards 33 | 34 | - login as ROLE_ADMIN (edit your user) or edit `app/config/security.yml` 35 | - go to `/admin/card`, `/admin/pack`, `/admin/cycle`, etc. 36 | 37 | # Misc Notes 38 | 39 | - your php module must be configured with `mbstring.internal_encoding = UTF-8` 40 | -------------------------------------------------------------------------------- /UPGRADE-2.2.md: -------------------------------------------------------------------------------- 1 | UPGRADE FROM 2.1 to 2.2 2 | ======================= 3 | 4 | * The [`web/.htaccess`](https://github.com/symfony/symfony-standard/blob/2.2/web/.htaccess) 5 | file has been enhanced substantially to prevent duplicate content with and 6 | without `/app.php` in the URI. It also improves functionality when using 7 | Apache aliases or when mod_rewrite is not available. So you might want to 8 | update your `.htaccess` file as well. 9 | 10 | * The ``_internal`` route is not used any more. It should then be removed 11 | from both your routing and security configurations. A ``fragments`` key has 12 | been added to the framework configuration and must be specified when ESI or 13 | Hinclude are in use. No security configuration is required for this path as 14 | by default ESI access is only permitted for trusted hosts and Hinclude 15 | access uses an URL signing mechanism. 16 | 17 | ``` 18 | framework: 19 | # ... 20 | fragments: { path: /_proxy } 21 | ``` 22 | 23 | Functional Tests 24 | ---------------- 25 | 26 | * The profiler has been disabled by default in the test environment. You can 27 | enable it again by modifying the ``config_test.yml`` configuration file or 28 | even better, you can just enable it for the very next request by calling 29 | ``$client->enableProfiler()`` when you need the profiler in a test (that 30 | speeds up functional tests quite a bit). 31 | -------------------------------------------------------------------------------- /app/.htaccess: -------------------------------------------------------------------------------- 1 | deny from all -------------------------------------------------------------------------------- /app/AppCache.php: -------------------------------------------------------------------------------- 1 | getEnvironment(), array('dev', 'test'))) { 29 | $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle(); 30 | $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle(); 31 | $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle(); 32 | } 33 | 34 | return $bundles; 35 | } 36 | 37 | public function registerContainerConfiguration(LoaderInterface $loader) 38 | { 39 | $loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml'); 40 | } 41 | 42 | public function getCacheDir() 43 | { 44 | return $this->rootDir.'/cache/'.$this->environment; 45 | } 46 | 47 | public function getLogDir() 48 | { 49 | return $this->rootDir.'/logs/'.$this->environment; 50 | } 51 | 52 | 53 | } 54 | -------------------------------------------------------------------------------- /app/Resources/FOSOAuthServerBundle/views/Authorize/authorize.html.twig: -------------------------------------------------------------------------------- 1 | {% extends 'NetrunnerdbBuilderBundle::layout.html.twig' %} 2 | 3 | {% block navbar %}{% endblock %} 4 | 5 | {% block body %} 6 | 7 |
8 | 9 |
10 |
11 | 12 | {% block fos_oauth_server_content %} 13 | {% include "FOSOAuthServerBundle:Authorize:authorize_content.html.twig" %} 14 | {% endblock fos_oauth_server_content %} 15 | 16 |
17 |
18 | 19 | {% endblock %} 20 | 21 | {% block footer %}{% endblock %} -------------------------------------------------------------------------------- /app/Resources/FOSOAuthServerBundle/views/Authorize/authorize_content.html.twig: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 |

NetrunnerDB Authorization

5 |
6 |
7 |

8 | The application {{ client.name }} would like to connect to your account. 9 |

10 |

11 | If you agree, {{ client.name }} will be able to perform the following operations on your behalf: 12 |

13 |
    14 |
  • Read your decks saved on NetrunnerDB
  • 15 |
  • Modify a deck or create a new one on NetrunnerDB
  • 16 |
17 |

18 |
19 |
20 | 21 | 22 | {{ form_row(form.client_id) }} 23 | {{ form_row(form.response_type) }} 24 | {{ form_row(form.redirect_uri) }} 25 | {{ form_row(form.state) }} 26 | {{ form_row(form.scope) }} 27 | {{ form_rest(form) }} 28 |
29 |
30 | 31 |
32 |
33 |
34 | -------------------------------------------------------------------------------- /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 | getPhpIniConfigPath(); 8 | 9 | echo "********************************\n"; 10 | echo "* *\n"; 11 | echo "* Symfony requirements check *\n"; 12 | echo "* *\n"; 13 | echo "********************************\n\n"; 14 | 15 | echo $iniPath ? sprintf("* Configuration file used by PHP: %s\n\n", $iniPath) : "* WARNING: No configuration file (php.ini) used by PHP!\n\n"; 16 | 17 | echo "** ATTENTION **\n"; 18 | echo "* The PHP CLI can use a different php.ini file\n"; 19 | echo "* than the one used with your web server.\n"; 20 | if ('\\' == DIRECTORY_SEPARATOR) { 21 | echo "* (especially on the Windows platform)\n"; 22 | } 23 | echo "* To be on the safe side, please also launch the requirements check\n"; 24 | echo "* from your web server using the web/config.php script.\n"; 25 | 26 | echo_title('Mandatory requirements'); 27 | 28 | $checkPassed = true; 29 | foreach ($symfonyRequirements->getRequirements() as $req) { 30 | /** @var $req Requirement */ 31 | echo_requirement($req); 32 | if (!$req->isFulfilled()) { 33 | $checkPassed = false; 34 | } 35 | } 36 | 37 | echo_title('Optional recommendations'); 38 | 39 | foreach ($symfonyRequirements->getRecommendations() as $req) { 40 | echo_requirement($req); 41 | } 42 | 43 | exit($checkPassed ? 0 : 1); 44 | 45 | /** 46 | * Prints a Requirement instance 47 | */ 48 | function echo_requirement(Requirement $requirement) 49 | { 50 | $result = $requirement->isFulfilled() ? 'OK' : ($requirement->isOptional() ? 'WARNING' : 'ERROR'); 51 | echo ' ' . str_pad($result, 9); 52 | echo $requirement->getTestMessage() . "\n"; 53 | 54 | if (!$requirement->isFulfilled()) { 55 | echo sprintf(" %s\n\n", $requirement->getHelpText()); 56 | } 57 | } 58 | 59 | function echo_title($title) 60 | { 61 | echo "\n** $title **\n\n"; 62 | } 63 | -------------------------------------------------------------------------------- /app/config/.buildpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/config/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | ANRDB-config 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.wst.validation.validationbuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.dltk.core.scriptbuilder 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.php.core.PHPNature 21 | 22 | 23 | -------------------------------------------------------------------------------- /app/config/.settings/org.eclipse.php.core.prefs: -------------------------------------------------------------------------------- 1 | #Tue Aug 20 09:23:35 CEST 2013 2 | eclipse.preferences.version=1 3 | include_path=0;/NRDB-config 4 | -------------------------------------------------------------------------------- /app/config/config_dev.yml: -------------------------------------------------------------------------------- 1 | imports: 2 | - { resource: config.yml } 3 | 4 | framework: 5 | router: 6 | resource: "%kernel.root_dir%/config/routing_dev.yml" 7 | strict_requirements: true 8 | profiler: 9 | enabled: true 10 | only_exceptions: false 11 | 12 | web_profiler: 13 | toolbar: true 14 | intercept_redirects: false 15 | 16 | monolog: 17 | handlers: 18 | main: 19 | type: stream 20 | path: %kernel.logs_dir%/%kernel.environment%.log 21 | level: debug 22 | channels: !event 23 | 24 | assetic: 25 | use_controller: true 26 | 27 | #swiftmailer: 28 | # delivery_address: me@example.com 29 | -------------------------------------------------------------------------------- /app/config/config_prod.yml: -------------------------------------------------------------------------------- 1 | imports: 2 | - { resource: config.yml } 3 | 4 | monolog: 5 | handlers: 6 | main: 7 | type: fingers_crossed 8 | action_level: error 9 | handler: nested 10 | nested: 11 | type: stream 12 | path: %kernel.logs_dir%/%kernel.environment%.log 13 | level: error 14 | -------------------------------------------------------------------------------- /app/config/config_test.yml: -------------------------------------------------------------------------------- 1 | imports: 2 | - { resource: config_dev.yml } 3 | 4 | framework: 5 | test: ~ 6 | session: 7 | storage_id: session.storage.mock_file 8 | profiler: 9 | enabled: false 10 | 11 | web_profiler: 12 | toolbar: false 13 | intercept_redirects: false 14 | 15 | swiftmailer: 16 | disable_delivery: true 17 | -------------------------------------------------------------------------------- /app/config/parameters.yml.dist: -------------------------------------------------------------------------------- 1 | parameters: 2 | database_driver: pdo_mysql 3 | database_host: 127.0.0.1 4 | database_port: ~ 5 | database_name: symfony 6 | database_user: root 7 | database_password: ~ 8 | 9 | mailer_transport: smtp 10 | mailer_host: 127.0.0.1 11 | mailer_user: ~ 12 | mailer_password: ~ 13 | 14 | locale: en 15 | secret: ThisTokenIsNotSoSecretChangeIt 16 | cardimages_dir: /a/dir/path 17 | long_cache: 864000 18 | short_cache: 600 19 | -------------------------------------------------------------------------------- /app/config/routing.yml: -------------------------------------------------------------------------------- 1 | fos_js_routing: 2 | resource: "@FOSJsRoutingBundle/Resources/config/routing/routing.xml" 3 | 4 | fos_user_security: 5 | resource: "@FOSUserBundle/Resources/config/routing/security.xml" 6 | 7 | fos_user_profile: 8 | resource: "@FOSUserBundle/Resources/config/routing/profile.xml" 9 | prefix: /profile 10 | 11 | fos_user_registration_confirm_override: 12 | pattern: /register/confirm/{token} 13 | defaults: 14 | _controller: NetrunnerdbUserBundle:Registration:confirm 15 | 16 | fos_user_register: 17 | resource: "@FOSUserBundle/Resources/config/routing/registration.xml" 18 | prefix: /register 19 | 20 | fos_user_resetting: 21 | resource: "@FOSUserBundle/Resources/config/routing/resetting.xml" 22 | prefix: /resetting 23 | 24 | fos_user_change_password: 25 | resource: "@FOSUserBundle/Resources/config/routing/change_password.xml" 26 | prefix: /profile 27 | 28 | alsciende_user: 29 | resource: "@NetrunnerdbUserBundle/Resources/config/routing.yml" 30 | prefix: / 31 | 32 | alsciende_builder: 33 | resource: "@NetrunnerdbBuilderBundle/Resources/config/routing.yml" 34 | prefix: / 35 | 36 | alsciende_cards: 37 | resource: "@NetrunnerdbCardsBundle/Resources/config/routing.yml" 38 | prefix: / 39 | 40 | fos_oauth_server_token: 41 | resource: "@FOSOAuthServerBundle/Resources/config/routing/token.xml" 42 | 43 | fos_oauth_server_authorize: 44 | resource: "@FOSOAuthServerBundle/Resources/config/routing/authorize.xml" 45 | 46 | oauth_server_auth_login: 47 | pattern: /oauth/v2/auth_login 48 | defaults: { _controller: NetrunnerdbUserBundle:Security:login } 49 | 50 | oauth_server_auth_login_check: 51 | pattern: /oauth/v2/auth_login_check 52 | defaults: { _controller: NetrunnerdbUserBundle:Security:loginCheck } 53 | -------------------------------------------------------------------------------- /app/config/routing_dev.yml: -------------------------------------------------------------------------------- 1 | _wdt: 2 | resource: "@WebProfilerBundle/Resources/config/routing/wdt.xml" 3 | prefix: /_wdt 4 | 5 | _profiler: 6 | resource: "@WebProfilerBundle/Resources/config/routing/profiler.xml" 7 | prefix: /_profiler 8 | 9 | _configurator: 10 | resource: "@SensioDistributionBundle/Resources/config/routing/webconfigurator.xml" 11 | prefix: /_configurator 12 | 13 | _main: 14 | resource: routing.yml 15 | -------------------------------------------------------------------------------- /app/config/security.yml: -------------------------------------------------------------------------------- 1 | security: 2 | encoders: 3 | FOS\UserBundle\Model\UserInterface: sha512 4 | 5 | role_hierarchy: 6 | ROLE_ADMIN: ROLE_USER 7 | ROLE_SUPER_ADMIN: ROLE_ADMIN 8 | 9 | providers: 10 | fos_userbundle: 11 | id: fos_user.user_provider.username 12 | 13 | firewalls: 14 | api: 15 | pattern: ^/api_oauth2 16 | fos_oauth: true 17 | stateless: true 18 | oauth_token: 19 | pattern: ^/oauth/v2/token 20 | security: false 21 | oauth_authorize: 22 | pattern: ^/oauth/v2/auth 23 | form_login: 24 | provider: fos_userbundle 25 | check_path: oauth_server_auth_login_check 26 | login_path: oauth_server_auth_login 27 | anonymous: true 28 | main: 29 | remember_me: 30 | key: "%secret%" 31 | lifetime: 31536000 32 | path: / 33 | domain: ~ 34 | pattern: ^/ 35 | form_login: 36 | provider: fos_userbundle 37 | csrf_provider: form.csrf_provider 38 | default_target_path: deck_builder_index 39 | use_referer: true 40 | anonymous: ~ 41 | logout: 42 | invalidate_session: false 43 | 44 | access_control: 45 | - { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY } 46 | - { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY } 47 | - { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY } 48 | - { path: ^/admin/, role: ROLE_ADMIN } 49 | - { path: ^/deck/, role: ROLE_USER } 50 | - { path: ^/.*/deck/, role: ROLE_USER } 51 | - { path: ^/.*/decks, role: ROLE_USER } 52 | - { path: ^/.*/user/, role: ROLE_USER } 53 | - { path: ^/api_oauth2, roles: IS_AUTHENTICATED_FULLY } 54 | -------------------------------------------------------------------------------- /app/console: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | 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/phpunit.xml.dist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 16 | 17 | 18 | ../src/*/*Bundle/Tests 19 | ../src/*/Bundle/*Bundle/Tests 20 | 21 | 22 | 23 | 28 | 29 | 30 | 31 | ../src 32 | 33 | ../src/*/*Bundle/Resources 34 | ../src/*/*Bundle/Tests 35 | ../src/*/Bundle/*Bundle/Resources 36 | ../src/*/Bundle/*Bundle/Tests 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : "symfony/framework-standard-edition", 3 | "description" : "The \"Symfony Standard Edition\" distribution", 4 | "type" : "project", 5 | "license" : [ 6 | "MIT" 7 | ], 8 | "require" : { 9 | "friendsofsymfony/oauth-server-bundle" : "dev-master", 10 | "symfony/symfony" : "2.4.*", 11 | "friendsofsymfony/user-bundle" : "~2.0@dev", 12 | "symfony/swiftmailer-bundle" : "~2.3", 13 | "doctrine/orm" : "~2.2,>=2.2.3", 14 | "symfony/assetic-bundle" : "~2.3", 15 | "incenteev/composer-parameter-handler" : "~2.0", 16 | "twig/extensions" : "~1.0", 17 | "friendsofsymfony/jsrouting-bundle" : "1.5.*", 18 | "liuggio/ExcelBundle" : "~2.0", 19 | "michelf/php-markdown" : "1.3.*", 20 | "php" : ">=5.3.3", 21 | "sensio/generator-bundle" : "~2.3", 22 | "symfony/monolog-bundle" : "~2.4", 23 | "sensio/framework-extra-bundle" : "~2.3", 24 | "sensio/distribution-bundle" : "~2.3", 25 | "doctrine/doctrine-bundle" : "~1.2" 26 | }, 27 | "require-dev": { 28 | "phpunit/phpunit": "3.7.30" 29 | }, 30 | "autoload" : { 31 | "psr-0" : { 32 | "" : "src/" 33 | } 34 | }, 35 | "minimum-stability" : "stable", 36 | "config" : { 37 | "bin-dir" : "bin" 38 | }, 39 | "scripts" : { 40 | "post-update-cmd" : [ 41 | "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters", 42 | "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap", 43 | "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache", 44 | "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets", 45 | "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile" 46 | ], 47 | "post-install-cmd" : [ 48 | "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters", 49 | "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap", 50 | "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache", 51 | "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets", 52 | "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile" 53 | ] 54 | }, 55 | "extra" : { 56 | "symfony-assets-install" : "symlink", 57 | "branch-alias" : { 58 | "dev-master" : "2.3-dev" 59 | }, 60 | "symfony-web-dir" : "web", 61 | "symfony-app-dir" : "app", 62 | "incenteev-parameters" : { 63 | "file" : "app/config/parameters.yml" 64 | } 65 | } 66 | } -------------------------------------------------------------------------------- /netrunnerdb-2013-10-16.sql.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilberterik/netrunnerdb/a512f74ce902e6ba271a5f6bbfdb02d142be0b43/netrunnerdb-2013-10-16.sql.gz -------------------------------------------------------------------------------- /netrunnerdb-2014-06-07.sql.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilberterik/netrunnerdb/a512f74ce902e6ba271a5f6bbfdb02d142be0b43/netrunnerdb-2014-06-07.sql.gz -------------------------------------------------------------------------------- /netrunnerdb_cards_2014-08-27.sql.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilberterik/netrunnerdb/a512f74ce902e6ba271a5f6bbfdb02d142be0b43/netrunnerdb_cards_2014-08-27.sql.gz -------------------------------------------------------------------------------- /src/.buildpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/.htaccess: -------------------------------------------------------------------------------- 1 | deny from all -------------------------------------------------------------------------------- /src/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | NRDB-src 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.wst.validation.validationbuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.dltk.core.scriptbuilder 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.php.core.PHPNature 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/.settings/org.eclipse.php.core.prefs: -------------------------------------------------------------------------------- 1 | #Wed Aug 21 14:54:13 CEST 2013 2 | eclipse.preferences.version=1 3 | include_path=0;/NRDB-src\u00052;/NRDB-vendor 4 | -------------------------------------------------------------------------------- /src/Netrunnerdb/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | Bundles 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/Netrunnerdb/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding/=UTF-8 3 | -------------------------------------------------------------------------------- /src/Netrunnerdb/BuilderBundle/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | BuilderBundle 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/Netrunnerdb/BuilderBundle/Controller/ToolsController.php: -------------------------------------------------------------------------------- 1 | render('NetrunnerdbBuilderBundle:Tools:demo.html.twig'); 14 | } 15 | } -------------------------------------------------------------------------------- /src/Netrunnerdb/BuilderBundle/DependencyInjection/Configuration.php: -------------------------------------------------------------------------------- 1 | root('netrunnerdb_builder'); 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/Netrunnerdb/BuilderBundle/DependencyInjection/NetrunnerdbBuilderExtension.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/Netrunnerdb/BuilderBundle/Entity/CommentRepository.php: -------------------------------------------------------------------------------- 1 | id; 40 | } 41 | 42 | /** 43 | * Set quantity 44 | * 45 | * @param integer $quantity 46 | * @return Deckcontent 47 | */ 48 | public function setQuantity($quantity) 49 | { 50 | $this->quantity = $quantity; 51 | 52 | return $this; 53 | } 54 | 55 | /** 56 | * Get quantity 57 | * 58 | * @return integer 59 | */ 60 | public function getQuantity() 61 | { 62 | return $this->quantity; 63 | } 64 | 65 | /** 66 | * Set deck 67 | * 68 | * @param string $decklist 69 | * @return Deck 70 | */ 71 | public function setDecklist($decklist) 72 | { 73 | $this->decklist = $decklist; 74 | 75 | return $this; 76 | } 77 | 78 | /** 79 | * Get decklist 80 | * 81 | * @return string 82 | */ 83 | public function getDecklist() 84 | { 85 | return $this->decklist; 86 | } 87 | 88 | /** 89 | * Set card 90 | * 91 | * @param string $card 92 | * @return Card 93 | */ 94 | public function setCard($card) 95 | { 96 | $this->card = $card; 97 | 98 | return $this; 99 | } 100 | 101 | /** 102 | * Get card 103 | * 104 | * @return string 105 | */ 106 | public function getCard() 107 | { 108 | return $this->card; 109 | } 110 | 111 | } -------------------------------------------------------------------------------- /src/Netrunnerdb/BuilderBundle/Entity/DecklistslotRepository.php: -------------------------------------------------------------------------------- 1 | id; 40 | } 41 | 42 | /** 43 | * Set quantity 44 | * 45 | * @param integer $quantity 46 | * @return Deckcontent 47 | */ 48 | public function setQuantity($quantity) 49 | { 50 | $this->quantity = $quantity; 51 | 52 | return $this; 53 | } 54 | 55 | /** 56 | * Get quantity 57 | * 58 | * @return integer 59 | */ 60 | public function getQuantity() 61 | { 62 | return $this->quantity; 63 | } 64 | 65 | /** 66 | * Set deck 67 | * 68 | * @param string $deck 69 | * @return Deck 70 | */ 71 | public function setDeck($deck) 72 | { 73 | $this->deck = $deck; 74 | 75 | return $this; 76 | } 77 | 78 | /** 79 | * Get deck 80 | * 81 | * @return string 82 | */ 83 | public function getDeck() 84 | { 85 | return $this->deck; 86 | } 87 | 88 | /** 89 | * Set card 90 | * 91 | * @param string $card 92 | * @return Card 93 | */ 94 | public function setCard($card) 95 | { 96 | $this->card = $card; 97 | 98 | return $this; 99 | } 100 | 101 | /** 102 | * Get card 103 | * 104 | * @return \Netrunnerdb\CardsBundle\Entity\Card 105 | */ 106 | public function getCard() 107 | { 108 | return $this->card; 109 | } 110 | 111 | } -------------------------------------------------------------------------------- /src/Netrunnerdb/BuilderBundle/Entity/DeckslotRepository.php: -------------------------------------------------------------------------------- 1 | id; 31 | } 32 | 33 | /** 34 | * Set decklist 35 | * 36 | * @param string $decklist 37 | * @return Highlight 38 | */ 39 | public function setDecklist($decklist) 40 | { 41 | $this->decklist = $decklist; 42 | 43 | return $this; 44 | } 45 | 46 | /** 47 | * Get decklist 48 | * 49 | * @return string 50 | */ 51 | public function getDecklist() 52 | { 53 | return $this->decklist; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/Netrunnerdb/BuilderBundle/NetrunnerdbBuilderBundle.php: -------------------------------------------------------------------------------- 1 | ' + record.title 39 | + '' 40 | + record.setname + ''); 41 | }); 42 | } 43 | 44 | function handle_input_change(event) { 45 | NRDB.smart_filter.handler($(this).val(), update_cardsearch_result); 46 | } 47 | 48 | $(function() { 49 | $('#version-popover').popover({ 50 | html : true 51 | }); 52 | 53 | $('#card_search_form').on({ 54 | keyup : debounce(handle_input_change, 250) 55 | }); 56 | 57 | }); 58 | -------------------------------------------------------------------------------- /src/Netrunnerdb/BuilderBundle/Resources/public/js/nrdb.data.js: -------------------------------------------------------------------------------- 1 | if (typeof NRDB != "object") 2 | var NRDB = { 3 | data_loaded: jQuery.Callbacks(), 4 | api_url: { 5 | sets: 'http://netrunnerdb.com/api/sets/', 6 | cards: 'http://netrunnerdb.com/api/cards/' 7 | }, 8 | locale: 'en' 9 | }; 10 | NRDB.data = {}; 11 | (function(data, $) { 12 | data.sets = {}; 13 | data.cards = {}; 14 | 15 | var sets_data = null; 16 | var cards_data = null; 17 | var is_modified = null; 18 | 19 | data.query = function() { 20 | data.initialize(); 21 | data.promise_sets = $ 22 | .ajax(NRDB.api_url.sets+"?jsonp=NRDB.data.parse_sets&_locale=" 23 | + NRDB.locale); 24 | data.promise_cards = $ 25 | .ajax(NRDB.api_url.cards+"?jsonp=NRDB.data.parse_cards&_locale=" 26 | + NRDB.locale); 27 | $.when(data.promise_sets, data.promise_cards).done(data.initialize); 28 | } 29 | 30 | data.initialize = function() { 31 | if (is_modified === false) 32 | return; 33 | 34 | sets_data = sets_data 35 | || JSON.parse(localStorage 36 | .getItem('sets_data_' + NRDB.locale)); 37 | if(!sets_data) return; 38 | data.sets = TAFFY(sets_data); 39 | data.sets.sort("cyclenumber,number"); 40 | 41 | cards_data = cards_data 42 | || JSON 43 | .parse(localStorage 44 | .getItem('cards_data_' + NRDB.locale)); 45 | if(!cards_data) return; 46 | data.cards = TAFFY(cards_data); 47 | data.cards.sort("code"); 48 | 49 | NRDB.data_loaded.fire(); 50 | } 51 | 52 | data.parse_sets = function(response) { 53 | if(typeof response === "undefined") return; 54 | var json = JSON.stringify(sets_data = response); 55 | is_modified = is_modified 56 | || json != localStorage.getItem("sets_data_" + NRDB.locale); 57 | localStorage.setItem("sets_data_" + NRDB.locale, json); 58 | } 59 | 60 | data.parse_cards = function(response) { 61 | if(typeof response === "undefined") return; 62 | var json = JSON.stringify(cards_data = response); 63 | is_modified = is_modified 64 | || json != localStorage.getItem("cards_data_" + NRDB.locale); 65 | localStorage.setItem("cards_data_" + NRDB.locale, json); 66 | } 67 | 68 | $(function() { 69 | data.query(); 70 | }) 71 | 72 | })(NRDB.data, jQuery); 73 | 74 | 75 | -------------------------------------------------------------------------------- /src/Netrunnerdb/BuilderBundle/Resources/public/js/nrdb.deck_browser.js: -------------------------------------------------------------------------------- 1 | if (typeof NRDB != "object") 2 | var NRDB = { data_loaded: jQuery.Callbacks() }; 3 | 4 | NRDB.deck_browser = {}; 5 | (function(deck_browser, $) { 6 | var codes = null; 7 | 8 | function switch_left() { 9 | 10 | $('#deck_browser_left div:visible').last().hide(); 11 | $('#deck_browser_right div:hidden').first().show(); 12 | var focus = $('#deck_browser_center div:visible'); 13 | focus.prev().show(); 14 | focus.hide(); 15 | 16 | } 17 | 18 | function switch_right() { 19 | 20 | $('#deck_browser_right div:visible').last().hide(); 21 | $('#deck_browser_left div:hidden').first().show(); 22 | var focus = $('#deck_browser_center div:visible'); 23 | focus.next().show(); 24 | focus.hide(); 25 | 26 | } 27 | 28 | function focus_to(event) { 29 | var index = $(this).data('index'); 30 | focus_index(index); 31 | } 32 | 33 | function focus_index(index) { 34 | $('#deck_browser_left > div').each(function (i, elt) { 35 | if(i < index) $(elt).show(); 36 | else $(elt).hide(); 37 | }); 38 | $('#deck_browser_center > div').each(function (i, elt) { 39 | if(i == index) $(elt).show(); 40 | else $(elt).hide(); 41 | }); 42 | $('#deck_browser_right > div').each(function (i, elt) { 43 | if(codes.length - 1 - i > index) $(elt).show(); 44 | else $(elt).hide(); 45 | }); 46 | } 47 | 48 | deck_browser.update = function() { 49 | 50 | codes = [ Identity.code ]; 51 | NRDB.data.cards({ 52 | indeck : { 53 | 'gt' : 0 54 | }, 55 | type_code : { 56 | '!is' : 'identity' 57 | } 58 | }).order('type_code,title').each(function(record) { 59 | for (var i = 0; i < record.indeck; i++) { 60 | codes.push(record.code); 61 | } 62 | }); 63 | for (var i = 0; i < codes.length; i++) { 64 | var div = $('
'); 65 | $('#deck_browser_left').append(div.data('index', i)); 66 | $('#deck_browser_center').append(div.clone().data('index', i)); 67 | $('#deck_browser_right').prepend(div.clone().data('index', i)); 68 | } 69 | $('#deck_browser').on({ 70 | click : focus_to 71 | }, 'div'); 72 | focus_index(0); 73 | } 74 | 75 | })(NRDB.deck_browser, jQuery); 76 | -------------------------------------------------------------------------------- /src/Netrunnerdb/BuilderBundle/Resources/public/js/nrdb.deck_gallery.js: -------------------------------------------------------------------------------- 1 | if (typeof NRDB != "object") 2 | var NRDB = { data_loaded: jQuery.Callbacks() }; 3 | 4 | NRDB.deck_gallery = {}; 5 | (function(deck_gallery, $) { 6 | var codes = null; 7 | 8 | deck_gallery.update = function() { 9 | 10 | codes = [ Identity.code ]; 11 | qtys = [ 1 ]; 12 | NRDB.data.cards({ 13 | indeck : { 14 | 'gt' : 0 15 | }, 16 | type_code : { 17 | '!is' : 'identity' 18 | } 19 | }).order('type_code,title').each(function(record) { 20 | codes.push(record.code); 21 | qtys.push(record.indeck); 22 | }); 23 | for (var i = 0; i < codes.length; i++) { 24 | var cell = $('
'+qtys[i]+'
'); 25 | $('#deck_gallery tr').append(cell.data('index', i)); 26 | } 27 | } 28 | 29 | })(NRDB.deck_gallery, jQuery); 30 | -------------------------------------------------------------------------------- /src/Netrunnerdb/BuilderBundle/Resources/public/js/nrdb.draw_simulator.js: -------------------------------------------------------------------------------- 1 | if (typeof NRDB != "object") 2 | var NRDB = { data_loaded: jQuery.Callbacks() }; 3 | 4 | NRDB.draw_simulator = {}; 5 | (function(draw_simulator, $) { 6 | var deck = null, initial_size = 0, draw_count = 0, container = null; 7 | 8 | draw_simulator.reset = function() { 9 | if(container) container.empty(); 10 | deck = null; 11 | initial_size = draw_count = 0; 12 | update_odds(); 13 | $('#draw-simulator-clear').attr('disabled', true); 14 | }; 15 | 16 | draw_simulator.init = function() { 17 | container = $('#table-draw-simulator-content'); 18 | deck = []; 19 | NRDB.data.cards({indeck:{'gt':0},type_code:{'!is':'identity'}}).each(function (record) { 20 | for(var ex = 0; ex < record.indeck; ex++) { 21 | deck.push(record); 22 | } 23 | }); 24 | initial_size = deck.length; 25 | } 26 | 27 | function update_odds() { 28 | for(var i=1; i<=3; i++) { 29 | var odd = hypergeometric.get_cumul(1, initial_size, i, draw_count); 30 | $('#draw-simulator-odds-'+i).text(Math.round(100*odd)); 31 | } 32 | } 33 | 34 | function do_draw(draw) { 35 | for(var pick = 0; pick < draw && deck.length > 0; pick++) { 36 | var rand = Math.floor(Math.random() * deck.length); 37 | var spliced = deck.splice(rand, 1); 38 | var card = spliced[0]; 39 | container.append(''); 40 | $('#draw-simulator-clear').attr('disabled', false); 41 | draw_count++; 42 | } 43 | update_odds(); 44 | } 45 | 46 | draw_simulator.handle_click = function(event) { 47 | 48 | event.preventDefault(); 49 | var id = $(this).attr('id'); 50 | var command = id.substr(15); 51 | 52 | if(command === 'clear') { 53 | draw_simulator.reset(); 54 | return; 55 | } 56 | if(event.shiftKey) { 57 | draw_simulator.reset(); 58 | } 59 | if(deck === null) { 60 | draw_simulator.init(); 61 | } 62 | var draw; 63 | if(command === 'all') { 64 | draw = deck.length; 65 | } else { 66 | draw = parseInt(command, 10); 67 | } 68 | if(isNaN(draw)) return; 69 | do_draw(draw); 70 | 71 | }; 72 | 73 | draw_simulator.toggle_opacity = function(event) { 74 | $(this).css('opacity', 1.5 - parseFloat($(this).css('opacity'))); 75 | }; 76 | 77 | $(function () { 78 | $('#table-draw-simulator').on({click: draw_simulator.handle_click}, 'a.btn'); 79 | $('#table-draw-simulator').on({click: draw_simulator.toggle_opacity}, 'img.card'); 80 | }); 81 | 82 | })(NRDB.draw_simulator, jQuery); 83 | -------------------------------------------------------------------------------- /src/Netrunnerdb/BuilderBundle/Resources/public/js/nrdb.format.js: -------------------------------------------------------------------------------- 1 | if (typeof NRDB != "object") 2 | var NRDB = { data_loaded: jQuery.Callbacks() }; 3 | NRDB.format = {}; 4 | (function(format, $) { 5 | 6 | format.type = function(card) { 7 | var type = ''+card.type+''; 8 | if(card.subtype) type += ': '+card.subtype+''; 9 | if(card.type_code == "agenda") type += ' · '+card.advancementcost+'/'+card.agendapoints+''; 10 | if(card.type_code == "identity" && card.side_code == "corp") type += ' · '+card.minimumdecksize+'/'+card.influencelimit+''; 11 | if(card.type_code == "identity" && card.side_code == "runner") type += ' · '+card.minimumdecksize+'/'+card.influencelimit+' '+card.baselink+''; 12 | if(card.type_code == "operation" || card.type_code == "event") type += ' · '+card.cost+''; 13 | if(card.type_code == "resource" || card.type_code == "hardware") type += ' · '+card.cost+''; 14 | if(card.type_code == "program") type += ' · '+card.cost+' '+card.memoryunits+''; 15 | if(card.type_code == "asset" || card.type_code == "upgrade") type += ' · '+card.cost+' '+card.trash+''; 16 | if(card.type_code == "ice") type += ' · '+card.cost+''; 17 | return type; 18 | } 19 | 20 | format.text = function(card) { 21 | var text = card.text; 22 | 23 | text = text.replace(/\[Subroutine\]/g, ''); 24 | text = text.replace(/\[Credits\]/g, ''); 25 | text = text.replace(/\[Trash\]/g, ''); 26 | text = text.replace(/\[Click\]/g, ''); 27 | text = text.replace(/\[Recurring Credits\]/g, ''); 28 | text = text.replace(/\[Memory Unit\]/g, ''); 29 | text = text.replace(/\[Link\]/g, ''); 30 | text = text.split("\n").join('

'); 31 | return '

'+text+'

'; 32 | } 33 | 34 | })(NRDB.format, jQuery); 35 | -------------------------------------------------------------------------------- /src/Netrunnerdb/BuilderBundle/Resources/public/js/nrdb.fuzzy_search.js: -------------------------------------------------------------------------------- 1 | if (typeof NRDB != "object") 2 | var NRDB = { data_loaded: jQuery.Callbacks() }; 3 | 4 | NRDB.fuzzy_search = {}; 5 | (function(fuzzy_search, $) { 6 | 7 | // takes a card name and fuzzy-searches it in the card db 8 | // the input can include a qty indicator like 3x 9 | // returns an array of objects Card with an additional key "qty" 10 | fuzzy_search.lookup = function(input, max_results) { 11 | if(max_results == null) max_results = 5; 12 | var qty = null, name = input.replace(/\(.*\)/, '').replace(/\W+/g, ' ').replace(/\s+/, ' ').trim().toLowerCase(); 13 | if(name.match(/^(\d+)x?\s*(.*)/)) { 14 | qty = parseInt(RegExp.$1, 10); 15 | name = RegExp.$2; 16 | } else if(name.match(/(.*)\s*x?(\d+)$/)) { 17 | qty = parseInt(RegExp.$2, 10); 18 | name = RegExp.$1; 19 | } 20 | if(name == "") return; 21 | var options = []; 22 | var query = NRDB.data.cards({token: {likenocase:name}}); 23 | if(query.count()) { 24 | query.each(function (record,recordnumber) { 25 | options.push(record); 26 | }); 27 | } else if(typeof String.prototype.score === "function") { 28 | var matches = []; 29 | $.each(dict, function(index, row) { 30 | var score = row.token.score(name, 0.9); 31 | row.score = score; 32 | matches.push(row); 33 | }); 34 | matches.sort(function (a,b) { return a.score > b.score ? -1 : a.score < b.score ? 1 : 0 }); 35 | var bestScore = matches[0].score; 36 | for(var i=0; i 0.4 && matches[i].score > bestScore * 0.9; i++) { 37 | options.push(matches[i]); 38 | } 39 | } 40 | return { qty: qty, cards: options }; 41 | } 42 | 43 | var dict = []; 44 | NRDB.data_loaded.add(function() { 45 | NRDB.data.cards({set_code:"alt"}).remove(); 46 | NRDB.data.cards().each(function (record, recordnumber) { 47 | record.token = record.title.replace(/\W+/, ' ').trim().toLowerCase(); 48 | dict.push(record); 49 | }); 50 | }); 51 | 52 | })(NRDB.fuzzy_search, jQuery); 53 | -------------------------------------------------------------------------------- /src/Netrunnerdb/BuilderBundle/Resources/public/js/nrdb.tip.js: -------------------------------------------------------------------------------- 1 | if (typeof NRDB != "object") 2 | var NRDB = { data_loaded: jQuery.Callbacks() }; 3 | 4 | NRDB.tip = {}; 5 | (function(tip, $) { 6 | 7 | tip.display = function(event) { 8 | var code = $(this).data('index') 9 | || $(this).closest('.card-container').data('index') 10 | || ($(this).attr('href') && $(this).attr('href').replace( 11 | /.*\/card\/(\d\d\d\d\d)$/, 12 | "$1")); 13 | var card = NRDB.data.cards({ 14 | code : code 15 | }).first(); 16 | if (!card) 17 | return; 18 | var type = '

' + NRDB.format.type(card) + '

'; 19 | var influence = ''; 20 | for (var i = 0; i < card.factioncost; i++) 21 | influence += "•"; 22 | if (card.strength != null) 23 | type += '

Strength ' + card.strength + '

'; 24 | var image_svg = ''; 25 | if($('#nrdb_svg_hex').length && typeof InstallTrigger === 'undefined') { 26 | // no hexagon for Firefox, bad boy! 27 | image_svg = '
'; 29 | } 30 | $(this).qtip( 31 | { 32 | content : { 33 | text : image_svg 34 | + '

' 35 | + (card.uniqueness ? "♦ " : "") 36 | + card.title + '

' + type 37 | + '
' + NRDB.format.text(card) + '
' 38 | + '

' + influence 39 | + ' ' + card.faction + ' – ' + card.setname + '

' 40 | }, 41 | style : { 42 | classes : 'qtip-bootstrap qtip-nrdb' 43 | }, 44 | position : { 45 | my : 'left center', 46 | at : 'right center', 47 | viewport : $(window) 48 | }, 49 | show : { 50 | event : event.type, 51 | ready : true, 52 | solo : true 53 | }/*, 54 | hide : { 55 | event: 'unfocus' 56 | }*/ 57 | }, event); 58 | }; 59 | 60 | $(function() { 61 | 62 | if(typeof Modernizr == 'undefined' || !Modernizr.touch ) { 63 | $('body').on({ 64 | mouseover : tip.display, 65 | focus : tip.display 66 | }, 'a'); 67 | } 68 | 69 | }); 70 | 71 | })(NRDB.tip, jQuery); 72 | 73 | -------------------------------------------------------------------------------- /src/Netrunnerdb/BuilderBundle/Resources/public/js/nrdb.user.js: -------------------------------------------------------------------------------- 1 | if (typeof NRDB != "object") 2 | var NRDB = { data_loaded: jQuery.Callbacks() }; 3 | 4 | NRDB.user = {}; 5 | (function(user, $) { 6 | 7 | user.params = {}; 8 | user.deferred = $.Deferred().always(function() { 9 | if(user.data) { 10 | user.update(); 11 | } else { 12 | user.anonymous(); 13 | } 14 | }); 15 | 16 | user.query = function () { 17 | $.ajax(Routing.generate('user_info', user.params), { 18 | cache: false, 19 | dataType: 'json', 20 | success: function(data, textStatus, jqXHR) { 21 | user.data = data; 22 | user.deferred.resolve(); 23 | }, 24 | error: function(jqXHR, textStatus, errorThrown) { 25 | user.deferred.reject(); 26 | } 27 | }); 28 | } 29 | 30 | user.retrieve = function () { 31 | if(localStorage) { 32 | var timestamp = new Date(parseInt(localStorage.getItem('user_timestamp'),10)); 33 | var now = new Date(); 34 | if(now - timestamp < 3600000) { 35 | var storedData = localStorage.getItem('user'); 36 | if(storedData) { 37 | user.data = JSON.parse(storedData); 38 | user.deferred.resolve(); 39 | return; 40 | } 41 | } 42 | } 43 | user.query(); 44 | } 45 | 46 | user.wipe = function () { 47 | localStorage.removeItem('user'); 48 | localStorage.removeItem('user_timestamp'); 49 | } 50 | 51 | user.store = function () { 52 | localStorage.setItem('user', JSON.stringify(user.data)); 53 | localStorage.setItem('user_timestamp', new Date().getTime()); 54 | } 55 | 56 | user.anonymous = function() { 57 | user.wipe(); 58 | $('#login').append(''); 59 | } 60 | 61 | user.update = function() { 62 | user.store(); 63 | $('#login').addClass('dropdown').append(''); 72 | } 73 | 74 | $(function() { 75 | if($.isEmptyObject(user.params)) { 76 | user.retrieve() 77 | } else { 78 | user.query(); 79 | } 80 | }); 81 | 82 | })(NRDB.user, jQuery); 83 | 84 | -------------------------------------------------------------------------------- /src/Netrunnerdb/BuilderBundle/Resources/public/js/search.js: -------------------------------------------------------------------------------- 1 | NRDB.data_loaded.add(function() { 2 | NRDB.data.sets({ 3 | code : "alt" 4 | }).remove(); 5 | 6 | NRDB.data.cards({ 7 | set_code : "alt" 8 | }).remove(); 9 | 10 | $('#card').typeahead({ 11 | name : 'cardnames', 12 | local : NRDB.data.cards().select('title') 13 | }); 14 | }); 15 | 16 | $(function() { 17 | $('#card').on('typeahead:selected typeahead:autocompleted', function(event, data) { 18 | var card = NRDB.data.cards({ 19 | title : data.value 20 | }).first(); 21 | var line = $('

'+ 22 | card.title + '

'); 23 | line.on({ 24 | click: function(event) { line.remove() } 25 | }); 26 | line.insertBefore($('#card')); 27 | $(event.target).typeahead('setQuery', ''); 28 | }); 29 | }) 30 | -------------------------------------------------------------------------------- /src/Netrunnerdb/BuilderBundle/Resources/public/js/string_score.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * string_score.js: String Scoring Algorithm 0.1.10 3 | * 4 | * http://joshaven.com/string_score 5 | * https://github.com/joshaven/string_score 6 | * 7 | * Copyright (C) 2009-2011 Joshaven Potter 8 | * Special thanks to all of the contributors listed here https://github.com/joshaven/string_score 9 | * MIT license: http://www.opensource.org/licenses/mit-license.php 10 | * 11 | * Date: Tue Mar 1 2011 12 | */ 13 | String.prototype.score=function(m,s){if(this==m){return 1}if(m==""){return 0}var f=0,q=m.length,g=this,p=g.length,o,k,e=1,j;for(var d=0,r,n,h,a,b,l;d-1)?l:Math.max(a,b);if(n===-1){if(s){e+=1-s;continue}else{return 0}}else{r=0.1}if(g[n]===h){r+=0.1}if(n===0){r+=0.6;if(d===0){o=1}}else{if(g.charAt(n-1)===" "){r+=0.8}}g=g.substring(n+1,p);f+=r}k=f/q;j=((k*(q/p))+k)/2;j=j/e;if(o&&(j+0.15<1)){j+=0.15}return j}; -------------------------------------------------------------------------------- /src/Netrunnerdb/BuilderBundle/Resources/translations/messages.fr.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Symfony2 is great 7 | J'aime Symfony2 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/Netrunnerdb/BuilderBundle/Resources/views/Builder/directimport.html.twig: -------------------------------------------------------------------------------- 1 | {% extends 'NetrunnerdbBuilderBundle::layout.html.twig' %} 2 | 3 | {% block head %} 4 | 5 | 6 | 7 | 8 | 13 | 14 | {% endblock %} 15 | 16 | {% block body %} 17 | 18 |
19 | 20 |
21 | 22 |
23 |
24 |
25 | 26 | 27 |
28 | 29 |
30 |
31 | 32 |
33 |
34 |
35 | 36 |
    37 |
38 |
39 |
40 | 41 | 42 |
43 | 44 | 45 |
46 |
47 | 48 |
49 |
50 |
51 | 52 |
53 |
54 |
55 |
56 | 57 |
58 | 59 |
60 | 61 | {% endblock %} 62 | -------------------------------------------------------------------------------- /src/Netrunnerdb/BuilderBundle/Resources/views/Builder/initbuild.html.twig: -------------------------------------------------------------------------------- 1 | {% extends 'NetrunnerdbBuilderBundle::layout.html.twig' %} 2 | 3 | {% block body %} 4 | 5 | 17 | 18 |
19 | 20 |
21 | 22 |
23 |
24 | 25 |
Choose your identity
26 | 27 |
28 | {% for identity in identities %} 29 | 30 | 31 | {{ identity.title(app.request.locale) }} ({{ identity.pack.name }}) 32 | 33 | {% endfor %} 34 |
35 |
36 |
37 |
38 | 39 |
40 | 41 |
42 | 43 | 44 | 45 |
46 | 47 | {% endblock %} 48 | -------------------------------------------------------------------------------- /src/Netrunnerdb/BuilderBundle/Resources/views/Default/allcomments.html.twig: -------------------------------------------------------------------------------- 1 | {% extends 'NetrunnerdbBuilderBundle::layout.html.twig' %} 2 | 3 | {% block body %} 4 | 5 |
6 |
7 | 8 |
9 | 10 |

Decklist comments:

11 | 12 | 13 | 14 | 15 | {% for comment in comments %} 16 | 17 | 18 | 22 | 23 | {% endfor %} 24 | 25 | 26 |
19 |
{{ comment.creation|date('M d, Y') }} on {{ comment.decklist_name }}, by {{ comment.author }}:
20 | {{ comment.text|raw }} 21 |
27 | 28 |
29 |
    30 | {% if prevurl is null %} 31 |
  • «
  • 32 | {% else %} 33 |
  • «
  • 34 | {% endif %} 35 | {% for page in pages %} 36 | {% if page.current %} 37 |
  • {{ page.numero }} (current)
  • 38 | {% else %} 39 |
  • {{ page.numero }}
  • 40 | {% endif %} 41 | {% endfor %} 42 | {% if nexturl is null %} 43 |
  • »
  • 44 | {% else %} 45 |
  • »
  • 46 | {% endif %} 47 |
48 |
49 | 50 |
51 | 52 | 53 |
54 |
55 | 56 | {% endblock %} 57 | -------------------------------------------------------------------------------- /src/Netrunnerdb/BuilderBundle/Resources/views/Default/donators.html.twig: -------------------------------------------------------------------------------- 1 | {% extends 'NetrunnerdbBuilderBundle::layout.html.twig' %} 2 | 3 | {% block body %} 4 | 5 |
6 |
7 | 8 |
9 |

The Gracious Donators

10 |

NetrunnerDB wouldn't be the same without them. Many, many thanks.

11 | 19 |
20 | 21 |
22 |
23 | 24 | {% endblock %} 25 | -------------------------------------------------------------------------------- /src/Netrunnerdb/BuilderBundle/Resources/views/Default/usercomments.html.twig: -------------------------------------------------------------------------------- 1 | {% extends 'NetrunnerdbBuilderBundle::layout.html.twig' %} 2 | 3 | {% block body %} 4 | 5 |
6 |
7 | 8 |
9 | 10 |

Published comments:

11 | 12 | 13 | 14 | 15 | {% for comment in comments %} 16 | 17 | 18 | 22 | 23 | {% endfor %} 24 | 25 | 26 |
19 |
{{ comment.creation|date('M d, Y') }} on {{ comment.decklist_name }}:
20 | {{ comment.text|raw }} 21 |
27 | 28 |
29 |
    30 | {% if prevurl is null %} 31 |
  • «
  • 32 | {% else %} 33 |
  • «
  • 34 | {% endif %} 35 | {% for page in pages %} 36 | {% if page.current %} 37 |
  • {{ page.numero }} (current)
  • 38 | {% else %} 39 |
  • {{ page.numero }}
  • 40 | {% endif %} 41 | {% endfor %} 42 | {% if nexturl is null %} 43 |
  • »
  • 44 | {% else %} 45 |
  • »
  • 46 | {% endif %} 47 |
48 |
49 | 50 |
51 | 52 | 53 |
54 |
55 | 56 | {% endblock %} 57 | -------------------------------------------------------------------------------- /src/Netrunnerdb/BuilderBundle/Resources/views/Emails/newcomment_author.html.twig: -------------------------------------------------------------------------------- 1 |

{{ username }} commented on your decklist {{ decklist_name }}

2 |
3 | {{ comment|raw }} 4 |
5 |

To unsubscribe from those notifications, change your account settings.

6 | -------------------------------------------------------------------------------- /src/Netrunnerdb/BuilderBundle/Resources/views/Emails/newcomment_commenter.html.twig: -------------------------------------------------------------------------------- 1 |

{{ username }} also commented on a decklist {{ decklist_name }}

2 |
3 | {{ comment|raw }} 4 |
5 |

To unsubscribe from those notifications, change your account settings.

6 | -------------------------------------------------------------------------------- /src/Netrunnerdb/BuilderBundle/Resources/views/Emails/newcomment_mentionned.html.twig: -------------------------------------------------------------------------------- 1 |

{{ username }} mentionned you in a comment on the decklist {{ decklist_name }}

2 |
3 | {{ comment|raw }} 4 |
5 |

To unsubscribe from those notifications, change your account settings.

6 | -------------------------------------------------------------------------------- /src/Netrunnerdb/BuilderBundle/Resources/views/octgn.xml.twig: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | {{ identity.name }} 5 |
6 |
7 | {% for card in rd %} 8 | {{ card.name }} 9 | {% endfor %} 10 |
11 | 12 |
-------------------------------------------------------------------------------- /src/Netrunnerdb/BuilderBundle/Tests/Controller/DefaultControllerTest.php: -------------------------------------------------------------------------------- 1 | request('GET', '/hello/Fabien'); 14 | 15 | $this->assertTrue($crawler->filter('html:contains("Hello Fabien")')->count() > 0); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Netrunnerdb/CardsBundle/.buildpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/Netrunnerdb/CardsBundle/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | CardsBundle 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.wst.validation.validationbuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.dltk.core.scriptbuilder 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.php.core.PHPNature 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/Netrunnerdb/CardsBundle/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | #Fri Jul 05 15:27:43 CEST 2013 2 | eclipse.preferences.version=1 3 | encoding//Controller/DefaultController.php=UTF-8 4 | encoding/=UTF-8 5 | -------------------------------------------------------------------------------- /src/Netrunnerdb/CardsBundle/.settings/org.eclipse.php.core.prefs: -------------------------------------------------------------------------------- 1 | #Fri Jul 05 15:27:45 CEST 2013 2 | eclipse.preferences.version=1 3 | include_path=0;/CardsBundle 4 | -------------------------------------------------------------------------------- /src/Netrunnerdb/CardsBundle/DQL/BinaryFunction.php: -------------------------------------------------------------------------------- 1 | stringPrimary->dispatch($sqlWalker); 20 | } 21 | 22 | /** 23 | * @override 24 | */ 25 | public function parse(\Doctrine\ORM\Query\Parser $parser) { 26 | $parser->match(Lexer::T_IDENTIFIER); 27 | $parser->match(Lexer::T_OPEN_PARENTHESIS); 28 | $this->stringPrimary = $parser->StringPrimary(); 29 | $parser->match(Lexer::T_CLOSE_PARENTHESIS); 30 | } 31 | 32 | } -------------------------------------------------------------------------------- /src/Netrunnerdb/CardsBundle/DQL/ReplaceFunction.php: -------------------------------------------------------------------------------- 1 | stringPrimary->dispatch($sqlWalker) . ', ' . 28 | $this->stringSecondary->dispatch($sqlWalker) . ', ' . 29 | $this->stringThird->dispatch($sqlWalker) . 30 | ')'; 31 | /* return $sqlWalker->getConnection()->getDatabasePlatform()->getReplaceExpression( 32 | $this->stringPrimary, $this->stringSecondary, $this->stringThird 33 | );*/ 34 | } 35 | 36 | /** 37 | * @override 38 | */ 39 | public function parse(\Doctrine\ORM\Query\Parser $parser) { 40 | $parser->match(Lexer::T_IDENTIFIER); 41 | $parser->match(Lexer::T_OPEN_PARENTHESIS); 42 | $this->stringPrimary = $parser->StringPrimary(); 43 | $parser->match(Lexer::T_COMMA); 44 | $this->stringSecondary = $parser->StringPrimary(); 45 | $parser->match(Lexer::T_COMMA); 46 | $this->stringThird = $parser->StringPrimary(); 47 | $parser->match(Lexer::T_CLOSE_PARENTHESIS); 48 | } 49 | 50 | } -------------------------------------------------------------------------------- /src/Netrunnerdb/CardsBundle/DependencyInjection/Configuration.php: -------------------------------------------------------------------------------- 1 | root('netrunnerdb_netrunner_cards'); 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/Netrunnerdb/CardsBundle/DependencyInjection/NetrunnerdbCardsExtension.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/Netrunnerdb/CardsBundle/Form/CycleType.php: -------------------------------------------------------------------------------- 1 | add('code') 15 | ->add('name') 16 | ->add('nameFr') 17 | ->add('nameDe') 18 | ->add('nameEs') 19 | ->add('namePl') 20 | ->add('number') 21 | ; 22 | } 23 | 24 | public function setDefaultOptions(OptionsResolverInterface $resolver) 25 | { 26 | $resolver->setDefaults(array( 27 | 'data_class' => 'Netrunnerdb\CardsBundle\Entity\Cycle' 28 | )); 29 | } 30 | 31 | public function getName() 32 | { 33 | return 'netrunnerdb_cardsbundle_cycletype'; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/Netrunnerdb/CardsBundle/Form/PackType.php: -------------------------------------------------------------------------------- 1 | add('code') 15 | ->add('name') 16 | ->add('nameFr') 17 | ->add('nameDe') 18 | ->add('nameEs') 19 | ->add('namePl') 20 | ->add('released') 21 | ->add('size') 22 | ->add('number') 23 | ->add('cycle', 'entity', array('class' => 'NetrunnerdbCardsBundle:Cycle', 'property' => 'name')) 24 | ; 25 | } 26 | 27 | public function setDefaultOptions(OptionsResolverInterface $resolver) 28 | { 29 | $resolver->setDefaults(array( 30 | 'data_class' => 'Netrunnerdb\CardsBundle\Entity\Pack' 31 | )); 32 | } 33 | 34 | public function getName() 35 | { 36 | return 'netrunnerdb_cardsbundle_packtype'; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/Netrunnerdb/CardsBundle/Form/TypeType.php: -------------------------------------------------------------------------------- 1 | add('name') 15 | ->add('nameFr') 16 | ->add('nameDe') 17 | ->add('nameEs') 18 | ->add('namePl') 19 | ; 20 | } 21 | 22 | public function setDefaultOptions(OptionsResolverInterface $resolver) 23 | { 24 | $resolver->setDefaults(array( 25 | 'data_class' => 'Netrunnerdb\CardsBundle\Entity\Type' 26 | )); 27 | } 28 | 29 | public function getName() 30 | { 31 | return 'netrunnerdb_cardsbundle_typetype'; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/Netrunnerdb/CardsBundle/NetrunnerdbCardsBundle.php: -------------------------------------------------------------------------------- 1 | Card edit 5 | 6 |
7 | 8 | {{ form_widget(edit_form) }} 9 |

10 | 11 |

12 |
13 | 14 | 28 | {% endblock %} 29 | -------------------------------------------------------------------------------- /src/Netrunnerdb/CardsBundle/Resources/views/Card/new.html.twig: -------------------------------------------------------------------------------- 1 | {% extends '::base.html.twig' %} 2 | 3 | {% block body -%} 4 |

Card creation

5 | 6 |
7 | {{ form_widget(form) }} 8 |

9 | 10 |

11 |
12 | 13 | 20 | {% endblock %} 21 | -------------------------------------------------------------------------------- /src/Netrunnerdb/CardsBundle/Resources/views/Cycle/edit.html.twig: -------------------------------------------------------------------------------- 1 | {% extends '::base.html.twig' %} 2 | 3 | {% block body -%} 4 |

Cycle edit

5 | 6 |
7 | 8 | {{ form_widget(edit_form) }} 9 |

10 | 11 |

12 |
13 | 14 | 28 | {% endblock %} 29 | -------------------------------------------------------------------------------- /src/Netrunnerdb/CardsBundle/Resources/views/Cycle/index.html.twig: -------------------------------------------------------------------------------- 1 | {% extends '::base.html.twig' %} 2 | 3 | {% block body -%} 4 |

Cycle list

5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | {% for entity in entities %} 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 41 | 42 | {% endfor %} 43 | 44 |
IdCodeNameNamefrNamedeNameesNameplNumberActions
{{ entity.id }}{{ entity.code }}{{ entity.name }}{{ entity.nameFr }}{{ entity.nameDe }}{{ entity.nameEs }}{{ entity.namePl }}{{ entity.number }} 32 |
    33 |
  • 34 | show 35 |
  • 36 |
  • 37 | edit 38 |
  • 39 |
40 |
45 | 46 | 53 | {% endblock %} 54 | -------------------------------------------------------------------------------- /src/Netrunnerdb/CardsBundle/Resources/views/Cycle/new.html.twig: -------------------------------------------------------------------------------- 1 | {% extends '::base.html.twig' %} 2 | 3 | {% block body -%} 4 |

Cycle creation

5 | 6 |
7 | {{ form_widget(form) }} 8 |

9 | 10 |

11 |
12 | 13 | 20 | {% endblock %} 21 | -------------------------------------------------------------------------------- /src/Netrunnerdb/CardsBundle/Resources/views/Cycle/show.html.twig: -------------------------------------------------------------------------------- 1 | {% extends '::base.html.twig' %} 2 | 3 | {% block body -%} 4 |

Cycle

5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 |
Id{{ entity.id }}
Code{{ entity.code }}
Name{{ entity.name }}
Namefr{{ entity.nameFr }}
Namede{{ entity.nameDe }}
Namees{{ entity.nameEs }}
Namepl{{ entity.namePl }}
Number{{ entity.number }}
42 | 43 | 62 | {% endblock %} 63 | -------------------------------------------------------------------------------- /src/Netrunnerdb/CardsBundle/Resources/views/Default/allsets.html.twig: -------------------------------------------------------------------------------- 1 |
    2 | {% for cycle in data %} 3 |
  1. {{ cycle.name }} {% if cycle.cyclenumber != 0 and cycle.known != cycle.total %}({{cycle.known}}/{{cycle.total}}){% endif %} 4 | {% if cycle.packs|length > 1 %} 5 |
      6 | {% for pack in cycle.packs %} 7 |
    1. {{ pack.name }} {% if cycle.cyclenumber != 0 and pack.known != pack.total %}({{pack.known}}/{{pack.total}}){% endif %}
    2. 8 | {% endfor %} 9 |
    10 | {% endif %} 11 |
  2. 12 | {% endfor %} 13 |
14 | -------------------------------------------------------------------------------- /src/Netrunnerdb/CardsBundle/Resources/views/Default/langs.html.twig: -------------------------------------------------------------------------------- 1 | {% set params = app.request.attributes.get('_route_params')|merge(app.request.query.all()) %} 2 |
  • 3 |
  • 4 |
  • 5 |
  • 6 |
  • 7 |
  • 8 | -------------------------------------------------------------------------------- /src/Netrunnerdb/CardsBundle/Resources/views/Default/menu.html.twig: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /src/Netrunnerdb/CardsBundle/Resources/views/Default/rulings.html.twig: -------------------------------------------------------------------------------- 1 | {% extends 'NetrunnerdbCardsBundle::main.html.twig' %} 2 | 3 | {% block title %}Rulings{% endblock %} 4 | 5 | {% block content %} 6 | 7 |

    {{ block('title') }}

    8 | 9 |
    10 | 11 |

    From the latest FAQ

    12 | 13 |
      14 | {% for ruling in faq %} 15 |
    • 16 |
      {{ ruling.question|raw }}
      17 |
      {{ ruling.answer|raw }} ({{ ruling.created }})
      18 |
    • 19 | {% endfor %} 20 |
    21 |
    22 |
    23 | 24 |

    By direct answer

    25 | 26 |
      27 | {% for ruling in mail %} 28 |
    • 29 |
      {{ ruling.question|raw }}
      30 |
      {{ ruling.answer|raw }} ({{ ruling.created }})
      31 |
    • 32 | {% endfor %} 33 |
    34 |
    35 | {% endblock %} 36 | -------------------------------------------------------------------------------- /src/Netrunnerdb/CardsBundle/Resources/views/Default/searchoptions.html.twig: -------------------------------------------------------------------------------- 1 |
    2 | 10 |
    11 |
    12 | 19 | 20 |
    -------------------------------------------------------------------------------- /src/Netrunnerdb/CardsBundle/Resources/views/Default/sitemap.html.twig: -------------------------------------------------------------------------------- 1 | {% extends 'NetrunnerdbCardsBundle::main.html.twig' %} 2 | 3 | {% block title %}{% trans %}Card Sets{% endtrans %}{% endblock %} 4 | 5 | {% block content %} 6 | 7 |

    {{ block('title') }}

    8 | 9 | {{ allsets|raw }} 10 | 11 | {% endblock %} 12 | -------------------------------------------------------------------------------- /src/Netrunnerdb/CardsBundle/Resources/views/Excel/confirm.html.twig: -------------------------------------------------------------------------------- 1 | {% autoescape false %} 2 |

    {{ locale }}

    3 | 4 | {% for card in cards %} 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | {% endfor %} 17 |
    {{ card.code }}{{ card.oldtitle }}{{ card.title }}{{ card.oldkeywords }}{{ card.keywords }}{{ card.oldtext|nl2br }}{{ card.text|nl2br }}{{ card.oldflavor }}{{ card.flavor }}
    18 |
    19 | 20 |
    21 | {% endautoescape %} -------------------------------------------------------------------------------- /src/Netrunnerdb/CardsBundle/Resources/views/Excel/form.html.twig: -------------------------------------------------------------------------------- 1 |
    2 | 10 | 11 | 12 |
    -------------------------------------------------------------------------------- /src/Netrunnerdb/CardsBundle/Resources/views/Pack/edit.html.twig: -------------------------------------------------------------------------------- 1 | {% extends '::base.html.twig' %} 2 | 3 | {% block body -%} 4 |

    Pack edit

    5 | 6 |
    7 | 8 | {{ form_widget(edit_form) }} 9 |

    10 | 11 |

    12 |
    13 | 14 | 28 | {% endblock %} 29 | -------------------------------------------------------------------------------- /src/Netrunnerdb/CardsBundle/Resources/views/Pack/index.html.twig: -------------------------------------------------------------------------------- 1 | {% extends '::base.html.twig' %} 2 | 3 | {% block body -%} 4 |

    Pack list

    5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | {% for entity in entities %} 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | {% endfor %} 47 | 48 |
    IdCodeNameNamefrNamedeNameesNameplReleasedSizeNumberActions
    {{ entity.id }}{{ entity.code }}{{ entity.name }}{{ entity.nameFr }}{{ entity.nameDe }}{{ entity.nameEs }}{{ entity.namePl }}{% if entity.released %}{{ entity.released|date('Y-m-d H:i:s') }}{% endif %}{{ entity.size }}{{ entity.number }} 36 |
      37 |
    • 38 | show 39 |
    • 40 |
    • 41 | edit 42 |
    • 43 |
    44 |
    49 | 50 | 57 | {% endblock %} 58 | -------------------------------------------------------------------------------- /src/Netrunnerdb/CardsBundle/Resources/views/Pack/new.html.twig: -------------------------------------------------------------------------------- 1 | {% extends '::base.html.twig' %} 2 | 3 | {% block body -%} 4 |

    Pack creation

    5 | 6 |
    7 | {{ form_widget(form) }} 8 |

    9 | 10 |

    11 |
    12 | 13 | 20 | {% endblock %} 21 | -------------------------------------------------------------------------------- /src/Netrunnerdb/CardsBundle/Resources/views/Pack/show.html.twig: -------------------------------------------------------------------------------- 1 | {% extends '::base.html.twig' %} 2 | 3 | {% block body -%} 4 |

    Pack

    5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 |
    Id{{ entity.id }}
    Code{{ entity.code }}
    Name{{ entity.name }}
    Namefr{{ entity.nameFr }}
    Namede{{ entity.nameDe }}
    Namees{{ entity.nameEs }}
    Namepl{{ entity.namePl }}
    Released{{ entity.released|date('Y-m-d H:i:s') }}
    Size{{ entity.size }}
    Number{{ entity.number }}
    50 | 51 | 70 | {% endblock %} 71 | -------------------------------------------------------------------------------- /src/Netrunnerdb/CardsBundle/Resources/views/Search/display-card.html.twig: -------------------------------------------------------------------------------- 1 | {% extends 'NetrunnerdbCardsBundle:Search:display.html.twig' %} 2 | 3 | {% import "NetrunnerdbCardsBundle:Search:cardlayouts.html.twig" as cardlayouts %} 4 | 5 | {% block main %} 6 | 7 | {% for i in 0..cards|length-1 %} 8 | {{ cardlayouts.with_scan(cards[i]) }} 9 | {% endfor %} 10 | 11 | {% endblock %} 12 | 13 | -------------------------------------------------------------------------------- /src/Netrunnerdb/CardsBundle/Resources/views/Search/display-list.html.twig: -------------------------------------------------------------------------------- 1 | {% extends 'NetrunnerdbCardsBundle:Search:display.html.twig' %} 2 | 3 | {% import "NetrunnerdbCardsBundle:Search:cardlayouts.html.twig" as cardlayouts %} 4 | 5 | {% block main %} 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | {% for i in 0..cards|length-1 %} 21 | {{ cardlayouts.as_list(cards[i]) }} 22 | {% endfor %} 23 |
    {% trans %}Title{% endtrans %}{% trans %}Faction{% endtrans %}{% trans %}Type{% endtrans %}{% trans %}Subtype{% endtrans %}{% trans %}Set{% endtrans %}
    24 | 25 | {% endblock %} 26 | -------------------------------------------------------------------------------- /src/Netrunnerdb/CardsBundle/Resources/views/Search/display-scan.html.twig: -------------------------------------------------------------------------------- 1 | {% extends 'NetrunnerdbCardsBundle:Search:display.html.twig' %} 2 | 3 | {% import "NetrunnerdbCardsBundle:Search:cardlayouts.html.twig" as cardlayouts %} 4 | 5 | {% block main %} 6 | 7 | 8 | {% for row in 0..(cards|length-1)//4 %} 9 |
    10 | {% for col in 0..3 %}{% set index = row*4+col %} 11 | {% if index in cards|keys %} 12 | {{ cardlayouts.scan_only(cards[index]) }} 13 | {% endif %} 14 | {% endfor %} 15 |
    16 | {% endfor %} 17 | 18 | {% endblock %} 19 | -------------------------------------------------------------------------------- /src/Netrunnerdb/CardsBundle/Resources/views/Search/display-short.html.twig: -------------------------------------------------------------------------------- 1 | {% extends 'NetrunnerdbCardsBundle:Search:display.html.twig' %} 2 | 3 | {% import "NetrunnerdbCardsBundle:Search:cardlayouts.html.twig" as cardlayouts %} 4 | 5 | {% block main %} 6 | 7 | {% for key, value in cards %} 8 |

    {{ key }}

    9 |
    10 | {% for i in 0..value|length-1 %} 11 | {{ cardlayouts.as_simple(value[i]) }} 12 | {% endfor %} 13 |
    14 | {% endfor %} 15 | 16 | {% endblock %} 17 | -------------------------------------------------------------------------------- /src/Netrunnerdb/CardsBundle/Resources/views/Search/display-spoiler.html.twig: -------------------------------------------------------------------------------- 1 | {% extends 'NetrunnerdbCardsBundle:Search:display.html.twig' %} 2 | 3 | {% import "NetrunnerdbCardsBundle:Search:cardlayouts.html.twig" as cardlayouts %} 4 | 5 | {% block main %} 6 | 7 | {% for row in 0..(cards|length-1)//4 %} 8 |
    9 | {% for col in 0..3 %} 10 | {% if row*4+col < cards|length %}{{ cardlayouts.as_grid(cards[row*4+col]) }}{% endif %} 11 | {% endfor %} 12 |
    13 | {% endfor %} 14 | 15 | {% endblock %} 16 | -------------------------------------------------------------------------------- /src/Netrunnerdb/CardsBundle/Resources/views/Search/display.html.twig: -------------------------------------------------------------------------------- 1 | {% extends display_mode_template %} 2 | 3 | {% block title %}{{ title }}{% endblock %} 4 | 5 | {% block content %} 6 | 7 | {% if mode == 'full' %} 8 | {{ searchbar|raw }} 9 | {% endif %} 10 | 11 |
    12 | 13 | {% if mode == 'full' or mode == 'fragment' %} 14 | {{ pagination|raw }} 15 | {% endif %} 16 | 17 |
    18 | 19 | {% if cards|length > 0 %} 20 | 21 | {% block main %}{% endblock %} 22 | 23 | {% else %} 24 |
    25 |

    Your query didn't match any card.

    26 |
    27 | 28 | {% endif %} 29 |
    30 | 31 | {% if mode == 'full' or mode == 'fragment' %} 32 | {{ pagination|raw }} 33 | {% endif %} 34 | 35 |
    36 | 37 | {% endblock %} 38 | -------------------------------------------------------------------------------- /src/Netrunnerdb/CardsBundle/Resources/views/Search/pagination.html.twig: -------------------------------------------------------------------------------- 1 |
    2 |
    3 |
    4 |
    5 |
      6 |
    • {{ first|raw }}
    • 7 | {% if ellipsisbefore %}
    • ...
    • {% endif %} 8 |
    • {{ prev|raw }}
    • 9 |
    • {{ current|raw }}
    • 10 |
    • {{ next|raw }}
    • 11 | {% if ellipsisafter %}
    • ...
    • {% endif %} 12 |
    • {{ last|raw }}
    • 13 |
    14 |
    15 |
    16 |

    {{ count }} {% trans %}cards{% endtrans %}

    17 |
    18 |
    19 | -------------------------------------------------------------------------------- /src/Netrunnerdb/CardsBundle/Resources/views/Search/paginationitem.html.twig: -------------------------------------------------------------------------------- 1 | {% if href %}{% endif %} {{ s }}–{{ e }}{% if href %}{% endif %} -------------------------------------------------------------------------------- /src/Netrunnerdb/CardsBundle/Resources/views/Search/searchbar.html.twig: -------------------------------------------------------------------------------- 1 |
    2 |
    3 |
    4 | 21 | 22 |
    23 | {% include 'NetrunnerdbCardsBundle:Default:searchoptions.html.twig' %} 24 |
    25 |
    26 | -------------------------------------------------------------------------------- /src/Netrunnerdb/CardsBundle/Resources/views/Search/setnavigation.html.twig: -------------------------------------------------------------------------------- 1 |
    2 |
    3 | 14 |
    15 |
    16 | -------------------------------------------------------------------------------- /src/Netrunnerdb/CardsBundle/Resources/views/Type/edit.html.twig: -------------------------------------------------------------------------------- 1 | {% extends '::base.html.twig' %} 2 | 3 | {% block body -%} 4 |

    Type edit

    5 | 6 |
    7 | 8 | {{ form_widget(edit_form) }} 9 |

    10 | 11 |

    12 |
    13 | 14 | 28 | {% endblock %} 29 | -------------------------------------------------------------------------------- /src/Netrunnerdb/CardsBundle/Resources/views/Type/index.html.twig: -------------------------------------------------------------------------------- 1 | {% extends '::base.html.twig' %} 2 | 3 | {% block body -%} 4 |

    Type list

    5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | {% for entity in entities %} 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 37 | 38 | {% endfor %} 39 | 40 |
    IdNameNamefrNamedeNameesNameplActions
    {{ entity.id }}{{ entity.name }}{{ entity.nameFr }}{{ entity.nameDe }}{{ entity.nameEs }}{{ entity.namePl }} 28 |
      29 |
    • 30 | show 31 |
    • 32 |
    • 33 | edit 34 |
    • 35 |
    36 |
    41 | 42 | 49 | {% endblock %} 50 | -------------------------------------------------------------------------------- /src/Netrunnerdb/CardsBundle/Resources/views/Type/new.html.twig: -------------------------------------------------------------------------------- 1 | {% extends '::base.html.twig' %} 2 | 3 | {% block body -%} 4 |

    Type creation

    5 | 6 |
    7 | {{ form_widget(form) }} 8 |

    9 | 10 |

    11 |
    12 | 13 | 20 | {% endblock %} 21 | -------------------------------------------------------------------------------- /src/Netrunnerdb/CardsBundle/Resources/views/Type/show.html.twig: -------------------------------------------------------------------------------- 1 | {% extends '::base.html.twig' %} 2 | 3 | {% block body -%} 4 |

    Type

    5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 |
    Id{{ entity.id }}
    Name{{ entity.name }}
    Namefr{{ entity.nameFr }}
    Namede{{ entity.nameDe }}
    Namees{{ entity.nameEs }}
    Namepl{{ entity.namePl }}
    34 | 35 | 54 | {% endblock %} 55 | -------------------------------------------------------------------------------- /src/Netrunnerdb/CardsBundle/Resources/views/apiset.xml.twig: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | {% autoescape false %} 10 | {% for card in cards %} 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | {% endfor %} 28 | {% endautoescape %} 29 | 30 | -------------------------------------------------------------------------------- /src/Netrunnerdb/CardsBundle/Resources/views/main.html.twig: -------------------------------------------------------------------------------- 1 | {% extends 'NetrunnerdbBuilderBundle::layout.html.twig' %} 2 | 3 | {% block body %} 4 | 5 | {#} 6 | {% render(controller('NetrunnerdbCardsBundle:Default:header', {'_locale':app.request.locale})) %} 7 | #} 8 |
    9 | {% block content %}{% endblock %} 10 |
    11 | {# 12 | {% include 'NetrunnerdbCardsBundle::footer.html.twig' %} 13 | #} 14 | {% endblock %} -------------------------------------------------------------------------------- /src/Netrunnerdb/CardsBundle/Tests/Controller/CardControllerTest.php: -------------------------------------------------------------------------------- 1 | request('GET', '/admin/card/'); 17 | $this->assertEquals(200, $client->getResponse()->getStatusCode(), "Unexpected HTTP status code for GET /admin/card/"); 18 | $crawler = $client->click($crawler->selectLink('Create a new entry')->link()); 19 | 20 | // Fill in the form and submit it 21 | $form = $crawler->selectButton('Create')->form(array( 22 | 'netrunnerdb_cardsbundle_cardtype[field_name]' => 'Test', 23 | // ... other fields to fill 24 | )); 25 | 26 | $client->submit($form); 27 | $crawler = $client->followRedirect(); 28 | 29 | // Check data in the show view 30 | $this->assertGreaterThan(0, $crawler->filter('td:contains("Test")')->count(), 'Missing element td:contains("Test")'); 31 | 32 | // Edit the entity 33 | $crawler = $client->click($crawler->selectLink('Edit')->link()); 34 | 35 | $form = $crawler->selectButton('Edit')->form(array( 36 | 'netrunnerdb_cardsbundle_cardtype[field_name]' => 'Foo', 37 | // ... other fields to fill 38 | )); 39 | 40 | $client->submit($form); 41 | $crawler = $client->followRedirect(); 42 | 43 | // Check the element contains an attribute with value equals "Foo" 44 | $this->assertGreaterThan(0, $crawler->filter('[value="Foo"]')->count(), 'Missing element [value="Foo"]'); 45 | 46 | // Delete the entity 47 | $client->submit($crawler->selectButton('Delete')->form()); 48 | $crawler = $client->followRedirect(); 49 | 50 | // Check the entity has been delete on the list 51 | $this->assertNotRegExp('/Foo/', $client->getResponse()->getContent()); 52 | } 53 | 54 | */ 55 | } 56 | -------------------------------------------------------------------------------- /src/Netrunnerdb/CardsBundle/Tests/Controller/CardsControllerTest.php: -------------------------------------------------------------------------------- 1 | request('GET', '/admin/cards/'); 17 | $this->assertTrue(200 === $client->getResponse()->getStatusCode()); 18 | $crawler = $client->click($crawler->selectLink('Create a new entry')->link()); 19 | 20 | // Fill in the form and submit it 21 | $form = $crawler->selectButton('Create')->form(array( 22 | 'netrunnerdb_cardsbundle_cardstype[field_name]' => 'Test', 23 | // ... other fields to fill 24 | )); 25 | 26 | $client->submit($form); 27 | $crawler = $client->followRedirect(); 28 | 29 | // Check data in the show view 30 | $this->assertTrue($crawler->filter('td:contains("Test")')->count() > 0); 31 | 32 | // Edit the entity 33 | $crawler = $client->click($crawler->selectLink('Edit')->link()); 34 | 35 | $form = $crawler->selectButton('Edit')->form(array( 36 | 'netrunnerdb_cardsbundle_cardstype[field_name]' => 'Foo', 37 | // ... other fields to fill 38 | )); 39 | 40 | $client->submit($form); 41 | $crawler = $client->followRedirect(); 42 | 43 | // Check the element contains an attribute with value equals "Foo" 44 | $this->assertTrue($crawler->filter('[value="Foo"]')->count() > 0); 45 | 46 | // Delete the entity 47 | $client->submit($crawler->selectButton('Delete')->form()); 48 | $crawler = $client->followRedirect(); 49 | 50 | // Check the entity has been delete on the list 51 | $this->assertNotRegExp('/Foo/', $client->getResponse()->getContent()); 52 | } 53 | 54 | */ 55 | } -------------------------------------------------------------------------------- /src/Netrunnerdb/CardsBundle/Tests/Controller/CycleControllerTest.php: -------------------------------------------------------------------------------- 1 | request('GET', '/admin/cycle/'); 17 | $this->assertEquals(200, $client->getResponse()->getStatusCode(), "Unexpected HTTP status code for GET /admin/cycle/"); 18 | $crawler = $client->click($crawler->selectLink('Create a new entry')->link()); 19 | 20 | // Fill in the form and submit it 21 | $form = $crawler->selectButton('Create')->form(array( 22 | 'netrunnerdb_cardsbundle_cycletype[field_name]' => 'Test', 23 | // ... other fields to fill 24 | )); 25 | 26 | $client->submit($form); 27 | $crawler = $client->followRedirect(); 28 | 29 | // Check data in the show view 30 | $this->assertGreaterThan(0, $crawler->filter('td:contains("Test")')->count(), 'Missing element td:contains("Test")'); 31 | 32 | // Edit the entity 33 | $crawler = $client->click($crawler->selectLink('Edit')->link()); 34 | 35 | $form = $crawler->selectButton('Edit')->form(array( 36 | 'netrunnerdb_cardsbundle_cycletype[field_name]' => 'Foo', 37 | // ... other fields to fill 38 | )); 39 | 40 | $client->submit($form); 41 | $crawler = $client->followRedirect(); 42 | 43 | // Check the element contains an attribute with value equals "Foo" 44 | $this->assertGreaterThan(0, $crawler->filter('[value="Foo"]')->count(), 'Missing element [value="Foo"]'); 45 | 46 | // Delete the entity 47 | $client->submit($crawler->selectButton('Delete')->form()); 48 | $crawler = $client->followRedirect(); 49 | 50 | // Check the entity has been delete on the list 51 | $this->assertNotRegExp('/Foo/', $client->getResponse()->getContent()); 52 | } 53 | 54 | */ 55 | } 56 | -------------------------------------------------------------------------------- /src/Netrunnerdb/CardsBundle/Tests/Controller/DefaultControllerTest.php: -------------------------------------------------------------------------------- 1 | request('GET', '/hello/Fabien'); 14 | 15 | $this->assertTrue($crawler->filter('html:contains("Hello Fabien")')->count() > 0); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Netrunnerdb/CardsBundle/Tests/Controller/PackControllerTest.php: -------------------------------------------------------------------------------- 1 | request('GET', '/admin/pack/'); 17 | $this->assertEquals(200, $client->getResponse()->getStatusCode(), "Unexpected HTTP status code for GET /admin/pack/"); 18 | $crawler = $client->click($crawler->selectLink('Create a new entry')->link()); 19 | 20 | // Fill in the form and submit it 21 | $form = $crawler->selectButton('Create')->form(array( 22 | 'netrunnerdb_cardsbundle_packtype[field_name]' => 'Test', 23 | // ... other fields to fill 24 | )); 25 | 26 | $client->submit($form); 27 | $crawler = $client->followRedirect(); 28 | 29 | // Check data in the show view 30 | $this->assertGreaterThan(0, $crawler->filter('td:contains("Test")')->count(), 'Missing element td:contains("Test")'); 31 | 32 | // Edit the entity 33 | $crawler = $client->click($crawler->selectLink('Edit')->link()); 34 | 35 | $form = $crawler->selectButton('Edit')->form(array( 36 | 'netrunnerdb_cardsbundle_packtype[field_name]' => 'Foo', 37 | // ... other fields to fill 38 | )); 39 | 40 | $client->submit($form); 41 | $crawler = $client->followRedirect(); 42 | 43 | // Check the element contains an attribute with value equals "Foo" 44 | $this->assertGreaterThan(0, $crawler->filter('[value="Foo"]')->count(), 'Missing element [value="Foo"]'); 45 | 46 | // Delete the entity 47 | $client->submit($crawler->selectButton('Delete')->form()); 48 | $crawler = $client->followRedirect(); 49 | 50 | // Check the entity has been delete on the list 51 | $this->assertNotRegExp('/Foo/', $client->getResponse()->getContent()); 52 | } 53 | 54 | */ 55 | } 56 | -------------------------------------------------------------------------------- /src/Netrunnerdb/CardsBundle/Tests/Controller/RulingsControllerTest.php: -------------------------------------------------------------------------------- 1 | request('GET', '/admin/rulings/'); 17 | $this->assertTrue(200 === $client->getResponse()->getStatusCode()); 18 | $crawler = $client->click($crawler->selectLink('Create a new entry')->link()); 19 | 20 | // Fill in the form and submit it 21 | $form = $crawler->selectButton('Create')->form(array( 22 | 'netrunnerdb_cardsbundle_rulingstype[field_name]' => 'Test', 23 | // ... other fields to fill 24 | )); 25 | 26 | $client->submit($form); 27 | $crawler = $client->followRedirect(); 28 | 29 | // Check data in the show view 30 | $this->assertTrue($crawler->filter('td:contains("Test")')->count() > 0); 31 | 32 | // Edit the entity 33 | $crawler = $client->click($crawler->selectLink('Edit')->link()); 34 | 35 | $form = $crawler->selectButton('Edit')->form(array( 36 | 'netrunnerdb_cardsbundle_rulingstype[field_name]' => 'Foo', 37 | // ... other fields to fill 38 | )); 39 | 40 | $client->submit($form); 41 | $crawler = $client->followRedirect(); 42 | 43 | // Check the element contains an attribute with value equals "Foo" 44 | $this->assertTrue($crawler->filter('[value="Foo"]')->count() > 0); 45 | 46 | // Delete the entity 47 | $client->submit($crawler->selectButton('Delete')->form()); 48 | $crawler = $client->followRedirect(); 49 | 50 | // Check the entity has been delete on the list 51 | $this->assertNotRegExp('/Foo/', $client->getResponse()->getContent()); 52 | } 53 | 54 | */ 55 | } -------------------------------------------------------------------------------- /src/Netrunnerdb/CardsBundle/Tests/Controller/RxcControllerTest.php: -------------------------------------------------------------------------------- 1 | request('GET', '/admin/rxc/'); 17 | $this->assertTrue(200 === $client->getResponse()->getStatusCode()); 18 | $crawler = $client->click($crawler->selectLink('Create a new entry')->link()); 19 | 20 | // Fill in the form and submit it 21 | $form = $crawler->selectButton('Create')->form(array( 22 | 'netrunnerdb_cardsbundle_rxctype[field_name]' => 'Test', 23 | // ... other fields to fill 24 | )); 25 | 26 | $client->submit($form); 27 | $crawler = $client->followRedirect(); 28 | 29 | // Check data in the show view 30 | $this->assertTrue($crawler->filter('td:contains("Test")')->count() > 0); 31 | 32 | // Edit the entity 33 | $crawler = $client->click($crawler->selectLink('Edit')->link()); 34 | 35 | $form = $crawler->selectButton('Edit')->form(array( 36 | 'netrunnerdb_cardsbundle_rxctype[field_name]' => 'Foo', 37 | // ... other fields to fill 38 | )); 39 | 40 | $client->submit($form); 41 | $crawler = $client->followRedirect(); 42 | 43 | // Check the element contains an attribute with value equals "Foo" 44 | $this->assertTrue($crawler->filter('[value="Foo"]')->count() > 0); 45 | 46 | // Delete the entity 47 | $client->submit($crawler->selectButton('Delete')->form()); 48 | $crawler = $client->followRedirect(); 49 | 50 | // Check the entity has been delete on the list 51 | $this->assertNotRegExp('/Foo/', $client->getResponse()->getContent()); 52 | } 53 | 54 | */ 55 | } -------------------------------------------------------------------------------- /src/Netrunnerdb/CardsBundle/Tests/Controller/TypeControllerTest.php: -------------------------------------------------------------------------------- 1 | request('GET', '/admin/type/'); 17 | $this->assertEquals(200, $client->getResponse()->getStatusCode(), "Unexpected HTTP status code for GET /admin/type/"); 18 | $crawler = $client->click($crawler->selectLink('Create a new entry')->link()); 19 | 20 | // Fill in the form and submit it 21 | $form = $crawler->selectButton('Create')->form(array( 22 | 'netrunnerdb_cardsbundle_typetype[field_name]' => 'Test', 23 | // ... other fields to fill 24 | )); 25 | 26 | $client->submit($form); 27 | $crawler = $client->followRedirect(); 28 | 29 | // Check data in the show view 30 | $this->assertGreaterThan(0, $crawler->filter('td:contains("Test")')->count(), 'Missing element td:contains("Test")'); 31 | 32 | // Edit the entity 33 | $crawler = $client->click($crawler->selectLink('Edit')->link()); 34 | 35 | $form = $crawler->selectButton('Edit')->form(array( 36 | 'netrunnerdb_cardsbundle_typetype[field_name]' => 'Foo', 37 | // ... other fields to fill 38 | )); 39 | 40 | $client->submit($form); 41 | $crawler = $client->followRedirect(); 42 | 43 | // Check the element contains an attribute with value equals "Foo" 44 | $this->assertGreaterThan(0, $crawler->filter('[value="Foo"]')->count(), 'Missing element [value="Foo"]'); 45 | 46 | // Delete the entity 47 | $client->submit($crawler->selectButton('Delete')->form()); 48 | $crawler = $client->followRedirect(); 49 | 50 | // Check the entity has been delete on the list 51 | $this->assertNotRegExp('/Foo/', $client->getResponse()->getContent()); 52 | } 53 | 54 | */ 55 | } 56 | -------------------------------------------------------------------------------- /src/Netrunnerdb/UserBundle/Command/DeleteInactiveCommand.php: -------------------------------------------------------------------------------- 1 | setName('nrdb:inactive-users') 19 | ->setDescription('Delete users inactive since 48 hours') 20 | ; 21 | } 22 | 23 | protected function execute(InputInterface $input, OutputInterface $output) 24 | { 25 | $em = $this->getContainer()->get('doctrine')->getManager(); 26 | $limit = new \DateTime(); 27 | $limit->sub(new \DateInterval('PT48H')); 28 | $count = 0; 29 | 30 | $users = $em->getRepository('NetrunnerdbUserBundle:User')->findBy(array('enabled' => false)); 31 | foreach($users as $user) { 32 | /* @var $user Netrunnerdb\UserBundle\Entity\User */ 33 | if($user->getCreation() < $limit) { 34 | $count++; 35 | $em->remove($user); 36 | } 37 | } 38 | $em->flush(); 39 | $output->writeln(date('c') . " Delete $count inactive users."); 40 | } 41 | } -------------------------------------------------------------------------------- /src/Netrunnerdb/UserBundle/Controller/RegistrationController.php: -------------------------------------------------------------------------------- 1 | container->get('fos_user.user_manager'); 18 | 19 | $user = $userManager->findUserByConfirmationToken($token); 20 | 21 | if (null === $user) { 22 | // User with token not found. Do whatever you want here 23 | return new RedirectResponse($this->container->get('router')->generate('fos_user_security_login')); 24 | } 25 | else{ 26 | // Token found. Letting the FOSUserBundle's action handle the confirmation 27 | return parent::confirmAction($request, $token); 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /src/Netrunnerdb/UserBundle/Controller/SecurityController.php: -------------------------------------------------------------------------------- 1 | getSession(); 16 | 17 | if ($request->attributes->has(SecurityContext::AUTHENTICATION_ERROR)) { 18 | $error = $request->attributes->get(SecurityContext::AUTHENTICATION_ERROR); 19 | } elseif (null !== $session && $session->has(SecurityContext::AUTHENTICATION_ERROR)) { 20 | $error = $session->get(SecurityContext::AUTHENTICATION_ERROR); 21 | $session->remove(SecurityContext::AUTHENTICATION_ERROR); 22 | } else { 23 | $error = ''; 24 | } 25 | 26 | if ($error) { 27 | $error = $error->getMessage(); 28 | } 29 | 30 | $lastUsername = (null === $session) ? '' : $session->get(SecurityContext::LAST_USERNAME); 31 | 32 | return $this->render( 33 | 'NetrunnerdbUserBundle:Security:login.html.twig', 34 | array( 35 | 'last_username' => $lastUsername, 36 | 'error' => $error, 37 | ) 38 | ); 39 | } 40 | 41 | public function loginCheckAction(Request $request) 42 | { 43 | 44 | } 45 | } -------------------------------------------------------------------------------- /src/Netrunnerdb/UserBundle/DependencyInjection/Configuration.php: -------------------------------------------------------------------------------- 1 | root('netrunnerdb_user'); 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/Netrunnerdb/UserBundle/DependencyInjection/NetrunnerdbUserExtension.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/Netrunnerdb/UserBundle/Entity/AccessToken.php: -------------------------------------------------------------------------------- 1 | name; 30 | } 31 | 32 | public function setName($name) 33 | { 34 | $this->name = $name; 35 | } 36 | } -------------------------------------------------------------------------------- /src/Netrunnerdb/UserBundle/Entity/RefreshToken.php: -------------------------------------------------------------------------------- 1 | userRepository = $userRepository; 20 | } 21 | 22 | public function loadUserByUsername($username) 23 | { 24 | $q = $this->userRepository 25 | ->createQueryBuilder('u') 26 | ->where('u.username = :username OR u.email = :email') 27 | ->setParameter('username', $username) 28 | ->setParameter('email', $username) 29 | ->getQuery(); 30 | 31 | try { 32 | $user = $q->getSingleResult(); 33 | } catch (NoResultException $e) { 34 | $message = sprintf( 35 | 'Unable to find an active admin NetrunnerdbUserBundle:User object identified by "%s".', 36 | $username 37 | ); 38 | throw new UsernameNotFoundException($message, 0, $e); 39 | } 40 | 41 | return $user; 42 | } 43 | 44 | public function refreshUser(UserInterface $user) 45 | { 46 | $class = get_class($user); 47 | if (!$this->supportsClass($class)) { 48 | throw new UnsupportedUserException( 49 | sprintf( 50 | 'Instances of "%s" are not supported.', 51 | $class 52 | ) 53 | ); 54 | } 55 | 56 | return $this->userRepository->find($user->getId()); 57 | } 58 | 59 | public function supportsClass($class) 60 | { 61 | return $this->userRepository->getClassName() === $class 62 | || is_subclass_of($class, $this->userRepository->getClassName()); 63 | } 64 | } -------------------------------------------------------------------------------- /src/Netrunnerdb/UserBundle/Resources/config/doctrine/AccessToken.orm.yml: -------------------------------------------------------------------------------- 1 | Netrunnerdb\UserBundle\Entity\AccessToken: 2 | type: entity 3 | table: access_token 4 | manyToOne: 5 | client: 6 | targetEntity: Client 7 | nullable: false 8 | joinColumn: 9 | name: client_id 10 | referencedColumnName: id 11 | user: 12 | targetEntity: User 13 | nullable: false 14 | joinColumn: 15 | name: user_id 16 | referencedColumnName: id 17 | fields: 18 | id: 19 | type: integer 20 | id: true 21 | generator: 22 | strategy: AUTO 23 | -------------------------------------------------------------------------------- /src/Netrunnerdb/UserBundle/Resources/config/doctrine/AuthCode.orm.yml: -------------------------------------------------------------------------------- 1 | Netrunnerdb\UserBundle\Entity\AuthCode: 2 | type: entity 3 | table: auth_code 4 | manyToOne: 5 | client: 6 | targetEntity: Client 7 | nullable: false 8 | joinColumn: 9 | name: client_id 10 | referencedColumnName: id 11 | user: 12 | targetEntity: User 13 | nullable: false 14 | joinColumn: 15 | name: user_id 16 | referencedColumnName: id 17 | fields: 18 | id: 19 | type: integer 20 | id: true 21 | generator: 22 | strategy: AUTO 23 | -------------------------------------------------------------------------------- /src/Netrunnerdb/UserBundle/Resources/config/doctrine/Client.orm.yml: -------------------------------------------------------------------------------- 1 | Netrunnerdb\UserBundle\Entity\Client: 2 | type: entity 3 | table: client 4 | fields: 5 | id: 6 | type: integer 7 | id: true 8 | generator: 9 | strategy: AUTO 10 | name: 11 | type: string 12 | 13 | -------------------------------------------------------------------------------- /src/Netrunnerdb/UserBundle/Resources/config/doctrine/RefreshToken.orm.yml: -------------------------------------------------------------------------------- 1 | Netrunnerdb\UserBundle\Entity\RefreshToken: 2 | type: entity 3 | table: refresh_token 4 | manyToOne: 5 | client: 6 | targetEntity: Client 7 | nullable: false 8 | joinColumn: 9 | name: client_id 10 | referencedColumnName: id 11 | user: 12 | targetEntity: User 13 | nullable: false 14 | joinColumn: 15 | name: user_id 16 | referencedColumnName: id 17 | fields: 18 | id: 19 | type: integer 20 | id: true 21 | generator: 22 | strategy: AUTO 23 | -------------------------------------------------------------------------------- /src/Netrunnerdb/UserBundle/Resources/config/routing.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilberterik/netrunnerdb/a512f74ce902e6ba271a5f6bbfdb02d142be0b43/src/Netrunnerdb/UserBundle/Resources/config/routing.yml -------------------------------------------------------------------------------- /src/Netrunnerdb/UserBundle/Resources/config/services.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | # netrunnerdb_user.example.class: Netrunnerdb\UserBundle\Example 3 | 4 | services: 5 | # netrunnerdb_user.example: 6 | # class: %netrunnerdb_user.example.class% 7 | # arguments: [@service_id, "plain_value", %parameter%] 8 | -------------------------------------------------------------------------------- /src/Netrunnerdb/UserBundle/Resources/doc/index.rst: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilberterik/netrunnerdb/a512f74ce902e6ba271a5f6bbfdb02d142be0b43/src/Netrunnerdb/UserBundle/Resources/doc/index.rst -------------------------------------------------------------------------------- /src/Netrunnerdb/UserBundle/Resources/translations/messages.fr.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Symfony2 is great 7 | J'aime Symfony2 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/Netrunnerdb/UserBundle/Resources/views/Security/login.html.twig: -------------------------------------------------------------------------------- 1 | {% extends 'NetrunnerdbBuilderBundle::layout.html.twig' %} 2 | 3 | {% block navbar %}{% endblock %} 4 | 5 | {% block body %} 6 | 7 |
    8 | 9 |
    10 |
    11 |
    12 |
    13 |

    NetrunnerDB Authentication

    14 |
    15 |
    16 |
    17 | 18 |

    19 | Welcome on NetrunnerDB. Please log in to proceed. Your password will remain confidential. 20 |

    21 |
    22 | {% if(error) %} 23 |
    {{ error }}
    24 | {% endif %} 25 |
    26 | 27 |

    28 |
    29 |
    30 | 31 |

    32 |
    33 |
    34 | 35 |
    36 |
    37 |
    38 | 39 |
    40 |
    41 |
    42 |
    43 |
    44 | 45 | {% endblock %} 46 | 47 | {% block footer %}{% endblock %} -------------------------------------------------------------------------------- /src/Netrunnerdb/UserBundle/Tests/Controller/DefaultControllerTest.php: -------------------------------------------------------------------------------- 1 | request('GET', '/hello/Fabien'); 14 | 15 | $this->assertTrue($crawler->filter('html:contains("Hello Fabien")')->count() > 0); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /web/app.php: -------------------------------------------------------------------------------- 1 | register(true); 14 | */ 15 | 16 | require_once __DIR__.'/../app/AppKernel.php'; 17 | require_once __DIR__.'/../app/AppCache.php'; 18 | 19 | $kernel = new AppKernel('prod', false); 20 | $kernel->loadClassCache(); 21 | $kernel = new AppCache($kernel); 22 | Request::enableHttpMethodParameterOverride(); 23 | $request = Request::createFromGlobals(); 24 | $response = $kernel->handle($request); 25 | $response->send(); 26 | $kernel->terminate($request, $response); 27 | -------------------------------------------------------------------------------- /web/app_dev.php: -------------------------------------------------------------------------------- 1 | loadClassCache(); 27 | Request::enableHttpMethodParameterOverride(); 28 | $request = Request::createFromGlobals(); 29 | $response = $kernel->handle($request); 30 | $response->send(); 31 | $kernel->terminate($request, $response); 32 | -------------------------------------------------------------------------------- /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 | --------------------------------------------------------------------------------