Added full Vacancy description
Also added support for Markdown
This commit is contained in:
parent
035c9399a6
commit
4b390ea536
|
@ -8,10 +8,13 @@ use App\User;
|
|||
use App\Form;
|
||||
|
||||
use App\Notifications\VacancyClosed;
|
||||
use GrahamCampbell\Markdown\Facades\Markdown;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
|
||||
class VacancyController extends Controller
|
||||
{
|
||||
public function index()
|
||||
|
@ -35,6 +38,7 @@ class VacancyController extends Controller
|
|||
|
||||
'vacancyName' => $request->vacancyName,
|
||||
'vacancyDescription' => $request->vacancyDescription,
|
||||
'vacancyFullDescription' => Markdown::convertToHTML($request->vacancyFullDescription),
|
||||
'vacancySlug' => Str::slug($request->vacancyName),
|
||||
'permissionGroupName' => $request->permissionGroup,
|
||||
'discordRoleID' => $request->discordRole,
|
||||
|
|
|
@ -26,6 +26,7 @@ class VacancyRequest extends FormRequest
|
|||
return [
|
||||
'vacancyName' => 'required|string',
|
||||
'vacancyDescription' => 'required|string',
|
||||
'vacancyFullDescription' => 'nullable|string',
|
||||
'permissionGroup' => 'required|string',
|
||||
'discordRole' => 'required|string',
|
||||
'vacancyCount' => 'required|integer',
|
||||
|
|
|
@ -13,6 +13,7 @@ class Vacancy extends Model
|
|||
'permissionGroupName',
|
||||
'vacancyName',
|
||||
'vacancyDescription',
|
||||
'vacancyFullDescription',
|
||||
'discordRoleID',
|
||||
'vacancyFormID',
|
||||
'vacancyCount',
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
"fideloper/proxy": "^4.2",
|
||||
"fruitcake/laravel-cors": "^1.0",
|
||||
"geo-sot/laravel-env-editor": "^0.9.9",
|
||||
"graham-campbell/markdown": "^12.0",
|
||||
"guzzlehttp/guzzle": "^6.5",
|
||||
"jeroennoten/laravel-adminlte": "^3.2",
|
||||
"laravel/framework": "^7.0",
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "16e8efbacd91ef3417b21bd2648e1629",
|
||||
"content-hash": "51429857899e8134bbe6b4fa61145cc3",
|
||||
"packages": [
|
||||
{
|
||||
"name": "almasaeed2010/adminlte",
|
||||
|
@ -1091,6 +1091,73 @@
|
|||
],
|
||||
"time": "2020-04-17T23:33:36+00:00"
|
||||
},
|
||||
{
|
||||
"name": "graham-campbell/markdown",
|
||||
"version": "v12.0.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/GrahamCampbell/Laravel-Markdown.git",
|
||||
"reference": "584eb9f24004238b80ee98b6e7be82f0933554dd"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/GrahamCampbell/Laravel-Markdown/zipball/584eb9f24004238b80ee98b6e7be82f0933554dd",
|
||||
"reference": "584eb9f24004238b80ee98b6e7be82f0933554dd",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"illuminate/contracts": "^6.0|^7.0",
|
||||
"illuminate/support": "^6.0|^7.0",
|
||||
"illuminate/view": "^6.0|^7.0",
|
||||
"league/commonmark": "^1.3",
|
||||
"php": "^7.2.5"
|
||||
},
|
||||
"require-dev": {
|
||||
"graham-campbell/analyzer": "^3.0",
|
||||
"graham-campbell/testbench": "^5.4",
|
||||
"mockery/mockery": "^1.3.1",
|
||||
"phpunit/phpunit": "^8.5|^9.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "12.0-dev"
|
||||
},
|
||||
"laravel": {
|
||||
"providers": [
|
||||
"GrahamCampbell\\Markdown\\MarkdownServiceProvider"
|
||||
]
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"GrahamCampbell\\Markdown\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Graham Campbell",
|
||||
"email": "graham@alt-three.com"
|
||||
}
|
||||
],
|
||||
"description": "Markdown Is A CommonMark Wrapper For Laravel",
|
||||
"keywords": [
|
||||
"Graham Campbell",
|
||||
"GrahamCampbell",
|
||||
"Laravel Markdown",
|
||||
"Laravel-Markdown",
|
||||
"common mark",
|
||||
"commonmark",
|
||||
"framework",
|
||||
"laravel",
|
||||
"markdown"
|
||||
],
|
||||
"time": "2020-04-14T16:14:52+00:00"
|
||||
},
|
||||
{
|
||||
"name": "guzzlehttp/guzzle",
|
||||
"version": "6.5.4",
|
||||
|
|
|
@ -164,7 +164,9 @@ return [
|
|||
|
||||
/*
|
||||
* Package Service Providers...
|
||||
|
||||
*/
|
||||
GrahamCampbell\Markdown\MarkdownServiceProvider::class,
|
||||
|
||||
/*
|
||||
* Application Service Providers...
|
||||
|
@ -230,7 +232,8 @@ return [
|
|||
'Validator' => Illuminate\Support\Facades\Validator::class,
|
||||
'View' => Illuminate\Support\Facades\View::class,
|
||||
'UUID' => App\Facades\UUID::class,
|
||||
'IP' => App\Facades\IP::class
|
||||
'IP' => App\Facades\IP::class,
|
||||
'Markdown' => GrahamCampbell\Markdown\Facades\Markdown::class,
|
||||
|
||||
],
|
||||
|
||||
|
|
|
@ -0,0 +1,158 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of Laravel Markdown.
|
||||
*
|
||||
* (c) Graham Campbell <graham@alt-three.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Enable View Integration
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option specifies if the view integration is enabled so you can write
|
||||
| markdown views and have them rendered as html. The following extensions
|
||||
| are currently supported: ".md", ".md.php", and ".md.blade.php". You may
|
||||
| disable this integration if it is conflicting with another package.
|
||||
|
|
||||
| Default: true
|
||||
|
|
||||
*/
|
||||
|
||||
'views' => true,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| CommonMark Extensions
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option specifies what extensions will be automatically enabled.
|
||||
| Simply provide your extension class names here.
|
||||
|
|
||||
| Default: []
|
||||
|
|
||||
*/
|
||||
|
||||
'extensions' => [],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Renderer Configuration
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option specifies an array of options for rendering HTML.
|
||||
|
|
||||
| Default: [
|
||||
| 'block_separator' => "\n",
|
||||
| 'inner_separator' => "\n",
|
||||
| 'soft_break' => "\n",
|
||||
| ]
|
||||
|
|
||||
*/
|
||||
|
||||
'renderer' => [
|
||||
'block_separator' => "\n",
|
||||
'inner_separator' => "\n",
|
||||
'soft_break' => "\n",
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Enable Em Tag Parsing
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option specifies if `<em>` parsing is enabled.
|
||||
|
|
||||
| Default: true
|
||||
|
|
||||
*/
|
||||
|
||||
'enable_em' => true,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Enable Strong Tag Parsing
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option specifies if `<strong>` parsing is enabled.
|
||||
|
|
||||
| Default: true
|
||||
|
|
||||
*/
|
||||
|
||||
'enable_strong' => true,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Enable Asterisk Parsing
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option specifies if `*` should be parsed for emphasis.
|
||||
|
|
||||
| Default: true
|
||||
|
|
||||
*/
|
||||
|
||||
'use_asterisk' => true,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Enable Underscore Parsing
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option specifies if `_` should be parsed for emphasis.
|
||||
|
|
||||
| Default: true
|
||||
|
|
||||
*/
|
||||
|
||||
'use_underscore' => true,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| HTML Input
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option specifies how to handle untrusted HTML input.
|
||||
|
|
||||
| Default: 'strip'
|
||||
|
|
||||
*/
|
||||
|
||||
'html_input' => 'strip',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Allow Unsafe Links
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option specifies whether to allow risky image URLs and links.
|
||||
|
|
||||
| Default: true
|
||||
|
|
||||
*/
|
||||
|
||||
'allow_unsafe_links' => false,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Maximum Nesting Level
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option specifies the maximum permitted block nesting level.
|
||||
|
|
||||
| Default: INF
|
||||
|
|
||||
*/
|
||||
|
||||
'max_nesting_level' => INF,
|
||||
|
||||
];
|
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddDetailedDescriptionToVacancy extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('vacancies', function (Blueprint $table) {
|
||||
$table->longText('vacancyFullDescription')->nullable()->after('vacancyDescription');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('vacancies', function (Blueprint $table) {
|
||||
$table->dropColumn('vacancyFullDescription');
|
||||
});
|
||||
}
|
||||
}
|
|
@ -55,6 +55,9 @@
|
|||
<label for="vacancyDescription">Vacancy Description</label>
|
||||
<input type="text" id="vacancyDescription" name="vacancyDescription" class="form-control">
|
||||
|
||||
<label for="vacancyFullDescription">Vacancy Details</label>
|
||||
<textarea name="vacancyFullDescription" class="form-control" rel="txtTooltip" title="Add things like admission requirements, rank resposibilities and roles, and anything else you feel is necessary" data-toggle="tooltip" data-placement="bottom"></textarea>
|
||||
<span class="right text-muted"><i class="fab fa-markdown"></i> Markdown supported</span>
|
||||
<div class="row mt-3">
|
||||
|
||||
<div class="col">
|
||||
|
|
|
@ -14,6 +14,38 @@
|
|||
|
||||
@section('content')
|
||||
|
||||
@if (!$vacancies->isEmpty())
|
||||
|
||||
@foreach($vacancies as $vacancy)
|
||||
|
||||
<x-modal id="{{ $vacancy->vacancySlug . '-details' }}" modal-label="{{ $vacancy->vacancySlug . '-details-label' }}" modal-title="Vacancy details" include-close-button="true">
|
||||
|
||||
@if (is_null($vacancy->vacancyFullDescription))
|
||||
|
||||
<div class="alert alert-warning">
|
||||
|
||||
<h3><i class="fas fa-question-circle"></i> There don't seem to be any details</h3>
|
||||
<p>
|
||||
This vacancy does not have any details yet.
|
||||
</p>
|
||||
|
||||
</div>
|
||||
@else
|
||||
|
||||
{!! $vacancy->vacancyFullDescription !!}
|
||||
<p class="text-sm text-muted">
|
||||
Last updated @ {{ $vacancy->updated_at }}
|
||||
</p>
|
||||
@endif
|
||||
|
||||
<x-slot name="modalFooter"></x-slot>
|
||||
|
||||
</x-modal>
|
||||
|
||||
@endforeach
|
||||
|
||||
@endif
|
||||
|
||||
<div class="row mt-5">
|
||||
|
||||
<div class="col">
|
||||
|
@ -190,7 +222,7 @@
|
|||
<div class="card-footer text-center">
|
||||
|
||||
<button type="button" class="btn btn-primary btn-sm" onclick="window.location.href='{{ route('renderApplicationForm', ['vacancySlug' => $vacancy->vacancySlug]) }}'">Apply</button>
|
||||
<button type="button" class="btn btn-warning btn-sm">Learn More</button>
|
||||
<button type="button" class="btn btn-warning btn-sm" onclick="$('#{{ $vacancy->vacancySlug }}-details').modal('show')">Learn More</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -2,6 +2,42 @@
|
|||
|
||||
@section('content')
|
||||
|
||||
@if(!$positions->isEmpty())
|
||||
|
||||
<!-- todo: details component -->
|
||||
|
||||
|
||||
@foreach($positions as $position)
|
||||
|
||||
<x-modal id="{{ $position->vacancySlug . '-details' }}" modal-label="{{ $position->vacancySlug . '-details-label' }}" modal-title="Opening details" include-close-button="true">
|
||||
|
||||
@if (is_null($position->vacancyFullDescription))
|
||||
|
||||
<div class="alert alert-warning">
|
||||
|
||||
<h3><i class="fas fa-question-circle"></i> There don't seem to be any details</h3>
|
||||
<p>
|
||||
This opening does not have any details yet.
|
||||
</p>
|
||||
|
||||
</div>
|
||||
@else
|
||||
|
||||
{!! $position->vacancyFullDescription !!}
|
||||
<p class="text-sm text-muted">
|
||||
Last updated @ {{ $position->updated_at }}
|
||||
</p>
|
||||
@endif
|
||||
|
||||
<x-slot name="modalFooter"></x-slot>
|
||||
|
||||
</x-modal>
|
||||
|
||||
@endforeach
|
||||
|
||||
|
||||
@endif
|
||||
|
||||
<!--Main Layout-->
|
||||
<main class="py-5">
|
||||
|
||||
|
@ -57,6 +93,7 @@
|
|||
|
||||
@guest
|
||||
<button type="button" class="btn btn-success" onclick="window.location.href='{{route('renderApplicationForm', ['vacancySlug' => $position->vacancySlug])}}'">Apply</button>
|
||||
<button type="button" class="btn btn-info" onclick="$('#{{ $position->vacancySlug }}-details').modal('show')">Learn more</button>
|
||||
@endguest
|
||||
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue