init
This commit is contained in:
108
resources/views/cities.blade.php
Normal file
108
resources/views/cities.blade.php
Normal file
@@ -0,0 +1,108 @@
|
||||
{{-- The @extends directive informs Blade that we are using the layout we defined in resources/views/layouts/app.blade.php. --}}
|
||||
{{-- All of the content between @section('content') and @endsection will be injected into the location of the @yield('content') directive within the app.blade.php layout. --}}
|
||||
{{-- The @include('common.errors') directive will load the template located at resources/views/common/errors.blade.php. --}}
|
||||
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="col-sm-offset-2 col-sm-8">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading panel-search">
|
||||
Search & Add City
|
||||
</div>
|
||||
|
||||
<div class="panel-body">
|
||||
<!-- Display Validation Errors -->
|
||||
@include('common.errors')
|
||||
|
||||
<!-- New City Form -->
|
||||
<form action="{{ url('city') }}" method="POST" class="form-horizontal">
|
||||
@csrf
|
||||
|
||||
<!-- City Name -->
|
||||
<div class="form-group">
|
||||
<label for="city-name" class="col-sm-3 control-label">City</label>
|
||||
|
||||
<div class="col-sm-6">
|
||||
<input type="text" name="name" id="city-name" class="form-control"
|
||||
value="{{ old('city') }}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Add City Button -->
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-3 col-sm-6">
|
||||
<button type="submit" class="btn btn-default">
|
||||
<i class="fa fa-btn fa-plus"></i>Add
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Current Cities -->
|
||||
@if ($cities->isNotEmpty())
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
Current Cities
|
||||
</div>
|
||||
<div class="panel-heading">
|
||||
|
||||
<form action="{{ url('refresh') }}" method="POST">
|
||||
@csrf
|
||||
<button type="submit" id="refresh">
|
||||
Refresh
|
||||
</button>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<table class="table table-striped city-table">
|
||||
<tbody>
|
||||
|
||||
@foreach ($cities as $city)
|
||||
<tr>
|
||||
<td class="table-text">
|
||||
<div class="widget">
|
||||
<div class="panel">
|
||||
|
||||
<form action="{{ url('city/' . $city->id) }}" method="POST">
|
||||
@csrf
|
||||
@method('delete')
|
||||
<button type="submit" id="x">
|
||||
X
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<div class="city">
|
||||
{{ "{$city->location_name}, {$city->location_country}" }}
|
||||
</div>
|
||||
|
||||
<div class="temp">
|
||||
<img src="{{ $city->weather_icon }}" alt="" width="60">
|
||||
{{ $city->current_temperature }}°
|
||||
</div>
|
||||
|
||||
<div class="weather-description">{{ $city->weather_description }}</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div>Wind Speed: {{ $city->wind_speed }} KM/h from {{ $city->wind_dir }}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
12
resources/views/common/errors.blade.php
Normal file
12
resources/views/common/errors.blade.php
Normal file
@@ -0,0 +1,12 @@
|
||||
@if (count($errors) > 0)
|
||||
<!-- Form Error List -->
|
||||
<div class="alert alert-danger">
|
||||
<strong>Error!</strong>
|
||||
<br><br>
|
||||
<ul>
|
||||
@foreach ($errors->all() as $error)
|
||||
<li>{{ $error }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
47
resources/views/errors/503.blade.php
Normal file
47
resources/views/errors/503.blade.php
Normal file
@@ -0,0 +1,47 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Be right back.</title>
|
||||
|
||||
<link href="https://fonts.googleapis.com/css?family=Lato:100" rel="stylesheet" type="text/css">
|
||||
|
||||
<style>
|
||||
html, body {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
width: 100%;
|
||||
color: #B0BEC5;
|
||||
display: table;
|
||||
font-weight: 100;
|
||||
font-family: 'Lato';
|
||||
}
|
||||
|
||||
.container {
|
||||
text-align: center;
|
||||
display: table-cell;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.content {
|
||||
text-align: center;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 72px;
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<div class="content">
|
||||
<div class="title">Be right back.</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
38
resources/views/layouts/app.blade.php
Normal file
38
resources/views/layouts/app.blade.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<title>Wonderful Weather</title>
|
||||
|
||||
<!-- Fonts -->
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.4.0/css/font-awesome.min.css" rel='stylesheet' type='text/css'>
|
||||
<link href="https://fonts.googleapis.com/css?family=Lato:100,300,400,700" rel='stylesheet' type='text/css'>
|
||||
|
||||
<!-- Styles -->
|
||||
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="{{ asset('css/style.css') }}" rel="stylesheet" type="text/css">
|
||||
</head>
|
||||
<body id="app-layout">
|
||||
<nav class="navbar navbar-default">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
|
||||
<!-- App Name -->
|
||||
<a class="navbar-brand" href="{{ url('/') }}">
|
||||
Wonderful Weather {{ config('app.version') }}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
@yield('content')
|
||||
|
||||
<!-- JavaScripts -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
|
||||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user