News can now be non-public
This commit is contained in:
30
app/DoctrineMigrations/Version20120723171539.php
Normal file
30
app/DoctrineMigrations/Version20120723171539.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Migrations\AbstractMigration,
|
||||
Doctrine\DBAL\Schema\Schema;
|
||||
|
||||
/**
|
||||
* Auto-generated Migration: Please modify to your need!
|
||||
*/
|
||||
class Version20120723171539 extends AbstractMigration
|
||||
{
|
||||
public function up(Schema $schema)
|
||||
{
|
||||
// this up() migration is autogenerated, please modify it to your needs
|
||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");
|
||||
|
||||
$this->addSql("ALTER TABLE news ADD public TINYINT(1) DEFAULT NULL");
|
||||
$this->addSql("UPDATE news SET public = 1");
|
||||
$this->addSql("ALTER TABLE news CHANGE public public TINYINT(1) NOT NULL");
|
||||
}
|
||||
|
||||
public function down(Schema $schema)
|
||||
{
|
||||
// this down() migration is autogenerated, please modify it to your needs
|
||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");
|
||||
|
||||
$this->addSql("ALTER TABLE news DROP public");
|
||||
}
|
||||
}
|
@@ -92,7 +92,9 @@
|
||||
<div class="hir">
|
||||
<p class="hir-cim">{{ news.title }}</p>
|
||||
<p class="hir-szoveg">{{ news.text|raw }}</p>
|
||||
{% if app.user %}
|
||||
<p class="hir-szerzo">{{ news.createdBy.displayName }}</p>
|
||||
{% endif %}
|
||||
<p class="hir-datum">{{ news.createdAt|date('Y-m-d H:i') }}</p>
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
Reference in New Issue
Block a user