コード例 #1
0
 public function showArchive($username)
 {
     $user = User::whereUsername($username)->firstOrFail();
     $profile = $user->profile()->first();
     $title = "My Archives";
     $currentQuestion = Question::getCurrentQuestion();
     $remaining_time = Question::getRemainingTime($currentQuestion);
     $leading = Post::getLeadingBant($currentQuestion);
     $posts = $user->posts()->get();
     return View::make('profile.dashboard.archive')->with(['question' => $currentQuestion, 'remaining_time' => $remaining_time, 'leading' => $leading, 'profile' => $profile, 'user' => $user, 'posts' => $posts, 'title' => $title]);
 }
コード例 #2
0
 public function postOptions()
 {
     $title = "Post";
     $currentQuestion = Question::getCurrentQuestion();
     $points_pct = Question::getTotalPointsPct($currentQuestion);
     $remaining_time = Question::getRemainingTime($currentQuestion);
     $posts = Post::getRandPosts($currentQuestion);
     $leading_username = "******";
     $leading_votes = 30;
     return View::make('posts.options')->with(['question' => $currentQuestion, 'remaining_time' => $remaining_time, 'points_pct' => $points_pct, 'posts' => $posts, 'leading_username' => $leading_username, 'leading_votes' => $leading_votes, 'title' => $title]);
 }
コード例 #3
0
 public function index()
 {
     $user = User::whereUsername(LoggedInUser::username())->firstOrFail();
     $profile = $user->profile()->first();
     $title = "My Settings";
     $email_notifications = Profile::getEmailNotifications();
     $email_user_settings = Profile::getMyEmailNotifications(Auth::id());
     $currentQuestion = Question::getCurrentQuestion();
     $remaining_time = Question::getRemainingTime($currentQuestion);
     $leading = Post::getLeadingBant($currentQuestion);
     $posts = $user->posts()->get();
     return View::make('profile.dashboard.settings')->with(['question' => $currentQuestion, 'remaining_time' => $remaining_time, 'leading' => $leading, 'profile' => $profile, 'user' => $user, 'email_notifications' => $email_notifications, 'email_user_settings' => $email_user_settings, 'posts' => $posts, 'title' => $title]);
 }
コード例 #4
0
 private function displayForm($type)
 {
     $title = "Post Comment";
     $currentQuestion = Question::getCurrentQuestion();
     $points_pct = Question::getTotalPointsPct($currentQuestion);
     $remaining_time = Question::getRemainingTime($currentQuestion);
     $posts = Post::getRandPosts($currentQuestion);
     if (Post::hasPost($currentQuestion)) {
         return Alert::flash(Lang::get('post.exist'), 'warning');
     }
     $options = [$currentQuestion['left_option'] => ucfirst($currentQuestion['left_option']), $currentQuestion['right_option'] => ucfirst($currentQuestion['right_option'])];
     return View::make("posts.options.{$type}")->with(['question' => $currentQuestion, 'remaining_time' => $remaining_time, 'points_pct' => $points_pct, 'posts' => $posts, 'options' => $options, 'title' => $title]);
 }
コード例 #5
0
 public static function adminUser($id)
 {
     $title = "User";
     $currentQuestion = Question::getCurrentQuestion();
     $remaining_time = Question::getRemainingTime($currentQuestion);
     $leading = Post::getLeadingBant($currentQuestion);
     $get_user = User::getUser($id);
     return View::make('admin.users-show')->with(['question' => $currentQuestion, 'remaining_time' => $remaining_time, 'leading' => $leading, 'user' => $get_user, 'title' => $title]);
 }