Commit ba131289 authored by alissonalbuquerque's avatar alissonalbuquerque
Browse files

Merge remote-tracking branch 'origin/avaliador_page' into main_temp

parents eed64155 6ac94d52
<?php
namespace App\Http\Controllers;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
class AvaliadorController extends Controller
{
/**
* Show last PAD.
*
* @return \Illuminate\View\View
*/
public function index()
{
}
/**
* @param integer $id
* @return \Illuminate\Http\Response
*/
public function view($id) {
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
}
/**
* Store a newly created resource in storage.
* @param \Illuminate\Http\Request $request
*/
public function store(Request $request)
{
}
public function anexo()
{
return view('pad.anexo', ['index_menu' => 1 ]);
}
/**
* Show the form for editing the specified resource.
*
* @param integer $id
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param integer $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
{
}
public function delete($id) {
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
}
}
\ No newline at end of file
......@@ -3,8 +3,10 @@
namespace App\Http\Controllers;
use App\Models\User;
use App\Models\Curso;
use App\Models\Util\MenuItemsAdmin;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Hash;
class CoordenadorController extends Controller
{
......@@ -18,28 +20,107 @@ class CoordenadorController extends Controller
]);
}
/**
* @param Request $request
* @param mixed $id
*
* @return Response
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
return view('coordenador.create', [
'index_menu' => MenuItemsAdmin::COORDENADORES,
'cursos' => Curso::all(),
]);
}
/**
* Update the specified user.
* Store a newly created resource in storage.
*
* @param Request $request
* @param string $id
* @return Response
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
public function store(Request $request)
{
$model = new User();
$validator = User::validator($request->all());
$validator->type = User::TYPE_COORDINATOR;
if ($validator->fails()) {
return redirect()->back()->withErrors($validator->errors())->withInput();
}
$model->fill($request->all());
$model->type = User::TYPE_COORDINATOR;
$model->password = Hash::make($model->password);
$model->save();
return redirect()->route('coordenador_index')->with('success', 'Salvo com sucesso!');
}
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show($id)
{
//
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
$user = User::findOrFail($id);
return view('coordenador.update', [
'index_menu' => MenuItemsAdmin::COORDENADORES,
'cursos' => Curso::all(),
'user' => $user,
]);
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
{
$model = User::findOrFail($id);
$validator = User::validator($request->all());
if ($validator->fails()) {
return redirect()->back()->withErrors($validator->errors());
}
$model->fill($request->all());
$newPassword = $request->input('password');
if($newPassword != null){
$model->password = Hash::make($newPassword);
}
$model->save();
return redirect()->route('coordenador_index')->with('success', 'Atualizado com sucesso!');
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
$model = User::find($id);
$model->delete();
return redirect()->route('coordenador_index')->with('success', 'Excluído com sucesso!');
}
}
......@@ -2,7 +2,7 @@
namespace App\Http\Controllers;
use App\Models\Unidade;
use App\Models\Campus;
use App\Models\User;
use App\Models\Util\MenuItemsAdmin;
use Illuminate\Http\Request;
......@@ -32,7 +32,7 @@ class DiretorController extends Controller
{
return view('diretor.create', [
'index_menu' => MenuItemsAdmin::DIRETORES,
'unidades' => Unidade::all()
'campus' => Campus::all(),
]);
}
......@@ -82,7 +82,7 @@ class DiretorController extends Controller
$user = User::findOrFail($id);
return view('diretor.update', [
'index_menu' => MenuItemsAdmin::DIRETORES,
'unidades' => Unidade::all(),
'campus' => Campus::all(),
'user' => $user,
]);
}
......@@ -104,6 +104,12 @@ class DiretorController extends Controller
}
$model->fill($request->all());
$newPassword = $request->input('password');
if($newPassword != null){
$model->password = Hash::make($newPassword);
}
$model->save();
return redirect()->route('diretor_index')->with('success', 'Atualizado com sucesso!');
}
......
......@@ -85,7 +85,7 @@ class PadController extends Controller
if($validated) {
$model = new Pad($request->all());
if($model->save()) {
$users = User::find()->whereType(User::TYPE_TEACHER)->get();
......
<?php
namespace App\Http\Controllers;
use App\Models\User;
use App\Models\Curso;
use App\Models\Util\MenuItemsAdmin;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Hash;
class ProfessorController extends Controller
{
public function index()
{
$professores = User::where('type', '=', User::TYPE_TEACHER)->get();
return view('professor.index', [
'index_menu' => MenuItemsAdmin::PROFESSORES,
'professores' => $professores
]);
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
return view('professor.create', [
'index_menu' => MenuItemsAdmin::PROFESSORES,
'cursos' => Curso::all(),
]);
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
$model = new User();
$validator = User::validator($request->all());
$validator->type = User::TYPE_TEACHER;
if ($validator->fails()) {
return redirect()->back()->withErrors($validator->errors())->withInput();
}
$model->fill($request->all());
$model->type = User::TYPE_TEACHER;
$model->password = Hash::make($model->password);
$model->save();
return redirect()->route('professor_index')->with('success', 'Salvo com sucesso!');
}
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show($id)
{
//
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
$user = User::findOrFail($id);
return view('professor.update', [
'index_menu' => MenuItemsAdmin::PROFESSORES,
'cursos' => Curso::all(),
'user' => $user,
]);
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
{
$model = User::findOrFail($id);
$validator = User::validator($request->all());
if ($validator->fails()) {
return redirect()->back()->withErrors($validator->errors());
}
$model->fill($request->all());
$newPassword = $request->input('password');
if($newPassword != null){
$model->password = Hash::make($newPassword);
}
$model->save();
return redirect()->route('professor_index')->with('success', 'Atualizado com sucesso!');
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
$model = User::find($id);
$model->delete();
return redirect()->route('professor_index')->with('success', 'Excluído com sucesso!');
}
}
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Avaliacao extends Model
{
use HasFactory;
protected $table = 'avaliador_pad';
protected $fillable = ['id', 'ch_semanal', 'status', 'descricao', 'tarefa_id', 'avaliador_id'];
public function tarefa() {
//return $this->belongsTo(PAD::class);
}
public function avaliadorPad() {
return $this->belongsTo(AvaliadorPad::class);
}
}
<?php
namespace App\Models;
use App\Queries\UserPadQuery;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class AvaliadorPad extends Model
{
use HasFactory;
protected $table = 'avaliador_pad';
protected $fillable = ['id', 'dimensao', 'user_id', 'pad_id'];
public function Avaliador() {
return $this->belongsTo(User::class);
}
public function pad() {
return $this->belongsTo(PAD::class);
}
public static function find() {
return new UserPadQuery(get_called_class());
}
}
......@@ -25,5 +25,4 @@ class UserPad extends Model
public static function find() {
return new UserPadQuery(get_called_class());
}
}
......@@ -12,4 +12,5 @@ class MenuItemsAdmin
const DIRETORES = 4;
const COORDENADORES = 5;
const PADS = 6;
const PROFESSORES = 7;
}
......@@ -4,6 +4,11 @@ namespace App\Models\Util;
class PadTables {
const TYPE_ENSINO = 0;
const TYPE_EXTENSAO = 1;
const TYPE_PESQUISA = 2;
const TYPE_GESTAO = 3;
public static function tablesEnsino() {
return [
['id' => 'ensino_aulas', 'name' => '1. ENSINO (AULAS EM COMPONENTES CURRICULARES)'],
......
<?php
namespace App\Queries;
use App\Models\AvaliadorPad;
class AvaliadorPadQuery {
private $query;
public function __construct()
{
$this->query = AvaliadorPad::where([]);
}
/**
* @param integer $id
* @return AvaliadorPadQuery|Builder
*/
public function whereId($id, $expression = '=')
{
$this->query = $this->query->where('id', $expression, $id);
return $this->query;
}
/**
* @param integer $user_id
* @return AvaliadorPadQuery|Builder
*/
public function whereUser($user_id, $expression = '=')
{
$this->query = $this->query->where('user_id', $expression, $user_id);
return $this->query;
}
/**
* @return Builder
*/
public function getQuery()
{
return $this->query;
}
}
\ No newline at end of file
......@@ -1300,16 +1300,16 @@
},
{
"name": "laravel/framework",
"version": "v8.83.18",
"version": "v8.83.19",
"source": {
"type": "git",
"url": "https://github.com/laravel/framework.git",
"reference": "db8188e9cc8359a5c6706fa9d9f55aad7f235077"
"reference": "4264f2ee12330bdb1be050998f58ba7271236395"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/framework/zipball/db8188e9cc8359a5c6706fa9d9f55aad7f235077",
"reference": "db8188e9cc8359a5c6706fa9d9f55aad7f235077",
"url": "https://api.github.com/repos/laravel/framework/zipball/4264f2ee12330bdb1be050998f58ba7271236395",
"reference": "4264f2ee12330bdb1be050998f58ba7271236395",
"shasum": ""
},
"require": {
......@@ -1469,7 +1469,7 @@
"issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework"
},
"time": "2022-06-28T14:30:38+00:00"
"time": "2022-07-13T13:23:09+00:00"
},
{
"name": "laravel/sanctum",
......@@ -2107,16 +2107,16 @@
},
{
"name": "nesbot/carbon",
"version": "2.58.0",
"version": "2.59.1",
"source": {
"type": "git",
"url": "https://github.com/briannesbitt/Carbon.git",
"reference": "97a34af22bde8d0ac20ab34b29d7bfe360902055"
"reference": "a9000603ea337c8df16cc41f8b6be95a65f4d0f5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/97a34af22bde8d0ac20ab34b29d7bfe360902055",
"reference": "97a34af22bde8d0ac20ab34b29d7bfe360902055",
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/a9000603ea337c8df16cc41f8b6be95a65f4d0f5",
"reference": "a9000603ea337c8df16cc41f8b6be95a65f4d0f5",
"shasum": ""
},
"require": {
......@@ -2131,11 +2131,12 @@
"doctrine/orm": "^2.7",
"friendsofphp/php-cs-fixer": "^3.0",
"kylekatarnls/multi-tester": "^2.0",
"ondrejmirtes/better-reflection": "*",
"phpmd/phpmd": "^2.9",
"phpstan/extension-installer": "^1.0",
"phpstan/phpstan": "^0.12.54 || ^1.0",
"phpunit/php-file-iterator": "^2.0.5",
"phpunit/phpunit": "^7.5.20 || ^8.5.23",
"phpstan/phpstan": "^0.12.99 || ^1.7.14",
"phpunit/php-file-iterator": "^2.0.5 || ^3.0.6",
"phpunit/phpunit": "^7.5.20 || ^8.5.26 || ^9.5.20",
"squizlabs/php_codesniffer": "^3.4"
},
"bin": [
......@@ -2192,15 +2193,19 @@
},
"funding": [
{
"url": "https://opencollective.com/Carbon",
"type": "open_collective"
"url": "https://github.com/sponsors/kylekatarnls",
"type": "github"
},
{
"url": "https://opencollective.com/Carbon#sponsor",
"type": "opencollective"
},
{
"url": "https://tidelift.com/funding/github/packagist/nesbot/carbon",
"url": "https://tidelift.com/subscription/pkg/packagist-nesbot-carbon?utm_source=packagist-nesbot-carbon&utm_medium=referral&utm_campaign=readme",
"type": "tidelift"
}
],
"time": "2022-04-25T19:31:17+00:00"
"time": "2022-06-29T21:43:55+00:00"
},
{
"name": "nette/schema",
......@@ -2951,16 +2956,16 @@
},
{
"name": "psy/psysh",
"version": "v0.11.5",
"version": "v0.11.7",
"source": {
"type": "git",
"url": "https://github.com/bobthecow/psysh.git",
"reference": "c23686f9c48ca202710dbb967df8385a952a2daf"
"reference": "77fc7270031fbc28f9a7bea31385da5c4855cb7a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/bobthecow/psysh/zipball/c23686f9c48ca202710dbb967df8385a952a2daf",
"reference": "c23686f9c48ca202710dbb967df8385a952a2daf",
"url": "https://api.github.com/repos/bobthecow/psysh/zipball/77fc7270031fbc28f9a7bea31385da5c4855cb7a",
"reference": "77fc7270031fbc28f9a7bea31385da5c4855cb7a",
"shasum": ""
},
"require": {
......@@ -3021,9 +3026,9 @@
],
"support": {
"issues": "https://github.com/bobthecow/psysh/issues",
"source": "https://github.com/bobthecow/psysh/tree/v0.11.5"
"source": "https://github.com/bobthecow/psysh/tree/v0.11.7"
},
"time": "2022-05-27T18:03:49+00:00"
"time": "2022-07-07T13:49:11+00:00"
},
{
"name": "ralouphie/getallheaders",
......@@ -5926,16 +5931,16 @@
},
{
"name": "facade/ignition",
"version": "2.17.5",
"version": "2.17.6",
"source": {
"type": "git",
"url": "https://github.com/facade/ignition.git",
"reference": "1d71996f83c9a5a7807331b8986ac890352b7a0c"
"reference": "6acd82e986a2ecee89e2e68adfc30a1936d1ab7c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/facade/ignition/zipball/1d71996f83c9a5a7807331b8986ac890352b7a0c",
"reference": "1d71996f83c9a5a7807331b8986ac890352b7a0c",
"url": "https://api.github.com/repos/facade/ignition/zipball/6acd82e986a2ecee89e2e68adfc30a1936d1ab7c",
"reference": "6acd82e986a2ecee89e2e68adfc30a1936d1ab7c",
"shasum": ""
},
"require": {
......@@ -6000,7 +6005,7 @@
"issues": "https://github.com/facade/ignition/issues",
"source": "https://github.com/facade/ignition"
},
"time": "2022-02-23T18:31:24+00:00"
"time": "2022-06-30T18:26:59+00:00"
},
{
"name": "facade/ignition-contracts",
......
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateEvaluatorPadTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('avaliador_pad', function (Blueprint $table) {
$table->id();
$table->tinyInteger('dimensao')->notNull();
$table->foreignId('user_id')->notNull();
$table->foreignId('pad_id')->notNull();
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('avaliador_pad');
}
}
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateAvaliacaoTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('avaliacao', function (Blueprint $table) {
$table->id();
$table->integer('ch_semanal')->notNull();
$table->integer('status')->notNull();
$table->string('descricao')->notNull();
$table->integer('tarefa_id')->notNull();
$table->foreignId('avaliador_id')->notNull();
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('avaliacao');
}
}
......@@ -2,11 +2,9 @@
namespace Database\Seeders;
use App\Models\PAD;
use App\Models\User;
use Illuminate\Database\Seeder;
class PadSeeder extends Seeder
class AvaliacaoSeeder extends Seeder
{
/**
* Run the database seeds.
......@@ -14,6 +12,7 @@ class PadSeeder extends Seeder
* @return void
*/
public function run()
{
{
//
}
}
......@@ -29,6 +29,5 @@ class CampusSeeder extends Seeder
]);
}
}
}
}
......@@ -23,6 +23,8 @@ class DatabaseSeeder extends Seeder
PlanejamentoSeeder::class,
PadSeeder::class,
DisciplinaSeeder::class,
EvaluatorSeeder::class,
]);
}
}
<?php
namespace Database\Seeders;
use Illuminate\Database\Seeder;
use App\Models\AvaliadorPad;
use App\Models\Util\PadTables;
class EvaluatorSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
AvaliadorPad::create([
'id' => 1,
'dimensao' => PadTables::TYPE_ENSINO,
'user_id' => 8,
'pad_id' => 1
]
);
}
}
<?php
namespace Database\Seeders;
use App\Models\PAD;
use App\Models\User;
use Illuminate\Database\Seeder;
class PadSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
PAD::create([
'id' => 1,
'nome' => "2022.1",
'data_inicio' => "2022-02-01",
'data_fim' => "2022-06-01",
'status' => 0
]);
PAD::create([
'id' => 2,
'nome' => "2022.2",
'data_inicio' => "2022-07-01",
'data_fim' => "2022-12-01",
'status' => 1
]);
}
}
:root{
--main-bg-color: pink;
:root {
--main-bg-color: #dfdfdf;
--main-bg-light-color: #f7f7f7;
--main-border-grey-color: #dee2e6;
--main-default-link-color: #2e4363;
--main-success-color: #0d6efd;
--main-danger-color: #c43c3c;
--main-warning-color: #dacc53;
}
*{
* {
font-family: "Electrolize", sans-serif;
}
......@@ -13,82 +19,110 @@
width: 100%;
padding: 18px 6% 10px 6%;
margin: 0 0 30px 0;
border-bottom: 1px solid #dee2e6 !important;
border-bottom: 1px solid var(--main-border-grey-color) !important;
}
body{
body {
position: relative;
}
/*Main header - top*/
header {
background-color: #dfdfdf;
background-color: var(--main-bg-color);
margin-bottom: 30px;
-webkit-box-shadow: 0px 1px 6px 0px rgba(50, 50, 50, 0.5);
-moz-box-shadow: 0px 1px 6px 0px rgba(50, 50, 50, 0.5);
box-shadow: 0px 1px 6px 0px rgba(50, 50, 50, 0.5);
position: sticky!important;
position: sticky !important;
}
header .header-left-side {
background-color: #f7f7f7;
background-color: var(--main-bg-light-color);
padding: 1em 3em 1em 15vh;
background: linear-gradient(110deg, #f7f7f7 90%, #dfdfdf 0%);
background: linear-gradient(110deg, var(--main-bg-light-color) 90%, var(--main-bg-color) 0%);
}
header .header-right-side {
padding-right: 15vh;
}
/***************************/
/* Nav bar and content main*/
.main-container {
display: flex;
flex-direction: row;
}
/**************/
/*content main*/
main {
min-height: 70vh;
margin-right: 15vh!important;
/* max-height: 70vh; */
margin-right: 15vh !important;
}
/****************/
/* Left nav bar */
nav {
margin-left: 13vh;
margin-right: 1em;
border-radius: 0.5em;
border: 2px solid #dee2e6 !important;
border: 2px solid var(--main-border-grey-color) !important;
padding: .5em;
}
nav ul li a {
color: #17223b;
color: var(--main-default-link-color);
font-size: large;
}
nav ul .active {
background-color: #dfdfdf !important;
color: #17223b !important;
background-color: var(--main-bg-color) !important;
color: var(--main-default-link-color) !important;
font-weight: bold;
border-left: solid 3px #0d6efd;
/* border: 1px solid #007bff; */
border-left: solid 3px var(--main-success-color);
}
nav .content-user-info {
font-weight: bold;
}
nav .custom-nav-link{
nav .custom-nav-link {
display: block;
padding: .5rem 1rem;
color: #2e4363;
color: var(--main-default-link-color);
text-decoration: none;
border-radius: .2em;
transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out;
transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out;
}
nav .custom-nav-link:hover{
color: #0d6efd;
nav .custom-nav-link:hover {
color: var(--main-success-color);
}
/*
.custom-btn-create:hover {
background-color: #f1f1f1 !important;
color: var(--main-success-color) !important;
border-bottom: solid 3px var(--main-success-color);
}*/
/*************************/
@media (min-width: 768px) {
.bd-placeholder-img-lg {
font-size: 3.5rem;
}
}
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment