This commit is contained in:
foobar
2022-08-21 21:39:06 +02:00
commit 27c1969aaa
7354 changed files with 897064 additions and 0 deletions

0
resources/css/app.css Normal file
View File

1
resources/js/app.js Normal file
View File

@@ -0,0 +1 @@
import './bootstrap';

34
resources/js/bootstrap.js vendored Normal file
View File

@@ -0,0 +1,34 @@
import _ from 'lodash';
window._ = _;
/**
* We'll load the axios HTTP library which allows us to easily issue requests
* to our Laravel back-end. This library automatically handles sending the
* CSRF token as a header based on the value of the "XSRF" token cookie.
*/
import axios from 'axios';
window.axios = axios;
window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
/**
* Echo exposes an expressive API for subscribing to channels and listening
* for events that are broadcast by Laravel. Echo and event broadcasting
* allows your team to easily build robust real-time web applications.
*/
// import Echo from 'laravel-echo';
// import Pusher from 'pusher-js';
// window.Pusher = Pusher;
// window.Echo = new Echo({
// broadcaster: 'pusher',
// key: import.meta.env.VITE_PUSHER_APP_KEY,
// wsHost: import.meta.env.VITE_PUSHER_HOST ?? `ws-${import.meta.env.VITE_PUSHER_APP_CLUSTER}.pusher.com`,
// wsPort: import.meta.env.VITE_PUSHER_PORT ?? 80,
// wssPort: import.meta.env.VITE_PUSHER_PORT ?? 443,
// forceTLS: (import.meta.env.VITE_PUSHER_SCHEME ?? 'https') === 'https',
// enabledTransports: ['ws', 'wss'],
// });

View 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 }}&deg;
</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

View 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

View 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>

View 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>