Skip to content

Commit

Permalink
Reverted to 1 layout format + other design changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Marko259 committed Aug 1, 2024
1 parent f10d8f0 commit f17788b
Show file tree
Hide file tree
Showing 25 changed files with 194 additions and 418 deletions.
14 changes: 9 additions & 5 deletions app/Http/Controllers/EventController.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function store(Request $request)
'image' => 'nullable|image|mimes:jpeg,jpg|max:2048',
]);

$imageName = null;
$imageURL = null;

if ($request->hasFile('image')) {
$image = $request->file('image');
Expand All @@ -81,6 +81,8 @@ public function store(Request $request)
if (!Storage::disk('public')->exists('images/' . $imageName)) {
return back()->withErrors(['image' => 'Failed to upload the image.'])->withInput();
}

$imageURL = asset('storage/images/' . $imageName);
}

$event = Event::create([
Expand All @@ -92,7 +94,7 @@ public function store(Request $request)
'recurrence_interval' => $request->input('event_type') == '0' ? null : $request->input('recurrence_interval'),
'recurrence_unit' => $request->input('event_type') == '0' ? null : $request->input('recurrence_unit'),
'recurrence_end_date' => $request->input('event_type') == '0' ? null : $request->input('recurrence_end_date'),
'image' => $imageName,
'image' => $imageURL,
]);

// Ensure area and user association
Expand Down Expand Up @@ -154,7 +156,7 @@ public function update(Request $request, Event $event)
'image' => 'nullable|image|mimes:jpeg,jpg|max:2048',
]);

$imageName = $event->image;
$imageURL = $event->image;

if ($request->hasFile('image')) {
$image = $request->file('image');
Expand All @@ -179,8 +181,10 @@ public function update(Request $request, Event $event)
if (!Storage::disk('public')->exists('images/' . $imageName)) {
return back()->withErrors(['image' => 'Failed to upload the image.']);
}

$imageURL = asset('storage/images/' . $imageName);

$event->image = $imageName;
$event->image = $imageURL;
}

$event->update([
Expand All @@ -192,7 +196,7 @@ public function update(Request $request, Event $event)
'recurrence_interval' => $request->input('event_type') == '0' ? null : $request->input('recurrence_interval'),
'recurrence_unit' => $request->input('event_type') == '0' ? null : $request->input('recurrence_unit'),
'recurrence_end_date' => $request->input('event_type') == '0' ? null : $request->input('recurrence_end_date'),
'image' => $imageName,
'image' => $imageURL,
]);

// Ensure area and user association
Expand Down
41 changes: 0 additions & 41 deletions app/Http/Controllers/FrontController.php

This file was deleted.

2 changes: 1 addition & 1 deletion app/Http/Controllers/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,6 @@ public function update(Request $request, User $user)
}
}

return redirect()->route('users.index')->withSuccess('User successfully updated');
return redirect()->route('users.show', $user)->withSuccess('User successfully updated');
}
}
Binary file modified public/favicon.ico
100755 → 100644
Binary file not shown.
20 changes: 14 additions & 6 deletions resources/views/calendar/create.blade.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
@extends('layouts.auth.app')
@extends('layouts.app')
@section('title', 'Create Calendar')
@section('content')
<div class="row justify-content-center">
<div class="row">
<div class="col-xl-6 col-md-12 mb-12">
<div class="card shadow mb-4">
<div class="card-header bg-primary py-3 d-flex flex-row align-items-center justify-content-center">
<div class="card-header bg-primary py-3 d-flex flex-row align-items-center">
<h6 class="m-0 fw-bold text-white">User input</h6>
</div>
<div class="card-body">
Expand All @@ -29,10 +29,18 @@
@enderror
</div>

<div class="form-check">
<input class="form-check-input" type="radio" name="public" id="public" value="1" {{ old('public') == "1" ? 'checked' : '' }} required>
<label class="form-check-label" for="public">
Public Calendar
</label>
</div>

<div class="form-check mb-4">
<input type="hidden" name="public" value="0">
<input class="form-check-input" type="checkbox" value="1" name="public" id="public" {{ old('public') == "1" ? 'checked' : '' }}>
<label for="public" class="form-label my-1 me-2">Public calendar?</label>
<input class="form-check-input" type="radio" name="public" id="private" value="0" {{ old('public') == "0" ? 'checked' : '' }} required>
<label class="form-check-label" for="private">
Private Calendar
</label>
</div>
</div>
<button type="submit" id="submit-btn" class="btn btn-success">Create Calendar</button>
Expand Down
20 changes: 14 additions & 6 deletions resources/views/calendar/edit.blade.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
@extends('layouts.auth.app')
@extends('layouts.app')
@section('title', 'Create Calendar')
@section('content')
<div class="row justify-content-center">
<div class="row">
<div class="col-xl-6 col-md-12 mb-12">
<div class="card shadow mb-4">
<div class="card-header bg-primary py-3 d-flex flex-row align-items-center justify-content-center">
<div class="card-header bg-primary py-3 d-flex flex-row align-items-center">
<h6 class="m-0 fw-bold text-white">User input</h6>
</div>
<div class="card-body">
Expand All @@ -30,10 +30,18 @@
@enderror
</div>

<div class="form-check">
<input class="form-check-input" type="radio" name="public" id="public" value="1" {{ $calendar->public == "1" ? 'checked' : '' }} required>
<label class="form-check-label" for="public">
Public Calendar
</label>
</div>

<div class="form-check mb-4">
<input type="hidden" name="public" value="0">
<input class="form-check-input" type="checkbox" value="1" name="public" id="public" {{$calendar->public == "1" ? 'checked' : '' }}>
<label for="public" class="form-label my-1 me-2">Public calendar?</label>
<input class="form-check-input" type="radio" name="public" id="private" value="0" {{ $calendar->public == "0" ? 'checked' : '' }} required>
<label class="form-check-label" for="private">
Private Calendar
</label>
</div>
</div>

Expand Down
10 changes: 5 additions & 5 deletions resources/views/calendar/index.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@extends('layouts.auth.app')
@extends('layouts.app')
@section('title', 'Calendars')
@section('title-flex')
@can('create', \App\Models\Calendar::class)
Expand All @@ -14,7 +14,7 @@
<div class="row">
<div class="col-xl-12 col-md-12 mb-12">
<div class="card shadow mb-4">
<div class="card-header bg-primary py-3 d-flex flex-row align-items-center justify-content-center">
<div class="card-header bg-primary py-3 d-flex flex-row align-items-center">
<h6 class="m-0 fw-bold text-white">Calendar Overview</h6>
</div>

Expand All @@ -35,18 +35,18 @@
<td>{{ $calendar->id }}</td>
<td>{{ $calendar->name }}</td>
<td>
<a class="btn btn-info" href="{{ route('calendar', $calendar->id) }}"><i class="fas fa-eye"></i>
<a class="btn btn-sm btn-info" href="{{ route('calendar', $calendar->id) }}"><i class="fas fa-eye"></i>
Show</a>
@can('update', $calendar)
<a class="btn btn-primary" href="{{ route('calendars.edit', $calendar->id) }}"><i class="fas fa-edit"></i>
<a class="btn btn-sm btn-primary" href="{{ route('calendars.edit', $calendar->id) }}"><i class="fas fa-edit"></i>
Edit</a>
@endcan
@can('destroy', $calendar)
<form method="POST" action="{{ route('calendars.destroy', $calendar->id) }}" style="display:inline"
onsubmit="return confirm('Are you sure you want to delete this calendar?')">
@method('DELETE')
@csrf
<button class="btn btn-danger" type="submit"><i class="fas fa-trash"
<button class="btn btn-sm btn-danger" type="submit"><i class="fas fa-trash"
aria-hidden="true"></i> Delete</button>
</form>
@endcan
Expand Down
45 changes: 28 additions & 17 deletions resources/views/calendar/show.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@extends('layouts.public.app')
@extends('layouts.app')
@section('title', 'Calendar - '. $calendar->name)
@section('css')
<style>
Expand Down Expand Up @@ -28,22 +28,33 @@
var calendarEl = document.getElementById('calendar');
var calendar = new Calendar(calendarEl, {
plugins: [
dayGridPlugin,
interactionPlugin,
bootstrapPlugin,
timeGridPlugin,
listPlugin
],
themeSystem: 'bootstrap',
firstDay: 1,
eventColor: '#1a475f',
nowIndicator: true,
longPressDelay: 0,
timeZone: 'UTC',
events: @json($events),
editable: false,
});
plugins: [
dayGridPlugin,
interactionPlugin,
bootstrapPlugin,
timeGridPlugin,
listPlugin
],
themeSystem: 'bootstrap',
firstDay: 1,
eventColor: '#1a475f',
nowIndicator: true,
longPressDelay: 0,
eventTimeFormat: {
hour: "2-digit",
minute: "2-digit",
hour12: false
},
slotLabelFormat: {
hour: '2-digit',
minute: '2-digit',
hour12: false
},
dayMaxEvents: 4,
timeZone: 'UTC',
initialView: 'dayGridMonth',
events: @json($events),
});
function updateToolbar() {
if (window.innerWidth < 768) {
Expand Down
35 changes: 0 additions & 35 deletions resources/views/dashboard.blade.php

This file was deleted.

12 changes: 6 additions & 6 deletions resources/views/events/create.blade.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
@extends('layouts.auth.app')
@extends('layouts.app')
@section('title', 'Create Event')
@section('content')
<div class="row justify-content-center">
<div class="row">
<div class="col-xl-6 col-md-12 mb-12">
<div class="card shadow mb-4">
<div class="card-header bg-primary py-3 d-flex flex-row align-items-center justify-content-center">
<div class="card-header bg-primary py-3 d-flex flex-row align-items-center">
<h6 class="m-0 fw-bold text-white">User input</h6>
</div>
<div class="card-body">
Expand All @@ -27,7 +27,7 @@
<option disabled selected>Select Calendar</option>
@foreach ($calendars as $calendar)
@can('view', $calendar)
<option value="{{ $calendar->id }}" {{ old('calendar_id') == $calendar->id ? 'selected' : '' }}>{{ $calendar->name }}</option>
<option value="{{ $calendar->id }}" {{ old('calendar_id') == $calendar->id ? 'selected' : '' }}>{{ $calendar->name }} ({{ $calendar->public == 1 ? 'Public' : 'Private' }})</option>
@endcan
@endforeach
</select>
Expand Down Expand Up @@ -73,7 +73,7 @@
<div class="row mb-4">
<div class="col-md-6">
<div class="form-group">
<label for="start_date" class="form-label my-1 me-2">Start Date & Time <i class="fas fa-xs fa-asterisk" style="color: red;"></i></label>
<label for="start_date" class="form-label my-1 me-2">Start Date & Time (Zulu)<i class="fas fa-xs fa-asterisk" style="color: red;"></i></label>
<input type="text" name="start_date" id="start_date" class="datepicker form-control @error('start_date') is-invalid @enderror">
@error('start_date')
<span class="text-danger">{{ $errors->first('start_date') }}</span>
Expand All @@ -82,7 +82,7 @@
</div>
<div class="col-md-6">
<div class="form-group">
<label for="end_date" class="form-label my-1 me-2">End Date & Time <i class="fas fa-xs fa-asterisk" style="color: red;"></i></label>
<label for="end_date" class="form-label my-1 me-2">End Date & Time (Zulu)<i class="fas fa-xs fa-asterisk" style="color: red;"></i></label>
<input type="text" name="end_date" id="end_date" class="datepicker form-control @error('end_date') is-invalid @enderror">
@error('end_date')
<span class="text-danger">{{ $errors->first('end_date') }}</span>
Expand Down
Loading

0 comments on commit f17788b

Please sign in to comment.