Skip to content

Commit ab8ae80

Browse files
committed
refactor
1 parent cbdddff commit ab8ae80

File tree

4 files changed

+32
-47
lines changed

4 files changed

+32
-47
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@if (\Session::has('success'))
2+
<div class="alert alert-success">
3+
<p>{{ \Session::get('success') }}</p>
4+
</div><br>
5+
@endif
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
@if ($errors->any())
2-
<div class="alert alert-danger">
2+
<div class="alert alert-danger mb-1">
33
<ul class="mb-auto">
44
@foreach ($errors->all() as $error)
55
<li>{{ $error }}</li>
66
@endforeach
77
</ul>
8-
</div><br/>
8+
</div>
99
@endif
Lines changed: 24 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,38 @@
1-
@extends('layouts.app')
1+
@extends('layouts.app')
22
@section('title','Create new task')
33

44
@section('styles')
5-
<script src="//cdn.ckeditor.com/4.8.0/standard/ckeditor.js"></script>
6-
@endsection
5+
<script src="//cdn.ckeditor.com/4.8.0/standard/ckeditor.js"></script>
6+
@endsection
77

88
@section('content')
9-
<div class="row">
10-
11-
<div class="col">
12-
13-
<div class="d-flex justify-content-between">
9+
<div class="d-flex justify-content-between">
1410
<div>
15-
<h2>Create task</h2>
11+
<h2>Create task</h2>
1612
</div>
1713
<div>
18-
<a href="{{route('tasks.index')}}" class='btn btn-lg btn-warning'>Go back</a>
14+
<a href="{{ route('tasks.index') }}" class='btn btn-lg btn-warning'>Go back</a>
1915
</div>
20-
</div>
21-
<br>
22-
@include('particles.errors')
23-
@if (\Session::has('success'))
24-
<div class="alert alert-success">
25-
<p>{{ \Session::get('success') }}</p>
26-
</div><br />
27-
@endif
28-
<form name='create_form' method="post" action="{{route('tasks.store')}}">
29-
{{csrf_field()}}
16+
</div>
17+
@include('particles.errors')
18+
@include('particles.alert')
19+
<form name='create_form' method="post" action="{{ route('tasks.store') }}">
20+
{{ csrf_field() }}
3021

31-
<div class="form-group col-md-12">
22+
<div class="form-group">
3223
<label for="name">Name:</label>
3324
<input type="text" class="form-control" name="name" maxlength='150' required>
34-
</div>
25+
</div>
3526

36-
<div class="form-group col-md-12">
37-
<label for="description">Description:</label>
38-
<textarea name="description"></textarea>
39-
<script>
40-
CKEDITOR.replace( 'description' );
41-
</script>
42-
</div>
43-
</div>
44-
<div class="form-group col-md-12">
45-
<button type="submit" class="btn btn-success btn-block">Add Task</button>
46-
</div>
47-
</form>
48-
</div>
49-
</div>
27+
<div class="form-group">
28+
<label for="description">Description:</label>
29+
<textarea name="description"></textarea>
30+
<script>
31+
CKEDITOR.replace('description');
32+
</script>
33+
</div>
34+
<div class="form-group">
35+
<button type="submit" class="btn btn-success btn-block">Add Task</button>
36+
</div>
37+
</form>
5038
@endsection

resources/views/tasks/edit.blade.php

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,7 @@
2020
</div>
2121
</div>
2222
<br>
23-
@if ($errors->any())
24-
<div class="alert alert-danger">
25-
<ul>
26-
@foreach ($errors->all() as $error)
27-
<li>{{ $error }}</li>
28-
@endforeach
29-
</ul>
30-
</div><br />
31-
@endif
23+
@include('particles.errors')
3224
@if (\Session::has('success'))
3325
<div class="alert alert-success">
3426
<p>{{ \Session::get('success') }}</p>

0 commit comments

Comments
 (0)