1
0
mirror of https://github.com/flarum/core.git synced 2025-08-09 01:46:35 +02:00

Rename to Flags, tweak flag controls

- Display post "destructiveControls" in flag instead of custom buttons
- Make flags more versatile/extensible
- Delete associated flags when a post is deleted

Uninstall the Reports extension before installing.
This commit is contained in:
Toby Zerner
2015-09-22 18:14:33 +09:30
parent 8da417c5b5
commit a1e01938ef
36 changed files with 390 additions and 401 deletions

View File

@@ -8,22 +8,22 @@
* file that was distributed with this source code.
*/
namespace Flarum\Migrations\Reports;
namespace Flarum\Migrations\Flags;
use Illuminate\Database\Schema\Blueprint;
use Flarum\Migrations\Migration;
class AddReportsReadTimeToUsersTable extends Migration
class AddFlagsReadTimeToUsersTable extends Migration
{
public function up()
{
$this->schema->table('users', function (Blueprint $table) {
$table->dateTime('reports_read_time')->nullable();
$table->dateTime('flags_read_time')->nullable();
});
}
public function down()
{
$this->schema->drop('reports_read_time');
$this->schema->drop('flags_read_time');
}
}

View File

@@ -8,20 +8,20 @@
* file that was distributed with this source code.
*/
namespace Flarum\Migrations\Reports;
namespace Flarum\Migrations\Flags;
use Illuminate\Database\Schema\Blueprint;
use Flarum\Migrations\Migration;
class CreateReportsTable extends Migration
class CreateFlagsTable extends Migration
{
public function up()
{
$this->schema->create('reports', function (Blueprint $table) {
$this->schema->create('flags', function (Blueprint $table) {
$table->increments('id');
$table->integer('post_id')->unsigned();
$table->integer('user_id')->unsigned();
$table->string('reporter')->nullable();
$table->string('type');
$table->integer('user_id')->unsigned()->nullable();
$table->string('reason')->nullable();
$table->string('reason_detail')->nullable();
$table->dateTime('time');
@@ -30,6 +30,6 @@ class CreateReportsTable extends Migration
public function down()
{
$this->schema->drop('reports');
$this->schema->drop('flags');
}
}