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:
parent
e3f2bde26d
commit
fea5630ea4
24 changed files with 478 additions and 731 deletions
database/migrations
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue