Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
4bf7790
Add spatie/laravel-html
betsyecastro Aug 13, 2026
86372d6
Migrate student application form to spatie/laravel-html
betsyecastro Aug 14, 2026
464f834
Migrate profile information edit form to spatie/laravel-html
betsyecastro Aug 14, 2026
7052b41
Replace Form::inlineErrors with a Blade directive
betsyecastro Aug 14, 2026
40a84f2
Migrate settings edit form to spatie/laravel-html
betsyecastro Aug 17, 2026
fb07a5e
Migrate schools create and form views to spatie/laravel-html and fix …
betsyecastro Aug 17, 2026
dbcbc8a
Migrate user edit view to spatie/laravel-html
betsyecastro Aug 17, 2026
b465186
Migrate search form to spatie/laravel-html
betsyecastro Aug 17, 2026
70ed1f1
Migrate user edit view to spatie/laravel-html
betsyecastro Aug 17, 2026
8842f92
Migrate search form to spatie/laravel-html
betsyecastro Aug 17, 2026
4f431af
Migrate schools create, edit and form views to spatie/laravel-html an…
betsyecastro Aug 17, 2026
77e15ee
Migrate settings edit form and custom questions form to spatie/larave…
betsyecastro Aug 17, 2026
0701e44
Migrate student application show view (app status update form) to spa…
betsyecastro Aug 18, 2026
cdda2b7
Migrate user create form to spatie/laravel-htm
betsyecastro Aug 18, 2026
19ebf94
Migrate tags views to spatie/laravel-htm
betsyecastro Aug 18, 2026
d517936
Migrate logs form to spatie/laravel-htm
betsyecastro Aug 18, 2026
1e4941a
Merge branch 'add-laravel-html' of github.com:utdal/profiles into add…
betsyecastro Aug 18, 2026
3450a97
Fix search form missing ->open() call
betsyecastro Aug 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ public function boot()
Paginator::defaultView('vendor.pagination.default');
Paginator::defaultSimpleView('vendor.pagination.simple-default');
Paginator::useBootstrap();

Form::component('inlineErrors', 'errors.inline', ['field_name']);

Blade::directive('inlineErrors', fn ($field) =>
"<?php echo view('errors.inline', ['field_name' => {$field}])->render(); ?>"
);

View::composer([
'layout',
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"sentry/sentry-laravel": "^4.15.0",
"spatie/browsershot": "^5.1.0",
"spatie/laravel-backup": "^8.1",
"spatie/laravel-html": "^3.13",
"spatie/laravel-medialibrary": "^11.23.1",
"spatie/laravel-tags": "^4.3.2",
"stevebauman/purify": "^5.1.1"
Expand Down
80 changes: 79 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions resources/views/_search.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{!! Form::open(['url' => route('profiles.index'), 'method' => 'get', 'class' => 'form-inline my-2 my-lg-0 mr-sm-2']) !!}
{{ html()->form('GET', route('profiles.index'))->class('form-inline my-2 my-lg-0 mr-sm-2')->open() }}
<div class="search input-group input-group-lg">
<input class="search form-control" type="search" name="search" placeholder="search..." aria-label="Search" value="{{ $search ?? '' }}">
<div class="input-group-append">
Expand All @@ -7,7 +7,7 @@
</button>
</div>
</div>
{!! Form::close() !!}
{{ html()->form()->close() }}

@if($errors->has('search'))
@pushOnce('scripts')
Expand Down
4 changes: 2 additions & 2 deletions resources/views/logs/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<div class="container">
<h1>Activity Logs</h1>

{!! Form::open(['url' => route('app.logs.index'), 'method' => 'get', 'class' => 'form-inline mb-4']) !!}
{{ html()->form('GET', route('app.logs.index'))->class('form-inline mb-4')->attribute('accept-charset', 'UTF-8')->open() }}
<div class="search input-group input-group-lg">
<input id="log_search" class="search form-control" type="search" name="log_search" placeholder="search..." aria-label="Search" value="{{$log_search}}">
<div class="input-group-append">
Expand All @@ -25,7 +25,7 @@
</button>
</div>
</div>
{!! Form::close() !!}
{{ html()->form()->close() }}

<table class="table table-sm table-striped">
<thead>
Expand Down
30 changes: 15 additions & 15 deletions resources/views/profiles/edit/information.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,55 +2,55 @@
<div class="row">
@foreach($data as $info)
<div class="col col-md-4">
{!! Form::open(['url' => route('profiles.update-image', [$profile->slug]), 'method' => 'POST', 'files' => true]) !!}
{{ html()->form('POST', route('profiles.update-image', [$profile->slug]))->acceptsFiles()->attribute('accept-charset', 'UTF-8')->open() }}
<label for="file">Icon</label>
<img id="file-img" class="profile_photo" src="{{ $profile->imageUrl }}" />
<br />
<br />
<div class="control-group">
<div class="controls">
{!! Form::file('image', ['id' => 'file', 'name' => 'image', 'required' => 'true', 'accept' => 'image/*', 'class' => 'd-none form-control']) !!}
{{ html()->file('image')->id('file')->name('image')->required()->accept('image/*')->class('d-none form-control') }}
<label for="file" class="btn btn-secondary btn-block"><i class="fas fa-plus"></i> Select Image</label>
{!! Form::inlineErrors('image') !!}
@inlineErrors('image')
</div>
</div>
<button type="submit" class="btn btn-primary btn-block" data-toggle="replace-icon" data-newicon="fas fa-sync fa-spin" data-inputrequired="#file">
<i class="fas fa-upload"></i> Replace Image
</button>
{!! Form::close() !!}
{{ html()->form()->close() }}
<br>
<br>
{!! Form::open(['url' => route('profiles.update-banner', [$profile->slug]), 'method' => 'POST', 'files' => true]) !!}
{{ html()->form('POST', route('profiles.update-banner', [$profile->slug]))->acceptsFiles()->open() }}
<label for="banner">Banner</label>
<img id="banner-img" class="profile_photo" src="{{ $profile->banner_url }}" />
<br />
<br />
<div class="control-group">
<div class="controls">
{!! Form::file('banner_image', ['id' => 'banner', 'name' => 'banner_image', 'required' => 'true', 'accept' => 'image/*', 'class' => 'd-none form-control']) !!}
{{ html()->file('banner_image')->id('banner')->name('banner_image')->required()->accept('image/*')->class('d-none form-control') }}
<label for="banner" class="btn btn-secondary btn-block"><i class="fas fa-plus"></i> Select Image</label>
{!! Form::inlineErrors('banner_image') !!}
@inlineErrors('banner_image')
</div>
</div>
<button type="submit" class="btn btn-primary btn-block" data-toggle="replace-icon" data-newicon="fas fa-sync fa-spin" data-inputrequired="#banner">
<i class="fas fa-upload"></i> Replace Image
</button>
{!! Form::close() !!}
{{ html()->form()->close() }}
<br>
<br>
</div>
<div class="col col-md-8 col-12">
{!! Form::model($profile, ['route' => ['profiles.update', 'profile' => $profile, 'section' => 'information']]) !!}
{{ html()->modelForm($profile,'POST',route('profiles.update', ['profile' => $profile, 'section' => 'information']))->attribute('accept-charset', 'UTF-8')->open() }}
<div class="form-group">
{!! Form::label('full_name', 'Display Name') !!}
{!! Form::text('full_name', $profile->full_name, ['class' => 'form-control', 'required']) !!}
{!! Form::inlineErrors('full_name') !!}
{{ html()->label('Display Name', 'full_name') }}
{{ html()->text('faull_name', $profile->full_name)->class('form-control')->required() }}
@inlineErrors('full_name')
</div>
<div class="form-group">
<input type="hidden" name="data[{{$info->id}}][id]" value="{{$info->id}}" />
<label for="data[{{$info->id}}][data][title]">Title</label>
<input type="text" class="form-control" name="data[{{$info->id}}][data][title]" id="data[{{$info->id}}][data][title]" value="{{$info->title}}" required />
{!! Form::inlineErrors("data.".$info->id.".data.title") !!}
@inlineErrors("data.".$info->id.".data.title")
</div>
<div class="form-group">
<label for="data[{{$info->id}}][data][distinguished_title]">Distinguished Title</label>
Expand Down Expand Up @@ -359,9 +359,9 @@ class="border-left ml-3"
</div>
</fieldset>
@endcan
{!! Form::submit('Save', array('class' => 'btn btn-primary edit-button')) !!}
{{ html()->submit('Save')->class('btn btn-primary edit-button') }}
<a href="{{ $profile->url }}" class='btn btn-light edit-button'>Cancel</a>
{!! Form::close() !!}
{{ html()->closeModelForm() }}
</div>
@endforeach
</div>
4 changes: 2 additions & 2 deletions resources/views/profiles/edit/layout.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

@yield('info')

{!! Form::open(['url' => route('profiles.update', [$profile->slug, $section]), 'files' => $files ?? false]) !!}
{{ html()->form('POST', route('profiles.update', [$profile->slug, $section]))->acceptsFilesIf($files ?? false)->open() }}

@include('profiles.edit._insert_button', ['type' => 'prepend'])
<div class="row mb-4 lower-border"></div>
Expand All @@ -17,4 +17,4 @@
@include('profiles.edit._insert_button', ['type' => 'append'])
@include('profiles.edit._buttons')

{!! Form::close() !!}
{{ html()->form()->close() }}
4 changes: 2 additions & 2 deletions resources/views/schools/create.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
<div class="container">
<h2 class="text-center mt-5">Add a New School:</h2>

{!! Form::open(['route' => 'schools.store', 'class' => 'form-horizontal', 'id' => 'schools_form']) !!}
{{ html()->form('POST', route('schools.store'))->id('schools_form')->class('form-horizontal')->attribute('accept-charset', 'UTF-8')->open() }}
@include('schools.form', ['submitButtonText' => 'Add School'])
{!! Form::close() !!}
{{ html()->form()->close() }}

</div>
@stop
4 changes: 2 additions & 2 deletions resources/views/schools/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
<div class="container">
<h2 class="text-center mt-5">Edit School &ldquo;{{ $school->display_name }}&rdquo;:</h2>

{!! Form::model($school, ['method' => 'PATCH', 'route' => ['schools.update', $school], 'class' => 'form-horizontal', 'id' => 'schools_form']) !!}
{{ html()->modelForm($school,'PATCH',route('schools.update', ['school' => $school]))->id('schools_form')->class('form-horizontal')->attribute('accept-charset', 'UTF-8')->open() }}
@include('schools.form', ['submitButtonText' => 'Update School'])
{!! Form::close() !!}
{{ html()->closeModelForm() }}

</div>
@stop
16 changes: 8 additions & 8 deletions resources/views/schools/form.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<small id="nameHelp" class="form-text text-muted">The name of the school.</small>
</label>
<div class="col-sm-9">
{!! Form::text('name', null, ['class' => 'form-control', 'required' => 'required']) !!}
{{ html()->text('name', null)->required()->class('form-control') }}
</div>
</div>

Expand All @@ -18,33 +18,33 @@
<small id="shortNameHelp" class="form-text text-muted">This is used as the URL slug. If the school is known by an acroym, e.g. <em>EECS</em>, this is where to put it.</small>
</label>
<div class="col-sm-9">
{!! Form::text('short_name', null, ['class' => 'form-control', 'required' => 'required']) !!}
{{ html()->text('short_name', null)->required()->class('form-control') }}
</div>
</div>

<hr>

<!-- Display Name -->
<div class="form-group row">
<label for="short_name" class="col-sm-3 col-form-label">
<label for="display_name" class="col-sm-3 col-form-label">
Display Name:
<small id="displayNameHelp" class="form-text text-muted">This is used wherever the school name is displayed in the interface.</small>
</label>
<div class="col-sm-9">
{!! Form::text('display_name', null, ['class' => 'form-control', 'required' => 'required']) !!}
{{ html()->text('display_name', null)->required()->class('form-control') }}
</div>
</div>

<hr>

<!-- Aliases -->
<div class="form-group row">
<label for="short_name" class="col-sm-3 col-form-label">
<label for="aliases" class="col-sm-3 col-form-label">
Aliases:
<small id="displayNameHelp" class="form-text text-muted">A semicolon-delimited list of other aliases for the school. This is used when auto-associating a new user with a school. As such, it's a good idea to include departments and majors associated with the school in this list, as well.</small>
<small id="aliases" class="form-text text-muted">A semicolon-delimited list of other aliases for the school. This is used when auto-associating a new user with a school. As such, it's a good idea to include departments and majors associated with the school in this list, as well.</small>
</label>
<div class="col-sm-9">
{!! Form::textarea('aliases', null, ['class' => 'form-control']) !!}
{{ html()->textarea('aliases', null)->class('form-control') }}
</div>
</div>

Expand All @@ -54,7 +54,7 @@
@unless($readonly ?? false)
<div class="form-group row">
<div class="offset-sm-3 col-sm-9">
{!! Form::submit($submitButtonText ?? 'Add School', ['class' => 'btn btn-primary form-control']) !!}
{{ html()->submit($submitButtonText ?? 'Add School')->class('btn btn-primary form-control') }}
</div>
</div>
@endunless
Loading