vendor and env first commit
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
$("#announcements-icon").click(function () {
|
||||
$.post(read_announcements_endpoint);
|
||||
$(".announcements .activity-badge").remove();
|
||||
});
|
||||
@@ -0,0 +1,31 @@
|
||||
.nav-item.announcements {
|
||||
a.nav-icon {
|
||||
font-size: 1.3rem;
|
||||
|
||||
&:hover .activity-badge {
|
||||
transform: scale(1.1);
|
||||
}
|
||||
}
|
||||
|
||||
.activity-badge {
|
||||
width: 13px;
|
||||
height: 13px;
|
||||
background: #bf5329;
|
||||
border: 2px solid #fff;
|
||||
border-radius: 10px;
|
||||
position: absolute;
|
||||
right: -1px;
|
||||
-webkit-transition: all 0.15s;
|
||||
transition: all 0.15s;
|
||||
-webkit-transform: scale(0.85);
|
||||
transform: scale(0.85);
|
||||
}
|
||||
|
||||
.navbar-item {
|
||||
border-bottom: 1px solid #e0ebf0;
|
||||
|
||||
&:last-of-type {
|
||||
border-bottom: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'created_announcement' => 'Erstellt eine Ankündigung #:id: :title',
|
||||
'updated_announcement' => 'Aktualisierte Ankündigung #:id',
|
||||
'deleted_announcement' => 'Gelöschte Ankündigung #:id',
|
||||
];
|
||||
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"Announcement": "",
|
||||
"Announcements": "",
|
||||
"Create Announcement": "",
|
||||
"Creator": "",
|
||||
"Title": "",
|
||||
"Created At": "",
|
||||
"Action": "",
|
||||
"Edit Announcement": "",
|
||||
"Delete Announcement": "",
|
||||
"Please Confirm": "",
|
||||
"Are you sure that you want to delete this announcement?": "",
|
||||
"Yes, delete it!": "",
|
||||
"No announcements found.": "",
|
||||
"No new announcements at the moment.": "",
|
||||
"Edit": "",
|
||||
"New Announcement": "",
|
||||
"Create an Announcement": "",
|
||||
"Update Announcement": "",
|
||||
"Update": "",
|
||||
"Create": "",
|
||||
"What are you announcing?": "",
|
||||
"Body": "",
|
||||
"Describe your announcement using markdown...": "",
|
||||
"E-Mail Notification": "",
|
||||
"Send email notification about the announcement to all users.": "",
|
||||
"Announcement Details": "",
|
||||
"View All": "",
|
||||
"Thanks": "",
|
||||
"Announcement created successfully.": "",
|
||||
"Announcement updated successfully.": "",
|
||||
"Announcement deleted successfully.": ""
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'created_announcement' => 'Created an announcement #:id: :title',
|
||||
'updated_announcement' => 'Updated announcement #:id',
|
||||
'deleted_announcement' => 'Deleted announcement #:id',
|
||||
];
|
||||
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"Announcement": "Annonce",
|
||||
"Announcements": "Annonces",
|
||||
"Create Announcement": "Créer une annonce",
|
||||
"Creator": "Créateur",
|
||||
"Title": "Titre",
|
||||
"Created At": "Date de création",
|
||||
"Action": "Action",
|
||||
"Edit Announcement": "Modifier l'annonce",
|
||||
"Delete Announcement": "Supprimer l'annonce",
|
||||
"Please Confirm": "Confirmation",
|
||||
"Are you sure that you want to delete this announcement?": "Êtes-vous bien sûr de vouloir supprimer cette annonce ?",
|
||||
"Yes, delete it!": "Oui, supprimer",
|
||||
"No announcements found.": "Aucune annonce à afficher",
|
||||
"No new announcements at the moment.": "Aucune annonce pour le moment.",
|
||||
"Edit": "Modifier",
|
||||
"New Announcement": "Nouvelle annonce",
|
||||
"Create an Announcement": "Créer une annonce",
|
||||
"Update Announcement": "Mettre à jour l'annonce",
|
||||
"Update": "Mettre à jour",
|
||||
"Create": "Créer",
|
||||
"What are you announcing?": "Que souhaitez-vous annoncer ?",
|
||||
"Body": "Message",
|
||||
"Describe your announcement using markdown...": "Vous pouvez utiliser Markdown dans le corps de votre annonce.",
|
||||
"E-Mail Notification": "Notification par mail",
|
||||
"Send email notification about the announcement to all users.": "Envoyer une notification par mail à tous les utilisateurs.",
|
||||
"Announcement Details": "Détails de l'annonce",
|
||||
"View All": "Liste complète",
|
||||
"Thanks": "Merci",
|
||||
"Announcement created successfully.": "L'annonce a bien été créée.",
|
||||
"Announcement updated successfully.": "L'annonce a bien été mise à jour.",
|
||||
"Announcement deleted successfully.": "L'annonce a bien été supprimée."
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'created_announcement' => 'Création de l\'annonce #:id: :title',
|
||||
'updated_announcement' => 'Mise à jour de l\'annonce #:id',
|
||||
'deleted_announcement' => 'Suppression de l\'annonce #:id',
|
||||
];
|
||||
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"Announcement": "Objava",
|
||||
"Announcements": "Objave",
|
||||
"Create Announcement": "Kreiraj Objavu",
|
||||
"Creator": "Autor",
|
||||
"Title": "Naslov",
|
||||
"Created At": "Datum Kreiranja",
|
||||
"Action": "Akcija",
|
||||
"Edit Announcement": "Izmeni Objavu",
|
||||
"Delete Announcement": "Obriši Objavu",
|
||||
"Please Confirm": "Molimo potvrdite",
|
||||
"Are you sure that you want to delete this announcement?": "Da li ste sigurni da želite da obrišete ovu objavu?",
|
||||
"Yes, delete it!": "Da, obriši!",
|
||||
"No announcements found.": "Nema pronađenih objava.",
|
||||
"No new announcements at the moment.": "Nema novih objava u ovom trenutku.",
|
||||
"Edit": "Izmeni",
|
||||
"New Announcement": "Nova Objava",
|
||||
"Create an Announcement": "Kreiraj Objavu",
|
||||
"Update Announcement": "Ažuriraj Objavu",
|
||||
"Update": "Ažuriraj",
|
||||
"Create": "Kreiraj",
|
||||
"What are you announcing?": "Šta želite da objavite?",
|
||||
"Body": "Opis",
|
||||
"Describe your announcement using markdown...": "Napišite objavu koristeći markdown...",
|
||||
"E-Mail Notification": "Email Obaveštenje",
|
||||
"Send email notification about the announcement to all users.": "Pošalji email o ovom obaveštenju svim korisnicima.",
|
||||
"Announcement Details": "Detalji Objave",
|
||||
"View All": "Vidi sve",
|
||||
"Thanks": "Hvala",
|
||||
"Announcement created successfully.": "Objava je uspešno kreirana.",
|
||||
"Announcement updated successfully.": "Objava je uspešno ažurirana.",
|
||||
"Announcement deleted successfully.": "Objava je uspešno obrisana."
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'created_announcement' => 'Kreirao je objavu #:id: :title.',
|
||||
'updated_announcement' => 'Ažurirao je objavu #:id.',
|
||||
'deleted_announcement' => 'Obrisao je objavu #:id.',
|
||||
];
|
||||
@@ -0,0 +1,85 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('page-title', $edit ? __('Update Announcement') : __('New Announcement'))
|
||||
@section('page-heading', $edit ? __('Update Announcement') : __('New Announcement'))
|
||||
|
||||
@section('breadcrumbs')
|
||||
<li class="breadcrumb-item">
|
||||
<a href="{{ route('announcements.index') }}">@lang('Announcements')</a>
|
||||
</li>
|
||||
<li class="breadcrumb-item active">
|
||||
{{ $edit ? __('Update') : __('Create') }}
|
||||
</li>
|
||||
@stop
|
||||
|
||||
@section('content')
|
||||
|
||||
@include('partials.messages')
|
||||
|
||||
@if ($edit)
|
||||
{!! Form::open(['route' => ['announcements.update', $announcement], 'id' => 'announcement-form', 'method' => 'PUT']) !!}
|
||||
@else
|
||||
{!! Form::open(['route' => 'announcements.store', 'id' => 'announcement-form']) !!}
|
||||
@endif
|
||||
<div class="row">
|
||||
<div class="col-md-6 my-4 mx-auto">
|
||||
<div class="card">
|
||||
<h6 class="card-header">
|
||||
{{ $edit ? __('Update Announcement') : __('Create an Announcement') }}
|
||||
</h6>
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
<label for="title">@lang('Title')</label>
|
||||
<input type="text"
|
||||
class="form-control input-solid"
|
||||
id="title"
|
||||
name="title"
|
||||
placeholder="@lang('What are you announcing?')"
|
||||
value="{{ $edit ? $announcement->title : '' }}">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="body">@lang('Body')</label>
|
||||
<textarea
|
||||
name="body"
|
||||
class="form-control input-solid"
|
||||
rows="10"
|
||||
id="body"
|
||||
placeholder="@lang('Describe your announcement using markdown...')"
|
||||
>{{ $edit ? $announcement->body : '' }}</textarea>
|
||||
</div>
|
||||
|
||||
@if (! $edit)
|
||||
<div class="form-group mt-4">
|
||||
<div class="custom-control custom-checkbox">
|
||||
<input type="checkbox"
|
||||
class="custom-control-input"
|
||||
name="email_notification"
|
||||
id="email_notification"
|
||||
value="1"/>
|
||||
|
||||
<label class="custom-control-label font-weight-normal" for="email_notification">
|
||||
<span class="d-block">@lang('E-Mail Notification')</span>
|
||||
<small>@lang('Send email notification about the announcement to all users.')</small>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
{{ $edit ? __('Update Announcement') : __('Create Announcement') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{!! Form::close() !!}
|
||||
@stop
|
||||
|
||||
@section('scripts')
|
||||
{!! JsValidator::formRequest(\Vanguard\Announcements\Http\Requests\AnnouncementRequest::class, '#announcement-form') !!}
|
||||
@stop
|
||||
@@ -0,0 +1,101 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('page-title', __('Announcements'))
|
||||
@section('page-heading', __('Announcements'))
|
||||
|
||||
@section('breadcrumbs')
|
||||
<li class="breadcrumb-item active">
|
||||
@lang('Announcements')
|
||||
</li>
|
||||
@stop
|
||||
|
||||
@section('content')
|
||||
|
||||
@include('partials.messages')
|
||||
|
||||
<div class="d-flex mb-4">
|
||||
<a href="{{ route('announcements.create') }}" class="btn btn-primary btn-rounded ml-auto">
|
||||
<i class="fas fa-plus mr-2"></i>
|
||||
@lang('Create Announcement')
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-borderless table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th class="min-width-150">@lang('Creator')</th>
|
||||
<th class="min-width-150">@lang('Title')</th>
|
||||
<th class="min-width-150">@lang('Created At')</th>
|
||||
<th class="text-center min-width-150">@lang('Action')</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if (count($announcements))
|
||||
@foreach ($announcements as $announcement)
|
||||
<tr>
|
||||
<td style="width: 40px;">
|
||||
<a href="{{ route('users.show', $announcement->creator) }}">
|
||||
<img
|
||||
class="rounded-circle img-responsive"
|
||||
width="40"
|
||||
src="{{ $announcement->creator->present()->avatar }}"
|
||||
alt="{{ $announcement->creator->present()->name }}">
|
||||
</a>
|
||||
</td>
|
||||
<td class="align-middle">
|
||||
@permission('users.manage')
|
||||
<a href="{{ route('users.show', $announcement->creator) }}">
|
||||
{{ $announcement->creator->username ?: __('N/A') }}
|
||||
</a>
|
||||
@else
|
||||
<span>{{ $announcement->creator->username ?: __('N/A') }}</span>
|
||||
@endpermission
|
||||
</td>
|
||||
<td class="align-middle">
|
||||
<a href="{{ route('announcements.show', $announcement) }}">
|
||||
{{ \Illuminate\Support\Str::limit($announcement->title, 50) }}
|
||||
</a>
|
||||
</td>
|
||||
<td class="align-middle">
|
||||
{{ $announcement->created_at->format(config('app.date_format')) }}
|
||||
</td>
|
||||
<td class="text-center align-middle">
|
||||
<a href="{{ route('announcements.edit', $announcement) }}"
|
||||
class="btn btn-icon edit"
|
||||
title="@lang('Edit Announcement')"
|
||||
data-toggle="tooltip" data-placement="top">
|
||||
<i class="fas fa-edit"></i>
|
||||
</a>
|
||||
|
||||
<a href="{{ route('announcements.destroy', $announcement) }}"
|
||||
class="btn btn-icon"
|
||||
title="@lang('Delete Announcement')"
|
||||
data-toggle="tooltip"
|
||||
data-placement="top"
|
||||
data-method="DELETE"
|
||||
data-confirm-title="@lang('Please Confirm')"
|
||||
data-confirm-text="@lang('Are you sure that you want to delete this announcement?')"
|
||||
data-confirm-delete="@lang('Yes, delete it!')">
|
||||
<i class="fas fa-trash"></i>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@else
|
||||
<tr>
|
||||
<td colspan="7"><em>@lang('No announcements found.')</em></td>
|
||||
</tr>
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{!! $announcements->render() !!}
|
||||
@stop
|
||||
@@ -0,0 +1,33 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('page-title', __('Announcements'))
|
||||
@section('page-heading', __('Announcements'))
|
||||
|
||||
@section('breadcrumbs')
|
||||
<li class="breadcrumb-item active">
|
||||
@lang('Announcements')
|
||||
</li>
|
||||
@stop
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-md-6 mx-auto mb-4">
|
||||
@foreach ($announcements as $announcement)
|
||||
@include('announcements::partials.card')
|
||||
@endforeach
|
||||
|
||||
@if (count($announcements) == 0)
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<p class="lead text-center m-0">
|
||||
@lang('No new announcements at the moment.')
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
{!! $announcements->render() !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@stop
|
||||
@@ -0,0 +1,10 @@
|
||||
@component('mail::message')
|
||||
|
||||
# {{ $announcement->title }}
|
||||
|
||||
{!! $announcement->body !!}
|
||||
|
||||
@lang('Thanks'),<br>
|
||||
{{ config('app.name') }}
|
||||
|
||||
@endcomponent
|
||||
@@ -0,0 +1,39 @@
|
||||
<div class="card overflow-hidden shadow-lg">
|
||||
<div class="card-body p-0">
|
||||
<div class="p-4">
|
||||
<h4 class="card-title mb-3">
|
||||
{{ $announcement->title }}
|
||||
</h4>
|
||||
<div>
|
||||
{{ $announcement->parsed_body }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex justify-content-between align-items-center px-4 py-3 bg-lighter">
|
||||
<div class="d-flex align-items-center ">
|
||||
<img
|
||||
class="rounded-circle img-responsive mr-2"
|
||||
width="40"
|
||||
src="{{ $announcement->creator->present()->avatar }}"
|
||||
alt="{{ $announcement->creator->present()->name }}">
|
||||
|
||||
<div>
|
||||
<div class="line-height-1">
|
||||
{{ $announcement->creator->present()->name }}
|
||||
</div>
|
||||
<div class="text-muted">
|
||||
{{ $announcement->created_at->format('M d') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@permission('announcements.manage')
|
||||
<div>
|
||||
<a href="{{ route('announcements.edit', $announcement) }}"
|
||||
class="btn btn-secondary btn-sm">
|
||||
@lang('Edit')
|
||||
</a>
|
||||
</div>
|
||||
@endpermission
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
<div class="d-flex align-items-start px-4 p-4 navbar-item">
|
||||
<img src="{{ $announcement->creator->present()->avatar }}" width="50" height="50"
|
||||
class="rounded-circle img-responsive mr-3">
|
||||
|
||||
<div class="w-100">
|
||||
<div class="d-flex justify-content-between align-items-start">
|
||||
<span class="font-weight-bold">
|
||||
{{ $announcement->creator->present()->name }}
|
||||
</span>
|
||||
<span class="text-muted">
|
||||
{{ $announcement->created_at->diffForHumans(null, true, true) }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<a href="{{ route('announcements.show', $announcement) }}">
|
||||
{{ $announcement->title }}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
<li class="nav-item dropdown announcements d-flex align-items-center px-3" id="announcements-icon">
|
||||
<a href="#"
|
||||
class="text-gray-500 position-relative nav-icon"
|
||||
id="announcementsDropdown"
|
||||
role="button"
|
||||
data-toggle="dropdown"
|
||||
aria-haspopup="true"
|
||||
aria-expanded="false">
|
||||
@if (count($announcements) > 0 && $announcements->first()->wasReadBy(auth()->user()))
|
||||
<i class="activity-badge"></i>
|
||||
@endif
|
||||
<i class="fas fa-bullhorn"></i>
|
||||
</a>
|
||||
<div class="dropdown-menu dropdown-menu-right position-absolute p-0 shadow-lg"
|
||||
aria-labelledby="announcementsDropdown"
|
||||
style="width: 380px; height: 350px; overflow-y: scroll; overflow-x: hidden;">
|
||||
<div class="text-center p-4">
|
||||
<h5 class="text-muted mt-2">
|
||||
@lang('Announcements')
|
||||
</h5>
|
||||
@if (count($announcements) > 0)
|
||||
<a href="{{ route('announcements.list') }}">
|
||||
@lang('View All')
|
||||
</a>
|
||||
@endif
|
||||
</div>
|
||||
<div class="bg-lighter">
|
||||
@if (count($announcements) > 0)
|
||||
@foreach ($announcements as $announcement)
|
||||
@include('announcements::partials.navbar.item')
|
||||
@endforeach
|
||||
@else
|
||||
<p class="text-center">@lang('No new announcements at the moment.')</p>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</li>
|
||||
@@ -0,0 +1,4 @@
|
||||
<script>
|
||||
var read_announcements_endpoint = "{{ route('announcements.read') }}";
|
||||
</script>
|
||||
<script src="{{ url("vendor/plugins/announcements/js/announcements.js") }}"></script>
|
||||
@@ -0,0 +1,4 @@
|
||||
<link media="all"
|
||||
type="text/css"
|
||||
rel="stylesheet"
|
||||
href="{{ url(mix('/css/announcements.css', 'vendor/plugins/announcements')) }}">
|
||||
@@ -0,0 +1,24 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('page-title', __('Announcement') . ":" . $announcement->title)
|
||||
@section('page-heading', __('Announcement Details'))
|
||||
|
||||
@section('breadcrumbs')
|
||||
<li class="breadcrumb-item">
|
||||
<a href="{{ route('announcements.list') }}">
|
||||
@lang('Announcements')
|
||||
</a>
|
||||
</li>
|
||||
<li class="breadcrumb-item active">
|
||||
{{ __('Announcement Details') }}
|
||||
</li>
|
||||
@stop
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-md-6 mx-auto mb-4">
|
||||
@include('announcements::partials.card')
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
|
||||
Reference in New Issue
Block a user