vendor and env first commit
This commit is contained in:
@@ -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