コード例 #1
0
 public function feedback()
 {
     \App::setLocale(Auth::user()->language());
     $user = Auth::user();
     $propositionFactory = new PropositionFactory();
     $viewUser = ['fullName' => $user->firstName() . " " . $user->lastName(), 'firstName' => $user->firstName(), 'lastName' => $user->lastName(), 'contactEmail' => $user->contactEmail(), 'email' => $user->email(), 'avatar' => $user->avatar(), 'belongsToSchool' => $user->belongsToSchool(), 'schoolEmail' => $user->googleEmail(), 'role' => $user->role(), 'propositionsCount' => $propositionFactory->getPropositionsCountByUser($user->userId())];
     return view('feedback', ['fullName' => $user->firstName() . " " . $user->lastName(), 'user' => $viewUser]);
 }
コード例 #2
0
 public function handle_flags()
 {
     $user = Auth::user();
     if ($user->role() !== User::ROLE_MODERATOR) {
         abort(404);
     }
     $propositionsFactory = new PropositionFactory();
     $viewUser = ['fullName' => $user->firstName() . " " . $user->lastName(), 'firstName' => $user->firstName(), 'lastName' => $user->lastName(), 'contactEmail' => $user->contactEmail(), 'email' => $user->email(), 'avatar' => $user->avatar(), 'belongsToSchool' => $user->belongsToSchool(), 'schoolEmail' => $user->googleEmail(), 'role' => $user->role(), 'propositionsCount' => $propositionsFactory->getPropositionsCountByUser($user->userId())];
     $viewPropositions = array();
     foreach ($propositionsFactory->getFlaggedPropositionsExeptUsers($user->userId()) as $flag) {
         $proposition = $propositionsFactory->getProposition($flag->propositionId());
         $viewPropositions[$proposition->propositionId()] = ['id' => $proposition->propositionId(), 'propositionSort' => $proposition->propositionSort(), 'propositionLong' => $proposition->propositionLong(), 'proposer' => $proposition->proposerId(), 'propositionCreationDate' => Carbon::createFromTimestamp(strtotime($proposition->date_created()))->diffForHumans(), 'userHasVoted' => $propositionsFactory->getUserVoteStatus($proposition->propositionId(), $user->userId()), 'deadline' => $proposition->deadline(), 'statusId' => $proposition->status(), 'ending_in' => Carbon::now()->diffInDays(Carbon::createFromTimestamp(strtotime($proposition->deadline())), false), 'flagsCount' => $propositionsFactory->getFlagCount($proposition->propositionId()), 'offensiveCount' => $propositionsFactory->getFlagTypeCount($proposition->propositionId(), 1), 'inappropriateCount' => $propositionsFactory->getFlagTypeCount($proposition->propositionId(), 2), 'incomprehensibleCount' => $propositionsFactory->getFlagTypeCount($proposition->propositionId(), 3)];
     }
     return view('moderator.flags', ['fullName' => $user->firstName() . " " . $user->lastName(), 'user' => $viewUser, 'propositions' => $viewPropositions]);
 }
コード例 #3
0
 public function password()
 {
     $user = Auth::user();
     $propositionFactory = new PropositionFactory();
     $propositionsCount = $propositionFactory->getPropositionsCountByUser($user->userId());
     $viewUser = ['fullName' => $user->firstName() . " " . $user->lastName(), 'firstName' => $user->firstName(), 'lastName' => $user->lastName(), 'contactEmail' => $user->contactEmail(), 'email' => $user->email(), 'avatar' => $user->avatar(), 'belongsToSchool' => $user->belongsToSchool(), 'schoolEmail' => $user->googleEmail(), 'role' => $user->role(), 'propositionsCount' => $propositionsCount];
     return view('account_new.password', ['fullName' => $user->firstName() . " " . $user->lastName(), 'user' => $viewUser]);
 }