0
0
Fork 0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-05-07 09:30:58 +00:00

Made some changes to the comment system

Changed to be rendered server side along with page content.
Changed deletion to fully delete comments from the database.
Added 'local_id' to comments for referencing.
Updated reply system to be non-nested (Incomplete)
Made database comment format entity-agnostic to be more future proof.
Updated designs of comment sections.
This commit is contained in:
Dan Brown 2017-09-03 16:37:51 +01:00
parent e3f2bde26d
commit fea5630ea4
No known key found for this signature in database
GPG key ID: 46D9F943C24A2EF9
24 changed files with 478 additions and 731 deletions

View file

@ -15,17 +15,19 @@ class CreateCommentsTable extends Migration
{
Schema::create('comments', function (Blueprint $table) {
$table->increments('id')->unsigned();
$table->integer('page_id')->unsigned();
$table->integer('entity_id')->unsigned();
$table->string('entity_type');
$table->longText('text')->nullable();
$table->longText('html')->nullable();
$table->integer('parent_id')->unsigned()->nullable();
$table->integer('local_id')->unsigned()->nullable();
$table->integer('created_by')->unsigned();
$table->integer('updated_by')->unsigned()->nullable();
$table->boolean('active')->default(true);
$table->index(['page_id']);
$table->timestamps();
$table->index(['entity_id', 'entity_type']);
$table->index(['local_id']);
// Assign new comment permissions to admin role
$adminRoleId = DB::table('roles')->where('system_name', '=', 'admin')->first()->id;
// Create & attach new entity permissions