Skip to content

Commit

Permalink
Merge pull request #324 from ubermichael/blog-pdfs
Browse files Browse the repository at this point in the history
Add PDFs to blog posts
  • Loading branch information
ubermichael authored Jun 1, 2022
2 parents 4a737bb + 757b136 commit 58ee20a
Show file tree
Hide file tree
Showing 70 changed files with 3,764 additions and 104 deletions.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"doctrine/doctrine-bundle": "^2.3",
"doctrine/doctrine-migrations-bundle": "3.0.*",
"doctrine/orm": "^2.7",
"doctrine/persistence": "^2.5",
"knplabs/knp-menu-bundle": "^3.2",
"knplabs/knp-paginator-bundle": "^5.8",
"ninsuo/symfony-collection": "^2.1",
Expand Down
39 changes: 20 additions & 19 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion config/bundles.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
Tetranz\Select2EntityBundle\TetranzSelect2EntityBundle::class => ['all' => true],
DAMA\DoctrineTestBundle\DAMADoctrineTestBundle::class => ['test' => true],

Nines\BlogBundle\NinesBlogBundle::class => ['all' => true],
Nines\EditorBundle\NinesEditorBundle::class => ['all' => true],
Nines\FeedbackBundle\NinesFeedbackBundle::class => ['all' => true],
Nines\MakerBundle\NinesMakerBundle::class => ['dev' => true],
Nines\MediaBundle\NinesMediaBundle::class => ['all' => true],
Nines\UserBundle\NinesUserBundle::class => ['all' => true],
Nines\UtilBundle\NinesUtilBundle::class => ['all' => true],
];
6 changes: 0 additions & 6 deletions config/packages/nines_blog.yaml

This file was deleted.

3 changes: 3 additions & 0 deletions config/packages/nines_util.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ nines_util:
person:
class: App\Entity\Person
route: person_show
post:
class: App\Entity\Post
route: nines_blog_post_show
title:
class: App\Entity\Title
route: title_show
Expand Down
2 changes: 1 addition & 1 deletion config/packages/security.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ security:
remember_me_parameter: remember_me

role_hierarchy:
ROLE_ADMIN: [ ROLE_ADMIN, ROLE_BLOG_ADMIN, ROLE_COMMENT_ADMIN, ROLE_CONTENT_ADMIN, ROLE_DC_ADMIN, ROLE_USER_ADMIN ]
ROLE_ADMIN: [ ROLE_ADMIN, ROLE_BLOG_ADMIN, ROLE_COMMENT_ADMIN, ROLE_CONTENT_ADMIN, ROLE_DC_ADMIN, ROLE_MEDIA_ADMIN, ROLE_USER_ADMIN ]
ROLE_BLOG_ADMIN: ROLE_USER
ROLE_COMMENT_ADMIN: ROLE_USER
ROLE_CONTENT_ADMIN: ROLE_USER
Expand Down
10 changes: 5 additions & 5 deletions config/routes.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
nines_blog:
resource: '@NinesBlogBundle/config/routes.yaml'
prefix: /blog

nines_editor:
prefix: /editor
resource: '@NinesEditorBundle/config/routes.yaml'
prefix: editor

nines_feedback:
prefix: /feedback
resource: '@NinesFeedbackBundle/config/routes.yaml'

nines_media:
prefix: /media
resource: '@NinesMediaBundle/config/routes.yaml'

nines_user:
resource: '@NinesUserBundle/config/routes.yaml'
1 change: 1 addition & 0 deletions config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,4 @@ services:
- { name: knp_menu.menu_builder, method: spotlightMenu, alias: spotlight}
- { name: knp_menu.menu_builder, method: userNavMenu, alias: wphp_user }
- { name: knp_menu.menu_builder, method: postNavMenu, alias: wphp_post }
- { name: knp_menu.menu_builder, method: pageMenu, alias: nines_blog_pages }
2 changes: 1 addition & 1 deletion etc
Submodule etc updated 1 files
+9 −0 Makefile.common
39 changes: 39 additions & 0 deletions migrations/2022/06/Version20220601174953.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php

declare(strict_types=1);

/*
* (c) 2021 Michael Joyce <[email protected]>
* This source file is subject to the GPL v2, bundled
* with this source code in the file LICENSE.
*/

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20220601174953 extends AbstractMigration {
public function getDescription() : string {
return '';
}

public function up(Schema $schema) : void {
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE nines_media_audio (id INT AUTO_INCREMENT NOT NULL, created DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', updated DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', entity VARCHAR(120) NOT NULL, description LONGTEXT DEFAULT NULL, license LONGTEXT DEFAULT NULL, public TINYINT(1) NOT NULL, original_name VARCHAR(128) NOT NULL, path VARCHAR(128) NOT NULL, mime_type VARCHAR(64) NOT NULL, file_size INT NOT NULL, FULLTEXT INDEX nines_media_audio_ft (original_name, description), INDEX IDX_9D15F751E284468 (entity), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE nines_media_image (id INT AUTO_INCREMENT NOT NULL, thumb_path VARCHAR(128) NOT NULL, image_width INT NOT NULL, image_height INT NOT NULL, created DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', updated DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', entity VARCHAR(120) NOT NULL, description LONGTEXT DEFAULT NULL, license LONGTEXT DEFAULT NULL, public TINYINT(1) NOT NULL, original_name VARCHAR(128) NOT NULL, path VARCHAR(128) NOT NULL, mime_type VARCHAR(64) NOT NULL, file_size INT NOT NULL, FULLTEXT INDEX nines_media_image_ft (original_name, description), INDEX IDX_4055C59BE284468 (entity), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE nines_media_link (id INT AUTO_INCREMENT NOT NULL, url VARCHAR(500) NOT NULL, text VARCHAR(191) DEFAULT NULL, created DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', updated DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', entity VARCHAR(120) NOT NULL, FULLTEXT INDEX nines_media_link_ft (url, text), INDEX IDX_3B5D85A3E284468 (entity), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE nines_media_pdf (id INT AUTO_INCREMENT NOT NULL, public TINYINT(1) NOT NULL, original_name VARCHAR(128) NOT NULL, path VARCHAR(128) NOT NULL, mime_type VARCHAR(64) NOT NULL, file_size INT NOT NULL, thumb_path VARCHAR(128) NOT NULL, created DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', updated DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', description LONGTEXT DEFAULT NULL, license LONGTEXT DEFAULT NULL, entity VARCHAR(120) NOT NULL, FULLTEXT INDEX nines_media_pdf_ft (original_name, description), INDEX IDX_9286B706E284468 (entity), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
}

public function down(Schema $schema) : void {
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE nines_media_audio');
$this->addSql('DROP TABLE nines_media_image');
$this->addSql('DROP TABLE nines_media_link');
$this->addSql('DROP TABLE nines_media_pdf');
}
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"hamburgers": "^1.1.3",
"jquery": "^3.4.1",
"jquery-ui-dist": "^1.12.1",
"pdfobject": "^2.2.8",
"select2": "^4.0.12",
"select2-bootstrap-css": "^1.4.6",
"swup": "^2.0.14",
Expand Down
4 changes: 4 additions & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@ parameters:
checkMissingCallableSignature: true
dynamicConstantNames:
- App\Tests\Controller\CurrencyTest::ANON_RESPONSE_CODE
- App\Tests\Controller\PageTest::ANON_RESPONSE_CODE
- App\Tests\Controller\PostCategoryTest::ANON_RESPONSE_CODE
- App\Tests\Controller\PostStatusTest::ANON_RESPONSE_CODE
- App\Tests\Controller\PostTest::ANON_RESPONSE_CODE
6 changes: 3 additions & 3 deletions src/Controller/DefaultController.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@

namespace App\Controller;

use App\Entity\Page;
use App\Entity\Post;
use App\Entity\PostCategory;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\NonUniqueResultException;
use Knp\Bundle\PaginatorBundle\Definition\PaginatorAwareInterface;
use Nines\BlogBundle\Entity\Page;
use Nines\BlogBundle\Entity\Post;
use Nines\BlogBundle\Entity\PostCategory;
use Nines\UtilBundle\Controller\PaginatorTrait;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
Expand Down
Loading

0 comments on commit 58ee20a

Please sign in to comment.