Skip to content

Commit

Permalink
Fixed layout in admin panel views
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkBrines committed Mar 30, 2024
1 parent f77d29f commit 88bed44
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 59 deletions.
16 changes: 9 additions & 7 deletions resources/views/admin/index.edge
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
@!layout('base/main')

@section('title')
Admin panel
Admin panel
@endsection

@section('content')
<h1>Admin panel</h1>
<section class="container">
<h1>Admin panel</h1>

<ul>
@each(model in models)
<ul>
@each(model in models)
<li><a href="{{ route('adminPanel.model.index', {model: model}) }}">{{ model }}</a></li>
@endeach
</ul>
@endsection
@endeach
</ul>
</section>
@endsection
33 changes: 18 additions & 15 deletions resources/views/adminmodel/create.edge
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,23 @@ Admin panel - {{ model }} / create
@endsection

@section('content')
<h1>Admin panel - {{ model }} / create</h1>
<section class="container">

<form method="post" enctype="multipart/form-data">
@each(field in fields)
<label>{{ field }}</label>
<h1>Admin panel - {{ model }} / create</h1>

@if(field == "content")
<textarea name="{{ field }}"></textarea>
@elseif(field == "file")
<input type="file" name="{{ field }}">
@else
<input type="text" name="{{ field }}">
@end
@endeach
<button type="submit">Save</button>
</form>
@endsection
<form method="post" enctype="multipart/form-data">
@each(field in fields)
<label>{{ field }}</label>

@if(field == "content")
<textarea name="{{ field }}"></textarea>
@elseif(field == "file")
<input type="file" name="{{ field }}">
@else
<input type="text" name="{{ field }}">
@end
@endeach
<button type="submit">Save</button>
</form>
</section>
@endsection
27 changes: 15 additions & 12 deletions resources/views/adminmodel/index.edge
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,24 @@ Admin panel - {{ model }}
@endsection

@section('content')
<h1>Admin panel - {{ model }}</h1>
<section class="container">

<div>
@if(model !== "users")
<a href="{{ route('adminPanel.model.create', {model: model}) }}">Create</a>
@endif
</div>
<h1>Admin panel - {{ model }}</h1>

<div>
@each(item in items)
<div>
@if(model !== "users")
<a href="{{ route('adminPanel.model.create', {model: model}) }}">Create</a>
@endif
</div>

<div>
@each(item in items)
<a href="{{ route('adminPanel.model.view' , {model: model, id: item.id}) }}">
@each(attr in item)
<p>{{ attr }}</p>
<p>{{ attr }}</p>
@endeach
</a>
@endeach
</div>
@endsection
@endeach
</div>
</section>
@endsection
33 changes: 18 additions & 15 deletions resources/views/adminmodel/update.edge
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,23 @@ Admin panel - {{ model }} / {{ id }} / update
@endsection

@section('content')
<h1>Admin panel - {{ model }} / {{ id }} / update</h1>
<section class="container">

<form method="post" enctype="multipart/form-data">
@each((attr_value, attr_name) in item)
<label>{{ attr_name }}</label>
<h1>Admin panel - {{ model }} / {{ id }} / update</h1>

@if(attr_name == "content")
<textarea name="{{ attr_name }}">{{ attr_value }}</textarea>
@elseif(attr_name == "file")
<input type="file" name="{{ attr_name }}">
@else
<input type="text" name="{{ attr_name }}" value="{{ attr_value }}">
@end
@endeach
<button type="submit">Save</button>
</form>
@endsection
<form method="post" enctype="multipart/form-data">
@each((attr_value, attr_name) in item)
<label>{{ attr_name }}</label>

@if(attr_name == "content")
<textarea name="{{ attr_name }}">{{ attr_value }}</textarea>
@elseif(attr_name == "file")
<input type="file" name="{{ attr_name }}">
@else
<input type="text" name="{{ attr_name }}" value="{{ attr_value }}">
@end
@endeach
<button type="submit">Save</button>
</form>
</section>
@endsection
23 changes: 13 additions & 10 deletions resources/views/adminmodel/view.edge
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,19 @@ Admin panel - {{ model }} / {{ item.id }} / view
@endsection

@section('content')
<h1>Admin panel - {{ model }} / {{ item.id }} / view</h1>
<section class="container">

<h1>Admin panel - {{ model }} / {{ item.id }} / view</h1>

<div>
<a href="{{ route('adminPanel.model.update', {model: model, id: item.id}) }}">Update</a>
<a
onclick="if(confirm('Are you sure you want to delete this {{ model }}?')) {window.location = '{{ route('adminPanel.model.delete', {model: model, id: item.id}) }}'}">Delete</a>
<div>
@each(attr in item)
<p>{{ attr }}</p>
@endeach
<a href="{{ route('adminPanel.model.update', {model: model, id: item.id}) }}">Update</a>
<a
onclick="if(confirm('Are you sure you want to delete this {{ model }}?')) {window.location = '{{ route('adminPanel.model.delete', {model: model, id: item.id}) }}'}">Delete</a>
<div>
@each(attr in item)
<p>{{ attr }}</p>
@endeach
</div>
</div>
</div>
@endsection
</section>
@endsection

0 comments on commit 88bed44

Please sign in to comment.