1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-28 17:02:04 +03:00

Started the page attributes interface

This commit is contained in:
Dan Brown
2016-05-12 23:12:05 +01:00
parent fcfb9470c9
commit 1fa079b466
11 changed files with 152 additions and 34 deletions

View File

@ -38,18 +38,15 @@ class AttributeController extends Controller
*/
public function updateForEntity($entityType, $entityId, Request $request)
{
$this->validate($request, [
'attributes.*.name' => 'required|min:3|max:250',
'attributes.*.value' => 'max:250'
]);
$entity = $this->attributeRepo->getEntity($entityType, $entityId, 'update');
if ($entity === null) return $this->jsonError("Entity not found", 404);
$inputAttributes = $request->input('attributes');
$attributes = $this->attributeRepo->saveAttributesToEntity($entity, $inputAttributes);
return response()->json($attributes);
return response()->json([
'attributes' => $attributes,
'message' => 'Attributes successfully updated'
]);
}
/**

View File

@ -72,7 +72,7 @@ class PageController extends Controller
$this->checkOwnablePermission('page-create', $book);
$this->setPageTitle('Edit Page Draft');
return view('pages/create', ['draft' => $draft, 'book' => $book]);
return view('pages/edit', ['page' => $draft, 'book' => $book, 'isDraft' => true]);
}
/**