Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conflict/landlord home to master #15

Merged
merged 5 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 1 addition & 2 deletions app/Actions/FileManager/FileManagerFileStoreAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ public function __construct($storage_disk)
/**
* @param string $directory
* @param UploadedFile $file
* @param $request
* @return false|string
*/
public function handle(string $directory, UploadedFile $file, $request)
Expand All @@ -45,7 +44,7 @@ public function handle(string $directory, UploadedFile $file, $request)
$lectureFiles->save();
}

return $file->storeAs($directory, $filename, $this->storage_disk);
return $file->storeAs($directory, $filename, $this->storage_disk);;
}

/**
Expand Down
2 changes: 2 additions & 0 deletions app/Http/Controllers/Admin/EDU/Lecture/LectureController.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ public function destroy(Lecture $lecture) : RedirectResponse
public function edit(Lecture $lecture) : Response
{
$this->addMetaTitleSection('Edit - ' . $lecture->title)->shareMeta();
$lecture->load('files');
$lecture->load('section', 'section.course');

$lecture->load('files');
$lecture->load('section', 'section.course');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ public function index(Request $request): JsonResponse
return response()->json(compact('files'));
}

// TODO:: Show file from s3 for lecture?
public function show(Request $request, $lecture_id): JsonResponse
{
$files = LectureFiles::where('lecture_id', $lecture_id)->get();
Expand All @@ -61,6 +60,7 @@ public function store(Request $request)
$file = $request->file('file');

$action = new FileManagerFileStoreAction($this->storage_disk);

return $action->handle($directory, $file, $request);
}

Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Landlord/HomeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ class HomeController extends Controller
*/
public function index()
{
return Inertia::render('landlord/home/Index');
return Inertia::render('website/home/Index');
}
}
11 changes: 4 additions & 7 deletions app/Http/Middleware/HandleInertiaRequests.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,10 @@

class HandleInertiaRequests extends Middleware
{
/**
* The root template that's loaded on the first page visit.
*
* @see https://inertiajs.com/server-side-setup#root-template
* @var string
*/
protected $rootView = 'app';
public function rootView(Request $request)
{
return tenant() ? 'app' : 'landlord.app';
}

/**
* Determines the current asset version.
Expand Down
2 changes: 1 addition & 1 deletion app/Models/EDU/Lecture/LectureFiles.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class LectureFiles extends Model
protected $guarded = [];

protected $casts = [];

public function lecture(): BelongsTo
{
return $this->belongsTo(Lecture::class);
Expand Down
10 changes: 0 additions & 10 deletions app/Providers/InertiaServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ class InertiaServiceProvider extends ServiceProvider
*/
public function boot()
{
$this->setView();
$this->versionAssets();
$this->shareData();
$this->registerLengthAwarePaginator();
Expand Down Expand Up @@ -116,15 +115,6 @@ public function links($view = null, $data = [])
}


/**
* Set the root view
*/
protected function setView()
{
Inertia::setRootView('app');
}


/**
* Share base data with inertia, including:
* - App data
Expand Down
2 changes: 1 addition & 1 deletion app/Traits/Admin/EDU/CourseActions.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public function updateSection($section, $index, $courseId)
return $updateSection;
}

public function updateLecture($lecture, $index, $sectionId): Lecture
public function updateLecture($lecture, $index, $sectionId)
{
if (!Arr::get($lecture, 'id')) {
unset($lecture['child_items']);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('edu_lecture_files', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('lecture_id');
$table->longText('file_path');
$table->timestamps();
});
}

/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('edu_lecture_files');
}
};
886 changes: 443 additions & 443 deletions public/js/app.js

Large diffs are not rendered by default.

10 changes: 6 additions & 4 deletions public/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"/js/app.js": "/js/app.js?id=d69a8deca51f71b8ee213121c4c43524",
"/css/app.css": "/css/app.css?id=35f539f79e3b6b9163705c13e2fc863d",
"/vendor/tinymce/skins/sigi/skin.min.css": "/vendor/tinymce/skins/sigi/skin.min.css?id=60a11fce9c5bc75d91258cb21baeb055",
"/vendor/tinymce/skins/sigi/content.min.css": "/vendor/tinymce/skins/sigi/content.min.css?id=b724f2327bc1de0b0020d5e3f27282a8"
"/js/app.js": "/js/app.js?id=b96eed840eab43a09122dbc0458dbba5",
"/js/landlord/app.js": "/js/landlord/app.js?id=b940247f480b46266efb3079ed9ad562",
"/css/landlord/app.css": "/css/landlord/app.css?id=260c5957ed9bc04a40d3338de21ba52e",
"/css/app.css": "/css/app.css?id=2ac40501b2bbf4a42dad8797d955b99c",
"/vendor/tinymce/skins/sigi/skin.min.css": "/vendor/tinymce/skins/sigi/skin.min.css?id=44cad401b79c32a4eea69f6543b2cc17",
"/vendor/tinymce/skins/sigi/content.min.css": "/vendor/tinymce/skins/sigi/content.min.css?id=0a84ef5a12bcd58488e4179b803076a6"
}
11 changes: 11 additions & 0 deletions resources/css/landlord/app.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@import './core/theme.css';
@import './core/fonts.css';

@import "tailwindcss/base";
@import './core/base.css';

@import "tailwindcss/components";

@import "./core/custom-includes.css";

@import "tailwindcss/utilities";
28 changes: 28 additions & 0 deletions resources/css/landlord/core/base.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/**
* Core - Base Styles
*/

.html-base {
@apply bg-theme-base font-sans-landlord text-theme-base-contrast;
}

::selection {
/* WebKit/Blink Browsers */
background: var(--selection-color);
color: var(--selection-color-contrast);
}
::-moz-selection {
/* Gecko Browsers */
background: var(--selection-color);
color: var(--selection-color-contrast);
}

:disabled {
cursor: not-allowed;
opacity: 0.5;
}

.mobile-nav-scroll-lock {
@apply overflow-hidden;
@apply md:overflow-auto;
}
9 changes: 9 additions & 0 deletions resources/css/landlord/core/custom-includes.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
* Core - Custom Includes
*/
@import "../../core/npprogress.css";
@import "../../core/transition.css";
@import "../../core/button.css";
@import "../../core/form.css";
@import "../../core/pagination.css";
@import "../../core/table.css";
1 change: 1 addition & 0 deletions resources/css/landlord/core/fonts.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
137 changes: 137 additions & 0 deletions resources/css/landlord/core/theme.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
/**
* Core - Theme
* Define colors, shadows etc.
*/

:root {
/**
* Colors (Tailwind config)
*/
--color-base: theme('colors.white');
--color-base-contrast: theme('colors.black');
--color-base-subtle: theme('colors.gray.200');
--color-base-subtle-contrast: theme('colors.gray.500');
--color-card: theme('colors.white');
--color-card-contrast: theme('colors.black');
--color-danger: theme('colors.red.100');
--color-danger-contrast: theme('colors.red.500');
--color-danger-hover: theme('colors.red.200');
--color-danger-hover-contrast: theme('colors.red.600');
--color-info: theme('colors.yellow.100');
--color-info-contrast: theme('colors.yellow.500');
--color-info-hover: theme('colors.yellow.200');
--color-info-hover-contrast: theme('colors.yellow.600');
--color-primary: theme('colors.black');
--color-primary-contrast: theme('colors.white');
--color-primary-hover: theme('colors.gray.800');
--color-primary-hover-contrast: theme('colors.white');
--color-primary-subtle: theme('colors.gray.100');
--color-primary-subtle-contrast: theme('colors.gray.600');
--color-primary-subtle-hover: theme('colors.gray.200');
--color-primary-subtle-hover-contrast: theme('colors.gray.600');
--color-success: theme('colors.green.100');
--color-success-contrast: theme('colors.green.500');
--color-success-hover: theme('colors.green.200');
--color-success-hover-contrast: theme('colors.green.600');
--color-warning: theme('colors.orange.100');
--color-warning-contrast: theme('colors.orange.500');
--color-warning-hover: theme('colors.orange.200');
--color-warning-hover-contrast: theme('colors.orange.600');

/**
* Dropdown
*/
--dropdown-color-base: theme('colors.white');
--dropdown-color-base-contrast: theme('colors.theme.base-contrast');
--dropdown-color-hover: theme('colors.theme.primary-subtle');
--dropdown-color-hover-contrast: theme('colors.theme.primary-subtle-contrast');
--dropdown-color-separator: theme('colors.gray.200');
--dropdown-color-subheading: theme('colors.white');
--dropdown-color-subheading-contrast: theme('colors.navy.300');

/**
* Menu - Side
*/
--side-menu-color-active: theme('colors.blue.100');
--side-menu-color-active-contrast: theme('colors.theme.primary');
--side-menu-color-base: theme('colors.white');
--side-menu-color-base-contrast: theme('colors.navy.400');
--side-menu-color-hover: theme('colors.blue.100');
--side-menu-color-hover-contrast: theme('colors.theme.primary');
--side-menu-color-logo: theme('colors.navy.900');
--side-menu-color-logo-active: theme('colors.theme.primary');
--side-menu-color-separator: theme('colors.theme.base');
--side-menu-color-sub-menu-active: theme('colors.white');
--side-menu-color-sub-menu-active-contrast: theme('colors.theme.primary');
--side-menu-color-sub-menu-base: theme('colors.white');
--side-menu-color-sub-menu-base-contrast: theme('colors.navy.400');
--side-menu-color-sub-menu-hover: theme('colors.white');
--side-menu-color-sub-menu-hover-contrast: theme('colors.theme.primary');
--side-menu-color-subheading: theme('colors.navy.300');
--side-menu-color-toggle: theme('colors.theme.base-contrast');
--side-menu-color-toggle-active: theme('colors.theme.primary');

/**
* Menu - Header
*/
--top-menu-color-base: theme('colors.white');
--top-menu-color-base-contrast: theme('colors.theme.base-contrast');
--top-menu-color-hover: theme('colors.white');
--top-menu-color-hover-contrast: theme('colors.theme.primary');


/**
* NProgress
*/
--nprogress-color: theme('colors.black');

/**
* DatePicker
*/
--datepicker-color-primary: theme('colors.theme.primary');

/**
* Pagination
*/
--pagination-color-active: theme('colors.theme.primary');
--pagination-color-active-border: theme('colors.theme.primary');
--pagination-color-active-contrast: theme('colors.theme.primary-contrast');
--pagination-color-base: theme('colors.white');
--pagination-color-base-border: theme('colors.white');
--pagination-color-base-contrast: theme('colors.theme.base-subtle-contrast');
--pagination-color-hover: theme('colors.theme.primary-subtle');
--pagination-color-hover-border: theme('colors.theme.primary-subtle');
--pagination-color-hover-contrast: theme('colors.theme.primary-subtle-contrast');

/**
* Table
*/
--table-color-alt-body: theme('colors.gray.100');
--table-color-alt-body-contrast: theme('colors.theme.base-contrast');
--table-color-body: none;
--table-color-body-border: theme('colors.gray.200');
--table-color-body-contrast: theme('colors.theme.base-contrast');
--table-color-body-hover: theme('colors.gray.200');
--table-color-body-hover-contrast: theme('colors.theme.base-contrast');
--table-color-header: theme('colors.gray.100');
--table-color-header-border: theme('colors.gray.200');
--table-color-header-contrast: theme('colors.gray.600');
--table-padding-body-x: theme('spacing.6');
--table-padding-body-x-slim: theme('spacing.3');
--table-padding-body-y: theme('spacing.1');
--table-padding-header-x: theme('spacing.6');
--table-padding-header-x-slim: theme('spacing.3');
--table-padding-header-y: 0.375rem; /** theme('spacing.1.5'); **/

/**
* Selection
*/
--selection-color: theme('colors.black');
--selection-color-contrast: theme('colors.white');

/**
* Shadows
*/
--ring-color-primary: rgba(255, 130, 246, var(--tw-ring-opacity));

}
Loading