diff --git a/resources/views/item.blade.php b/resources/views/item.blade.php index 7462e8c..2f816ba 100644 --- a/resources/views/item.blade.php +++ b/resources/views/item.blade.php @@ -6,8 +6,13 @@
- Item: {{$item->name}} - @include ('item.buttons') + {{$item->name}} + +
+ @include ('item.editButton') + @include ('item.deleteButton') +
+
@@ -16,61 +21,15 @@
@endif - Other items from the same product: - + @include('item.users')
-
-
- Users of this item -
-
- Users that has access to this item: - -
- Add user -
-
- {{ csrf_field() }} -
-
- -
-
-
-
- @include ('layouts.errors') + @include ('item.otherItems') -
-
-
BACK
+ +
BACK
diff --git a/resources/views/item/buttons.blade.php b/resources/views/item/buttons.blade.php deleted file mode 100644 index 3435755..0000000 --- a/resources/views/item/buttons.blade.php +++ /dev/null @@ -1,24 +0,0 @@ - -
- - - - @if ($item->product->user_id == \Auth::id()) -
- @method('PATCH') - -
- @endif - - - -
- @method('DELETE') - {{ csrf_field() }} - - -
- - -
-
\ No newline at end of file diff --git a/resources/views/item/deleteButton.blade.php b/resources/views/item/deleteButton.blade.php new file mode 100644 index 0000000..cc49276 --- /dev/null +++ b/resources/views/item/deleteButton.blade.php @@ -0,0 +1,28 @@ + + + + \ No newline at end of file diff --git a/resources/views/item/editButton.blade.php b/resources/views/item/editButton.blade.php new file mode 100644 index 0000000..a013282 --- /dev/null +++ b/resources/views/item/editButton.blade.php @@ -0,0 +1,32 @@ + + + + \ No newline at end of file diff --git a/resources/views/item/otherItems.blade.php b/resources/views/item/otherItems.blade.php new file mode 100644 index 0000000..f59513f --- /dev/null +++ b/resources/views/item/otherItems.blade.php @@ -0,0 +1,17 @@ +
+
+ Other items from the same product +
+ +
+ +
+
\ No newline at end of file diff --git a/resources/views/item/users.blade.php b/resources/views/item/users.blade.php new file mode 100644 index 0000000..d45b16e --- /dev/null +++ b/resources/views/item/users.blade.php @@ -0,0 +1,37 @@ +

Users:

+@forelse ($users as $user) + @if (!$loop->first) +
+ @endif + {{ $user->name }} ({{ $user->email}}) +
+
+
+ {{ csrf_field() }} + @method('DELETE') + + + +
+
+
+@empty +

There are no items yet. Include one with the form above.

+@endforelse + + + +
+
+

Add user

+
+
+ {{ csrf_field() }} +
+
+ +
+
+
+
+@include ('layouts.errors') \ No newline at end of file