Merge branch 'master' into 'production'
Master See merge request Romulus21/portal!65
This commit is contained in:
@@ -64,6 +64,8 @@ before_script:
|
|||||||
- php artisan migrate
|
- php artisan migrate
|
||||||
# Run database seed
|
# Run database seed
|
||||||
- php artisan db:seed
|
- php artisan db:seed
|
||||||
|
only:
|
||||||
|
- master
|
||||||
|
|
||||||
test:
|
test:
|
||||||
script:
|
script:
|
||||||
|
|||||||
@@ -2,10 +2,12 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use App\Mail\newUserInvitation;
|
||||||
use App\User;
|
use App\User;
|
||||||
use App\Http\Resources\User as UserResource;
|
use App\Http\Resources\User as UserResource;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Facades\Hash;
|
use Illuminate\Support\Facades\Hash;
|
||||||
|
use Illuminate\Support\Facades\Mail;
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
|
|
||||||
@@ -25,6 +27,8 @@ class UserController extends Controller
|
|||||||
request()['password'] = Hash::make(Str::random(30));
|
request()['password'] = Hash::make(Str::random(30));
|
||||||
$user = User::create($this->validateData());
|
$user = User::create($this->validateData());
|
||||||
|
|
||||||
|
Mail::to($user->email)->send(new newUserInvitation($user));
|
||||||
|
|
||||||
return (new UserResource($user))
|
return (new UserResource($user))
|
||||||
->response()
|
->response()
|
||||||
->setStatusCode(Response::HTTP_CREATED);
|
->setStatusCode(Response::HTTP_CREATED);
|
||||||
|
|||||||
43
app/Mail/newUserInvitation.php
Normal file
43
app/Mail/newUserInvitation.php
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Mail;
|
||||||
|
|
||||||
|
use App\User;
|
||||||
|
use Illuminate\Bus\Queueable;
|
||||||
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||||
|
use Illuminate\Mail\Mailable;
|
||||||
|
use Illuminate\Queue\SerializesModels;
|
||||||
|
|
||||||
|
class newUserInvitation extends Mailable
|
||||||
|
{
|
||||||
|
use Queueable, SerializesModels;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var User
|
||||||
|
*/
|
||||||
|
private $user;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new message instance.
|
||||||
|
*
|
||||||
|
* @param User $user
|
||||||
|
*/
|
||||||
|
public function __construct(User $user)
|
||||||
|
{
|
||||||
|
$this->user = $user;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build the message.
|
||||||
|
*
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function build()
|
||||||
|
{
|
||||||
|
return $this->from('portal@bricooli.fr')
|
||||||
|
->markdown('mail.new-user-invitation')
|
||||||
|
->with([
|
||||||
|
'user' => $this->user,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div v-if="authUser.data.attributes.is_admin">
|
||||||
<div class="card block">
|
<div class="card block">
|
||||||
<h2>Raspberry Links</h2>
|
<h2>Raspberry Links</h2>
|
||||||
<ul class="mt-2">
|
<ul class="mt-2">
|
||||||
@@ -10,6 +10,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import {mapGetters} from 'vuex'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'AutomaticLinksHome',
|
name: 'AutomaticLinksHome',
|
||||||
data: function () {
|
data: function () {
|
||||||
@@ -18,6 +20,7 @@ export default {
|
|||||||
{ name: 'Météo', link: 'http://192.168.1.32/meteo/meteo'},
|
{ name: 'Météo', link: 'http://192.168.1.32/meteo/meteo'},
|
||||||
{ name: 'MotionEye', link: 'http://192.168.1.32:8765'},
|
{ name: 'MotionEye', link: 'http://192.168.1.32:8765'},
|
||||||
{ name: 'TT-RSS', link: 'https://tt-rss.bricooli.fr'},
|
{ name: 'TT-RSS', link: 'https://tt-rss.bricooli.fr'},
|
||||||
|
{ name: 'Datus', link: 'https://192.168.1.24:5001'},
|
||||||
{ name: 'Pi-Hole', link: 'http://192.168.1.32/admin/index.php'},
|
{ name: 'Pi-Hole', link: 'http://192.168.1.32/admin/index.php'},
|
||||||
{ name: 'RaspAp', link: 'http://192.168.1.32/raspap'},
|
{ name: 'RaspAp', link: 'http://192.168.1.32/raspap'},
|
||||||
{ name: 'Kodi', link: 'http://192.168.1.19:8080/'},
|
{ name: 'Kodi', link: 'http://192.168.1.19:8080/'},
|
||||||
@@ -26,5 +29,10 @@ export default {
|
|||||||
],
|
],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
...mapGetters({
|
||||||
|
authUser: 'authUser',
|
||||||
|
})
|
||||||
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="p-4">
|
<div class="mx-2 p-2">
|
||||||
<div v-if="modal" class="modal-container" @click="modal = ! modal"></div>
|
<div v-if="modal" class="modal-container" @click="modal = ! modal"></div>
|
||||||
<div v-if="modal" class="modal px-2">
|
<div v-if="modal" class="modal px-2">
|
||||||
<p class="m-2 text-center">Add a new to-do list ?</p>
|
<p class="m-2 text-center">Add a new to-do list ?</p>
|
||||||
|
|||||||
15
resources/views/mail/new-user-invitation.blade.php
Normal file
15
resources/views/mail/new-user-invitation.blade.php
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
|
||||||
|
@component('mail::message')
|
||||||
|
# Confirmation d'inscription sur [portal.bricooli.fr](https://portal.bricooli.fr)
|
||||||
|
|
||||||
|
Bonjour {{ $user->name }},
|
||||||
|
|
||||||
|
Nous confirmons votre cooptation sur [portal.bricooli.fr](https://portal.bricooli.fr).
|
||||||
|
Vous pouver désormais vous inscrire en faisant :
|
||||||
|
|
||||||
|
@component('mail::button', ['url' => route('password.request')])
|
||||||
|
email oublié
|
||||||
|
@endcomponent
|
||||||
|
|
||||||
|
Merci
|
||||||
|
@endcomponent
|
||||||
7
tailwind.config.js
vendored
7
tailwind.config.js
vendored
@@ -63,4 +63,11 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
variants: {},
|
variants: {},
|
||||||
plugins: [],
|
plugins: [],
|
||||||
|
purge: {
|
||||||
|
enable: true,
|
||||||
|
content: [
|
||||||
|
'./resources/js/**/*.vue',
|
||||||
|
'./resources/views/**/*.blade.php',
|
||||||
|
],
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user