Skip to content

Commit

Permalink
Merge pull request #43 from cevi/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
jeromesigg authored Aug 19, 2024
2 parents 3b09e12 + 974e87a commit dbeaa0f
Show file tree
Hide file tree
Showing 142 changed files with 8,192 additions and 53,320 deletions.
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_NAME=Qualifikationen
MAIL_FROM_ADDRESS=null
MAIL_CAMP_NAME=Qualifikationen
MAIL_CAMP_ADDRESS=null

IMPORT_DB=true
ADMIN_PASSWORD=null
Expand Down
17 changes: 17 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"sqltools.connections": [
{
"mysqlOptions": {
"authProtocol": "default",
"enableSsl": "Disabled"
},
"previewLimit": 50,
"server": "localhost",
"port": 3306,
"driver": "MySQL",
"name": "Quali",
"database": "qualifikationen",
"username": "sail"
}
]
}
11 changes: 9 additions & 2 deletions app/Http/Controllers/AdminAnswersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace App\Http\Controllers;

use App\Models\Answer;
use App\Models\Help;
use Illuminate\Http\Request;

class AdminAnswersController extends Controller
Expand All @@ -16,8 +17,10 @@ public function index()
{
//
$answers = Answer::all();
$title= 'Antworten';
$help = Help::where('title',$title)->first();

return view('admin.answers.index', compact('answers'));
return view('admin.answers.index', compact('answers', 'title', 'help'));
}

/**
Expand Down Expand Up @@ -65,8 +68,12 @@ public function edit($id)
{
//
$answer = Answer::findOrFail($id);
$title= 'Antworten bearbeiten';
$help = Help::where('title',$title)->first();
$help['main_title'] = 'Antworten';
$help['main_route'] = '/admin/answers';

return view('admin.answers.edit', compact('answer'));
return view('admin.answers.edit', compact('answer', 'title', 'help'));
}

/**
Expand Down
34 changes: 24 additions & 10 deletions app/Http/Controllers/AdminCampsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,21 @@

namespace App\Http\Controllers;

use Str;
use App\Models\Camp;
use App\Models\Help;
use App\Models\User;
use App\Models\Group;
use App\Helper\Helper;
use App\Models\CampType;
use App\Events\CampCreated;
use App\Exports\PostsExport;
use App\Exports\UsersExport;
use App\Helper\Helper;
use App\Models\Camp;
use App\Models\CampType;
use App\Models\Group;
use App\Models\User;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Storage;
use Maatwebsite\Excel\Facades\Excel;
use Str;
use Illuminate\Support\Facades\Storage;

class AdminCampsController extends Controller
{
Expand Down Expand Up @@ -43,8 +44,13 @@ public function index()
$camptypes = CampType::pluck('name', 'id')->all();
$groups = Group::where('campgroup', true)->pluck('name', 'id')->all();
$title = 'Kursübersicht';
$help = Help::where('title',$title)->first();

return view('admin.camps.index', compact('camps', 'camptypes', 'groups', 'title'));
$title_modal = 'Kurs abschliessen?';
$text_modal = "Beim Kurs abschliessen werden alle Qualifikationen und hochgeladenen Dokumente gelöscht.";
confirmDelete($title_modal, $text_modal);

return view('admin.camps.index', compact('camps', 'camptypes', 'groups', 'title', 'help'));
}

/**
Expand Down Expand Up @@ -113,8 +119,16 @@ public function edit($id)
$camptypes = CampType::pluck('name', 'id')->all();
$groups = Group::where('campgroup', true)->pluck('name', 'id')->all();
$users = User::where('role_id', config('status.role_Kursleiter'))->pluck('username', 'id')->all();
$title = "Lager bearbeiten";
$help = Help::where('title',$title)->first();
$help['main_title'] = 'Lager';
$help['main_route'] = '/admin/camps';

$title_modal = 'Kurs abschliessen?';
$text_modal = "Beim Kurs abschliessen werden alle Qualifikationen und hochgeladenen Dokumente gelöscht.";
confirmDelete($title_modal, $text_modal);

return view('admin.camps.edit', compact('camp', 'users', 'camptypes', 'groups'));
return view('admin.camps.edit', compact('camp', 'users', 'camptypes', 'groups', 'title', 'help'));
}

/**
Expand Down Expand Up @@ -147,7 +161,7 @@ public function update(Request $request, $id)
*/
public function destroy(Camp $camp)
{
if (!Auth::user()->demo) {
if (!Auth::user()->demo){
$users = Auth::user()->camp->allUsers;
$camp_global = Camp::where('global_camp', true)->first();

Expand Down
15 changes: 11 additions & 4 deletions app/Http/Controllers/AdminChaptersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@

namespace App\Http\Controllers;

use App\Models\CampType;
use Validator;
use App\Models\Help;
use App\Models\Chapter;
use App\Models\CampType;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Validator;

class AdminChaptersController extends Controller
{
Expand All @@ -25,7 +26,9 @@ public function index()
else{
$chapters = $user->camp->camp_type->chapters;
}
return view('admin.chapters.index', compact('chapters'));
$title = "Kapitel";
$help = Help::where('title',$title)->first();
return view('admin.chapters.index', compact('chapters', 'title', 'help'));
}

/**
Expand Down Expand Up @@ -77,8 +80,12 @@ public function edit($id)
{
//
$chapter = Chapter::findOrFail($id);
$title = "Kapitel bearbeiten";
$help = Help::where('title',$title)->first();
$help['main_title'] = 'Kapitel';
$help['main_route'] = '/admin/chapters';

return view('admin.chapters.edit', compact('chapter'));
return view('admin.chapters.edit', compact('chapter', 'help', 'title'));
}

/**
Expand Down
13 changes: 10 additions & 3 deletions app/Http/Controllers/AdminClassificationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

namespace App\Http\Controllers;

use App\classification;
use App\Models\Help;
use Illuminate\Http\Request;
use App\Models\Classification;

class AdminClassificationController extends Controller
{
Expand All @@ -16,8 +17,10 @@ public function index()
{
//
$classifications = Classification::all();
$title= 'Klassifizierungen';
$help = Help::where('title',$title)->first();

return view('admin.classifications.index', compact('classifications'));
return view('admin.classifications.index', compact('classifications', 'title', 'help'));
}

/**
Expand Down Expand Up @@ -62,8 +65,12 @@ public function edit($id)
{
//
$classification = Classification::findOrFail($id);
$title= 'Klassifizierung bearbeiten';
$help = Help::where('title',$title)->first();
$help['main_title'] = 'Klassifizierungen';
$help['main_route'] = '/admin/classifications';

return view('admin.classifications.edit', compact('classification'));
return view('admin.classifications.edit', compact('classification', 'title', 'help'));
}

/**
Expand Down
13 changes: 10 additions & 3 deletions app/Http/Controllers/AdminCompetencesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

namespace App\Http\Controllers;

use App\Models\Help;
use App\Models\CampType;
use App\Models\Competence;
use App\Models\Question;
use App\Models\Competence;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;

Expand All @@ -30,8 +31,10 @@ public function index()
$competences = $camp_type->competences;
$camp_types = $user->camp->camp_type()->pluck('name', 'id')->toArray();
}
$title = "Kernkompetenzen";
$help = Help::where('title',$title)->first();

return view('admin.competences.index', compact('competences', 'questions', 'camp_types'));
return view('admin.competences.index', compact('competences', 'questions', 'camp_types', 'help', 'title'));
}

/**
Expand Down Expand Up @@ -59,8 +62,12 @@ public function edit(Competence $competence)
//
$questions = Question::pluck('competence', 'id')->all();
$camp_types = CampType::pluck('name', 'id')->all();
$title = "Kernkompetenz bearbeiten";
$help = Help::where('title',$title)->first();
$help['main_title'] = 'Kernkompetenzen';
$help['main_route'] = '/admin/competences';

return view('admin.competences.edit', compact('competence', 'questions', 'camp_types'));
return view('admin.competences.edit', compact('competence', 'questions', 'camp_types', 'title', 'help'));
}

/**
Expand Down
7 changes: 5 additions & 2 deletions app/Http/Controllers/AdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App\Http\Controllers;

use App\Models\Help;
use App\Helper\Helper;
use Illuminate\Support\Facades\Auth;

Expand Down Expand Up @@ -35,16 +36,18 @@ public function index()
$surveys_fertig = $camp->surveys()->where('survey_status_id', config('status.survey_fertig'))->count();

$title = 'Dashboard';
$help = Help::where('title',$title)->first();
$labels = Helper::GetSurveysLabels($surveys);
$datasets = Helper::GetSurveysDataset($surveys);
return view('admin/index', compact('user', 'surveys', 'surveys_all', 'surveys_1offen', 'surveys_2offen', 'surveys_fertig', 'title', 'labels', 'datasets', 'surveys'));
return view('admin/index', compact('user', 'surveys', 'surveys_all', 'surveys_1offen', 'surveys_2offen', 'surveys_fertig', 'title', 'labels', 'datasets', 'surveys', 'help'));
}

public function changes()
{
$user = Auth::user();
$title = 'Rückmeldungen / Änderungen';
$help = Help::where('title',$title)->first();

return view('admin/changes', compact('user', 'title'));
return view('admin/changes', compact('user', 'title', 'help'));
}
}
11 changes: 9 additions & 2 deletions app/Http/Controllers/AdminGroupsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App\Http\Controllers;

use App\Models\Help;
use App\Models\Group;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Crypt;
Expand All @@ -17,8 +18,10 @@ public function index()
{
//
$groups = Group::all();
$title = "Gruppen";
$help = Help::where('title',$title)->first();

return view('admin.groups.index', compact('groups'));
return view('admin.groups.index', compact('groups', 'title', 'help'));
}

/**
Expand Down Expand Up @@ -69,8 +72,12 @@ public function edit($id)
{
//
$group = Group::findOrFail($id);
$title = "Gruppe bearbeiten";
$help = Help::where('title',$title)->first();
$help['main_title'] = 'Gruppen';
$help['main_route'] = '/admin/groups';

return view('admin.groups.edit', compact('group'));
return view('admin.groups.edit', compact('group', 'title', 'help'));
}

/**
Expand Down
Loading

0 comments on commit dbeaa0f

Please sign in to comment.