mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-28 17:02:04 +03:00
Made chapters functional and cleaned design features
This commit is contained in:
@ -12,7 +12,7 @@ class Chapter extends Model
|
||||
return $this->belongsTo('Oxbow\Book');
|
||||
}
|
||||
|
||||
public function children()
|
||||
public function pages()
|
||||
{
|
||||
return $this->hasMany('Oxbow\Page')->orderBy('priority', 'ASC');
|
||||
}
|
||||
@ -22,4 +22,9 @@ class Chapter extends Model
|
||||
return '/books/' . $this->book->slug . '/chapter/' . $this->slug;
|
||||
}
|
||||
|
||||
public function getExcerpt($length = 100)
|
||||
{
|
||||
return strlen($this->description) > $length ? substr($this->description, 0, $length-3) . '...' : $this->description;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user