├── .gitignore
├── .htaccess.dist
├── LICENSE
├── Makefile
├── README.md
├── app
├── .htaccess
├── AppCache.php
├── AppKernel.php
├── Resources
│ ├── FOSOAuthServerBundle
│ │ └── views
│ │ │ └── Authorize
│ │ │ ├── authorize.html.twig
│ │ │ └── authorize_content.html.twig
│ ├── FOSUserBundle
│ │ └── views
│ │ │ ├── Security
│ │ │ └── login.html.twig
│ │ │ └── layout.html.twig
│ ├── TwigBundle
│ │ └── views
│ │ │ └── Exception
│ │ │ └── error404.html.twig
│ └── views
│ │ ├── Activity
│ │ ├── activity.html.twig
│ │ ├── decklist_comment.html.twig
│ │ ├── decklist_publish.html.twig
│ │ ├── review_comment.html.twig
│ │ └── review_publish.html.twig
│ │ ├── Banlists
│ │ └── banlists.html.twig
│ │ ├── Builder
│ │ ├── deck.html.twig
│ │ ├── decks.html.twig
│ │ ├── deckview.html.twig
│ │ ├── directimport.html.twig
│ │ ├── draw-simulator.html.twig
│ │ └── initbuild.html.twig
│ │ ├── Decklist
│ │ ├── decklist-row-always-xs.html.twig
│ │ ├── decklist-row.html.twig
│ │ ├── decklist.html.twig
│ │ └── decklists.html.twig
│ │ ├── Default
│ │ ├── about.html.twig
│ │ ├── allcomments.html.twig
│ │ ├── allsets.html.twig
│ │ ├── apiIntro.html.twig
│ │ ├── decklist_of_the_week.html.twig
│ │ ├── donators.html.twig
│ │ ├── index.html.twig
│ │ ├── navbar-factions.html.twig
│ │ ├── private_profile.html.twig
│ │ ├── public_profile.html.twig
│ │ ├── publish_decklist_form.html.twig
│ │ ├── recent_decklists.html.twig
│ │ ├── recent_reviews.html.twig
│ │ ├── syntax.html.twig
│ │ ├── update-log.html.twig
│ │ └── usercomments.html.twig
│ │ ├── Diff
│ │ └── decklistsDiff.html.twig
│ │ ├── Emails
│ │ ├── decklist-moderation-0.html.twig
│ │ ├── decklist-moderation-2.html.twig
│ │ ├── decklist-moderation-3.html.twig
│ │ ├── newcomment_author.html.twig
│ │ ├── newcomment_commenter.html.twig
│ │ └── newcomment_mentionned.html.twig
│ │ ├── Faction
│ │ └── faction.html.twig
│ │ ├── Formats
│ │ └── formats.html.twig
│ │ ├── Illustrators
│ │ └── illustrators.html.twig
│ │ ├── Oauth
│ │ ├── explorer.html.twig
│ │ └── initiate.html.twig
│ │ ├── Prebuilt
│ │ └── view.html.twig
│ │ ├── Reviews
│ │ └── reviews.html.twig
│ │ ├── Rotation
│ │ └── rotation.html.twig
│ │ ├── RulesTextUpdates
│ │ ├── 2025_03_24_elevation_release.html.twig
│ │ └── rules_text_updates.html.twig
│ │ ├── Rulings
│ │ └── list.html.twig
│ │ ├── Scripts
│ │ ├── api.html.twig
│ │ ├── nsg_formats.html.twig
│ │ └── panels.html.twig
│ │ ├── Search
│ │ ├── advanced-search.html.twig
│ │ ├── card.html.twig
│ │ ├── display-full.html.twig
│ │ ├── display-images.html.twig
│ │ ├── display-list.html.twig
│ │ ├── display-rulings.html.twig
│ │ ├── display-set.html.twig
│ │ ├── display-short.html.twig
│ │ ├── display-text.html.twig
│ │ ├── display-zoom.html.twig
│ │ ├── display.html.twig
│ │ ├── form.html.twig
│ │ ├── pagination.html.twig
│ │ ├── paginationitem.html.twig
│ │ ├── search.html.twig
│ │ ├── searchbar.html.twig
│ │ ├── searchoptions.html.twig
│ │ ├── searchtooltip.html.twig
│ │ └── setnavigation.html.twig
│ │ ├── Security
│ │ └── login.html.twig
│ │ ├── Tools
│ │ ├── demo-ext-decklist.html.twig
│ │ └── demo.html.twig
│ │ ├── base.html.twig
│ │ ├── layout.html.twig
│ │ └── octgn.xml.twig
└── config
│ ├── config.yml
│ ├── config_dev.yml
│ ├── config_prod.yml
│ ├── config_test.yml
│ ├── parameters.yml.dist
│ ├── routing.yml
│ ├── routing_dev.yml
│ ├── security.yml
│ └── services.yml
├── bin
├── console
├── publish-release.sh
└── symfony_requirements
├── composer.json
├── composer.lock
├── convert2utf8mb4.sql
├── docker
├── .gitignore
├── .htaccess
├── 000-default.conf
├── Dockerfile
├── README.md
├── app_dev.php
├── dev-parameters.yml
├── docker-compose.yml
├── docker-first-run.sh
├── import-cards.sh
├── local-bash.sh
├── local-mysql.sh
└── prepare-and-build.sh
├── phpunit.xml.dist
├── src
├── .htaccess
└── AppBundle
│ ├── AppBundle.php
│ ├── Behavior
│ └── Entity
│ │ ├── CodeNameInterface.php
│ │ ├── NormalizableInterface.php
│ │ ├── SlotInterface.php
│ │ └── TimestampableInterface.php
│ ├── Command
│ ├── CleanupCommand.php
│ ├── CommentOnlyUserSummaryCommand.php
│ ├── CommentizeCommand.php
│ ├── CreateClientCommand.php
│ ├── DonatorCommand.php
│ ├── ExportStdCommand.php
│ ├── HighlightCommand.php
│ ├── ImportStdCommand.php
│ ├── LegalityActiveMwlCommand.php
│ ├── LegalityApplyMwlCommand.php
│ ├── LegalityDecklistsLimitCommand.php
│ ├── LegalityDecklistsMwlCommand.php
│ ├── LegalityDecklistsRotationCommand.php
│ ├── LegalityRemoveMwlCommand.php
│ ├── Moderation
│ │ ├── ModerationActionCommand.php
│ │ └── ModerationLogCommand.php
│ ├── RebirthCommand.php
│ ├── RemoveDecklistCommand.php
│ ├── SetDecklistsUuidCommand.php
│ ├── SetDecksUuidCommand.php
│ ├── SpamUserLockdownCommand.php
│ ├── SuggestionsCommand.php
│ └── UserSummaryCommand.php
│ ├── Controller
│ ├── AbstractOauthController.php
│ ├── ApiDocController.php
│ ├── BanlistsController.php
│ ├── BuilderController.php
│ ├── ClaimsController.php
│ ├── DecklistsController.php
│ ├── DefaultController.php
│ ├── FactionController.php
│ ├── FormatsController.php
│ ├── IllustratorsController.php
│ ├── IndexController.php
│ ├── InfoController.php
│ ├── ModflagsController.php
│ ├── OauthController.php
│ ├── PrebuiltController.php
│ ├── PrivateApi20Controller.php
│ ├── PublicApi20Controller.php
│ ├── RedirectAfterLogout.php
│ ├── ReviewController.php
│ ├── RotationController.php
│ ├── RulesTextUpdatesController.php
│ ├── RulingController.php
│ ├── SearchController.php
│ ├── SecurityController.php
│ ├── SocialController.php
│ ├── TagController.php
│ └── ToolsController.php
│ ├── DQL
│ ├── BinaryFunction.php
│ └── ReplaceFunction.php
│ ├── DataFixtures
│ └── ORM
│ │ └── LoadUserData.php
│ ├── Entity
│ ├── AccessToken.php
│ ├── AuthCode.php
│ ├── Card.php
│ ├── Claim.php
│ ├── Client.php
│ ├── Comment.php
│ ├── Cycle.php
│ ├── Deck.php
│ ├── Deckchange.php
│ ├── Decklist.php
│ ├── Decklistslot.php
│ ├── Deckslot.php
│ ├── Faction.php
│ ├── Highlight.php
│ ├── Legality.php
│ ├── Moderation.php
│ ├── Modflag.php
│ ├── Mwl.php
│ ├── MwlCard.php
│ ├── Pack.php
│ ├── Prebuilt.php
│ ├── Prebuiltslot.php
│ ├── RefreshToken.php
│ ├── Review.php
│ ├── Reviewcomment.php
│ ├── Rotation.php
│ ├── Ruling.php
│ ├── Side.php
│ ├── Tournament.php
│ ├── Type.php
│ └── User.php
│ ├── EventListener
│ └── DecklistListener.php
│ ├── Repository
│ ├── CardRepository.php
│ ├── CycleRepository.php
│ ├── FactionRepository.php
│ ├── PackRepository.php
│ ├── RulingRepository.php
│ ├── SideRepository.php
│ └── TypeRepository.php
│ ├── Resources
│ └── config
│ │ ├── doctrine
│ │ ├── AccessToken.orm.yml
│ │ ├── AuthCode.orm.yml
│ │ ├── Card.orm.yml
│ │ ├── Claim.orm.yml
│ │ ├── Client.orm.yml
│ │ ├── Comment.orm.yml
│ │ ├── Cycle.orm.yml
│ │ ├── Deck.orm.yml
│ │ ├── Deckchange.orm.yml
│ │ ├── Decklist.orm.yml
│ │ ├── Decklistslot.orm.yml
│ │ ├── Deckslot.orm.yml
│ │ ├── Faction.orm.yml
│ │ ├── Highlight.orm.yml
│ │ ├── Legality.orm.yml
│ │ ├── Moderation.orm.yml
│ │ ├── Modflag.orm.yml
│ │ ├── Mwl.orm.yml
│ │ ├── MwlCard.orm.yml
│ │ ├── Pack.orm.yml
│ │ ├── Prebuilt.orm.yml
│ │ ├── Prebuiltslot.orm.yml
│ │ ├── RefreshToken.orm.yml
│ │ ├── Review.orm.yml
│ │ ├── Reviewcomment.orm.yml
│ │ ├── Rotation.orm.yml
│ │ ├── Ruling.orm.yml
│ │ ├── Side.orm.yml
│ │ ├── Tournament.orm.yml
│ │ ├── Type.orm.yml
│ │ └── User.orm.yml
│ │ └── routing.yml
│ ├── Service
│ ├── ActivityHelper.php
│ ├── CardsData.php
│ ├── DeckManager.php
│ ├── DecklistManager.php
│ ├── DiffService.php
│ ├── Illustrators.php
│ ├── Judge.php
│ ├── ModerationHelper.php
│ ├── PersonalizationHelper.php
│ ├── RepositoryFactory.php
│ ├── RotationService.php
│ └── TextProcessor.php
│ └── Twig
│ └── AppExtension.php
├── tests
└── AppBundle
│ └── Controller
│ └── DefaultControllerTest.php
├── var
├── SymfonyRequirements.php
├── cache
│ └── .gitkeep
├── logs
│ └── .gitkeep
└── sessions
│ └── .gitkeep
└── web
├── .htaccess
├── app.php
├── app_dev.php
├── apple-touch-icon.png
├── become_a_patron_button.png
├── card_aliases.txt
├── config.php
├── css
└── style.css
├── ext-decklist.js
├── favicon.ico
├── favicon.png
├── fonts
├── Lato-Bold.eot
├── Lato-Bold.ttf
├── Lato-Bold.woff
├── Lato-Bold.woff2
├── Lato-BoldItalic.eot
├── Lato-BoldItalic.ttf
├── Lato-BoldItalic.woff
├── Lato-BoldItalic.woff2
├── Lato-Italic.eot
├── Lato-Italic.ttf
├── Lato-Italic.woff
├── Lato-Italic.woff2
├── Lato-Light.eot
├── Lato-Light.ttf
├── Lato-Light.woff
├── Lato-Light.woff2
├── Lato-LightItalic.eot
├── Lato-LightItalic.ttf
├── Lato-LightItalic.woff
├── Lato-LightItalic.woff2
├── Lato-Regular.eot
├── Lato-Regular.ttf
├── Lato-Regular.woff
├── Lato-Regular.woff2
├── netrunner.eot
├── netrunner.svg
├── netrunner.ttf
├── netrunner.woff
├── nrdb.eot
├── nrdb.svg
├── nrdb.ttf
└── nrdb.woff
├── icon.png
├── images
├── factions
│ ├── 16px
│ │ ├── adam.png
│ │ ├── anarch.png
│ │ ├── apex.png
│ │ ├── criminal.png
│ │ ├── haas-bioroid.png
│ │ ├── jinteki.png
│ │ ├── nbn.png
│ │ ├── neutral-corp.png
│ │ ├── neutral-runner.png
│ │ ├── shaper.png
│ │ ├── sunny-lebeau.png
│ │ └── weyland-consortium.png
│ └── 38px
│ │ ├── anarch.png
│ │ ├── criminal.png
│ │ ├── haas-bioroid.png
│ │ ├── jinteki.png
│ │ ├── nbn.png
│ │ ├── neutral-corp.png
│ │ ├── neutral-runner.png
│ │ ├── shaper.png
│ │ └── weyland-consortium.png
├── flags
│ ├── 128px
│ │ ├── flag_de.png
│ │ ├── flag_en.png
│ │ ├── flag_es.png
│ │ ├── flag_fr.png
│ │ ├── flag_he.png
│ │ ├── flag_it.png
│ │ ├── flag_jp.png
│ │ ├── flag_kr.png
│ │ ├── flag_pl.png
│ │ ├── flag_pt.png
│ │ └── flag_zh.png
│ └── 32px
│ │ ├── flag_de.png
│ │ ├── flag_en.png
│ │ ├── flag_es.png
│ │ ├── flag_fr.png
│ │ ├── flag_he.png
│ │ ├── flag_it.png
│ │ ├── flag_jp.png
│ │ ├── flag_kr.png
│ │ ├── flag_pl.png
│ │ ├── flag_pt.png
│ │ └── flag_zh.png
├── icons.svg
└── types
│ ├── agenda.png
│ ├── asset.png
│ ├── event.png
│ ├── hardware.png
│ ├── ice.png
│ ├── identity.png
│ ├── operation.png
│ ├── program.png
│ ├── resource.png
│ └── upgrade.png
├── js
├── deck.v2.js
├── decklist.v2.js
├── decklists.js
├── decks.v2.js
├── deckview.v2.js
├── directimport.js
├── index.js
├── initbuild.js
├── nrdb.card_modal.js
├── nrdb.data.js
├── nrdb.deck_browser.js
├── nrdb.deck_gallery.js
├── nrdb.diff.js
├── nrdb.draw_simulator.js
├── nrdb.format.js
├── nrdb.fuzzy_search.js
├── nrdb.js
├── nrdb.settings.js
├── nrdb.smart_filter.js
├── nrdb.suggestions.js
├── nrdb.theme.js
├── nrdb.tip.js
├── nrdb.ui.js
├── nrdb.user.js
├── profile.js
├── publish_deck_form.v2.js
├── rotation.js
├── search.js
├── topnav.js
├── typeahead.jquery.js
├── typeahead.jquery.min.js
└── zoom.js
├── latofonts.css
├── lib
├── bootstrap-toggle-checklist.js
└── jquery-persistence.js
├── netrunnerfont.css
├── robots.txt
├── selection.json
└── update_log.example.txt
/.gitignore:
--------------------------------------------------------------------------------
1 | /.web-server-pid
2 | /app/config/parameters.yml
3 | /build/
4 | /phpunit.xml
5 | /var/*
6 | !/var/cache
7 | /var/cache/*
8 | !var/cache/.gitkeep
9 | !/var/logs
10 | /var/logs/*
11 | !var/logs/.gitkeep
12 | !/var/sessions
13 | /var/sessions/*
14 | !var/sessions/.gitkeep
15 | !var/SymfonyRequirements.php
16 | /var/HTML
17 | /vendor/
18 | /web/bundles/
19 | .php_cs.cache
20 | /web/card_image/
21 | /web/corp.json
22 | /web/runner.json
23 | /web/update_log.txt
24 |
--------------------------------------------------------------------------------
/.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 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2012-2016 Cédric Bertolini
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 |
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | install:
2 | composer install
3 | php bin/console assets:install --symlink web
4 |
5 | test:
6 | vendor/bin/phpstan analyze src --level 7
7 |
--------------------------------------------------------------------------------
/app/.htaccess:
--------------------------------------------------------------------------------
1 |
2 | Require all denied
3 |
4 |
5 | Order deny,allow
6 | Deny from all
7 |
8 |
--------------------------------------------------------------------------------
/app/AppCache.php:
--------------------------------------------------------------------------------
1 |
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 %}
22 |
--------------------------------------------------------------------------------
/app/Resources/FOSOAuthServerBundle/views/Authorize/authorize_content.html.twig:
--------------------------------------------------------------------------------
1 |
2 |
3 |
NetrunnerDB Authorization
4 |
5 |
6 |
7 | The application {{ client.name }} would like to connect to your account, {{ app.user.username }} .
8 |
9 |
10 | If you want to authorize a different account than {{ app.user.username }} , please log out and log back in .
11 |
12 |
13 | If you agree, {{ client.name }} will be able to perform the following operations on your behalf:
14 |
15 |
16 | Read your decks saved on NetrunnerDB
17 | Modify a deck or create a new one on NetrunnerDB
18 |
19 |
20 |
21 | {{ form_start(form) }}
22 |
23 |
24 | {{ form_row(form.client_id) }}
25 | {{ form_row(form.response_type) }}
26 | {{ form_row(form.redirect_uri) }}
27 | {{ form_row(form.state) }}
28 | {{ form_row(form.scope) }}
29 | {{ form_rest(form) }}
30 | {{ form_end(form) }}
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/app/Resources/FOSUserBundle/views/layout.html.twig:
--------------------------------------------------------------------------------
1 | {% extends '/layout.html.twig' %}
2 |
3 | {% block head %}
4 |
42 | {% endblock %}
43 |
44 | {% block body %}
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 | {% block fos_user_content %}{% endblock %}
55 |
56 |
57 |
58 |
59 |
60 |
61 | {% endblock %}
62 |
--------------------------------------------------------------------------------
/app/Resources/TwigBundle/views/Exception/error404.html.twig:
--------------------------------------------------------------------------------
1 | {% extends '/layout.html.twig' %}
2 | {% block pagetitle %}Error 404{% endblock %}
3 | {% block body %}
4 |
5 |
Sorry.
6 |
I tried very hard, but I couldn't find what you're looking for.
7 |
And that's pretty much it.
8 |
9 | {% endblock %}
10 | {% block footer %}
11 | {% endblock %}
--------------------------------------------------------------------------------
/app/Resources/views/Activity/activity.html.twig:
--------------------------------------------------------------------------------
1 | {% extends '/layout.html.twig' %}
2 |
3 | {% block head %}
4 |
7 | {% endblock %}
8 | {% block body %}
9 |
10 |
11 |
12 |
13 |
Latest activity
14 | {% if items_by_day|length == 0 %}
15 |
Looks like nothing worth mentioning happened in the last {{ max }} days!
16 | {% else %}
17 | {% for item_by_day in items_by_day %}
18 |
{{ item_by_day.day }}
19 |
20 | {% for item in item_by_day.items %}
21 | {% if item.type == 'DECKLIST_PUBLISH' %}
22 | {% include '/Activity/decklist_publish.html.twig' %}
23 | {% elseif item.type == 'DECKLIST_COMMENT' %}
24 | {% include '/Activity/decklist_comment.html.twig' %}
25 | {% elseif item.type == 'REVIEW_PUBLISH' %}
26 | {% include '/Activity/review_publish.html.twig' %}
27 | {% elseif item.type == 'REVIEW_COMMENT' %}
28 | {% include '/Activity/review_comment.html.twig' %}
29 | {% endif %}
30 | {% endfor %}
31 |
32 | {% endfor %}
33 | {% endif %}
34 | {% if app.user and app.user.following|length < 2 %}
35 |
To add users to your feed, go to their profile page and follow them.
36 | {% endif %}
37 |
38 |
39 |
40 |
41 |
42 |
43 | {% endblock %}
44 |
--------------------------------------------------------------------------------
/app/Resources/views/Activity/decklist_comment.html.twig:
--------------------------------------------------------------------------------
1 |
2 |
3 | {% if item.comment.author.id != app.user.id %}
4 |
5 | {% else %}
6 | You
7 | {% endif %}
8 | commented on the decklist
9 | {{ item.comment.decklist.name }}
10 |
11 |
--------------------------------------------------------------------------------
/app/Resources/views/Activity/decklist_publish.html.twig:
--------------------------------------------------------------------------------
1 |
2 |
3 | {% if item.decklist.user.id != app.user.id %}
4 | {{ item.decklist.user.username }}
5 | {% else %}
6 | You
7 | {% endif %}
8 | published the decklist
9 | {{ item.decklist.name }}
10 |
11 |
--------------------------------------------------------------------------------
/app/Resources/views/Activity/review_comment.html.twig:
--------------------------------------------------------------------------------
1 |
11 |
--------------------------------------------------------------------------------
/app/Resources/views/Activity/review_publish.html.twig:
--------------------------------------------------------------------------------
1 |
11 |
--------------------------------------------------------------------------------
/app/Resources/views/Builder/draw-simulator.html.twig:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Card draw simulator
5 |
6 |
7 |
8 | Draw: 1 2 3 4 5 Special all Reset
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/app/Resources/views/Decklist/decklist-row-always-xs.html.twig:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
9 |
10 | {{ decklist.lastpack }}
11 |
12 |
13 |
18 |
19 | {% if decklist.tournament %}
20 |
21 | {{ decklist.tournament }}
22 |
23 | {% endif %}
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/app/Resources/views/Default/allcomments.html.twig:
--------------------------------------------------------------------------------
1 | {% extends '/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 |
19 |
20 | {{ comment.text|raw }}
21 |
22 |
23 | {% endfor %}
24 |
25 |
26 |
27 |
28 |
29 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 | {% endblock %}
57 |
--------------------------------------------------------------------------------
/app/Resources/views/Default/allsets.html.twig:
--------------------------------------------------------------------------------
1 |
2 | {% for cycle in data %}
3 | {{ cycle.name }} {% if cycle.known != cycle.total %}({{cycle.known}}/{{cycle.total}}){% endif %}
4 | {% if cycle.packs is defined %}
5 |
6 | {% for pack in cycle.packs %}
7 | {{ pack.name }} {% if pack.known != pack.total %}({{pack.known}}/{{pack.total}}){% endif %}
8 | {% endfor %}
9 |
10 | {% endif %}
11 |
12 | {% endfor %}
13 |
14 |
--------------------------------------------------------------------------------
/app/Resources/views/Default/decklist_of_the_week.html.twig:
--------------------------------------------------------------------------------
1 | {% if decklist %}
2 |
3 |
4 |
Decklist of the week
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
Identity
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 | Description by the author:
28 |
29 | {{ decklist.username }}
30 | {% if decklist.donation > 0 %} {% endif %}
31 | {{ decklist.reputation }}
32 |
33 |
34 | {{ decklist.description|raw }}
35 |
36 |
37 | {% endif %}
38 |
--------------------------------------------------------------------------------
/app/Resources/views/Default/donators.html.twig:
--------------------------------------------------------------------------------
1 | {% extends '/layout.html.twig' %}
2 |
3 | {% block body %}
4 |
5 |
6 |
7 |
8 |
The Gracious Donators
9 |
NetrunnerDB wouldn't be the same without them. Many, many thanks!!!
10 |
This website is ad-free due to the generous donations of our generous supporters. Thank you all!
11 |
To become a Donator and help run this and all the Null Signal Games sites, you can support Null Signal Games on Ko-Fi .
12 |
20 |
21 |
22 |
23 |
24 |
25 | {% endblock %}
26 |
--------------------------------------------------------------------------------
/app/Resources/views/Default/index.html.twig:
--------------------------------------------------------------------------------
1 | {% extends '/layout.html.twig' %}
2 |
3 | {% block head %}
4 |
5 |
6 |
15 |
27 | {% endblock %}
28 | {% block body %}
29 |
30 |
31 | {% include '/Default/navbar-factions.html.twig' %}
32 |
33 |
34 | {% include '/Default/decklist_of_the_week.html.twig' %}
35 |
36 |
37 | {% include '/Default/recent_decklists.html.twig' %}
38 |
39 |
40 | {% include '/Default/update-log.html.twig' %}
41 |
42 |
43 |
44 | {% endblock %}
45 |
--------------------------------------------------------------------------------
/app/Resources/views/Default/recent_decklists.html.twig:
--------------------------------------------------------------------------------
1 | Last 10 decklists more
2 |
3 | {% for decklist in decklists %}
4 | {% include '/Decklist/decklist-row-always-xs.html.twig' %}
5 | {% endfor %}
6 |
7 |
--------------------------------------------------------------------------------
/app/Resources/views/Default/recent_reviews.html.twig:
--------------------------------------------------------------------------------
1 |
2 |
Card reviews more
3 |
4 | {% for review in reviews %}
5 |
6 |
10 |
11 | by
{{ review.username }}
12 | {% if review.donation > 0 %}
{% endif %}
13 |
{{ review.reputation }}
14 |
15 | {{ review.rawtext|raw }}
16 |
17 | {% endfor %}
18 |
19 |
20 |
--------------------------------------------------------------------------------
/app/Resources/views/Default/update-log.html.twig:
--------------------------------------------------------------------------------
1 | {% if updates is not empty %}
2 |
3 |
4 |
5 |
6 |
7 | NetrunnerDB Updates (expand)
8 | × Close
9 |
10 |
11 |
12 |
13 | {% for update in updates %}
14 |
15 | {{ update.date }}
16 |
17 |
18 | {% for entry in update.entries %}
19 | {{ entry }}
20 | {% endfor %}
21 |
22 |
23 |
24 | {% endfor %}
25 |
26 |
27 |
28 | {% endif %}
29 |
--------------------------------------------------------------------------------
/app/Resources/views/Default/usercomments.html.twig:
--------------------------------------------------------------------------------
1 | {% extends '/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 |
19 |
20 | {{ comment.text|raw }}
21 |
22 |
23 | {% endfor %}
24 |
25 |
26 |
27 |
28 |
29 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 | {% endblock %}
57 |
--------------------------------------------------------------------------------
/app/Resources/views/Diff/decklistsDiff.html.twig:
--------------------------------------------------------------------------------
1 | {% extends '/layout.html.twig' %}
2 |
3 | {% block body %}
4 |
5 |
6 |
7 |
Comparison of 2 decklists
8 |
9 |
10 |
11 |
12 | {% for card in decklist1.content %}
13 |
17 | {% endfor %}
18 |
19 |
20 |
∩
21 | {% for card in shared %}
22 |
26 | {% endfor %}
27 |
28 |
29 |
30 | {% for card in decklist2.content %}
31 |
35 | {% endfor %}
36 |
37 |
38 |
39 |
40 |
41 | {% endblock %}
42 |
--------------------------------------------------------------------------------
/app/Resources/views/Emails/decklist-moderation-0.html.twig:
--------------------------------------------------------------------------------
1 |
2 | Hello {{ username }}.
3 |
4 | The moderation team has reviewed your decklist {{ decklist_name }} .
5 | The last changes have been approved and your decklist is now regularly published.
6 |
7 |
8 |
9 | Regards,
10 | The moderation team of NetrunnerDB
11 |
--------------------------------------------------------------------------------
/app/Resources/views/Emails/decklist-moderation-2.html.twig:
--------------------------------------------------------------------------------
1 |
2 | Hello {{ username }}.
3 |
4 | The moderation team has reviewed your decklist {{ decklist_name }} .
5 | We are sorry to tell you that your decklist has been removed from the website. The reason is: {{ reason }} .
6 | You can edit your decklist to fix that issue and have your decklist reviewed again.
7 |
8 |
9 |
10 | Regards,
11 | The moderation team of NetrunnerDB
12 |
--------------------------------------------------------------------------------
/app/Resources/views/Emails/decklist-moderation-3.html.twig:
--------------------------------------------------------------------------------
1 |
2 | Hello {{ username }}.
3 |
4 | The moderation team has reviewed your decklist {{ decklist_name }} .
5 | We are sorry to tell you that your decklist has been permanently removed from the website. The reason is: {{ reason }} .
6 |
7 |
8 |
9 | Regards,
10 | The moderation team of NetrunnerDB
11 |
--------------------------------------------------------------------------------
/app/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 |
--------------------------------------------------------------------------------
/app/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 |
--------------------------------------------------------------------------------
/app/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 |
--------------------------------------------------------------------------------
/app/Resources/views/Oauth/initiate.html.twig:
--------------------------------------------------------------------------------
1 | {% extends '/layout.html.twig' %}
2 |
3 | {% block body %}
4 |
5 |
12 |
13 | {% endblock %}
--------------------------------------------------------------------------------
/app/Resources/views/Prebuilt/view.html.twig:
--------------------------------------------------------------------------------
1 | {% extends '/layout.html.twig' %}
2 |
3 | {% block head %}
4 |
5 |
23 | {% endblock %}
24 | {% block body %}
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 | {{ prebuilt.name }}
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 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 | {% endblock %}
73 |
--------------------------------------------------------------------------------
/app/Resources/views/RulesTextUpdates/rules_text_updates.html.twig:
--------------------------------------------------------------------------------
1 | {% extends '/layout.html.twig' %}
2 |
3 | {% block title %}Rules Text Updates{% endblock %}
4 |
5 | {% block head %}
6 |
14 | {% endblock %}
15 |
16 | {% block body %}
17 |
18 |
19 |
{{ block('title') }}
20 |
21 | {% include '/RulesTextUpdates/2025_03_24_elevation_release.html.twig' %}
22 |
23 |
24 |
25 | {% endblock %}
26 |
--------------------------------------------------------------------------------
/app/Resources/views/Rulings/list.html.twig:
--------------------------------------------------------------------------------
1 | {% extends '/layout.html.twig' %}
2 |
3 | {% block body %}
4 |
5 |
6 |
Rulings
7 |
8 | All cards with clarification and F.A.Q
9 |
10 |
17 |
18 | {% for card in list %}
19 | {% if not card.rulings is empty %}
20 | {{ card.title }} ( {{ card.pack.name }}, {{card.position}})
21 |
22 | {% for ruling in card.rulings %}
23 |
24 | Updated {{ ruling.dateUpdate | date("Y-m-d") }}
25 | {{ ruling.text|raw }}
26 |
27 | {% endfor %}
28 |
29 | {% endif %}
30 | {% endfor %}
31 |
32 |
33 |
34 |
35 | {% endblock %}
36 |
--------------------------------------------------------------------------------
/app/Resources/views/Scripts/nsg_formats.html.twig:
--------------------------------------------------------------------------------
1 |
40 |
--------------------------------------------------------------------------------
/app/Resources/views/Search/card.html.twig:
--------------------------------------------------------------------------------
1 |
3 | ×
4 | {{ title }} ({{ pack_name }})
5 |
6 |
--------------------------------------------------------------------------------
/app/Resources/views/Search/display-images.html.twig:
--------------------------------------------------------------------------------
1 | {% extends '/Search/display.html.twig' %}
2 |
3 | {% block main %}
4 |
5 |
6 | {% for row in 0..(cards|length-1)//4 %}
7 |
8 | {% for col in 0..3 %}{% set index = row*4+col %}
9 | {% if index in cards|keys %}
10 | {% set card = cards[index] %}
11 |
12 |
13 |
14 | {% endif %}
15 | {% endfor %}
16 |
17 | {% endfor %}
18 |
19 | {% endblock %}
20 |
--------------------------------------------------------------------------------
/app/Resources/views/Search/display-list.html.twig:
--------------------------------------------------------------------------------
1 | {% extends '/Search/display.html.twig' %}
2 |
3 | {% block main %}
4 |
5 |
6 |
7 |
8 | Title
9 | Faction
10 |
11 | Type
12 | …
13 | Subtype
14 | •
15 | Set
16 |
17 |
18 | {% for i in 0..cards|length-1 %}
19 |
20 | {% set card = cards[i] %}
21 |
22 | {{ card.title }}
23 |
24 |
25 |
26 |
27 |
28 |
29 | {{ card.cost }}{{ card.advancementcost }}
30 | {{ card.type_name }}
31 | {% if card.strength is not null %}{{ card.strength }}{% elseif card.agendapoints is not null %}{{ card.agendapoints }}{% else %}{{ card.trash }}{% endif %}
32 | {{ card.subtype }}
33 |
34 | {% if card.factioncost > 0 %}
35 |
36 | {% for i in 1..card.factioncost %}●{% if i%5==0 %} {% endif %}{% endfor %}
37 |
38 | {% endif %}
39 |
40 | {{ card.pack_name }} {{ card.position }}
41 |
42 | {% endfor %}
43 |
44 |
45 | {% endblock %}
46 |
--------------------------------------------------------------------------------
/app/Resources/views/Search/display-rulings.html.twig:
--------------------------------------------------------------------------------
1 | {% extends '/Search/display.html.twig' %}
2 |
3 | {% block main %}
4 |
5 |
6 |
7 | {% for i in 0..cards|length-1 %}{% set card = cards[i] %}
8 | {% if not card.rulings is empty %}
9 |
{{ card.title }} ( {{ card.pack_name }}, {{card.position}})
10 |
11 | {% for ruling in card.rulings %}
12 | {{ ruling.text|raw }}
13 | {% endfor %}
14 |
15 | {% endif %}
16 | {% endfor %}
17 |
18 |
19 |
20 | {% endblock %}
21 |
22 |
--------------------------------------------------------------------------------
/app/Resources/views/Search/display-short.html.twig:
--------------------------------------------------------------------------------
1 | {% extends '/Search/display.html.twig' %}
2 |
3 | {% block main %}
4 |
5 | {% for key, value in cards %}
6 | {{ key }}
7 |
8 | {% for i in 0..value|length-1 %}
9 | {% set card = value[i] %}
10 |
{{ card.title }}
11 | {% endfor %}
12 |
13 | {% endfor %}
14 |
15 | {% endblock %}
16 |
--------------------------------------------------------------------------------
/app/Resources/views/Search/display.html.twig:
--------------------------------------------------------------------------------
1 | {% extends '/layout.html.twig' %}
2 |
3 | {% block title %}{{ title }}{% endblock %}
4 |
5 | {% block body %}
6 |
7 |
8 | {{ searchbar|raw }}
9 |
10 |
11 |
12 | {{ pagination|raw }}
13 |
14 | {% if cards|length > 0 %}
15 |
16 | {% block main %}{% endblock %}
17 |
18 | {% else %}
19 |
20 |
23 |
24 | {% endif %}
25 |
26 | {{ pagination|raw }}
27 |
28 |
29 |
30 |
31 |
32 | {% endblock %}
33 |
--------------------------------------------------------------------------------
/app/Resources/views/Search/pagination.html.twig:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
19 |
20 |
29 |
30 |
31 |
{{ count }} cards
32 |
33 |
34 |
--------------------------------------------------------------------------------
/app/Resources/views/Search/paginationitem.html.twig:
--------------------------------------------------------------------------------
1 | {% if href %}
2 | {{ s }}–{{ e }}
3 | {% else %}
4 | {{ s }}–{{ e }}
5 | {% endif %}
6 |
--------------------------------------------------------------------------------
/app/Resources/views/Search/search.html.twig:
--------------------------------------------------------------------------------
1 | {% extends '/layout.html.twig' %}
2 |
3 | {% block head %}
4 | {% include '/Scripts/nsg_formats.html.twig' %}
5 |
6 | {% endblock %}
7 |
8 | {% block body %}
9 |
10 |
11 |
12 |
13 |
14 |
15 | {% set linkurl = path('decklists_searchform') %} Search
16 | {% set linkurl = path('decklists_list', {type:'popular'}) %}Popular
17 | {% set linkurl = path('decklists_list', {type:'recent'}) %}Recent
18 | {% set linkurl = path('decklists_list', {type:'dotw'}) %}Decklists of the Week
19 | {% set linkurl = path('decklists_list', {type:'tournament'}) %}Tournaments
20 | {% set linkurl = path('decklists_list', {type:'hottopics'}) %}Hot topics
21 | {% set linkurl = path('decklists_list', {type:'halloffame'}) %}Hall of Fame
22 | {% set linkurl = path('decklists_list', {type:'mine'}) %}My decklists
23 | {% set linkurl = path('decklists_list', {type:'favorites'}) %}My favorites
24 |
25 |
26 |
27 |
28 |
29 |
30 |
Decklist Search
31 | {{ form|raw }}
32 |
33 |
34 |
35 |
36 |
37 | {% endblock %}
38 |
--------------------------------------------------------------------------------
/app/Resources/views/Search/searchoptions.html.twig:
--------------------------------------------------------------------------------
1 |
2 |
3 | {% for key, value in sort_options %}
4 |
5 | Sort by {{value}}
6 |
7 | {% endfor %}
8 |
9 |
10 |
11 |
12 |
13 | {% for key, value in view_options %}
14 |
15 | View as {{value}}
16 |
17 | {% endfor %}
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/app/Resources/views/Search/searchtooltip.html.twig:
--------------------------------------------------------------------------------
1 | Search filters:
2 | default, no prefix - title (word or "phrase with spaces")
3 | x - text (word or "phrase with spaces and [symbols]")
4 | t - type (word)
5 | s - subtype (word or "multiple - subtypes")
6 | f - faction (faction code, letter, or '-' for neutral)
7 | p - strength (number)
8 | m - memory (number)
9 | o - cost (number)
10 | n - influence (number)
11 | d - side (letter)
12 | c - cycle (number)
13 | e - set (acronym or shortcode, aka 'sc19')
14 | a - flavor (word or "phrase with spaces")
15 | i - illustrator (word or "phrase with spaces")
16 | u - unique (0 for non-unique, 1 for unique)
17 | y - quantity in pack (number)
18 | b - ban list (one of: active, latest, or an mwl name).
19 | z - rotation (one of: current, latest, startup, rotation-2017, rotation-2018, rotation-2019, rotation-2021)
20 |
21 | Filter operators:
22 | : - include or is equal to the condition
23 | ! - does not include or is not equal the condition
24 | > - if numeric, is greater than condition
25 | < - if numeric, is less than condition
26 | | (pipe) - 'OR' multiple conditions together
27 |
28 | Examples:
29 | [ t:asset f:j|hb o>2 ] - Jinteki or Haas-Bioroid assets with rez cost greater than 2
30 | [ t:program s!icebreaker n<2 ] - non-icebreaker programs with 0 or 1 influence
31 | [ x:"the Corp loses 1 credit" ] - Amina, Corporate "Grant", and Lamprey
32 |
--------------------------------------------------------------------------------
/app/Resources/views/Search/setnavigation.html.twig:
--------------------------------------------------------------------------------
1 |
16 |
--------------------------------------------------------------------------------
/app/Resources/views/Security/login.html.twig:
--------------------------------------------------------------------------------
1 | {% extends '/layout.html.twig' %}
2 |
3 | {% block navbar %}{% endblock %}
4 |
5 | {% block body %}
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
NetrunnerDB Authentication
14 |
15 |
40 |
41 |
42 |
43 |
44 |
45 | {% endblock %}
46 |
47 | {% block footer %}{% endblock %}
48 |
--------------------------------------------------------------------------------
/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/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 |
--------------------------------------------------------------------------------
/app/config/config_dev.yml:
--------------------------------------------------------------------------------
1 | imports:
2 | - { resource: config.yml }
3 |
4 | framework:
5 | router:
6 | resource: '%kernel.project_dir%/app/config/routing_dev.yml'
7 | strict_requirements: true
8 | profiler: { only_exceptions: false }
9 |
10 | web_profiler:
11 | toolbar: true
12 | intercept_redirects: false
13 |
14 | monolog:
15 | handlers:
16 | main:
17 | type: stream
18 | path: '%kernel.logs_dir%/%kernel.environment%.log'
19 | level: debug
20 | channels: ['!event']
21 | console:
22 | type: console
23 | process_psr_3_messages: false
24 | channels: ['!event', '!doctrine', '!console']
25 | # To follow logs in real time, execute the following command:
26 | # `bin/console server:log -vv`
27 | server_log:
28 | type: server_log
29 | process_psr_3_messages: false
30 | host: 127.0.0.1:9911
31 | # uncomment to get logging in your browser
32 | # you may have to allow bigger header sizes in your Web server configuration
33 | #firephp:
34 | # type: firephp
35 | # level: info
36 | #chromephp:
37 | # type: chromephp
38 | # level: info
39 |
40 | #swiftmailer:
41 | # delivery_addresses: ['me@example.com']
42 |
--------------------------------------------------------------------------------
/app/config/config_prod.yml:
--------------------------------------------------------------------------------
1 | imports:
2 | - { resource: config.yml }
3 |
4 | #doctrine:
5 | # orm:
6 | # metadata_cache_driver: apc
7 | # result_cache_driver: apc
8 | # query_cache_driver: apc
9 |
10 | monolog:
11 | handlers:
12 | main:
13 | type: fingers_crossed
14 | action_level: error
15 | handler: nested
16 | excluded_404s:
17 | - ^/
18 | nested:
19 | type: stream
20 | path: '%kernel.logs_dir%/%kernel.environment%.log'
21 | level: debug
22 | console:
23 | type: console
24 | process_psr_3_messages: false
25 |
--------------------------------------------------------------------------------
/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 | collect: 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 | # This file is a "template" of what your parameters.yml file should look like
2 | # Set parameters here that may be different on each deployment target of the app, e.g. development, staging, production.
3 | # https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration
4 | parameters:
5 | database_host: 127.0.0.1
6 | database_port: ~
7 | database_name: netrunnerdb
8 | database_user: root
9 | database_password: ~
10 | # You should uncomment this if you want to use pdo_sqlite
11 | #database_path: '%kernel.project_dir%/var/data/data.sqlite'
12 |
13 | mailer_transport: smtp
14 | mailer_host: 127.0.0.1
15 | mailer_user: ~
16 | mailer_password: ~
17 |
18 | # Email Sender
19 | email_sender_address: ~
20 | email_sender_name: ~
21 |
22 | # A secret key that's used to generate certain security-related tokens
23 | secret: ThisTokenIsNotSoSecretChangeIt
24 |
25 | locale: en
26 | long_cache: 86400
27 | short_cache: 600
28 | assets_version: 1
29 | locale_names:
30 | en: English
31 | de: Deutsch
32 | fr: Français
33 | es: Español
34 | it: Italiano
35 | pl: Polskie
36 | kr: 한국어
37 | jp: 日本語
38 | zh: 中文
39 | supported_locales:
40 | - en
41 | oauth_test_client_id: ~
42 | oauth_test_client_secret: ~
43 | oauth_test_redirect_uri: ~
44 | images_path: ~
45 | card_image_url: 'https://card-images.netrunnerdb.com/v2'
46 | v3_api_url: 'https://api-preview.netrunnerdb.com/'
47 |
--------------------------------------------------------------------------------
/app/config/routing.yml:
--------------------------------------------------------------------------------
1 | app:
2 | resource: "@AppBundle/Resources/config/routing.yml"
3 | prefix: /
4 |
5 | fos_js_routing:
6 | resource: "@FOSJsRoutingBundle/Resources/config/routing/routing.xml"
7 |
8 | fos_user_security:
9 | resource: "@FOSUserBundle/Resources/config/routing/security.xml"
10 |
11 | fos_user_profile:
12 | resource: "@FOSUserBundle/Resources/config/routing/profile.xml"
13 | prefix: /profile
14 |
15 | fos_user_register:
16 | resource: "@FOSUserBundle/Resources/config/routing/registration.xml"
17 | prefix: /register
18 |
19 | #fos_user_registration_register:
20 | # path: /register
21 | # defaults:
22 | # _controller: AppBundle:Security:register
23 |
24 | fos_user_resetting:
25 | resource: "@FOSUserBundle/Resources/config/routing/resetting.xml"
26 | prefix: /resetting
27 |
28 | fos_user_change_password:
29 | resource: "@FOSUserBundle/Resources/config/routing/change_password.xml"
30 | prefix: /profile
31 |
32 | fos_oauth_server_token:
33 | resource: "@FOSOAuthServerBundle/Resources/config/routing/token.xml"
34 |
35 | fos_oauth_server_authorize:
36 | resource: "@FOSOAuthServerBundle/Resources/config/routing/authorize.xml"
37 |
38 | oauth_server_auth_login:
39 | path: /oauth/v2/auth_login
40 | defaults:
41 | _controller: AppBundle:Security:login
42 |
43 | oauth_server_auth_login_check:
44 | path: /oauth/v2/auth_login_check
45 | defaults:
46 | _controller: AppBundle:Security:loginCheck
47 |
48 | NelmioApiDocBundle:
49 | resource: "@NelmioApiDocBundle/Resources/config/routing.yml"
50 | prefix: /api/doc
51 |
--------------------------------------------------------------------------------
/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 | _errors:
10 | resource: '@TwigBundle/Resources/config/routing/errors.xml'
11 | prefix: /_error
12 |
13 | _main:
14 | resource: routing.yml
15 |
--------------------------------------------------------------------------------
/app/config/security.yml:
--------------------------------------------------------------------------------
1 | security:
2 |
3 | encoders:
4 | FOS\UserBundle\Model\UserInterface: sha512
5 |
6 | role_hierarchy:
7 | ROLE_ADMIN: ROLE_USER
8 | ROLE_SUPER_ADMIN: ROLE_ADMIN
9 |
10 | providers:
11 | fos_userbundle:
12 | id: fos_user.user_provider.username
13 |
14 | firewalls:
15 | api:
16 | pattern: ^/api_oauth2
17 | fos_oauth: true
18 | stateless: true
19 | api_20:
20 | pattern: ^/api/\d+.\d+/private
21 | fos_oauth: true
22 | stateless: true
23 | oauth_token:
24 | pattern: ^/oauth/v2/token
25 | security: false
26 | oauth_authorize:
27 | pattern: ^/oauth/v2/auth
28 | form_login:
29 | provider: fos_userbundle
30 | check_path: oauth_server_auth_login_check
31 | login_path: oauth_server_auth_login
32 | anonymous: true
33 | logout_on_user_change: true
34 | main:
35 | remember_me:
36 | secret: "%secret%"
37 | lifetime: 31536000
38 | path: /
39 | domain: ~
40 | pattern: ^/
41 | form_login:
42 | provider: fos_userbundle
43 | default_target_path: netrunnerdb_index
44 | use_referer: true
45 | anonymous: ~
46 | logout:
47 | invalidate_session: true
48 | success_handler: logout.redirect
49 | logout_on_user_change: true
50 |
51 | access_control:
52 | - { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
53 | - { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
54 | - { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
55 | - { path: ^/admin/, role: ROLE_ADMIN }
56 | - { path: ^/../deck/view/, role: IS_AUTHENTICATED_ANONYMOUSLY }
57 | - { path: ^/../deck/, role: ROLE_USER }
58 | - { path: ^/../decks, role: ROLE_USER }
59 | - { path: ^/../user/, role: ROLE_USER }
60 | - { path: ^/api_oauth2, roles: IS_AUTHENTICATED_FULLY }
61 |
--------------------------------------------------------------------------------
/app/config/services.yml:
--------------------------------------------------------------------------------
1 | services:
2 | _defaults:
3 | autowire: true
4 | autoconfigure: true
5 | public: true
6 | bind:
7 | $tempDir: '%kernel.project_dir%/var'
8 | $publicDir: '%kernel.project_dir%/web'
9 | $cardImageUrl: '%card_image_url%'
10 | $shortCache: '%short_cache%'
11 |
12 | logout.redirect:
13 | class: AppBundle\Controller\RedirectAfterLogout
14 |
15 | AppBundle\:
16 | resource: '../../src/AppBundle/*'
17 | exclude: '../../src/AppBundle/{Behavior,DataFixtures,DQL,Entity,Repository,Resources}'
18 |
19 | AppBundle\EventListener\DecklistListener:
20 | tags:
21 | - { name: doctrine.event_listener, entity: AppBundle\Entity\Decklist, event: postPersist }
22 | - { name: doctrine.event_listener, entity: AppBundle\Entity\Decklist, event: postUpdate }
23 | - { name: doctrine.event_listener, entity: AppBundle\Entity\Decklist, event: postRemove }
24 |
25 | FOS\OAuthServerBundle\Entity\ClientManager:
26 | alias: 'fos_oauth_server.client_manager.default'
27 |
28 | FOS\OAuthServerBundle\Entity\AccessTokenManager:
29 | alias: 'fos_oauth_server.access_token_manager.default'
30 |
--------------------------------------------------------------------------------
/bin/console:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env php
2 | getParameterOption(['--env', '-e'], getenv('SYMFONY_ENV') ?: 'dev');
19 | $debug = getenv('SYMFONY_DEBUG') !== '0' && !$input->hasParameterOption(['--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 |
--------------------------------------------------------------------------------
/docker/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore the symlinks out to the individual repos for the cards and source.
2 | netrunner-cards-json
3 | netrunnerdb
4 |
--------------------------------------------------------------------------------
/docker/000-default.conf:
--------------------------------------------------------------------------------
1 |
2 | # The ServerName directive sets the request scheme, hostname and port that
3 | # the server uses to identify itself. This is used when creating
4 | # redirection URLs. In the context of virtual hosts, the ServerName
5 | # specifies what hostname must appear in the request's Host: header to
6 | # match this virtual host. For the default virtual host (this file) this
7 | # value is not decisive as it is used as a last resort host regardless.
8 | # However, you must set it for any further virtual host explicitly.
9 | #ServerName www.example.com
10 |
11 | ServerAdmin webmaster@localhost
12 | DocumentRoot /var/www/html/nrdb/web
13 |
14 | # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
15 | # error, crit, alert, emerg.
16 | # It is also possible to configure the loglevel for particular
17 | # modules, e.g.
18 | #LogLevel info ssl:warn
19 |
20 | ErrorLog ${APACHE_LOG_DIR}/error.log
21 | CustomLog ${APACHE_LOG_DIR}/access.log combined
22 |
23 | # For most configuration files from conf-available/, which are
24 | # enabled or disabled at a global level, it is possible to
25 | # include a line for only one particular virtual host. For example the
26 | # following line enables the CGI configuration for this host only
27 | # after it has been globally disabled with "a2disconf".
28 | #Include conf-available/serve-cgi-bin.conf
29 |
30 |
31 | # vim: syntax=apache ts=4 sw=4 sts=4 sr noet
32 |
--------------------------------------------------------------------------------
/docker/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM php:7.4-apache
2 |
3 | MAINTAINER Jen Pollock
4 |
5 | RUN apt-get update && apt-get install -y \
6 | libzip-dev \
7 | zlib1g-dev \
8 | unzip
9 |
10 | RUN docker-php-ext-install zip pdo_mysql
11 |
12 | RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --2.2 --filename=composer
13 | # Listen on port 8080 instead of 80 in order to allow local development against the private Oauth API.
14 | RUN sed -i "s/Listen 80/Listen 8080/" /etc/apache2/ports.conf
15 | COPY 000-default.conf /etc/apache2/sites-available
16 |
17 | # Allow composer to create cache
18 | RUN chown -R www-data:www-data /var/www
19 |
20 | USER root
21 |
22 | EXPOSE 8080
23 |
24 | CMD ["apache2-foreground"]
25 |
26 | WORKDIR /var/www/html/nrdb
27 |
--------------------------------------------------------------------------------
/docker/README.md:
--------------------------------------------------------------------------------
1 | Docker & docker-compose based development environment for
2 | [netrunnerdb](https://github.com/netrunnerdb/netrunnerdb).
3 |
4 | This is just designed for local development only and not for any production use cases.
5 |
6 | You will need both docker and docker-compose installed.
7 |
8 | The Docker setup is a bit clunky, but does result in no changes to the git
9 | repos from the running server. The database and app volumes are real docker
10 | volumes and will persist until you wipe them out.
11 |
12 | All file changes should be picked up without restarting docker with the
13 | exception of .htaccess and app_dev.php since those are copied into the image.
14 |
15 | First, you will need to check out the
16 | [netrunnerdb](https://github.com/netrunnerdb/netrunnerdb) and
17 | [netrunner-cards-json](https://github.com/netrunnerdb/netrunner-cards-json)
18 | repositories somewhere on your system. It is easiest to check them out next to
19 | nrdb-dev-env.
20 |
21 | ```sh
22 | cd ..
23 | git checkout https://github.com/netrunnerdb/netrunnerdb
24 | git checkout https://github.com/netrunnerdb/netrunner-cards-json
25 | cd nrdb-dev-env
26 | ```
27 |
28 | Next, add symlinks for the other repositories, build the containers and bring
29 | them up:
30 |
31 | ```sh
32 | ./prepare-and-build.sh ../netrunnerdb ../netrunner-cards-json
33 | docker-compose up -d
34 | ```
35 |
36 | Now prepare the rest of the files for the images and set up the database:
37 | ```sh
38 | ./docker-first-run.sh
39 | ```
40 |
41 | Once this has completed you can visit [localhost:8080](http://localhost:8080)
42 | to see your new, empty, debug-and-dev-mode netrunnerdb instance.
43 |
44 | **NOTE:** If you get database errors in the last step, for instance when you
45 | rebuild the containers after some changes, it usually just means you haven't
46 | waited long enough for the database server to start up. Wait thirty seconds and
47 | try again.
48 |
49 | There are a few handy scripts to help you out as well. local-bash.sh will bring up
50 | a bash shell in your nrdb-dev instance. local-mysql.sh will prompt you for the
51 | database password (default passwd) and connect you to the running mysql
52 | instance.
53 |
54 | To update the card data, run:
55 |
56 | ```sh
57 | ./import-cards.sh
58 | ```
59 |
60 | while your docker image is running.
61 |
--------------------------------------------------------------------------------
/docker/app_dev.php:
--------------------------------------------------------------------------------
1 | loadClassCache();
27 | }
28 | $request = Request::createFromGlobals();
29 | $response = $kernel->handle($request);
30 | $response->send();
31 | $kernel->terminate($request, $response);
32 |
--------------------------------------------------------------------------------
/docker/dev-parameters.yml:
--------------------------------------------------------------------------------
1 | # This file is a "template" of what your parameters.yml file should look like
2 | # Set parameters here that may be different on each deployment target of the app, e.g. development, staging, production.
3 | # https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration
4 | parameters:
5 | database_host: nrdb-dev-db
6 | database_port: ~
7 | database_name: nrdb-dev
8 | database_user: nrdb-dev
9 | database_password: passwd
10 | # You should uncomment this if you want to use pdo_sqlite
11 | #database_path: '%kernel.project_dir%/var/data/data.sqlite'
12 |
13 | mailer_transport: smtp
14 | mailer_host: 127.0.0.1
15 | mailer_user: ~
16 | mailer_password: ~
17 |
18 | # Email Sender
19 | email_sender_address: nrdb@example.com
20 | email_sender_name: nrdb
21 |
22 | # A secret key that's used to generate certain security-related tokens
23 | secret: ThisTokenIsNotSoSecretChangeIt
24 |
25 | locale: en
26 | long_cache: 86400
27 | short_cache: 600
28 | assets_version: 1
29 | locale_names:
30 | en: English
31 | de: Deutsch
32 | fr: Français
33 | es: Español
34 | it: Italiano
35 | pl: Polskie
36 | kr: 한국어
37 | jp: 日本語
38 | zh: 中文
39 | supported_locales:
40 | - en
41 | oauth_test_client_id: ~
42 | oauth_test_client_secret: ~
43 | oauth_test_redirect_uri: ~
44 | images_path: ~
45 | v3_api_url: 'https://api.netrunnerdb.com'
46 | card_image_url: 'https://card-images.netrunnerdb.com/v2'
47 | asset_fingerprint: '123456789'
48 |
--------------------------------------------------------------------------------
/docker/docker-compose.yml:
--------------------------------------------------------------------------------
1 | services:
2 | nrdb-dev:
3 | environment:
4 | SYMFONY_ENV: dev
5 | container_name: nrdb-dev
6 | build: .
7 | depends_on:
8 | - nrdb-dev-db
9 | ports:
10 | - "8080:8080"
11 | links:
12 | - nrdb-dev-db
13 | volumes:
14 | # These folders and files will have links or copies made of them.
15 | - ./netrunnerdb/bin:/var/www/html/nrdb-bin
16 | - ./netrunnerdb/web:/var/www/html/nrdb-web
17 | - ./dev-parameters.yml:/var/www/html/nrdb-app-config-parameters.yml
18 | # Make a copy of app/config/ so we can link to the files in there from
19 | # /var/www/html/nrdb/app/config to avoid a parameters.yml file being
20 | # written to our repo there.
21 | - ./netrunnerdb/app/config:/var/www/html/nrdb-app-config
22 | # Link up the nrdb source code and card database.
23 | - ./netrunnerdb:/var/www/html/nrdb
24 | - ./netrunner-cards-json:/var/www/html/nrdb/cards
25 | # redirect everything to app_dev.php rather than app.php
26 | - ./.htaccess:/var/www/html/nrdb/web/.htaccess
27 | # Make sure data created by the running application isn't written
28 | # to the git repo.
29 | - appdata_appcfg:/var/www/html/nrdb/app/config
30 | - appdata_bin:/var/www/html/nrdb/bin
31 | - appdata_var:/var/www/html/nrdb/var
32 | - appdata_web:/var/www/html/nrdb/web
33 | - appdata_vendor:/var/www/html/nrdb/vendor
34 | # overwrite default app_dev.php with one that has the "does this
35 | # look like a dev setup?" security check commented out.
36 | - ./app_dev.php:/var/www/html/nrdb/web/app_dev.php
37 |
38 | nrdb-dev-db:
39 | container_name: nrdb-dev-db
40 | image: "mysql:8"
41 | restart: always
42 | volumes:
43 | - dbdata:/var/lib/mysql
44 | environment:
45 | MYSQL_ROOT_PASSWORD: passwd
46 | MYSQL_DATABASE: nrdb-dev
47 | MYSQL_USER: nrdb-dev
48 | MYSQL_PASSWORD: passwd
49 |
50 | volumes:
51 | appdata_appcfg:
52 | appdata_bin:
53 | appdata_bundles:
54 | appdata_var:
55 | appdata_vendor:
56 | appdata_web:
57 | dbdata:
58 |
--------------------------------------------------------------------------------
/docker/docker-first-run.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | CHOWN="chown -R www-data:www-data"
4 |
5 | # Set up permissions and copy/link files on the volumes.
6 | echo "Preparing /var/www/html/nrdb/app/config/"
7 | for FILE in $(ls netrunnerdb/app/config/)
8 | do
9 | BASE_FILE=$(basename ${FILE})
10 | docker exec -it nrdb-dev bash -c "if [ ! -L "/var/www/html/nrdb/app/config/${BASE_FILE}" ]; then ln -s /var/www/html/nrdb-app-config/${BASE_FILE} /var/www/html/nrdb/app/config/${BASE_FILE}; fi"
11 | done
12 | docker exec -it nrdb-dev bash -c "${CHOWN} /var/www/html/nrdb/app/config"
13 |
14 | # Link up files from web, minus bundles and app_dev.php
15 | echo "Preparing /var/www/html/nrdb/web/"
16 | for FILE in $(ls netrunnerdb/web/ | grep -v bundles | grep -v app_dev.php | grep -v config.php)
17 | do
18 | BASE_FILE=$(basename ${FILE})
19 | docker exec -it nrdb-dev bash -c "if [ ! -L "/var/www/html/nrdb/web/${BASE_FILE}" ]; then ln -s /var/www/html/nrdb-web/${BASE_FILE} /var/www/html/nrdb/web/${BASE_FILE}; fi"
20 | done
21 |
22 | docker exec -it nrdb-dev bash -c "${CHOWN} /var/www/html/nrdb/web"
23 | docker exec -it nrdb-dev bash -c "if [ ! -d /var/www/html/nrdb/web/bundles ]; then mkdir /var/www/html/nrdb/web/bundles; fi"
24 | docker exec -it nrdb-dev bash -c "${CHOWN} /var/www/html/nrdb/web/bundles"
25 | docker exec -it nrdb-dev bash -c " ln -s /var/www/html/nrdb/vendor /var/www/html/vendor"
26 |
27 | docker exec -it nrdb-dev bash -c "cp /var/www/html/nrdb-bin/* /var/www/html/nrdb/bin/"
28 | docker exec -it nrdb-dev bash -c "${CHOWN} /var/www/html/nrdb/bin"
29 | docker exec -it nrdb-dev bash -c "${CHOWN} /var/www/html/nrdb/var"
30 | docker exec -it nrdb-dev bash -c "${CHOWN} /var/www/html/nrdb/vendor"
31 |
32 | # Run composer install as www-data instead of root.
33 | docker exec -it nrdb-dev bash -c "su -s /bin/bash www-data -c 'composer install'"
34 |
35 | docker exec -it nrdb-dev bash -c "cp /var/www/html/nrdb-app-config-parameters.yml /var/www/html/nrdb/app/config/parameters.yml"
36 |
37 | echo "Initializing the database and importing the card data."
38 | docker exec -it nrdb-dev bash -c "php bin/console doctrine:schema:update --force; php bin/console app:import:std -f cards"
39 |
40 | docker exec -it nrdb-dev bash -c "${CHOWN} /var/www/html/nrdb/var"
41 |
42 | echo "TODO: import card images"
43 |
44 | echo "All done!"
45 |
--------------------------------------------------------------------------------
/docker/import-cards.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | set -e
4 | set -u
5 |
6 | echo "Updating the card data."
7 | docker exec -it nrdb-dev bash -c "php bin/console doctrine:schema:update --force; php bin/console app:import:std -f cards"
8 |
9 | echo "All done!"
10 |
--------------------------------------------------------------------------------
/docker/local-bash.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | docker exec -it nrdb-dev bash
4 |
--------------------------------------------------------------------------------
/docker/local-mysql.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | docker exec -it nrdb-dev-db mysql -u nrdb-dev -p nrdb-dev
4 |
--------------------------------------------------------------------------------
/docker/prepare-and-build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | NRDB_PATH=$1
4 | CARDS_PATH=$2
5 |
6 | read -r -d '' USAGE << EOM
7 | Please run this script with paths to both the nrdb and netrunner-cards-json repositories you have checked out.
8 | For example:
9 | ./prepare-and-build.sh ../netrunnerdb/ ../netrunner-cards-json/
10 | EOM
11 |
12 | if [ -z "${NRDB_PATH}" ] || [ -z "${CARDS_PATH}" ]
13 | then
14 | echo "${USAGE}"
15 | exit 1
16 | fi
17 |
18 | if [ ! -d "${NRDB_PATH}" ]
19 | then
20 | echo "nrdb directory ${NRDB_PATH} does not exist."
21 | exit 1
22 | fi
23 | if [ ! -d "${CARDS_PATH}" ]
24 | then
25 | echo "netrunner-cards-json directory ${CARDS_PATH} does not exist."
26 | exit 1
27 | fi
28 |
29 | set -e
30 | set -u
31 |
32 | echo "Linking netrunnerdb to ${NRDB_PATH} ..."
33 | if [ -L netrunnerdb ]
34 | then
35 | echo "Link already exists. Skipping."
36 | else
37 | ln -s "${NRDB_PATH}" netrunnerdb
38 | fi
39 |
40 | echo "Linking netrunner-cards-json to ${CARDS_PATH} ..."
41 | if [ -L netrunner-cards-json ]
42 | then
43 | echo "Link already exists. Skipping."
44 | else
45 | ln -s "${CARDS_PATH}" netrunner-cards-json
46 | fi
47 |
48 | docker-compose build
49 |
--------------------------------------------------------------------------------
/phpunit.xml.dist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | tests
18 |
19 |
20 |
21 |
22 |
23 | src
24 |
25 | src/*Bundle/Resources
26 | src/*/*Bundle/Resources
27 | src/*/Bundle/*Bundle/Resources
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/src/.htaccess:
--------------------------------------------------------------------------------
1 |
2 | Require all denied
3 |
4 |
5 | Order deny,allow
6 | Deny from all
7 |
8 |
--------------------------------------------------------------------------------
/src/AppBundle/AppBundle.php:
--------------------------------------------------------------------------------
1 | entityManager = $entityManager;
20 | }
21 |
22 | protected function configure()
23 | {
24 | $this
25 | ->setName('app:legality:active-mwl')
26 | ->setDescription('Checks to see if a new MWL becomes active')
27 | ;
28 | }
29 |
30 | protected function execute(InputInterface $input, OutputInterface $output)
31 | {
32 | $now = new \DateTime();
33 |
34 | $qb = $this->entityManager->createQueryBuilder();
35 | $qb->select('m')
36 | ->from('AppBundle:Mwl', 'm')
37 | ->orderBy('m.dateStart', 'DESC');
38 | $query = $qb->getQuery();
39 |
40 | /** @var Mwl[] $list */
41 | $list = $query->getResult();
42 |
43 | if (!count($list)) {
44 | $output->writeln("No MWL in database ");
45 | return;
46 | }
47 |
48 | $mwl = array_shift($list);
49 | if ($mwl->getActive() || $mwl->getDateStart() > $now) {
50 | $output->writeln("Nothing to do");
51 | return;
52 | }
53 |
54 | $mwl->setActive(true);
55 | $output->writeln($mwl->getName() . " set as ACTIVE");
56 |
57 | while ($mwl = array_shift($list)) {
58 | if ($mwl->getActive()) {
59 | $mwl->setActive(false);
60 | $output->writeln($mwl->getName() . " set as INACTIVE");
61 | }
62 | }
63 |
64 | $this->entityManager->flush();
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/src/AppBundle/Command/LegalityDecklistsLimitCommand.php:
--------------------------------------------------------------------------------
1 |
14 | */
15 | class LegalityDecklistsLimitCommand extends ContainerAwareCommand
16 | {
17 | /** @var EntityManagerInterface $entityManager */
18 | private $entityManager;
19 |
20 | public function __construct(EntityManagerInterface $entityManager)
21 | {
22 | parent::__construct();
23 | $this->entityManager = $entityManager;
24 | }
25 |
26 | protected function configure()
27 | {
28 | $this
29 | ->setName('app:legality:decklists-limit')
30 | ->setDescription('Compute decklist legality regarding card limits')
31 | ;
32 | }
33 |
34 | protected function execute(InputInterface $input, OutputInterface $output)
35 | {
36 | $sql = "UPDATE decklist d SET d.is_legal=0 WHERE d.is_legal=1"
37 | . " AND EXISTS(SELECT *"
38 | . " FROM decklistslot s"
39 | . " JOIN card c ON c.id=s.card_id"
40 | . " WHERE s.quantity>c.deck_limit"
41 | . " AND d.id=s.decklist_id)";
42 |
43 | $this->entityManager->getConnection()->executeQuery($sql);
44 |
45 | $output->writeln("Done ");
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/src/AppBundle/Command/LegalityDecklistsMwlCommand.php:
--------------------------------------------------------------------------------
1 |
14 | */
15 | class LegalityDecklistsMwlCommand extends ContainerAwareCommand
16 | {
17 | /** @var EntityManagerInterface $entityManager */
18 | private $entityManager;
19 |
20 | public function __construct(EntityManagerInterface $entityManager)
21 | {
22 | parent::__construct();
23 | $this->entityManager = $entityManager;
24 | }
25 |
26 | protected function configure()
27 | {
28 | $this
29 | ->setName('app:legality:decklists-mwl')
30 | ->setDescription('Compute decklist legality regarding MWL')
31 | ;
32 | }
33 |
34 | protected function execute(InputInterface $input, OutputInterface $output)
35 | {
36 | $sql = "UPDATE decklist d SET d.is_legal=0 WHERE d.is_legal=1"
37 | . " AND EXISTS(SELECT *"
38 | . " FROM legality l"
39 | . " JOIN mwl m ON m.id=l.mwl_id"
40 | . " WHERE m.active=1"
41 | . " AND l.is_legal=0"
42 | . " AND d.id=l.decklist_id)";
43 |
44 | $this->entityManager->getConnection()->executeQuery($sql);
45 |
46 | $output->writeln("Done ");
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/src/AppBundle/Command/LegalityRemoveMwlCommand.php:
--------------------------------------------------------------------------------
1 |
16 | */
17 | class LegalityRemoveMwlCommand extends ContainerAwareCommand
18 | {
19 | /** @var EntityManagerInterface $entityManager */
20 | private $entityManager;
21 |
22 | public function __construct(EntityManagerInterface $entityManager)
23 | {
24 | parent::__construct();
25 | $this->entityManager = $entityManager;
26 | }
27 |
28 | protected function configure()
29 | {
30 | $this
31 | ->setName('app:legality:remove-mwl')
32 | ->setDescription('Remove a MWL')
33 | ->addArgument(
34 | 'mwl_code',
35 | InputArgument::REQUIRED,
36 | 'Code of the MWL'
37 | );
38 | }
39 |
40 | protected function execute(InputInterface $input, OutputInterface $output)
41 | {
42 | $mwl_code = $input->getArgument('mwl_code');
43 | $mwl = $this->entityManager->getRepository('AppBundle:Mwl')->findOneBy(['code' => $mwl_code]);
44 | if (!$mwl) {
45 | throw new \Exception("MWL not found");
46 | }
47 |
48 | /** @var Deck[] $list_deck */
49 | $list_deck = $this->entityManager->getRepository('AppBundle:Deck')->findBy([
50 | 'mwl' => $mwl,
51 | ]);
52 |
53 | foreach ($list_deck as $deck) {
54 | $deck->setMwl(null);
55 | }
56 |
57 | $this->entityManager->flush();
58 |
59 | $this->entityManager->remove($mwl);
60 |
61 | $this->entityManager->flush();
62 |
63 | $output->writeln("Done.");
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/src/AppBundle/Command/RemoveDecklistCommand.php:
--------------------------------------------------------------------------------
1 | entityManager = $entityManager;
25 | $this->decklistManager = $decklistManager;
26 | }
27 |
28 | protected function configure()
29 | {
30 | $this
31 | ->setName('app:delete-decklist')
32 | ->setDescription('Remove one decklist')
33 | ->addArgument(
34 | 'id',
35 | InputArgument::REQUIRED,
36 | 'Id of the decklist'
37 | )
38 | ;
39 | }
40 |
41 | protected function execute(InputInterface $input, OutputInterface $output)
42 | {
43 | $decklist_id = $input->getArgument('id');
44 |
45 | /** @var Decklist $decklist */
46 | $decklist = $this->entityManager->getRepository('AppBundle:Decklist')->find($decklist_id);
47 |
48 | $this->decklistManager->removeConstraints($decklist);
49 | $this->entityManager->remove($decklist);
50 |
51 | $this->entityManager->flush();
52 |
53 | $output->writeln("Done.");
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/src/AppBundle/Controller/ApiDocController.php:
--------------------------------------------------------------------------------
1 | render('/Default/apiIntro.html.twig');
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/AppBundle/Controller/BanlistsController.php:
--------------------------------------------------------------------------------
1 | render('/Banlists/banlists.html.twig', [
20 | 'format' => $request->query->get('format'),
21 | 'restriction' => $request->query->get('restriction'),
22 | 'pagetitle' => "Ban Lists",
23 | 'pagedescription' => "View the ban lists for each format from throughout the game's history.",
24 | ]);
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/AppBundle/Controller/FormatsController.php:
--------------------------------------------------------------------------------
1 | render('/Formats/formats.html.twig', [
17 | 'pagetitle' => "Play Formats",
18 | 'pagedescription' => "See the official formats for Netrunner play.",
19 | ]);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/AppBundle/Controller/IllustratorsController.php:
--------------------------------------------------------------------------------
1 | render('/Illustrators/illustrators.html.twig', [
16 | 'pagetitle' => "Illustrators",
17 | 'pagedescription' => "Credit the artists who designed the look of the game.",
18 | ]);
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/AppBundle/Controller/InfoController.php:
--------------------------------------------------------------------------------
1 | isGranted('ROLE_USER')) {
30 | return new JsonResponse(['is_authenticated' => false]);
31 | }
32 |
33 | $user = $this->getUser();
34 |
35 | $content = $helper->defaultBlock($user);
36 |
37 | if ($request->query->has('decklist_id')) {
38 | $decklist = $entityManager->getRepository('AppBundle:Decklist')->find($request->query->get('decklist_id'));
39 | if ($decklist instanceof Decklist) {
40 | $content = array_merge($content, $helper->decklistBlock($user, $decklist));
41 | }
42 | }
43 |
44 | if ($request->query->has('card_id')) {
45 | $card = $entityManager->getRepository('AppBundle:Card')->find($request->query->get('card_id'));
46 | if ($card instanceof Card) {
47 | $content = array_merge($content, $helper->cardBlock($user, $card));
48 | }
49 | }
50 |
51 | return new JsonResponse($content);
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/src/AppBundle/Controller/ModflagsController.php:
--------------------------------------------------------------------------------
1 | getRepository('AppBundle:Modflag')->findAll();
26 |
27 | $content = [
28 | 'count' => count($modflags),
29 | 'data' => $modflags
30 | ];
31 |
32 | $serializer = SerializerBuilder::create()->build();
33 |
34 | $response = new Response();
35 | $response->setContent($serializer->serialize($content, 'json'));
36 | $response->headers->set('Content-Type', 'application/json');
37 | return $response;
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/AppBundle/Controller/PrebuiltController.php:
--------------------------------------------------------------------------------
1 | setPublic();
21 | $response->setMaxAge($this->getParameter('short_cache'));
22 |
23 | $dbh = $entityManager->getConnection();
24 |
25 | $rows = $dbh->executeQuery(
26 | "SELECT
27 | p.id,
28 | p.date_update,
29 | p.name,
30 | p.date_creation,
31 | c.code identity_code,
32 | f.code faction_code
33 | from prebuilt p
34 | join card c on p.identity_id=c.id
35 | join faction f on p.faction_id=f.id
36 | where p.code=?
37 | ",
38 |
39 | [$prebuilt_code]
40 | )->fetchAll();
41 |
42 | if (empty($rows)) {
43 | throw $this->createNotFoundException();
44 | }
45 |
46 | $prebuilt = $rows[0];
47 | $prebuilt_id = $prebuilt['id'];
48 |
49 | $cards = $dbh->executeQuery(
50 | "SELECT
51 | c.code card_code,
52 | s.quantity qty
53 | from prebuiltslot s
54 | join card c on s.card_id=c.id
55 | where s.prebuilt_id=?
56 | order by c.code asc",
57 |
58 | [$prebuilt_id]
59 | )->fetchAll();
60 |
61 |
62 | $prebuilt['cards'] = $cards;
63 |
64 | return $this->render('/Prebuilt/view.html.twig', [
65 | 'pagetitle' => $prebuilt['name'],
66 | 'prebuilt' => $prebuilt
67 | ], $response);
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/src/AppBundle/Controller/RedirectAfterLogout.php:
--------------------------------------------------------------------------------
1 | router = $router;
16 | }
17 |
18 | /**
19 | * Send the user to a specified URL if redirect_to is specified in the URL instead of the homepage.
20 | *
21 | * @param Request $request
22 | * @return RedirectResponse
23 | */
24 | public function onLogoutSuccess(Request $request)
25 | {
26 | return new RedirectResponse($request->query->get('redirect_to') ?
27 | $request->query->get('redirect_to') : $this->router->generate('netrunnerdb_index')
28 | );
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/AppBundle/Controller/RotationController.php:
--------------------------------------------------------------------------------
1 | createQuery("SELECT r FROM AppBundle:Rotation r ORDER BY r.dateStart DESC");
18 |
19 | return $this->render('/Rotation/rotation.html.twig', [
20 | 'pagetitle' => "Rotation",
21 | 'pagedescription' => "Compare the different card pools from the Standard format.",
22 | 'rotations' => $r->getResult(),
23 | 'cycles_and_packs' => $cardsData->getCyclesAndPacks(),
24 | ]);
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/AppBundle/Controller/RulesTextUpdatesController.php:
--------------------------------------------------------------------------------
1 | render('/RulesTextUpdates/rules_text_updates.html.twig', [
20 | 'format' => $request->query->get('format'),
21 | 'restriction' => $request->query->get('restriction'),
22 | 'pagetitle' => "Rules Text Updates",
23 | 'pagedescription' => "View the rules text updates by the NSG Rules Team.",
24 | ]);
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/AppBundle/Controller/SecurityController.php:
--------------------------------------------------------------------------------
1 | render(
18 | '/Security/login.html.twig',
19 | [
20 | 'last_username' => $authenticationUtils->getLastUsername(),
21 | 'error' => ($authenticationUtils->getLastAuthenticationError() == null ? "" : "Invalid credentials."),
22 | ]
23 | );
24 | }
25 |
26 | public function registerAction()
27 | {
28 | $session = $this->get('session');
29 |
30 | $session->getFlashBag()->add(
31 | 'warning',
32 | 'Registration is currently disabled.'
33 | );
34 |
35 | return $this->redirectToRoute('netrunnerdb_index');
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/src/AppBundle/Controller/ToolsController.php:
--------------------------------------------------------------------------------
1 | render('/Tools/demo.html.twig');
15 | }
16 |
17 | /**
18 | * @param int $id
19 | * @return \Symfony\Component\HttpFoundation\Response
20 | */
21 | public function extdecklistAction(int $id)
22 | {
23 | return $this->render('/Tools/demo-ext-decklist.html.twig', [
24 | 'id' => $id
25 | ]);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/AppBundle/DQL/BinaryFunction.php:
--------------------------------------------------------------------------------
1 | stringPrimary->dispatch($sqlWalker);
25 | }
26 |
27 | /**
28 | * @override
29 | */
30 | public function parse(Parser $parser)
31 | {
32 | $parser->match(Lexer::T_IDENTIFIER);
33 | $parser->match(Lexer::T_OPEN_PARENTHESIS);
34 | $this->stringPrimary = $parser->StringPrimary();
35 | $parser->match(Lexer::T_CLOSE_PARENTHESIS);
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/src/AppBundle/DQL/ReplaceFunction.php:
--------------------------------------------------------------------------------
1 | stringPrimary->dispatch($sqlWalker) . ', ' .
37 | $this->stringSecondary->dispatch($sqlWalker) . ', ' .
38 | $this->stringThird->dispatch($sqlWalker) .
39 | ')';
40 | /* return $sqlWalker->getConnection()->getDatabasePlatform()->getReplaceExpression(
41 | $this->stringPrimary, $this->stringSecondary, $this->stringThird
42 | );*/
43 | }
44 |
45 | /**
46 | * @override
47 | */
48 | public function parse(Parser $parser)
49 | {
50 | $parser->match(Lexer::T_IDENTIFIER);
51 | $parser->match(Lexer::T_OPEN_PARENTHESIS);
52 | $this->stringPrimary = $parser->StringPrimary();
53 | $parser->match(Lexer::T_COMMA);
54 | $this->stringSecondary = $parser->StringPrimary();
55 | $parser->match(Lexer::T_COMMA);
56 | $this->stringThird = $parser->StringPrimary();
57 | $parser->match(Lexer::T_CLOSE_PARENTHESIS);
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/src/AppBundle/DataFixtures/ORM/LoadUserData.php:
--------------------------------------------------------------------------------
1 |
14 | */
15 | class LoadUserData extends AbstractFixture implements OrderedFixtureInterface
16 | {
17 | /** @var UserManagerInterface $userManager */
18 | private $userManager;
19 |
20 | public function __construct(UserManagerInterface $userManager)
21 | {
22 | $this->userManager = $userManager;
23 | }
24 |
25 | public function load(ObjectManager $manager)
26 | {
27 | $userAdmin = $this->userManager->createUser();
28 | $userAdmin->setUsername('admin');
29 | $userAdmin->setEmail('admin@example.org');
30 | $userAdmin->setPlainPassword('admin');
31 | $userAdmin->addRole('ROLE_ADMIN');
32 | $userAdmin->setEnabled(true);
33 | $this->userManager->updateUser($userAdmin);
34 | $this->addReference('admin-user', $userAdmin);
35 |
36 | $userGuru = $this->userManager->createUser();
37 | $userGuru->setUsername('guru');
38 | $userGuru->setEmail('guru@example.org');
39 | $userGuru->setPlainPassword('guru');
40 | $userGuru->addRole('ROLE_GURU');
41 | $userGuru->setEnabled(true);
42 | $this->userManager->updateUser($userGuru);
43 | $this->addReference('guru-user', $userGuru);
44 | }
45 |
46 | public function getOrder()
47 | {
48 | return 1;
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/src/AppBundle/Entity/AccessToken.php:
--------------------------------------------------------------------------------
1 | name;
39 | }
40 |
41 | /**
42 | * @param string $name
43 | */
44 | public function setName(string $name)
45 | {
46 | $this->name = $name;
47 | }
48 |
49 | /**
50 | * @param Claim $claim
51 | * @return $this
52 | */
53 | public function addClaim(Claim $claim)
54 | {
55 | $this->claims[] = $claim;
56 |
57 | return $this;
58 | }
59 |
60 | /**
61 | * @param Claim $claim
62 | */
63 | public function removeClaim(Claim $claim)
64 | {
65 | $this->claims->removeElement($claim);
66 | }
67 |
68 | /**
69 | * @return Collection
70 | */
71 | public function getClaims()
72 | {
73 | return $this->claims;
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/src/AppBundle/Entity/Deckchange.php:
--------------------------------------------------------------------------------
1 | id;
41 | }
42 |
43 | /**
44 | * @return \DateTime
45 | */
46 | public function getDateCreation()
47 | {
48 | return $this->dateCreation;
49 | }
50 |
51 | /**
52 | * @param \DateTime $dateCreation
53 | * @return $this
54 | */
55 | public function setDatecreation(\DateTime $dateCreation)
56 | {
57 | $this->dateCreation = $dateCreation;
58 |
59 | return $this;
60 | }
61 |
62 | /**
63 | * @return string
64 | */
65 | public function getVariation()
66 | {
67 | return $this->variation;
68 | }
69 |
70 | /**
71 | * @param string $variation
72 | * @return $this
73 | */
74 | public function setVariation(string $variation)
75 | {
76 | $this->variation = $variation;
77 |
78 | return $this;
79 | }
80 |
81 | /**
82 | * @return Deck
83 | */
84 | public function getDeck()
85 | {
86 | return $this->deck;
87 | }
88 |
89 | /**
90 | * @param Deck $deck
91 | * @return $this
92 | */
93 | public function setDeck(Deck $deck)
94 | {
95 | $this->deck = $deck;
96 |
97 | return $this;
98 | }
99 |
100 | /**
101 | * @return boolean
102 | */
103 | public function getSaved()
104 | {
105 | return $this->saved;
106 | }
107 |
108 | /**
109 | * @param boolean $saved
110 | * @return Deckchange
111 | */
112 | public function setSaved(bool $saved)
113 | {
114 | $this->saved = $saved;
115 |
116 | return $this;
117 | }
118 | }
119 |
--------------------------------------------------------------------------------
/src/AppBundle/Entity/Decklistslot.php:
--------------------------------------------------------------------------------
1 | id;
38 | }
39 |
40 | /**
41 | * @return integer
42 | */
43 | public function getQuantity()
44 | {
45 | return $this->quantity;
46 | }
47 |
48 | /**
49 | * @param integer $quantity
50 | * @return Decklistslot
51 | */
52 | public function setQuantity(int $quantity)
53 | {
54 | $this->quantity = $quantity;
55 |
56 | return $this;
57 | }
58 |
59 | /**
60 | * @return Decklist
61 | */
62 | public function getDecklist()
63 | {
64 | return $this->decklist;
65 | }
66 |
67 | /**
68 | * @param Decklist $decklist
69 | * @return $this
70 | */
71 | public function setDecklist(Decklist $decklist)
72 | {
73 | $this->decklist = $decklist;
74 |
75 | return $this;
76 | }
77 |
78 | /**
79 | * @return Card
80 | */
81 | public function getCard()
82 | {
83 | return $this->card;
84 | }
85 |
86 | /**
87 | * @param Card $card
88 | * @return $this
89 | */
90 | public function setCard(Card $card)
91 | {
92 | $this->card = $card;
93 |
94 | return $this;
95 | }
96 | }
97 |
--------------------------------------------------------------------------------
/src/AppBundle/Entity/Deckslot.php:
--------------------------------------------------------------------------------
1 | id;
38 | }
39 |
40 | /**
41 | * @return integer
42 | */
43 | public function getQuantity()
44 | {
45 | return $this->quantity;
46 | }
47 |
48 | /**
49 | * @param integer $quantity
50 | * @return Deckslot
51 | */
52 | public function setQuantity(int $quantity)
53 | {
54 | $this->quantity = $quantity;
55 |
56 | return $this;
57 | }
58 |
59 | /**
60 | * @return Deck
61 | */
62 | public function getDeck()
63 | {
64 | return $this->deck;
65 | }
66 |
67 | /**
68 | * @param Deck $deck
69 | * @return $this
70 | */
71 | public function setDeck(Deck $deck)
72 | {
73 | $this->deck = $deck;
74 |
75 | return $this;
76 | }
77 |
78 | /**
79 | * @return Card
80 | */
81 | public function getCard()
82 | {
83 | return $this->card;
84 | }
85 |
86 | /**
87 | * @param Card $card
88 | * @return $this
89 | */
90 | public function setCard(Card $card)
91 | {
92 | $this->card = $card;
93 |
94 | return $this;
95 | }
96 | }
97 |
--------------------------------------------------------------------------------
/src/AppBundle/Entity/Highlight.php:
--------------------------------------------------------------------------------
1 | id;
26 | }
27 |
28 | /**
29 | * @return Decklist
30 | */
31 | public function getDecklist()
32 | {
33 | return $this->decklist;
34 | }
35 |
36 | /**
37 | * @param Decklist $decklist
38 | * @return $this
39 | */
40 | public function setDecklist(Decklist $decklist)
41 | {
42 | $this->decklist = $decklist;
43 |
44 | return $this;
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/src/AppBundle/Entity/Legality.php:
--------------------------------------------------------------------------------
1 | id;
37 | }
38 |
39 | /**
40 | * @return boolean
41 | */
42 | public function getIsLegal()
43 | {
44 | return $this->isLegal;
45 | }
46 |
47 | /**
48 | * @param boolean $isLegal
49 | * @return Legality
50 | */
51 | public function setIsLegal(bool $isLegal)
52 | {
53 | $this->isLegal = $isLegal;
54 |
55 | return $this;
56 | }
57 |
58 | /**
59 | * @return Decklist
60 | */
61 | public function getDecklist()
62 | {
63 | return $this->decklist;
64 | }
65 |
66 | /**
67 | * @param Decklist $decklist
68 | * @return $this
69 | */
70 | public function setDecklist(Decklist $decklist)
71 | {
72 | $this->decklist = $decklist;
73 |
74 | return $this;
75 | }
76 |
77 | /**
78 | * @return Mwl
79 | */
80 | public function getMwl()
81 | {
82 | return $this->mwl;
83 | }
84 |
85 | /**
86 | * @param Mwl $mwl
87 | * @return $this
88 | */
89 | public function setMwl(Mwl $mwl)
90 | {
91 | $this->mwl = $mwl;
92 |
93 | return $this;
94 | }
95 | }
96 |
--------------------------------------------------------------------------------
/src/AppBundle/Entity/Modflag.php:
--------------------------------------------------------------------------------
1 | decklists = new ArrayCollection();
36 | }
37 |
38 | /**
39 | * @return integer
40 | */
41 | public function getId()
42 | {
43 | return $this->id;
44 | }
45 |
46 | /**
47 | * @return string
48 | */
49 | public function getReason()
50 | {
51 | return $this->reason;
52 | }
53 |
54 | /**
55 | * @param string $reason
56 | * @return Modflag
57 | */
58 | public function setReason(string $reason)
59 | {
60 | $this->reason = $reason;
61 |
62 | return $this;
63 | }
64 |
65 | /**
66 | * Add decklist
67 | * @param Decklist $decklist
68 | * @return Modflag
69 | */
70 | public function addDecklist(Decklist $decklist)
71 | {
72 | $this->decklists[] = $decklist;
73 |
74 | return $this;
75 | }
76 |
77 | /**
78 | * Remove decklist
79 | * @param Decklist $decklist
80 | */
81 | public function removeDecklist(Decklist $decklist)
82 | {
83 | $this->decklists->removeElement($decklist);
84 | }
85 |
86 | /**
87 | * @return Collection
88 | */
89 | public function getDecklists()
90 | {
91 | return $this->decklists;
92 | }
93 | }
94 |
--------------------------------------------------------------------------------
/src/AppBundle/Entity/Prebuiltslot.php:
--------------------------------------------------------------------------------
1 | id;
37 | }
38 |
39 | /**
40 | * @return integer
41 | */
42 | public function getQuantity()
43 | {
44 | return $this->quantity;
45 | }
46 |
47 | /**
48 | * @param integer $quantity
49 | * @return Prebuiltslot
50 | */
51 | public function setQuantity(int $quantity)
52 | {
53 | $this->quantity = $quantity;
54 |
55 | return $this;
56 | }
57 |
58 | /**
59 | * @return Prebuilt
60 | */
61 | public function getPrebuilt()
62 | {
63 | return $this->prebuilt;
64 | }
65 |
66 | /**
67 | * @param Prebuilt $prebuilt
68 | * @return Prebuiltslot
69 | */
70 | public function setPrebuilt(Prebuilt $prebuilt)
71 | {
72 | $this->prebuilt = $prebuilt;
73 |
74 | return $this;
75 | }
76 |
77 | /**
78 | * @return Card
79 | */
80 | public function getCard()
81 | {
82 | return $this->card;
83 | }
84 |
85 | /**
86 | * @param Card $card
87 | * @return Prebuiltslot
88 | */
89 | public function setCard(Card $card)
90 | {
91 | $this->card = $card;
92 |
93 | return $this;
94 | }
95 | }
96 |
--------------------------------------------------------------------------------
/src/AppBundle/Entity/RefreshToken.php:
--------------------------------------------------------------------------------
1 | decklists = new ArrayCollection();
34 | }
35 |
36 | /**
37 | * @return integer
38 | */
39 | public function getId()
40 | {
41 | return $this->id;
42 | }
43 |
44 | /**
45 | * @return string
46 | */
47 | public function getDescription()
48 | {
49 | return $this->description;
50 | }
51 |
52 | /**
53 | * @param string $description
54 | * @return Tournament
55 | */
56 | public function setDescription(string $description)
57 | {
58 | $this->description = $description;
59 |
60 | return $this;
61 | }
62 |
63 | /**
64 | * Add decklists
65 | * @param Decklist $decklists
66 | * @return Tournament
67 | */
68 | public function addDecklist(Decklist $decklists)
69 | {
70 | $this->decklists[] = $decklists;
71 |
72 | return $this;
73 | }
74 |
75 | /**
76 | * Remove decklists
77 | * @param Decklist $decklists
78 | */
79 | public function removeDecklist(Decklist $decklists)
80 | {
81 | $this->decklists->removeElement($decklists);
82 | }
83 |
84 | /**
85 | * @return Collection
86 | */
87 | public function getDecklists()
88 | {
89 | return $this->decklists;
90 | }
91 | }
92 |
--------------------------------------------------------------------------------
/src/AppBundle/EventListener/DecklistListener.php:
--------------------------------------------------------------------------------
1 | logger = $logger;
21 | $this->cache = $cache;
22 | }
23 |
24 | private function clearFromCache(LifecycleEventArgs $args) {
25 | $entity = $args->getObject();
26 |
27 | if (!$entity instanceof Decklist) {
28 | return;
29 | }
30 | $this->cache->deleteItem('public-api-decklist-' . $entity->getId());
31 | }
32 |
33 | public function postPersist(LifecycleEventArgs $args)
34 | {
35 | $this->clearFromCache($args);
36 | }
37 |
38 | public function postUpdate(LifecycleEventArgs $args)
39 | {
40 | $this->clearFromCache($args);
41 | }
42 |
43 | public function postRemove(LifecycleEventArgs $args)
44 | {
45 | $this->clearFromCache($args);
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/src/AppBundle/Repository/CardRepository.php:
--------------------------------------------------------------------------------
1 | getClassMetadata('AppBundle\Entity\Card'));
13 | }
14 |
15 | public function findAll()
16 | {
17 | return $this->findBy([], ['code' => 'ASC']);
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/AppBundle/Repository/CycleRepository.php:
--------------------------------------------------------------------------------
1 | getClassMetadata('AppBundle\Entity\Cycle'));
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/AppBundle/Repository/FactionRepository.php:
--------------------------------------------------------------------------------
1 | getClassMetadata('AppBundle\Entity\Faction'));
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/AppBundle/Repository/PackRepository.php:
--------------------------------------------------------------------------------
1 | getClassMetadata('AppBundle\Entity\Pack'));
16 | }
17 |
18 | /**
19 | * @param Cycle $cycle
20 | * @return Pack[]
21 | */
22 | public function findByCycleWithCardCount(Cycle $cycle): array
23 | {
24 | $rsm = new ResultSetMappingBuilder($this->getEntityManager());
25 | $rsm->addRootEntityFromClassMetadata(Pack::class, 'p');
26 | $rsm->addScalarResult('cards', 'count', 'integer');
27 |
28 | $selectClause = $rsm->generateSelectClause([
29 | 'p' => 'p',
30 | ]);
31 |
32 | $sql = 'SELECT ' . $selectClause . ', count(c.id) as cards from pack p
33 | left join card c on c.pack_id=p.id
34 | where p.cycle_id = ?
35 | group by p.id
36 | order by p.position DESC';
37 |
38 | $query = $this->getEntityManager()->createNativeQuery($sql, $rsm);
39 | $query->setParameter(1, $cycle->getId());
40 |
41 | return array_map(function ($item) {
42 | /** @var Pack $pack */
43 | $pack = $item[0];
44 | $pack->setCardCount($item['count']);
45 |
46 | return $pack;
47 | }, $query->getResult());
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/src/AppBundle/Repository/RulingRepository.php:
--------------------------------------------------------------------------------
1 |
11 | */
12 | class RulingRepository extends EntityRepository
13 | {
14 | public function findAllSortedByCardCode()
15 | {
16 | return $this
17 | ->_em
18 | ->createQuery(
19 | 'SELECT r FROM AppBundle:Ruling r JOIN r.card c ORDER BY c.code ASC'
20 | )
21 | ->getResult();
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/AppBundle/Repository/SideRepository.php:
--------------------------------------------------------------------------------
1 | getClassMetadata('AppBundle\Entity\Side'));
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/AppBundle/Repository/TypeRepository.php:
--------------------------------------------------------------------------------
1 | getClassMetadata('AppBundle\Entity\Type'));
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/AppBundle/Resources/config/doctrine/AccessToken.orm.yml:
--------------------------------------------------------------------------------
1 | AppBundle\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/AppBundle/Resources/config/doctrine/AuthCode.orm.yml:
--------------------------------------------------------------------------------
1 | AppBundle\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/AppBundle/Resources/config/doctrine/Claim.orm.yml:
--------------------------------------------------------------------------------
1 | AppBundle\Entity\Claim:
2 | type: entity
3 | table: claim
4 | uniqueConstraints:
5 | usercard_index:
6 | columns: [ decklist_id, client_id, name, rank ]
7 | id:
8 | id:
9 | type: integer
10 | id: true
11 | generator:
12 | strategy: AUTO
13 | manyToOne:
14 | decklist:
15 | targetEntity: Decklist
16 | nullable: false
17 | inversedBy: claims
18 | joinColumn:
19 | name: decklist_id
20 | referencedColumnName: id
21 | client:
22 | targetEntity: Client
23 | nullable: true
24 | inversedBy: claims
25 | joinColumn:
26 | name: client_id
27 | referencedColumnName: id
28 | user:
29 | targetEntity: User
30 | nullable: true
31 | joinColumn:
32 | name: user_id
33 | referencedColumnName: id
34 | fields:
35 | name:
36 | type: string
37 | length: '255'
38 | url:
39 | type: string
40 | length: '255'
41 | rank:
42 | column: "`rank`"
43 | type: smallint
44 | participants:
45 | type: smallint
46 | lifecycleCallbacks: { }
47 |
--------------------------------------------------------------------------------
/src/AppBundle/Resources/config/doctrine/Client.orm.yml:
--------------------------------------------------------------------------------
1 | AppBundle\Entity\Client:
2 | type: entity
3 | table: client
4 | oneToMany:
5 | claims:
6 | targetEntity: Claim
7 | mappedBy: client
8 | cascade: ["remove"]
9 | fields:
10 | id:
11 | type: integer
12 | id: true
13 | generator:
14 | strategy: AUTO
15 | name:
16 | type: string
17 |
18 |
--------------------------------------------------------------------------------
/src/AppBundle/Resources/config/doctrine/Comment.orm.yml:
--------------------------------------------------------------------------------
1 | AppBundle\Entity\Comment:
2 | type: entity
3 | table: comment
4 | manyToOne:
5 | author:
6 | targetEntity: User
7 | nullable: false
8 | inversedBy: comments
9 | joinColumn:
10 | name: user_id
11 | referencedColumnName: id
12 | decklist:
13 | targetEntity: Decklist
14 | nullable: false
15 | inversedBy: comments
16 | joinColumn:
17 | name: decklist_id
18 | referencedColumnName: id
19 | fields:
20 | id:
21 | type: integer
22 | id: true
23 | generator:
24 | strategy: AUTO
25 | text:
26 | type: text
27 | dateCreation:
28 | type: datetime
29 | column: date_creation
30 | gedmo:
31 | timestampable:
32 | on: create
33 | hidden:
34 | type: boolean
35 | column: hidden
36 | options:
37 | default: false
38 | lifecycleCallbacks: { }
39 |
--------------------------------------------------------------------------------
/src/AppBundle/Resources/config/doctrine/Cycle.orm.yml:
--------------------------------------------------------------------------------
1 | AppBundle\Entity\Cycle:
2 | type: entity
3 | table: cycle
4 | repositoryClass: AppBundle\Repository\CycleRepository
5 | indexes:
6 | position_index:
7 | columns: [ position ]
8 | oneToMany:
9 | packs:
10 | orderBy: { 'position': 'ASC' }
11 | targetEntity: Pack
12 | mappedBy: cycle
13 | fetch: EAGER
14 | manyToMany:
15 | rotations:
16 | targetEntity: Rotation
17 | mappedBy: rotated
18 | cascade: ["remove"]
19 | fields:
20 | id:
21 | type: integer
22 | id: true
23 | generator:
24 | strategy: AUTO
25 | code:
26 | type: string
27 | unique: true
28 | length: 20
29 | nullable: false
30 | name:
31 | type: string
32 | length: 255
33 | nullable: false
34 | position:
35 | type: smallint
36 | nullable: false
37 | size:
38 | type: smallint
39 | nullable: false
40 | rotated:
41 | type: boolean
42 | nullable: false
43 | dateCreation:
44 | type: datetime
45 | nullable: false
46 | column: date_creation
47 | gedmo:
48 | timestampable:
49 | on: create
50 | dateUpdate:
51 | type: datetime
52 | nullable: false
53 | column: date_update
54 | gedmo:
55 | timestampable:
56 | on: update
57 | lifecycleCallbacks: { }
58 |
--------------------------------------------------------------------------------
/src/AppBundle/Resources/config/doctrine/Deckchange.orm.yml:
--------------------------------------------------------------------------------
1 | AppBundle\Entity\Deckchange:
2 | type: entity
3 | table: deckchange
4 | indexes:
5 | deck_saved_index:
6 | columns: [ deck_id, saved ]
7 | manyToOne:
8 | deck:
9 | targetEntity: Deck
10 | nullable: false
11 | inversedBy: changes
12 | joinColumn:
13 | name: deck_id
14 | referencedColumnName: id
15 | fields:
16 | id:
17 | type: integer
18 | id: true
19 | generator:
20 | strategy: AUTO
21 | dateCreation:
22 | type: datetime
23 | column: date_creation
24 | gedmo:
25 | timestampable:
26 | on: create
27 | variation:
28 | type: string
29 | length: 1024
30 | saved:
31 | type: boolean
32 | lifecycleCallbacks: { }
33 |
--------------------------------------------------------------------------------
/src/AppBundle/Resources/config/doctrine/Decklistslot.orm.yml:
--------------------------------------------------------------------------------
1 | AppBundle\Entity\Decklistslot:
2 | type: entity
3 | table: decklistslot
4 | manyToOne:
5 | decklist:
6 | targetEntity: Decklist
7 | nullable: false
8 | inversedBy: slots
9 | joinColumn:
10 | name: decklist_id
11 | referencedColumnName: id
12 | card:
13 | targetEntity: Card
14 | nullable: false
15 | joinColumn:
16 | name: card_id
17 | referencedColumnName: id
18 | fields:
19 | id:
20 | type: integer
21 | id: true
22 | generator:
23 | strategy: AUTO
24 | quantity:
25 | type: smallint
26 | lifecycleCallbacks: { }
27 |
--------------------------------------------------------------------------------
/src/AppBundle/Resources/config/doctrine/Deckslot.orm.yml:
--------------------------------------------------------------------------------
1 | AppBundle\Entity\Deckslot:
2 | type: entity
3 | table: deckslot
4 | manyToOne:
5 | deck:
6 | targetEntity: Deck
7 | nullable: false
8 | inversedBy: slots
9 | joinColumn:
10 | name: deck_id
11 | referencedColumnName: id
12 | card:
13 | targetEntity: Card
14 | nullable: false
15 | joinColumn:
16 | name: card_id
17 | referencedColumnName: id
18 | fields:
19 | id:
20 | type: integer
21 | id: true
22 | generator:
23 | strategy: AUTO
24 | quantity:
25 | type: smallint
26 | lifecycleCallbacks: { }
27 |
--------------------------------------------------------------------------------
/src/AppBundle/Resources/config/doctrine/Faction.orm.yml:
--------------------------------------------------------------------------------
1 | AppBundle\Entity\Faction:
2 | type: entity
3 | table: faction
4 | repositoryClass: AppBundle\Repository\FactionRepository
5 | indexes:
6 | code_index:
7 | columns: [ code ]
8 | oneToMany:
9 | cards:
10 | targetEntity: Card
11 | mappedBy: faction
12 | decklists:
13 | targetEntity: Decklist
14 | mappedBy: faction
15 | manyToOne:
16 | side:
17 | targetEntity: Side
18 | inversedBy: factions
19 | joinColumn:
20 | name: side_id
21 | referencedColumnName: id
22 | fields:
23 | id:
24 | type: integer
25 | id: true
26 | generator:
27 | strategy: AUTO
28 | code:
29 | type: string
30 | length: 255
31 | name:
32 | type: string
33 | length: 255
34 | color:
35 | type: string
36 | length: 6
37 | isMini:
38 | type: boolean
39 | nullable: true
40 | column: is_mini
41 | dateCreation:
42 | type: datetime
43 | nullable: false
44 | column: date_creation
45 | gedmo:
46 | timestampable:
47 | on: create
48 | dateUpdate:
49 | type: datetime
50 | nullable: false
51 | column: date_update
52 | gedmo:
53 | timestampable:
54 | on: update
55 | lifecycleCallbacks: { }
56 |
--------------------------------------------------------------------------------
/src/AppBundle/Resources/config/doctrine/Highlight.orm.yml:
--------------------------------------------------------------------------------
1 | AppBundle\Entity\Highlight:
2 | type: entity
3 | table: highlight
4 | fields:
5 | id:
6 | type: integer
7 | id: true
8 | generator:
9 | strategy: AUTO
10 | decklist:
11 | type: text
12 | nullable: true
13 | lifecycleCallbacks: { }
14 |
--------------------------------------------------------------------------------
/src/AppBundle/Resources/config/doctrine/Legality.orm.yml:
--------------------------------------------------------------------------------
1 | AppBundle\Entity\Legality:
2 | type: entity
3 | table: legality
4 | manyToOne:
5 | decklist:
6 | targetEntity: Decklist
7 | nullable: false
8 | inversedBy: legalities
9 | joinColumn:
10 | name: decklist_id
11 | referencedColumnName: id
12 | mwl:
13 | targetEntity: Mwl
14 | nullable: false
15 | inversedBy: legalities
16 | joinColumn:
17 | name: mwl_id
18 | referencedColumnName: id
19 | id:
20 | id:
21 | type: integer
22 | id: true
23 | generator:
24 | strategy: AUTO
25 | fields:
26 | isLegal:
27 | type: boolean
28 | column: is_legal
29 | lifecycleCallbacks: { }
30 |
--------------------------------------------------------------------------------
/src/AppBundle/Resources/config/doctrine/Moderation.orm.yml:
--------------------------------------------------------------------------------
1 | AppBundle\Entity\Moderation:
2 | type: entity
3 | table: moderation
4 | manyToOne:
5 | decklist:
6 | targetEntity: Decklist
7 | nullable: false
8 | joinColumn:
9 | name: decklist_id
10 | referencedColumnName: id
11 | moderator:
12 | targetEntity: User
13 | nullable: false
14 | joinColumn:
15 | name: user_id
16 | referencedColumnName: id
17 | id:
18 | id:
19 | type: integer
20 | id: true
21 | generator:
22 | strategy: AUTO
23 | fields:
24 | dateCreation:
25 | type: datetime
26 | nullable: false
27 | column: date_creation
28 | gedmo:
29 | timestampable:
30 | on: create
31 | statusBefore:
32 | type: integer
33 | nullable: true
34 | column: status_before
35 | statusAfter:
36 | type: integer
37 | nullable: true
38 | column: status_after
39 | lifecycleCallbacks: { }
40 |
--------------------------------------------------------------------------------
/src/AppBundle/Resources/config/doctrine/Modflag.orm.yml:
--------------------------------------------------------------------------------
1 | AppBundle\Entity\Modflag:
2 | type: entity
3 | table: modflags
4 | oneToMany:
5 | decklists:
6 | targetEntity: Decklist
7 | mappedBy: modflag
8 | id:
9 | id:
10 | type: integer
11 | id: true
12 | generator:
13 | strategy: AUTO
14 | fields:
15 | reason:
16 | type: string
17 | length: 255
18 | lifecycleCallbacks: { }
19 |
--------------------------------------------------------------------------------
/src/AppBundle/Resources/config/doctrine/Mwl.orm.yml:
--------------------------------------------------------------------------------
1 | AppBundle\Entity\Mwl:
2 | type: entity
3 | table: mwl
4 | oneToMany:
5 | legalities:
6 | targetEntity: Legality
7 | mappedBy: mwl
8 | cascade: ["persist","remove"]
9 | id:
10 | id:
11 | type: integer
12 | id: true
13 | generator:
14 | strategy: AUTO
15 | fields:
16 | code:
17 | type: string
18 | length: 255
19 | name:
20 | type: string
21 | length: 255
22 | dateCreation:
23 | type: datetime
24 | column: date_creation
25 | gedmo:
26 | timestampable:
27 | on: create
28 | dateUpdate:
29 | type: datetime
30 | column: date_update
31 | gedmo:
32 | timestampable:
33 | on: update
34 | dateStart:
35 | type: date
36 | nullable: true
37 | column: date_start
38 | active:
39 | type: boolean
40 | cards:
41 | type: json_array
42 | lifecycleCallbacks: { }
43 |
--------------------------------------------------------------------------------
/src/AppBundle/Resources/config/doctrine/MwlCard.orm.yml:
--------------------------------------------------------------------------------
1 | AppBundle\Entity\MwlCard:
2 | type: entity
3 | table: mwl_card
4 | manyToOne:
5 | mwl:
6 | targetEntity: Mwl
7 | nullable: false
8 | joinColumn:
9 | name: mwl_id
10 | referencedColumnName: id
11 | card:
12 | targetEntity: Card
13 | nullable: false
14 | joinColumn:
15 | name: card_id
16 | referencedColumnName: id
17 | fields:
18 | id:
19 | type: integer
20 | id: true
21 | generator:
22 | strategy: AUTO
23 | mwl_id:
24 | type: integer
25 | card_id:
26 | type: integer
27 | global_penalty:
28 | type: integer
29 | nullable: true
30 | universal_faction_cost:
31 | type: integer
32 | nullable: true
33 | is_restricted:
34 | type: boolean
35 | nullable: true
36 | is_banned:
37 | type: boolean
38 | nullable: true
39 | lifecycleCallbacks: { }
40 |
--------------------------------------------------------------------------------
/src/AppBundle/Resources/config/doctrine/Pack.orm.yml:
--------------------------------------------------------------------------------
1 | AppBundle\Entity\Pack:
2 | type: entity
3 | table: pack
4 | repositoryClass: AppBundle\Repository\PackRepository
5 | indexes:
6 | date_release_index:
7 | columns: [ date_release ]
8 | position_index:
9 | columns: [ position ]
10 | manyToOne:
11 | cycle:
12 | targetEntity: Cycle
13 | inversedBy: packs
14 | joinColumn:
15 | name: cycle_id
16 | referencedColumnName: id
17 | oneToMany:
18 | cards:
19 | orderBy: { 'position': 'ASC' }
20 | targetEntity: Card
21 | mappedBy: pack
22 | fetch: EXTRA_LAZY
23 | decklists:
24 | targetEntity: Decklist
25 | mappedBy: lastPack
26 | fields:
27 | id:
28 | type: integer
29 | id: true
30 | generator:
31 | strategy: AUTO
32 | code:
33 | type: string
34 | unique: true
35 | length: 10
36 | name:
37 | type: string
38 | length: 255
39 | dateRelease:
40 | type: date
41 | nullable: true
42 | column: date_release
43 | size:
44 | type: smallint
45 | nullable: true
46 | ffgId:
47 | type: integer
48 | column: ffg_id
49 | nullable: true
50 | position:
51 | type: smallint
52 | nullable: false
53 | dateCreation:
54 | type: datetime
55 | nullable: false
56 | column: date_creation
57 | gedmo:
58 | timestampable:
59 | on: create
60 | dateUpdate:
61 | type: datetime
62 | nullable: false
63 | column: date_update
64 | gedmo:
65 | timestampable:
66 | on: update
67 | lifecycleCallbacks: { }
68 |
--------------------------------------------------------------------------------
/src/AppBundle/Resources/config/doctrine/Prebuilt.orm.yml:
--------------------------------------------------------------------------------
1 | AppBundle\Entity\Prebuilt:
2 | type: entity
3 | table: prebuilt
4 | indexes:
5 | prebuilt_date_release_index:
6 | columns: [ date_release ]
7 | prebuilt_position_index:
8 | columns: [ position ]
9 | manyToOne:
10 | side:
11 | targetEntity: Side
12 | nullable: false
13 | joinColumn:
14 | name: side_id
15 | referencedColumnName: id
16 | identity:
17 | targetEntity: Card
18 | nullable: false
19 | joinColumn:
20 | name: identity_id
21 | referencedColumnName: id
22 | faction:
23 | targetEntity: Faction
24 | nullable: false
25 | joinColumn:
26 | name: faction_id
27 | referencedColumnName: id
28 | oneToMany:
29 | slots:
30 | targetEntity: Prebuiltslot
31 | mappedBy: prebuilt
32 | cascade: ["persist","detach","remove"]
33 | fields:
34 | id:
35 | type: integer
36 | id: true
37 | generator:
38 | strategy: AUTO
39 | code:
40 | type: string
41 | unique: true
42 | length: 50
43 | name:
44 | type: string
45 | length: 255
46 | dateRelease:
47 | type: date
48 | nullable: true
49 | column: date_release
50 | position:
51 | type: smallint
52 | nullable: false
53 | dateCreation:
54 | type: datetime
55 | nullable: false
56 | column: date_creation
57 | gedmo:
58 | timestampable:
59 | on: create
60 | dateUpdate:
61 | type: datetime
62 | nullable: false
63 | column: date_update
64 | gedmo:
65 | timestampable:
66 | on: update
67 | lifecycleCallbacks: { }
68 |
--------------------------------------------------------------------------------
/src/AppBundle/Resources/config/doctrine/Prebuiltslot.orm.yml:
--------------------------------------------------------------------------------
1 | AppBundle\Entity\Prebuiltslot:
2 | type: entity
3 | table: prebuiltslot
4 | manyToOne:
5 | prebuilt:
6 | targetEntity: Prebuilt
7 | nullable: false
8 | inversedBy: slots
9 | joinColumn:
10 | name: prebuilt_id
11 | referencedColumnName: id
12 | card:
13 | targetEntity: Card
14 | nullable: false
15 | joinColumn:
16 | name: card_id
17 | referencedColumnName: id
18 | fields:
19 | id:
20 | type: integer
21 | id: true
22 | generator:
23 | strategy: AUTO
24 | quantity:
25 | type: smallint
26 | lifecycleCallbacks: { }
27 |
--------------------------------------------------------------------------------
/src/AppBundle/Resources/config/doctrine/RefreshToken.orm.yml:
--------------------------------------------------------------------------------
1 | AppBundle\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/AppBundle/Resources/config/doctrine/Review.orm.yml:
--------------------------------------------------------------------------------
1 | AppBundle\Entity\Review:
2 | type: entity
3 | table: review
4 | uniqueConstraints:
5 | usercard_index:
6 | columns: [ card_id, user_id ]
7 | manyToOne:
8 | card:
9 | targetEntity: Card
10 | inversedBy: reviews
11 | joinColumn:
12 | name: card_id
13 | referencedColumnName: id
14 | user:
15 | targetEntity: User
16 | inversedBy: reviews
17 | joinColumn:
18 | name: user_id
19 | referencedColumnName: id
20 | oneToMany:
21 | comments:
22 | targetEntity: Reviewcomment
23 | mappedBy: review
24 | fetch: EXTRA_LAZY
25 | cascade: ["persist"]
26 | manyToMany:
27 | votes:
28 | targetEntity: User
29 | inversedBy: reviewvotes
30 | joinTable:
31 | name: reviewvote
32 | joinColumns:
33 | review_id:
34 | referencedColumnName: id
35 | inverseJoinColumns:
36 | user_id:
37 | referencedColumnName: id
38 | cascade: ["persist"]
39 | fields:
40 | id:
41 | type: integer
42 | id: true
43 | generator:
44 | strategy: AUTO
45 | dateCreation:
46 | type: datetime
47 | column: date_creation
48 | gedmo:
49 | timestampable:
50 | on: create
51 | dateUpdate:
52 | type: datetime
53 | column: date_update
54 | gedmo:
55 | timestampable:
56 | on: update
57 | rawtext:
58 | type: text
59 | nullable: false
60 | text:
61 | type: text
62 | nullable: false
63 | nbvotes:
64 | type: smallint
65 | nullable: false
66 |
67 |
--------------------------------------------------------------------------------
/src/AppBundle/Resources/config/doctrine/Reviewcomment.orm.yml:
--------------------------------------------------------------------------------
1 | AppBundle\Entity\Reviewcomment:
2 | type: entity
3 | table: reviewcomment
4 | manyToOne:
5 | author:
6 | targetEntity: User
7 | nullable: false
8 | joinColumn:
9 | name: user_id
10 | referencedColumnName: id
11 | review:
12 | targetEntity: Review
13 | nullable: false
14 | inversedBy: comments
15 | joinColumn:
16 | name: review_id
17 | referencedColumnName: id
18 | fields:
19 | id:
20 | type: integer
21 | id: true
22 | generator:
23 | strategy: AUTO
24 | dateCreation:
25 | type: datetime
26 | column: date_creation
27 | gedmo:
28 | timestampable:
29 | on: create
30 | dateUpdate:
31 | type: datetime
32 | column: date_update
33 | gedmo:
34 | timestampable:
35 | on: update
36 | text:
37 | type: text
38 | nullable: false
39 | lifecycleCallbacks: { }
40 |
--------------------------------------------------------------------------------
/src/AppBundle/Resources/config/doctrine/Rotation.orm.yml:
--------------------------------------------------------------------------------
1 | AppBundle\Entity\Rotation:
2 | type: entity
3 | table: rotation
4 | manyToMany:
5 | rotated:
6 | targetEntity: Cycle
7 | inversedBy: rotations
8 | joinTable:
9 | name: rotation_cycle
10 | joinColumns:
11 | rotation_id:
12 | referencedColumnName: id
13 | inverseJoinColumns:
14 | cycle_id:
15 | referencedColumnName: id
16 | cascade: ["persist"]
17 | oneToMany:
18 | decklists:
19 | targetEntity: Decklist
20 | mappedBy: rotation
21 | fields:
22 | id:
23 | type: integer
24 | id: true
25 | generator:
26 | strategy: AUTO
27 | code:
28 | type: string
29 | length: 255
30 | name:
31 | type: string
32 | length: 255
33 | dateCreation:
34 | type: datetime
35 | column: date_creation
36 | gedmo:
37 | timestampable:
38 | on: create
39 | dateUpdate:
40 | type: datetime
41 | column: date_update
42 | gedmo:
43 | timestampable:
44 | on: update
45 | dateStart:
46 | type: date
47 | nullable: true
48 | column: date_start
49 |
50 |
--------------------------------------------------------------------------------
/src/AppBundle/Resources/config/doctrine/Ruling.orm.yml:
--------------------------------------------------------------------------------
1 | AppBundle\Entity\Ruling:
2 | type: entity
3 | table: ruling
4 | repositoryClass: AppBundle\Repository\RulingRepository
5 | manyToOne:
6 | card:
7 | targetEntity: Card
8 | inversedBy: rulings
9 | joinColumn:
10 | name: card_id
11 | referencedColumnName: id
12 | user:
13 | targetEntity: User
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 | dateCreation:
24 | type: datetime
25 | column: date_creation
26 | gedmo:
27 | timestampable:
28 | on: create
29 | dateUpdate:
30 | type: datetime
31 | column: date_update
32 | gedmo:
33 | timestampable:
34 | on: update
35 | rawtext:
36 | type: text
37 | nullable: false
38 | text:
39 | type: text
40 | nullable: false
41 | nsg_rules_team_verified:
42 | type: boolean
43 | nullable: false
44 | options:
45 | default: false
46 |
--------------------------------------------------------------------------------
/src/AppBundle/Resources/config/doctrine/Side.orm.yml:
--------------------------------------------------------------------------------
1 | AppBundle\Entity\Side:
2 | type: entity
3 | table: side
4 | repositoryClass: AppBundle\Repository\SideRepository
5 | indexes:
6 | name_index:
7 | columns: [ name ]
8 | oneToMany:
9 | cards:
10 | targetEntity: Card
11 | mappedBy: side
12 | factions:
13 | targetEntity: Faction
14 | mappedBy: side
15 | decks:
16 | targetEntity: Deck
17 | mappedBy: side
18 | decklists:
19 | targetEntity: Decklist
20 | mappedBy: side
21 | fields:
22 | id:
23 | type: integer
24 | id: true
25 | generator:
26 | strategy: AUTO
27 | code:
28 | type: string
29 | unique: true
30 | length: 10
31 | name:
32 | type: string
33 | length: 255
34 | dateCreation:
35 | type: datetime
36 | nullable: false
37 | column: date_creation
38 | gedmo:
39 | timestampable:
40 | on: create
41 | dateUpdate:
42 | type: datetime
43 | nullable: false
44 | column: date_update
45 | gedmo:
46 | timestampable:
47 | on: update
48 | lifecycleCallbacks: { }
49 |
--------------------------------------------------------------------------------
/src/AppBundle/Resources/config/doctrine/Tournament.orm.yml:
--------------------------------------------------------------------------------
1 | AppBundle\Entity\Tournament:
2 | type: entity
3 | table: tournament
4 | oneToMany:
5 | decklists:
6 | targetEntity: Decklist
7 | mappedBy: tournament
8 | id:
9 | id:
10 | type: integer
11 | id: true
12 | generator:
13 | strategy: AUTO
14 | fields:
15 | description:
16 | type: string
17 | length: '60'
18 | lifecycleCallbacks: { }
19 |
--------------------------------------------------------------------------------
/src/AppBundle/Resources/config/doctrine/Type.orm.yml:
--------------------------------------------------------------------------------
1 | AppBundle\Entity\Type:
2 | type: entity
3 | table: type
4 | repositoryClass: AppBundle\Repository\TypeRepository
5 | indexes:
6 | name_index:
7 | columns: [ name ]
8 | oneToMany:
9 | cards:
10 | targetEntity: Card
11 | mappedBy: type
12 | manyToOne:
13 | side:
14 | targetEntity: Side
15 | joinColumn:
16 | name: side_id
17 | referencedColumnName: id
18 | fields:
19 | id:
20 | type: integer
21 | id: true
22 | generator:
23 | strategy: AUTO
24 | code:
25 | type: string
26 | unique: true
27 | length: 10
28 | name:
29 | type: string
30 | length: 255
31 | position:
32 | type: integer
33 | nullable: false
34 | isSubtype:
35 | type: boolean
36 | nullable: true
37 | column: is_subtype
38 | dateCreation:
39 | type: datetime
40 | nullable: false
41 | column: date_creation
42 | gedmo:
43 | timestampable:
44 | on: create
45 | dateUpdate:
46 | type: datetime
47 | nullable: false
48 | column: date_update
49 | gedmo:
50 | timestampable:
51 | on: update
52 | lifecycleCallbacks: { }
53 |
--------------------------------------------------------------------------------
/src/AppBundle/Service/DiffService.php:
--------------------------------------------------------------------------------
1 | entityManager = $entityManager;
16 | }
17 |
18 | public function diffContents(array $decks)
19 | {
20 |
21 | // n flat lists of the cards of each decklist
22 | $ensembles = [];
23 | foreach ($decks as $deck) {
24 | $cards = [];
25 | foreach ($deck as $code => $qty) {
26 | for ($i = 0; $i < $qty; $i++) {
27 | $cards[] = $code;
28 | }
29 | }
30 | $ensembles[] = $cards;
31 | }
32 |
33 | // 1 flat list of the cards seen in every decklist
34 | $conjunction = [];
35 | for ($i = 0; $i < count($ensembles[0]); $i++) {
36 | $code = $ensembles[0][$i];
37 | $indexes = [$i];
38 | for ($j = 1; $j < count($ensembles); $j++) {
39 | $index = array_search($code, $ensembles[$j]);
40 | if ($index !== false) {
41 | $indexes[] = $index;
42 | } else {
43 | break;
44 | }
45 | }
46 | if (count($indexes) === count($ensembles)) {
47 | $conjunction[] = $code;
48 | for ($j = 0; $j < count($indexes); $j++) {
49 | $list = $ensembles[$j];
50 | array_splice($list, $indexes[$j], 1);
51 | $ensembles[$j] = $list;
52 | }
53 | $i--;
54 | }
55 | }
56 |
57 | $listings = [];
58 | for ($i = 0; $i < count($ensembles); $i++) {
59 | $listings[$i] = array_count_values($ensembles[$i]);
60 | }
61 | $intersect = array_count_values($conjunction);
62 |
63 | return [$listings, $intersect];
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/src/AppBundle/Service/Illustrators.php:
--------------------------------------------------------------------------------
1 |
16 | */
17 | class RepositoryFactory
18 | {
19 | /** @var ManagerRegistry $registry */
20 | private $registry;
21 |
22 | public function __construct(ManagerRegistry $registry)
23 | {
24 | $this->registry = $registry;
25 | }
26 |
27 | /**
28 | * @param string $class
29 | * @return \Doctrine\Common\Persistence\ObjectRepository
30 | */
31 | public function getRepository(string $class)
32 | {
33 | $objectManager = $this->registry->getManagerForClass($class);
34 |
35 | if ($objectManager instanceof ObjectManager) {
36 | return $objectManager->getRepository($class);
37 | }
38 |
39 | throw new \LogicException('No manager defined for class ' . $class);
40 | }
41 |
42 | /**
43 | * @return PackRepository
44 | */
45 | public function getPackRepository()
46 | {
47 | $repository = $this->getRepository(Pack::class);
48 |
49 | if ($repository instanceof PackRepository) {
50 | return $repository;
51 | }
52 |
53 | throw new \LogicException('Doctrine manager returned wrong repository.');
54 | }
55 |
56 | /**
57 | * @return CycleRepository
58 | */
59 | public function getCycleRepository()
60 | {
61 | $repository = $this->getRepository(Cycle::class);
62 |
63 | if ($repository instanceof CycleRepository) {
64 | return $repository;
65 | }
66 |
67 | throw new \LogicException('Doctrine manager returned wrong repository.');
68 | }
69 | }
--------------------------------------------------------------------------------
/src/AppBundle/Twig/AppExtension.php:
--------------------------------------------------------------------------------
1 | request('GET', '/');
14 |
15 | $this->assertEquals(200, $client->getResponse()->getStatusCode());
16 | $this->assertContains('Welcome to Symfony', $crawler->filter('#container h1')->text());
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/var/cache/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/var/cache/.gitkeep
--------------------------------------------------------------------------------
/var/logs/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/var/logs/.gitkeep
--------------------------------------------------------------------------------
/var/sessions/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/var/sessions/.gitkeep
--------------------------------------------------------------------------------
/web/app.php:
--------------------------------------------------------------------------------
1 | loadClassCache();
13 | }
14 | //$kernel = new AppCache($kernel);
15 |
16 | // When using the HttpCache, you need to call the method in your front controller instead of relying on the configuration parameter
17 | //Request::enableHttpMethodParameterOverride();
18 | $request = Request::createFromGlobals();
19 | $response = $kernel->handle($request);
20 | $response->send();
21 | $kernel->terminate($request, $response);
22 |
--------------------------------------------------------------------------------
/web/app_dev.php:
--------------------------------------------------------------------------------
1 | loadClassCache();
27 | }
28 | $request = Request::createFromGlobals();
29 | $response = $kernel->handle($request);
30 | $response->send();
31 | $kernel->terminate($request, $response);
32 |
--------------------------------------------------------------------------------
/web/apple-touch-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/apple-touch-icon.png
--------------------------------------------------------------------------------
/web/become_a_patron_button.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/become_a_patron_button.png
--------------------------------------------------------------------------------
/web/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/favicon.ico
--------------------------------------------------------------------------------
/web/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/favicon.png
--------------------------------------------------------------------------------
/web/fonts/Lato-Bold.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/fonts/Lato-Bold.eot
--------------------------------------------------------------------------------
/web/fonts/Lato-Bold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/fonts/Lato-Bold.ttf
--------------------------------------------------------------------------------
/web/fonts/Lato-Bold.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/fonts/Lato-Bold.woff
--------------------------------------------------------------------------------
/web/fonts/Lato-Bold.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/fonts/Lato-Bold.woff2
--------------------------------------------------------------------------------
/web/fonts/Lato-BoldItalic.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/fonts/Lato-BoldItalic.eot
--------------------------------------------------------------------------------
/web/fonts/Lato-BoldItalic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/fonts/Lato-BoldItalic.ttf
--------------------------------------------------------------------------------
/web/fonts/Lato-BoldItalic.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/fonts/Lato-BoldItalic.woff
--------------------------------------------------------------------------------
/web/fonts/Lato-BoldItalic.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/fonts/Lato-BoldItalic.woff2
--------------------------------------------------------------------------------
/web/fonts/Lato-Italic.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/fonts/Lato-Italic.eot
--------------------------------------------------------------------------------
/web/fonts/Lato-Italic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/fonts/Lato-Italic.ttf
--------------------------------------------------------------------------------
/web/fonts/Lato-Italic.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/fonts/Lato-Italic.woff
--------------------------------------------------------------------------------
/web/fonts/Lato-Italic.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/fonts/Lato-Italic.woff2
--------------------------------------------------------------------------------
/web/fonts/Lato-Light.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/fonts/Lato-Light.eot
--------------------------------------------------------------------------------
/web/fonts/Lato-Light.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/fonts/Lato-Light.ttf
--------------------------------------------------------------------------------
/web/fonts/Lato-Light.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/fonts/Lato-Light.woff
--------------------------------------------------------------------------------
/web/fonts/Lato-Light.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/fonts/Lato-Light.woff2
--------------------------------------------------------------------------------
/web/fonts/Lato-LightItalic.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/fonts/Lato-LightItalic.eot
--------------------------------------------------------------------------------
/web/fonts/Lato-LightItalic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/fonts/Lato-LightItalic.ttf
--------------------------------------------------------------------------------
/web/fonts/Lato-LightItalic.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/fonts/Lato-LightItalic.woff
--------------------------------------------------------------------------------
/web/fonts/Lato-LightItalic.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/fonts/Lato-LightItalic.woff2
--------------------------------------------------------------------------------
/web/fonts/Lato-Regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/fonts/Lato-Regular.eot
--------------------------------------------------------------------------------
/web/fonts/Lato-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/fonts/Lato-Regular.ttf
--------------------------------------------------------------------------------
/web/fonts/Lato-Regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/fonts/Lato-Regular.woff
--------------------------------------------------------------------------------
/web/fonts/Lato-Regular.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/fonts/Lato-Regular.woff2
--------------------------------------------------------------------------------
/web/fonts/netrunner.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/fonts/netrunner.eot
--------------------------------------------------------------------------------
/web/fonts/netrunner.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/fonts/netrunner.ttf
--------------------------------------------------------------------------------
/web/fonts/netrunner.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/fonts/netrunner.woff
--------------------------------------------------------------------------------
/web/fonts/nrdb.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/fonts/nrdb.eot
--------------------------------------------------------------------------------
/web/fonts/nrdb.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/fonts/nrdb.ttf
--------------------------------------------------------------------------------
/web/fonts/nrdb.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/fonts/nrdb.woff
--------------------------------------------------------------------------------
/web/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/icon.png
--------------------------------------------------------------------------------
/web/images/factions/16px/adam.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/images/factions/16px/adam.png
--------------------------------------------------------------------------------
/web/images/factions/16px/anarch.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/images/factions/16px/anarch.png
--------------------------------------------------------------------------------
/web/images/factions/16px/apex.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/images/factions/16px/apex.png
--------------------------------------------------------------------------------
/web/images/factions/16px/criminal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/images/factions/16px/criminal.png
--------------------------------------------------------------------------------
/web/images/factions/16px/haas-bioroid.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/images/factions/16px/haas-bioroid.png
--------------------------------------------------------------------------------
/web/images/factions/16px/jinteki.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/images/factions/16px/jinteki.png
--------------------------------------------------------------------------------
/web/images/factions/16px/nbn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/images/factions/16px/nbn.png
--------------------------------------------------------------------------------
/web/images/factions/16px/neutral-corp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/images/factions/16px/neutral-corp.png
--------------------------------------------------------------------------------
/web/images/factions/16px/neutral-runner.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/images/factions/16px/neutral-runner.png
--------------------------------------------------------------------------------
/web/images/factions/16px/shaper.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/images/factions/16px/shaper.png
--------------------------------------------------------------------------------
/web/images/factions/16px/sunny-lebeau.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/images/factions/16px/sunny-lebeau.png
--------------------------------------------------------------------------------
/web/images/factions/16px/weyland-consortium.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/images/factions/16px/weyland-consortium.png
--------------------------------------------------------------------------------
/web/images/factions/38px/anarch.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/images/factions/38px/anarch.png
--------------------------------------------------------------------------------
/web/images/factions/38px/criminal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/images/factions/38px/criminal.png
--------------------------------------------------------------------------------
/web/images/factions/38px/haas-bioroid.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/images/factions/38px/haas-bioroid.png
--------------------------------------------------------------------------------
/web/images/factions/38px/jinteki.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/images/factions/38px/jinteki.png
--------------------------------------------------------------------------------
/web/images/factions/38px/nbn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/images/factions/38px/nbn.png
--------------------------------------------------------------------------------
/web/images/factions/38px/neutral-corp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/images/factions/38px/neutral-corp.png
--------------------------------------------------------------------------------
/web/images/factions/38px/neutral-runner.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/images/factions/38px/neutral-runner.png
--------------------------------------------------------------------------------
/web/images/factions/38px/shaper.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/images/factions/38px/shaper.png
--------------------------------------------------------------------------------
/web/images/factions/38px/weyland-consortium.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/images/factions/38px/weyland-consortium.png
--------------------------------------------------------------------------------
/web/images/flags/128px/flag_de.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/images/flags/128px/flag_de.png
--------------------------------------------------------------------------------
/web/images/flags/128px/flag_en.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/images/flags/128px/flag_en.png
--------------------------------------------------------------------------------
/web/images/flags/128px/flag_es.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/images/flags/128px/flag_es.png
--------------------------------------------------------------------------------
/web/images/flags/128px/flag_fr.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/images/flags/128px/flag_fr.png
--------------------------------------------------------------------------------
/web/images/flags/128px/flag_he.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/images/flags/128px/flag_he.png
--------------------------------------------------------------------------------
/web/images/flags/128px/flag_it.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/images/flags/128px/flag_it.png
--------------------------------------------------------------------------------
/web/images/flags/128px/flag_jp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/images/flags/128px/flag_jp.png
--------------------------------------------------------------------------------
/web/images/flags/128px/flag_kr.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/images/flags/128px/flag_kr.png
--------------------------------------------------------------------------------
/web/images/flags/128px/flag_pl.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/images/flags/128px/flag_pl.png
--------------------------------------------------------------------------------
/web/images/flags/128px/flag_pt.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/images/flags/128px/flag_pt.png
--------------------------------------------------------------------------------
/web/images/flags/128px/flag_zh.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/images/flags/128px/flag_zh.png
--------------------------------------------------------------------------------
/web/images/flags/32px/flag_de.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/images/flags/32px/flag_de.png
--------------------------------------------------------------------------------
/web/images/flags/32px/flag_en.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/images/flags/32px/flag_en.png
--------------------------------------------------------------------------------
/web/images/flags/32px/flag_es.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/images/flags/32px/flag_es.png
--------------------------------------------------------------------------------
/web/images/flags/32px/flag_fr.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/images/flags/32px/flag_fr.png
--------------------------------------------------------------------------------
/web/images/flags/32px/flag_he.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/images/flags/32px/flag_he.png
--------------------------------------------------------------------------------
/web/images/flags/32px/flag_it.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/images/flags/32px/flag_it.png
--------------------------------------------------------------------------------
/web/images/flags/32px/flag_jp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/images/flags/32px/flag_jp.png
--------------------------------------------------------------------------------
/web/images/flags/32px/flag_kr.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/images/flags/32px/flag_kr.png
--------------------------------------------------------------------------------
/web/images/flags/32px/flag_pl.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/images/flags/32px/flag_pl.png
--------------------------------------------------------------------------------
/web/images/flags/32px/flag_pt.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/images/flags/32px/flag_pt.png
--------------------------------------------------------------------------------
/web/images/flags/32px/flag_zh.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/images/flags/32px/flag_zh.png
--------------------------------------------------------------------------------
/web/images/types/agenda.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/images/types/agenda.png
--------------------------------------------------------------------------------
/web/images/types/asset.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/images/types/asset.png
--------------------------------------------------------------------------------
/web/images/types/event.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/images/types/event.png
--------------------------------------------------------------------------------
/web/images/types/hardware.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/images/types/hardware.png
--------------------------------------------------------------------------------
/web/images/types/ice.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/images/types/ice.png
--------------------------------------------------------------------------------
/web/images/types/identity.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/images/types/identity.png
--------------------------------------------------------------------------------
/web/images/types/operation.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/images/types/operation.png
--------------------------------------------------------------------------------
/web/images/types/program.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/images/types/program.png
--------------------------------------------------------------------------------
/web/images/types/resource.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/images/types/resource.png
--------------------------------------------------------------------------------
/web/images/types/upgrade.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NetrunnerDB/netrunnerdb/f1c8588bd751d665575d054d5d58a7a7acecb777/web/images/types/upgrade.png
--------------------------------------------------------------------------------
/web/js/decklists.js:
--------------------------------------------------------------------------------
1 | /* global NRDB, Promise, _ */
2 |
3 | Promise.all([NRDB.user.promise, NRDB.ui.promise]).then(function () {
4 | if(NRDB.user.data.is_moderator) {
5 | var $sideNav = $('#side_nav');
6 | var states = {'trashed': "Trashed", 'restored': "Restored"};
7 | _.forEach(states, function (label, state) {
8 | var $item = $('').appendTo($sideNav);
9 | var $link = $('').appendTo($item);
10 | $link.attr('href', Routing.generate('decklists_list', {type:state})).text(label).addClass('text-danger');
11 | });
12 | }
13 | });
14 |
--------------------------------------------------------------------------------
/web/js/index.js:
--------------------------------------------------------------------------------
1 | $(document).on('data.app', function() {
2 | if (Decklist == null) {
3 | return;
4 | }
5 | for (var i = 0; i < Decklist.cards.length; i++) {
6 | var slot = Decklist.cards[i];
7 | NRDB.data.cards.update({
8 | code : slot.card_code
9 | }, {
10 | indeck : parseInt(slot.qty, 10)
11 | });
12 | }
13 | if(Decklist.mwl_code) {
14 | MWL = NRDB.data.mwl.findById(Decklist.mwl_code);
15 | }
16 | update_deck();
17 | });
18 |
19 | $(function() {
20 | $('#version-popover').popover({
21 | html : true
22 | });
23 |
24 | $('#update-log a').click(function (event) {
25 | event.preventDefault();
26 | let l = event.currentTarget;
27 | if (l.text == '(expand)') {
28 | l.text = '(shrink)';
29 | $('#update-log tbody').css("max-height", "400px");
30 | } else {
31 | l.text = '(expand)';
32 | $('#update-log tbody').css("max-height", "");
33 | }
34 | return false;
35 | });
36 |
37 | $('#close-updates').click(function () {
38 | $('#update-log').hide();
39 | });
40 |
41 | });
42 |
--------------------------------------------------------------------------------
/web/js/nrdb.deck_browser.js:
--------------------------------------------------------------------------------
1 | (function(deck_browser, $) {
2 | var images = null;
3 |
4 | function switch_left() {
5 |
6 | $('#deck_browser_left div:visible').last().hide();
7 | $('#deck_browser_right div:hidden').first().show();
8 | var focus = $('#deck_browser_center div:visible');
9 | focus.prev().show();
10 | focus.hide();
11 |
12 | }
13 |
14 | function switch_right() {
15 |
16 | $('#deck_browser_right div:visible').last().hide();
17 | $('#deck_browser_left div:hidden').first().show();
18 | var focus = $('#deck_browser_center div:visible');
19 | focus.next().show();
20 | focus.hide();
21 |
22 | }
23 |
24 | function focus_to(event) {
25 | var index = $(this).data('index');
26 | focus_index(index);
27 | }
28 |
29 | function focus_index(index) {
30 | $('#deck_browser_left > div').each(function (i, elt) {
31 | if(i < index) $(elt).show();
32 | else $(elt).hide();
33 | });
34 | $('#deck_browser_center > div').each(function (i, elt) {
35 | if(i == index) $(elt).show();
36 | else $(elt).hide();
37 | });
38 | $('#deck_browser_right > div').each(function (i, elt) {
39 | if(images.length - 1 - i > index) $(elt).show();
40 | else $(elt).hide();
41 | });
42 | }
43 |
44 | deck_browser.update = function() {
45 |
46 | images = [ Identity.imageUrl ];
47 | NRDB.data.cards.find({
48 | indeck : {
49 | '$gt' : 0
50 | },
51 | type_code : {
52 | '$ne' : 'identity'
53 | }
54 | }, {
55 | '$orderBy': {
56 | type_code: 1,
57 | title: 1
58 | }
59 | }).forEach(function(card) {
60 | for (var i = 0; i < card.indeck; i++) {
61 | images.push(card.imageUrl);
62 | }
63 | });
64 | for (var i = 0; i < images.length; i++) {
65 | var div = $('');
66 | $('#deck_browser_left').append(div.data('index', i));
67 | $('#deck_browser_center').append(div.clone().data('index', i));
68 | $('#deck_browser_right').prepend(div.clone().data('index', i));
69 | }
70 | $('#deck_browser').on({
71 | click : focus_to
72 | }, 'div');
73 | focus_index(0);
74 | };
75 |
76 | })(NRDB.deck_browser = {}, jQuery);
77 |
--------------------------------------------------------------------------------
/web/js/nrdb.deck_gallery.js:
--------------------------------------------------------------------------------
1 | (function(deck_gallery, $) {
2 | var images = null;
3 |
4 | deck_gallery.update = function() {
5 |
6 | images = [ Identity.imageUrl ];
7 | qtys = [ 1 ];
8 | NRDB.data.cards.find({
9 | indeck : {
10 | '$gt' : 0
11 | },
12 | type_code : {
13 | '$ne' : 'identity'
14 | }
15 | }, {
16 | '$orderBy': {
17 | type_code: 1,
18 | title: 1
19 | }
20 | }).forEach(function(card) {
21 | images.push(card.imageUrl);
22 | qtys.push(card.indeck);
23 | });
24 | for (var i = 0; i < images.length; i++) {
25 | var cell = $(' '+qtys[i]+'
');
26 | $('#deck_gallery tr').append(cell.data('index', i));
27 | }
28 | };
29 |
30 | })(NRDB.deck_gallery = {}, jQuery);
31 |
--------------------------------------------------------------------------------
/web/js/nrdb.diff.js:
--------------------------------------------------------------------------------
1 | (function(diff, $) {
2 |
3 |
4 | // takes an array of strings and returns an object where each string of the array
5 | // is a key of the object and the value is the number of occurences of the string in the array
6 | function array_count(list) {
7 | var obj = {};
8 | var list = list.sort();
9 | for(var i=0; i -1) indexes.push(index);
43 | else break;
44 | }
45 | if(indexes.length === ensembles.length) {
46 | conjunction.push(code);
47 | for(var j=0; j {
11 | // Register click event for theme toggle button
12 | $('button[data-theme-toggle]').on('click', () => {
13 | set_theme(localStorage.getItem('theme') === 'light' ? 'dark' : 'light');
14 | })
15 | $('a[data-theme-toggle]').on('click', (event) => {
16 | event.preventDefault();
17 | set_theme(localStorage.getItem('theme') === 'light' ? 'dark' : 'light');
18 | });
19 | })
20 |
21 | // Listen for system theme preference change
22 | window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', event => {
23 | set_theme(event.matches ? 'dark' : 'light');
24 | });
25 |
--------------------------------------------------------------------------------
/web/js/profile.js:
--------------------------------------------------------------------------------
1 | $(function () {
2 |
3 | $.when(NRDB.user.deferred).then(function () {
4 | if(NRDB.user.data.is_authenticated) {
5 | if(NRDB.user.data.following.indexOf(UserId) > -1) {
6 | $('#unfollow').show();
7 | } else {
8 | $('#follow').show();
9 | }
10 | }
11 | });
12 |
13 | $('#unfollow').mouseover(function (event) {
14 | $(this).addClass('btn-danger').removeClass('btn-info').html(' Unfollow');
15 | }).mouseout(function (event) {
16 | $(this).addClass('btn-info').removeClass('btn-danger').html(' Following');
17 | });
18 |
19 | $('a.btn').click(function (event) {
20 | event.preventDefault();
21 | var href = $(this).attr('href');
22 | setTimeout(function () {
23 | location.href = href;
24 | }, 100);
25 | });
26 |
27 | });
28 |
--------------------------------------------------------------------------------
/web/latofonts.css:
--------------------------------------------------------------------------------
1 | /* Webfont: Lato-Bold */@font-face {
2 | font-family: 'LatoWeb';
3 | src: url('fonts/Lato-Bold.eot'); /* IE9 Compat Modes */
4 | src: url('fonts/Lato-Bold.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
5 | url('fonts/Lato-Bold.woff2') format('woff2'), /* Modern Browsers */
6 | url('fonts/Lato-Bold.woff') format('woff'), /* Modern Browsers */
7 | url('fonts/Lato-Bold.ttf') format('truetype');
8 | font-style: normal;
9 | font-weight: bold;
10 | text-rendering: optimizeLegibility;
11 | }
12 |
13 | /* Webfont: Lato-BoldItalic */@font-face {
14 | font-family: 'LatoWeb';
15 | src: url('fonts/Lato-BoldItalic.eot'); /* IE9 Compat Modes */
16 | src: url('fonts/Lato-BoldItalic.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
17 | url('fonts/Lato-BoldItalic.woff2') format('woff2'), /* Modern Browsers */
18 | url('fonts/Lato-BoldItalic.woff') format('woff'), /* Modern Browsers */
19 | url('fonts/Lato-BoldItalic.ttf') format('truetype');
20 | font-style: italic;
21 | font-weight: bold;
22 | text-rendering: optimizeLegibility;
23 | }
24 |
25 | /* Webfont: Lato-Italic */@font-face {
26 | font-family: 'LatoWeb';
27 | src: url('fonts/Lato-Italic.eot'); /* IE9 Compat Modes */
28 | src: url('fonts/Lato-Italic.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
29 | url('fonts/Lato-Italic.woff2') format('woff2'), /* Modern Browsers */
30 | url('fonts/Lato-Italic.woff') format('woff'), /* Modern Browsers */
31 | url('fonts/Lato-Italic.ttf') format('truetype');
32 | font-style: italic;
33 | font-weight: normal;
34 | text-rendering: optimizeLegibility;
35 | }
36 |
37 | /* Webfont: Lato-Regular */@font-face {
38 | font-family: 'LatoWeb';
39 | src: url('fonts/Lato-Regular.eot'); /* IE9 Compat Modes */
40 | src: url('fonts/Lato-Regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
41 | url('fonts/Lato-Regular.woff2') format('woff2'), /* Modern Browsers */
42 | url('fonts/Lato-Regular.woff') format('woff'), /* Modern Browsers */
43 | url('fonts/Lato-Regular.ttf') format('truetype');
44 | font-style: normal;
45 | font-weight: normal;
46 | text-rendering: optimizeLegibility;
47 | }
48 |
49 |
--------------------------------------------------------------------------------
/web/lib/jquery-persistence.js:
--------------------------------------------------------------------------------
1 | /*
2 | * jQuery Persistence plugin
3 | * Saves and Loads the value of an input in localForage
4 | */
5 |
6 | (function ($) {
7 | "use strict";
8 |
9 | var toggle = '[data-persistence]',
10 | eventName = 'persistence:change',
11 | eventNamespace = '.persistence';
12 |
13 | function Persistence (element) {
14 | var self = this,
15 | $element = $(element);
16 |
17 | $element.on('change' + eventNamespace, function (event) {
18 | self.save.call($element);
19 | });
20 | }
21 |
22 | var proto = Persistence.prototype;
23 |
24 | proto.load = function () {
25 | var $element = $(this),
26 | name = $element.attr('name');
27 |
28 | return localforage.getItem(name).then(function (value) {
29 | if(value === null) return;
30 | switch($element.attr('type')) {
31 | case 'checkbox':
32 | $element.prop('checked', value);
33 | break;
34 | case 'radio':
35 | $element.prop('checked', $element.val() === value);
36 | break;
37 | default:
38 | $element.val(value);
39 | break;
40 | }
41 | $element.trigger(eventName, [ value ]);
42 | });
43 | }
44 |
45 | proto.save = function () {
46 | var $element = $(this),
47 | name = $element.attr('name');
48 |
49 | var value;
50 | switch($element.attr('type')) {
51 | case 'checkbox':
52 | value = $element.is(':checked');
53 | break;
54 | case 'radio':
55 | value = $element.is(':checked') ? $element.val() : null;
56 | break;
57 | default:
58 | value = $element.val();
59 | break;
60 | }
61 |
62 | if(value === null) return;
63 | return localforage.setItem(name, value).then(function (value) {
64 | $element.trigger(eventName, [ value ]);
65 | });
66 | }
67 |
68 | // PERSISTENCE PLUGIN DEFINITION
69 | // ==========================
70 |
71 | $.fn.persistence = function (option) {
72 | return Promise.all(
73 | this.map(function () {
74 | var $this = $(this);
75 | var data = $this.data('jq.persistence');
76 |
77 | if (!data) $this.data('jq.persistence', (data = new Persistence(this)));
78 | if (typeof option == 'string') return data[option].call($this);
79 | })
80 | );
81 | };
82 |
83 | $.fn.persistence.Constructor = Persistence;
84 |
85 | })(jQuery);
86 |
--------------------------------------------------------------------------------
/web/robots.txt:
--------------------------------------------------------------------------------
1 | # www.robotstxt.org/
2 | # www.google.com/support/webmasters/bin/answer.py?hl=en&answer=156449
3 |
4 | User-agent: *
5 | Disallow:
6 |
--------------------------------------------------------------------------------
/web/update_log.example.txt:
--------------------------------------------------------------------------------
1 | Saturday, 28 June, 8128
2 | - This update is in the future.
3 | - To show updates on the home page, copy this file as "update_log.txt" and fill it with appropriate data in this format.
4 |
5 | Saturday, 1 January, 2000
6 | - Turn of the Millennium
7 | - An example of an update with multiple entries was added.
8 |
9 | Thursday, 1 January, 1970
10 | - Time began.
11 |
--------------------------------------------------------------------------------